Skip to content

refactor(timeline): use TimelineAction::from_event to create a RepliedToEvent struct #5057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented May 19, 2025

One more bullet item of #4823. The reply preview will now support all the types that are supported by the timeline, by default, and the UTD hook will also be called when creating a RepliedToEvent when the replied-to event is a UTD.

On top of #5046, so draft. Only the latest commit has been added on top of the aforementioned PR.

@bnjbvr bnjbvr force-pushed the bnjbvr/compute-better-replies2 branch from a6ee830 to d74cc9d Compare May 19, 2025 13:12
Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 68.88889% with 14 lines in your changes missing coverage. Please review.

Project coverage is 85.90%. Comparing base (6f8b744) to head (fd1b143).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
...rates/matrix-sdk-ui/src/timeline/controller/mod.rs 66.66% 8 Missing ⚠️
...ix-sdk-ui/src/timeline/event_item/content/reply.rs 78.94% 4 Missing ⚠️
crates/matrix-sdk-ui/src/timeline/mod.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5057   +/-   ##
=======================================
  Coverage   85.90%   85.90%           
=======================================
  Files         325      325           
  Lines       35943    35917   -26     
=======================================
- Hits        30876    30855   -21     
+ Misses       5067     5062    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bnjbvr bnjbvr force-pushed the bnjbvr/compute-better-replies2 branch from d74cc9d to abd9146 Compare May 19, 2025 13:30
@bnjbvr bnjbvr force-pushed the bnjbvr/compute-better-replies2 branch from abd9146 to d93678a Compare May 20, 2025 12:15
…e item

If the replied-to event is an aggregation, the
`RepliedToEvent::try_from_timeline_event` will now return `Ok(None)`,
and the caller may handle this as they please.

In the FFI layer, this will be filled with an error message indicating
that the event is unsupported.
@bnjbvr bnjbvr marked this pull request as ready for review May 20, 2025 12:27
@bnjbvr bnjbvr requested a review from a team as a code owner May 20, 2025 12:27
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team May 20, 2025 12:27
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some general questions, otherwise lgtm, thank you!


None => TimelineItemContent::MsgLike(MsgLikeContent::redacted()),
let sender = event.sender().to_owned();
let action = TimelineAction::from_event(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice 👌 .. although TimelineAction might no longer be the right name here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On another note: I wonder if populating those previously empty relations will create any issues 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have in mind any particular issue it could cause?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially thought of reply fallbacks showing up in reply items if it's a reply to a reply but honestly I don't have enough context around this to know if that's even a possibility. Figured it's better to just ask.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing that comes to mind, but we can watch out on this part during the next few releases 👍

@bnjbvr bnjbvr merged commit 4a627ba into main May 21, 2025
44 of 65 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/compute-better-replies2 branch May 21, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants