Skip to content
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

ui: Improvements for replies and edits #3627

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Jun 30, 2024

Each commit should be rather self-explanatory.

The motivation behind the second commit is for the use with Room::restore_composer_draft. When restoring a draft, but the edited/replied-to item is not available locally, that would result in two requests to the homeserver:

  1. When restoring the composer state, the client makes a request with Room::event() to get the content of the edited/replied-to event to be able to display it in the UI.
  2. When the user sends the message, the client must first call Timeline::{edit/replied_to}_info_from_event_id(), which makes a request to the homeserver, to be able to call Timeline::edit/send_reply() to send the event.

By exposing the content of the edit/replied-to info, the client needs only to make a single homeserver request with Timeline::{edit/replied_to}_info_from_event_id() and can display the edited/replied-to event in the UI with it.

There is EventItemIdentifier for the same purpose.

Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner June 30, 2024 13:26
@zecakeh zecakeh requested review from Hywan and removed request for a team June 30, 2024 13:26
Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 84.17%. Comparing base (38a18c3) to head (f31a2c5).
Report is 6 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-ui/src/timeline/mod.rs 37.50% 5 Missing ⚠️
crates/matrix-sdk-ui/src/timeline/event_handler.rs 75.00% 2 Missing ⚠️
...tes/matrix-sdk-ui/src/timeline/event_item/local.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3627      +/-   ##
==========================================
- Coverage   84.21%   84.17%   -0.05%     
==========================================
  Files         256      256              
  Lines       26553    26560       +7     
==========================================
- Hits        22362    22356       -6     
- Misses       4191     4204      +13     

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

@bnjbvr bnjbvr requested review from bnjbvr and removed request for Hywan July 1, 2024 06:57
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Thanks, makes sense! Ideally I'd like a small rename, but I can do it later if you'd prefer.
(Thanks in particular for the doc update!)

crates/matrix-sdk-ui/src/timeline/event_item/local.rs Outdated Show resolved Hide resolved
@zecakeh zecakeh requested a review from bnjbvr July 1, 2024 12:13
@bnjbvr bnjbvr enabled auto-merge (rebase) July 1, 2024 12:16
@bnjbvr bnjbvr merged commit 7fee66d into matrix-org:main Jul 1, 2024
39 checks passed
@zecakeh zecakeh deleted the reply-edit-info-content branch July 1, 2024 12:44
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