From 81205ac83a5bc8364f07d893ab0773f6d4caf1b8 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:17:30 +0000 Subject: [PATCH] ios: pinned sender avatar: stop at a change of show-group-as-sender --- apps/ios/Shared/Views/Chat/ChatView.swift | 4 ++-- plans/2026-10-02-sticky-sender-avatar.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 0e2c66dfaa..d83eca684e 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -39,8 +39,8 @@ private func shouldShowAvatar(_ current: ChatItem, _ older: ChatItem?) -> Bool { private func continuesSenderRun(_ merged: MergedItem) -> Bool { let item = merged.newest().item - if case .groupRcv = item.chatDir { - return !shouldShowAvatar(item, merged.oldest().nextItem) + if case .groupRcv = item.chatDir, let older = merged.oldest().nextItem { + return !shouldShowAvatar(item, older) && item.meta.showGroupAsSender == older.meta.showGroupAsSender } return false } diff --git a/plans/2026-10-02-sticky-sender-avatar.md b/plans/2026-10-02-sticky-sender-avatar.md index 8cd32cb270..b86a148f85 100644 --- a/plans/2026-10-02-sticky-sender-avatar.md +++ b/plans/2026-10-02-sticky-sender-avatar.md @@ -45,6 +45,7 @@ Rejected: - Android/desktop: no pinning while selecting messages. The avatar stays in the run's first row as on master, there is no stand-in, and pinning resumes when selection ends. - iOS: in selection mode the pinned avatar is always shifted by the selection checkbox, so in a run whose first message can't be deleted it is offset horizontally from that row's own avatar. Tapping it doesn't open member info; the tap goes to the message under it. - iOS: no pinned avatar in a pending member's "Chat with admins", where a title bar is drawn over the top of the list. +- iOS: pinning stops where the "show group as sender" flag changes within a sender's run (e.g. the local welcome message of a group joined by link, shown with the group's image, followed by the link host's own messages), so the pinned avatar never switches between the group image and a member photo. - iOS: SwiftUI may draw the overlay a frame after UIKit moves the cells, so the avatar can trail by one frame of scroll when it pins, unpins or is pushed up. When the avatar is pushed out at the bar, it disappears with up to 4pt still showing (the next sender takes the pin when their row crosses the pin line), and the row's own avatar can reappear blurred under the translucent bar once the next sender's messages reach it. ## Testing