Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9114f29
refactor(timeline): always unstash related pending reactions, even if…
bnjbvr Jan 22, 2025
9061977
fix(timeline): when removing an item, re-stash its associated reactions
bnjbvr Jan 22, 2025
99a5c36
refactor(timeline): keep poll aggregations around forever
bnjbvr Jan 23, 2025
2ffd947
refactor(timeline): use TimelineEventItemId for aggregated items
bnjbvr Feb 3, 2025
40c83f9
refactor!(timeline): put the reactions into the `TimelineItemContent`
bnjbvr Feb 3, 2025
73691b3
refactor(timeline): apply reactions as aggregations
bnjbvr Feb 3, 2025
5d257b3
refactor(timeline): remove unused `AnnotationKey`
bnjbvr Feb 3, 2025
fad2bcf
refactor(timeline): recall the id of the aggregated event
bnjbvr Feb 3, 2025
e52d1bd
refactor(timeline): apply reaction aggregation in place
bnjbvr Feb 4, 2025
8b88167
refactor(timeline): get rid of two uses of `meta.reactions.map`
bnjbvr Feb 4, 2025
ba714d8
refactor(timeline): undo aggregations upon redaction
bnjbvr Feb 5, 2025
fbc6791
test(timeline): use the `EventFactory` for a reaction redaction
bnjbvr Feb 5, 2025
51c7f77
refactor(timeline): rename `handle_reaction_redaction` to `handle_agg…
bnjbvr Feb 5, 2025
f4b27b3
test(timeline): avoid creating new `EventFactory` and reuse that in `…
bnjbvr Feb 5, 2025
7fad47f
refactor(timeline): only replace an item when applying the aggregatio…
bnjbvr Feb 5, 2025
44083b0
refactor(timeline): store the `ReactionStatus` in the Reaction aggreg…
bnjbvr Feb 5, 2025
0c13347
refactor(timeline): maintain aggregation mappings after events have b…
bnjbvr Feb 5, 2025
8a48ec1
test(timeline): use `assert_let_timeout` in one specific test of time…
bnjbvr Feb 5, 2025
1e2d13e
refactor(timeline): apply clippy lints
bnjbvr Feb 5, 2025
3578770
refactor(timeline): return owned `ReactionsByKeyBySender` in `Timelin…
bnjbvr Feb 6, 2025
4fb6989
doc(timeline): add doc and changelog for the new aggregation system
bnjbvr Feb 6, 2025
da828c3
refactor(timeline): apply aggregations in a single place
bnjbvr Feb 6, 2025
182f500
some review comments
bnjbvr Feb 10, 2025
8d36423
review: remove outdated comment
bnjbvr Feb 10, 2025
2ebcc44
review: demote log statement to info
bnjbvr Feb 10, 2025
4b26a48
review: return an custom result type for `Aggregations::apply/unapply`
bnjbvr Feb 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/matrix-sdk-ffi/src/timeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ pub struct EventTimelineItem {
impl From<matrix_sdk_ui::timeline::EventTimelineItem> for EventTimelineItem {
fn from(item: matrix_sdk_ui::timeline::EventTimelineItem) -> Self {
let reactions = item
.content()
.reactions()
.iter()
.map(|(k, v)| Reaction {
Expand Down
12 changes: 12 additions & 0 deletions crates/matrix-sdk-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All notable changes to this project will be documented in this file.

## [Unreleased] - ReleaseDate

### Bug Fixes

### Features

### Refactor

- [**breaking**] Reactions on a given timeline item have been moved from
[`EventTimelineItem::reactions()`] to [`TimelineItemContent::reactions()`]; they're thus available
from an [`EventTimelineItem`] by calling `.content().reactions()`. They're also returned by
ownership (cloned) instead of by reference.
([#4576](https://github.com/matrix-org/matrix-rust-sdk/pull/4576))

## [0.10.0] - 2025-02-04

### Bug Fixes
Expand Down
8 changes: 7 additions & 1 deletion crates/matrix-sdk-ui/src/timeline/algorithms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ impl EventTimelineItemWithId<'_> {
/// Create a clone of the underlying [`TimelineItem`] with the given
/// reactions.
pub fn with_reactions(&self, reactions: ReactionsByKeyBySender) -> Arc<TimelineItem> {
let event_item = self.inner.with_reactions(reactions);
let content = self.inner.content().with_reactions(reactions);

// Do not use `Self::with_content` which may override the latest_edit_json.
// TODO: it's likely incorrect?
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this comment - can you expand on it? If it's incorrect, do we need to fix it before we can commit this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah, something I noticed, and fixed in another PR; I can remove the comment now, thanks for spotting it!

let mut event_item = self.inner.clone();
event_item.content = content;

TimelineItem::new(event_item, self.internal_id.clone())
}
}
Expand Down
Loading
Loading