fix(chat): don't freeze the author-info flag at first composition - #6544
Conversation
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/32587171033/artifacts/9479465400 |
1808f79 to
1215fb4
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/32625591738/artifacts/9489667473 |
1215fb4 to
6a8c02b
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/32626458502/artifacts/9489911495 |
The chat list content read ChatUiState.isOneToOneConversation - which,
despite its name, carries "show author avatars and names", i.e. the
negation of the conversation being one-to-one - through
remember { mutableStateOf(...) } without a key. That snapshots the
field at the very first composition and never updates it again, so the
value only ends up correct when the conversation emission from the
database happens to win the race against the ComposeView's initial
composition.
Since the room list, chat opening and message prefetching moved onto
local database flows, a chat opens straight from the cache and the
first composition reliably runs before the conversation state lands.
The flag then stays frozen at its default false and group chats render
every incoming message without the author's avatar and display name.
Read the flag directly from the collected uiState instead, so the
message list recomposes with the real value once the conversation
arrives. Also drop the debug log that would otherwise print on every
recomposition.
Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
6a8c02b to
c1ab098
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/32653946074/artifacts/9497037726 |
Mention chips fell back to R.drawable.accent_circle whenever the avatar
request was still in flight or failed. That drawable is a bare oval
filled with colorPrimary, so a user chip - for example the actor in a
"{user} left the conversation" system message - rendered as a featureless
blue circle rather than a recognizable avatar placeholder. The chip's own
loadImage() uses the fallback for both .placeholder() and .error(), so
the circle showed up in both cases.
Add ic_circular_user, a gray circle with a white person glyph built the
same way as the existing ic_circular_group_mentions, icon_circular_team
and icon_circular_phone chip icons, and use it as the fallback for user,
guest and email chips. All chip fallbacks are now one visual family.
Applies to both chip renderers, since the Compose chip and the
MentionChipSpan in MarkdownText share resolveMentionFallbackIcon, and to
the legacy composer chips in DisplayUtils so the chip shown while typing
matches the one in the sent message. Self-mentions keep mention_chip,
whose dark circle is the deliberate contrast against the primary-colored
self chip.
Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
|
/backport to stable-25.0.x |
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/32658420756/artifacts/9498173326 |
Fixes group chats rendering incoming messages without the author's avatar and display name since the recent room-list/prefetching changes.
Root cause
ChatActivity.setChatListContent()readChatUiState.isOneToOneConversation— which, despite its name, carries "show author avatars and names", i.e.!conversation.isOneToOneConversation()as set inChatViewModel.observeConversation()— throughremember { mutableStateOf(uiState.isOneToOneConversation) }without a key. That snapshots the field at the very first composition and never updates it again.Whether that snapshot was correct was a race: it only held the real value when the conversation emission from the database reached
uiStatebefore the ComposeView's initial composition. Since the conversation list, chat opening and message prefetching moved onto local database flows (#6454, #6498), a chat opens straight from the cache and the first composition reliably runs before the conversation state lands — the flag stays frozen at its defaultfalse, andMessageScaffold(incoming && isOneToOneConversation && !isGrouped) never shows the avatar or the author name in group chats. The conversation-avatar caching (#6499) is not directly involved; chat-message avatars use the default Coil loader.Fix
Read the flag directly from the collected
uiState, so the message list recomposes with the real value once the conversation arrives. Also drops the debug log that would otherwise print on every recomposition.Possible follow-up (deliberately out of scope for this fix): the field's inverted naming —
isOneToOneConversationholding "is NOT one-to-one" acrossChatUiState,ChatViewState,ChatMessageContextand the message composables — is what made this freeze hard to spot and is worth a rename.🚧 TODO
🏁 Checklist
ChatActivity/backport to stable-xx.x🤖 AI (if applicable)