Skip to content

fix(chat): redraw a typing avatar when the typist's profile resolves - #1569

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/typing-avatar-profile-update
Sep 25, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/typing-avatar-profile-update

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Group typing avatars sometimes showed only the gradient fallback for members who have a profile picture.

It happens when someone starts typing before their profile is loaded. ChatViewModel emits the typist with profile = null, requests the profile, and emits the typist again once it arrives, under the same key. AvatarStack in TypingIndicator only wrote new values into its entries from LaunchedEffect(shownKeys), and the keys hadn't changed, so the entry kept the null-profile typist.

The fix adds a LaunchedEffect(shown) that refreshes each entry still on screen. The key-driven effect keeps its key: restarting it on every update would cancel the coroutine that animates out and removes a leaving avatar.

TypingIndicatorTest swaps a typist for a changed copy under the same key and checks the avatar redraws. It fails without the fix.

A group typist whose profile hadn't loaded yet kept drawing the gradient
fallback after the profile arrived. ChatViewModel emits the typist with a
null profile first and again once the profile resolves, under the same key.
AvatarStack only copied new values into its entries from the effect keyed
on the set of keys, so the second emission never reached the avatar.

A second effect keyed on the typist list now refreshes each entry that is
still shown. The key-driven effect keeps its key, since restarting it would
cancel the coroutine that removes a leaving avatar.
@bmc08gt bmc08gt self-assigned this Sep 25, 2026
@github-actions github-actions Bot added type: fix Bug fix area: ui Compose UI, theme, components, resources and removed type: fix Bug fix labels Sep 25, 2026
@bmc08gt
bmc08gt merged commit d7b0cde into code/cash Sep 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Compose UI, theme, components, resources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant