fix(chat): match Android's three-tier gap between bubbles - #737
Merged
Conversation
The transcript ran one gap for every pairing — 8 points, plus 6 where the sender flipped. Android picks from three in `bottomSpacingFor`: `grid.x1` inside a same-sender run, `grid.x2` where the grouping window has broken or a date separator sits, `grid.x3` on a change of speaker. On a normal-width phone those are 5, 10 and 15, so a thread read at a different density on each platform. Port the three tiers as `RowGap` and answer `interItemSpacing(_:after:)` in Android's order, separators before senders. iOS already computes `isContinuedByNext` the way Android computes `groupedBelow` — same sender, inside the grouping window — so the tight tier needs no grouping pass of its own. The profile card has no sender, so it keeps the base gap rather than the tight one Android hands a non-bubble neighbour; Android has no profile card to match.
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.
The transcript ran one gap for every pairing — 8 points, plus 6 where the sender flipped. Android picks from three in
bottomSpacingFor:grid.x1inside a same-sender run,grid.x2where the grouping window has broken or a date separator sits,grid.x3on a change of speaker. On a normal-width phone those are 5, 10 and 15, so a thread read at a different density on each platform.The three tiers land as
RowGap, andinterItemSpacing(_:after:)now answers in Android's order — separators before senders. iOS already computesisContinuedByNextthe way Android computesgroupedBelow(same sender, inside the grouping window), so the tight tier needs no grouping pass of its own.senderFlipExtraSpacingis gone: the wide gap is a value now rather than a delta on the base.One deliberate divergence: the profile card has no sender, so it keeps the base gap of 10 rather than the tight one Android hands a non-bubble neighbour. Android has no profile card to match.