fix(chat): size bubbles to iOS's max width - #1595
Merged
Merged
Conversation
Text, reply, deleted, and encrypted bubbles capped at 0.78 of the row after the transcript inset, while iOS and our own link cards take 0.78 of the transcript's full width. The bubbles came out about 31dp narrower than iOS's on a normal-width phone. transcriptCardWidth becomes transcriptBubbleMaxWidth and sizes both. The reaction pill row under a bubble calls it too, in place of its own copy of the fraction. Cash and media bubbles keep their 0.64 of the inset row.
The cash card took 0.64 of the inset row. It now takes the same 0.78 of the transcript width as every other bubble, which is the rule iOS moves its fixed 232pt card to as well. The reaction pill row under a cash card already used that width, so it now lines up with the card.
The cash card goes back to the width it had before this branch: 0.64 of the row after the transcript inset, not the shared 0.78 bubble width. The reaction pill row under it sizes by the same rule, so it stays the card's width.
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.
Text, reply, deleted, and encrypted bubbles capped at 0.78 of the row after the transcript inset. iOS (
ChatViewController.maxBubbleWidthFraction) and our own link cards take 0.78 of the transcript's full width, so our bubbles came out about 31dp narrower than iOS's on a normal-width phone.The cash card keeps its 0.64 of the inset row. iOS drew it at a fixed 232pt and now takes the same 0.64 of its inset row in its own PR (code-payments/code-ios-app#890).
transcriptCardWidthbecomestranscriptBubbleMaxWidthand sizes every bubble and link card.bubbleMaxWidth(content, …)picks the width per message: a system notice spans the row, a cash card takes 0.64 of the inset row, everything else takestranscriptBubbleMaxWidth.bubbleMaxWidthinstead of keeping its own copy of the fraction, so it stays the width of the bubble or cash card above it.