Own-message bubble hugs content; consecutive runs form clean rectangles#912
Merged
Conversation
…ctangles The filled own-message tint spanned the full row. It now hugs its content (w-fit), so a short message reads as a small pill instead of a full-width band. A run of consecutive own messages shares the widest line's width so the tint reads as one clean rectangle rather than a ragged per-row hug. Because the timeline is virtualized with flat, independent rows (no per-group DOM container), this uses a small imperative width registry (messageGroupWidth): widths are applied via el.style.width (never React state, so no re-render loop), all dirty groups flush in one microtask with reads-before-writes, and only the background box widens so row heights are unchanged and scroll is untouched. Solo own messages stay pure CSS w-fit and never register.
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 filled own-message tint spanned the full row. It now hugs its content, so a short message reads as a small pill (stopping around where the
you · timeheader ends) instead of a full-width band. Long messages still wrap at the available width; incoming rows and whisper cards are unchanged.A run of consecutive own messages shares the widest line's width so the tint reads as one clean rectangle rather than a ragged per-row hug. The timeline is virtualized with flat, independent rows (no per-group DOM container), so there is no CSS-only path — this uses a small imperative width registry (
messageGroupWidth.tsx):el.style.width(never React state, so no measure→render loop);w-fit), so row heights never change and the virtualizer/scroll anchoring are untouched;w-fit;max-w-fullis the safety net: a stale pinned width can never overflow, the group stays rectangular at the available width.Re-fit triggers: mount, content change (via a width signature), and container resize (reusing the same debounced signal
CollapsibleContentalready uses).