Skip to content

Own-message bubble hugs content; consecutive runs form clean rectangles#912

Merged
mremond merged 1 commit into
mainfrom
mr/friendly-aryabhata-7f04f4
Jul 8, 2026
Merged

Own-message bubble hugs content; consecutive runs form clean rectangles#912
mremond merged 1 commit into
mainfrom
mr/friendly-aryabhata-7f04f4

Conversation

@mremond

@mremond mremond commented Jul 8, 2026

Copy link
Copy Markdown
Member

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 · time header 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):

  • widths are applied via el.style.width (never React state, so no measure→render loop);
  • all dirty groups flush in one microtask, reads-before-writes (single layout pass, before paint — no flicker);
  • only the background box widens (text stays w-fit), so row heights never change and the virtualizer/scroll anchoring are untouched;
  • only multi-row own runs register — a solo own message stays pure CSS w-fit;
  • max-w-full is 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 CollapsibleContent already uses).

…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.
@mremond mremond added this to the 0.17.1 milestone Jul 8, 2026
@mremond mremond merged commit d9135f1 into main Jul 8, 2026
3 checks passed
@mremond mremond deleted the mr/friendly-aryabhata-7f04f4 branch July 8, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant