Repository navigation
fix(chat): group-chat sender runs — avatar on the last bubble, runs broken by sender id - #1481
Merged
Merged
Conversation
…ofile A group's incoming bubbles are cornered as one run until the member profiles land: First at the top, Middle through the rest, whoever actually sent them. isSameAuthorAs compared sender?.userId, and `sender` is filled from the profile map that ChatViewModel combines into the paging stream. That map starts null and arrives after the first page, so early on every member's bubble has a null sender and they all compare equal. bubblePositionOf and rowGapBelow both read that answer, so the run gets one set of corners and the tight same-sender gap. A member whose profile never resolves stays merged for good. ContentBubble now carries senderId straight off the message, independent of the lookup, and authorId prefers it. The profile is still what draws the name and the picture; it is no longer what decides who said it.
The picture sat on the same bubble as the name, at the top of the run. It now sits on the run's last message — the newest thing that person said, level with the bottom bubble — while the name stays on the first, so the two mark the run's ends instead of stacking. endsSenderRun is the mirror of startsSenderRun: `newer` is peek(index - 1) under reverseLayout, where `older` is peek(index + 1). Both key off authorId rather than the resolved sender, so a run holds its shape from the first frame instead of re-splitting when the profiles arrive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes to how a group transcript reads a run of messages.
The avatar sits on the run's last bubble
It was on the same bubble as the name, at the top. It now sits next to the newest thing that person said, level with the bottom bubble, and the name stays on the first — the two mark the run's ends instead of stacking on one bubble.
endsSenderRunis the mirror ofstartsSenderRun:newerispeek(index - 1)underreverseLayoutwhereolderispeek(index + 1).Runs break by sender id, not by resolved profile
A group's incoming bubbles were cornered as one run until the member profiles landed — First at the top, Middle through the rest, whoever actually sent them.
isSameAuthorAscomparedsender?.userId, andsendercomes from the profile mapChatViewModelcombines into the paging stream. That map starts null and arrives after the first page, so early on every member's bubble has a nullsenderand they all compare equal.bubblePositionOfandrowGapBelowboth read that answer, so the merged run got one set of corners and the tight same-sender gap. A member whose profile never resolves stayed merged for good.ContentBubblenow carriessenderIdoff the message, independent of the lookup, andauthorIdprefers it. The profile still draws the name and the picture; it no longer decides who said it. The run helpers key offauthorIdtoo, so a run holds its shape from the first frame rather than re-splitting when the names arrive.Tests
BubblePositionTestis new: cornering across a sender change, with resolved profiles and without.SenderRunTestgained theendsSenderRuncases and the unresolved-profile case.