From b2b38e0f80a66c0edcad497d289c75be4e08f61e Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 10 Jun 2025 12:32:21 +0300 Subject: [PATCH] Tweak the thread summary design --- ElementX/Sources/Other/Avatars.swift | 2 +- .../Timeline/View/Style/TimelineItemBubbledStylerView.swift | 2 +- .../Timeline/View/Threads/TimelineThreadSummaryView.swift | 1 + ...imelineItemBubbledStylerView.Thread-summary-iPad-en-GB.png | 4 ++-- ...melineItemBubbledStylerView.Thread-summary-iPad-pseudo.png | 4 ++-- ...neItemBubbledStylerView.Thread-summary-iPhone-16-en-GB.png | 4 ++-- ...eItemBubbledStylerView.Thread-summary-iPhone-16-pseudo.png | 4 ++-- .../PreviewTests/timelineThreadSummaryView.iPad-en-GB-0.png | 4 ++-- .../PreviewTests/timelineThreadSummaryView.iPad-pseudo-0.png | 4 ++-- .../timelineThreadSummaryView.iPhone-16-en-GB-0.png | 4 ++-- .../timelineThreadSummaryView.iPhone-16-pseudo-0.png | 4 ++-- 11 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ElementX/Sources/Other/Avatars.swift b/ElementX/Sources/Other/Avatars.swift index 95307984c..98027076b 100644 --- a/ElementX/Sources/Other/Avatars.swift +++ b/ElementX/Sources/Other/Avatars.swift @@ -121,7 +121,7 @@ enum UserAvatarSizeOnScreen { case .sessionVerification: return 52 case .threadSummary: - return 28 + return 24 } } } diff --git a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift index 6c058d170..122cb6109 100644 --- a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift @@ -422,7 +422,7 @@ struct TimelineItemBubbledStylerView_Previews: PreviewProvider, TestablePreview ScrollView { let threadSummary = TimelineItemThreadSummary.loaded(senderID: "@alice:matrix.org", sender: .init(id: "@alice:matrix.org", displayName: "Alice"), - latestEventContent: .message(.text(.init(body: "This is a threaded message")))) + latestEventContent: .message(.text(.init(body: "This is a very long, multi-lined, threaded message")))) MockTimelineContent(threadSummary: threadSummary) } diff --git a/ElementX/Sources/Screens/Timeline/View/Threads/TimelineThreadSummaryView.swift b/ElementX/Sources/Screens/Timeline/View/Threads/TimelineThreadSummaryView.swift index f2fc9e5bd..3c3bde4b3 100644 --- a/ElementX/Sources/Screens/Timeline/View/Threads/TimelineThreadSummaryView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Threads/TimelineThreadSummaryView.swift @@ -121,6 +121,7 @@ struct TimelineThreadSummaryView: View { .accessibilityLabel(L10n.commonInReplyTo(sender?.disambiguatedDisplayName ?? senderID)) Text(context.viewState.buildMessagePreview(formattedBody: formattedBody, plainBody: plainBody)) + .multilineTextAlignment(.leading) .font(.compound.bodyXS) .foregroundColor(.compound.textSecondary) .tint(.compound.textLinkExternal) diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-en-GB.png index d7b9b2a00..1511195e9 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-en-GB.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-en-GB.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0332b38d12d948ea7891f21403c6ffd524abbf9cf3dcb9840dd75219c948fc1f -size 2542610 +oid sha256:bfe8a376d3de35ee8c5c87dbc8c2e76485294cda575cb95f4a477d0533619caa +size 2557843 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-pseudo.png index 37d80bce4..907551188 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-pseudo.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPad-pseudo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f7ead73a4370302fde4c9811dcee87e318294ce1d93f3134a907db3695d2aa50 -size 2540695 +oid sha256:797e94aa2584fd960f828e5e87c4207e1106e62be8254630a14406a5af7be6cf +size 2556128 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-en-GB.png index 6bc04b863..a57ac49f0 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-en-GB.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-en-GB.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a64d7a96d7b3318cb74c6c139a70f755fdfb2c1e3e7cb01f76f1bc47eaae0c2 -size 1248263 +oid sha256:50bb8dd3931574e4464321f2020a2f5f5e7603655bcac2cf0f9b1456c667f257 +size 1273104 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-pseudo.png index 8ce0ff7d8..7365a23a4 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-pseudo.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineItemBubbledStylerView.Thread-summary-iPhone-16-pseudo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe424bc4fb3bfd022030e9e6a40019be65fc6f098f8583573fe02f2a2e3f2a2e -size 1245475 +oid sha256:614e39891312cdeab5caca4e6ab3d35773bd1df4edfa4eb3e137794a067667fe +size 1270109 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-en-GB-0.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-en-GB-0.png index 835bdd8bb..fdde12838 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-en-GB-0.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-en-GB-0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:def40a09d9521734f58296a959107a0cb5d8dd3ad8ea23dc6d01dfbf298aba93 -size 215724 +oid sha256:57e6b180bfb36b09a8037dbf51948e31aa14e11446beb80eb445a853bdb51924 +size 204274 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-pseudo-0.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-pseudo-0.png index 01a06b94c..71bb8c042 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-pseudo-0.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPad-pseudo-0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9d960cd717a6bd446e2743727248f65b8ee3550557564a94b8768f7639d65931 -size 220359 +oid sha256:9cfd71844e9650e4dddb3ae402d4d9637932866ed5e7ce47be06ec504c594c2a +size 209066 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-en-GB-0.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-en-GB-0.png index 9144edd2e..8c860b54a 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-en-GB-0.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-en-GB-0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0dcebc6129401b306a56627361515c900269c7d7449361e53c3b7c0e4c4a5bb7 -size 149719 +oid sha256:f7f03c9bef8f1893c319839f3564695742b9e53ae4205a290082f6cbe2512375 +size 142314 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-pseudo-0.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-pseudo-0.png index 9b2ed3453..c1985fe5d 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-pseudo-0.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/timelineThreadSummaryView.iPhone-16-pseudo-0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:901983ae900d41fdf9b8d733d8a2e05c919e17922e75cf1bc6c91413db82fc70 -size 147986 +oid sha256:f1aa50f59b5e3c3b1310ea0a196a4df4edb90ea9ab7ef8f4589c4962ee36cba6 +size 141379