Introduce a TimelineItemThreadSummary object (#4032)

* Introduce a `TimelineItemThreadSummary` object to hold details about threads starting from that particular item

This patch introduces a thread summary object that will be available on main timeline messages that are the root for a given thread.
It currently provides the latest message content and sender for that thread but it will grow to provide info on the number of replies, unreads etc.

It also add a new UI component called `TimelineThreadSummaryView` that makes use of this data and is in turn used by the bubbled styler to render it in the timeline.

The rest of the PR is about refactoring on the `RoomTimelineItemFactory` so that replies and thread summaries use similar paths and builders.

* Add a feature flag for threads

* Address PR comments

* Converge on single implementation for message previews
This commit is contained in:
Stefan Ceriu
2025-04-16 16:19:29 +03:00
committed by GitHub
parent 8c9773e4de
commit 806d676299
34 changed files with 689 additions and 134 deletions
@@ -1001,6 +1001,12 @@ extension PreviewTests {
}
}
func testTimelineThreadSummaryView() async throws {
for (index, preview) in TimelineThreadSummaryView_Previews._allPreviews.enumerated() {
try await assertSnapshots(matching: preview, step: index)
}
}
func testTimelineView() async throws {
for (index, preview) in TimelineView_Previews._allPreviews.enumerated() {
try await assertSnapshots(matching: preview, step: index)
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0332b38d12d948ea7891f21403c6ffd524abbf9cf3dcb9840dd75219c948fc1f
size 2542610
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f7ead73a4370302fde4c9811dcee87e318294ce1d93f3134a907db3695d2aa50
size 2540695
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a64d7a96d7b3318cb74c6c139a70f755fdfb2c1e3e7cb01f76f1bc47eaae0c2
size 1248263
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fe424bc4fb3bfd022030e9e6a40019be65fc6f098f8583573fe02f2a2e3f2a2e
size 1245475
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:def40a09d9521734f58296a959107a0cb5d8dd3ad8ea23dc6d01dfbf298aba93
size 215724
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d960cd717a6bd446e2743727248f65b8ee3550557564a94b8768f7639d65931
size 220359
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0dcebc6129401b306a56627361515c900269c7d7449361e53c3b7c0e4c4a5bb7
size 149719
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:901983ae900d41fdf9b8d733d8a2e05c919e17922e75cf1bc6c91413db82fc70
size 147986