Skip to content

fix(transcript): break a conversation chip with the line it sits on - #1410

Merged
vastsa merged 1 commit into
mainfrom
fix/message-chip-reads-as-text
Oct 4, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/message-chip-reads-as-text

Conversation

@vastsa

@vastsa vastsa commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Problem

A conversation chip inside a user message could be pushed whole onto a line of
its own, leaving the rest of the line it left behind blank — a hole in the
middle of the message.

Measured in the app's own stylesheet bundle, on a 532px line whose text ends at
355px:

chip fragments line 1 right edge line box
before 1, on line 2 355px of 532px filled (177px blank) 44px
after 2 (line 1 + line 2) filled to 530.4px 43.4px = 2 × 21.7px

The chip is 195.6px wide (it carries the conversation title) and the line had
177px left, so it could never fit there.

Change

Chromium never fragments a <button> across lines — display: inline and
white-space: normal on a button still measured one single rect — so the
conversation chip carries its button role, its accessible name and its Enter /
Space behaviour on a <span> that the message stylesheet lays out as an inline
run (display: inline, box-decoration-break: clone, the label allowed to
break). The tile then spans the break and the chip's first line reaches the
right edge, so a wrapped chip leaves no blank.

A chip that does fit is unchanged, and measures better than before: the label's
ink sits at the message text's own offsets inside the line (2.5px / 19px, before
3.97px / 20.47px), and the tile still covers exactly one line of message text
(padding: 0.186em 6px, since an inline box is only as tall as its font).

Only the conversation chip changes; file, image and draft chips keep the atomic
pill. Draft chips live outside .message-row, so the composer is untouched.

Verification

  • apps/desktop/test/session-reference-ui.test.mjs — renders the chip and
    asserts the button role, keyboard reachability, Enter/Space activation, and
    that activation still opens the referenced conversation.
  • apps/desktop/test/renderer-review-fixes.test.mjs — pins the inline-run rule
    (inline display, clone decoration, breakable label) and the icon's own gap.
  • node --test test/*.test.mjs — 3513 tests, 3512 pass; the one failure
    (remote-host-ssh-transport timing) passes on its own re-run and is unrelated.
  • tsc -p tsconfig.json --noEmit, biome lint, check-style-tokens.mjs — clean.
  • scripts/e2e-transcript-render.mjs — TRANSCRIPT_RENDER_PROBE {"ok":true,...}.
  • Chromium measurement of the real compiled stylesheet above, before and after.

Docs: docs/spec/04-ux/08-component-spec.md and its zh-CN mirror.

A conversation chip carries a title, so it can be wider than whatever a line
has left. As an atomic chip it was pushed whole onto the next line, and the line
it left kept its blank: a reader saw a hole in the middle of a message.

Chromium never fragments a `<button>` across lines, so the chip now carries its
button role and its Enter/Space behaviour on a span that the message stylesheet
lays out as an inline run. Its first line reaches the right edge of the line it
started on, the tile continues over the break, and a chip that does fit reads as
before — the label sits on the message's own baseline, with the tile covering
exactly one line of message text.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit 91dbf67 into main Oct 4, 2026
4 checks passed
@vastsa
vastsa deleted the fix/message-chip-reads-as-text branch October 6, 2026 16:56
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.

2 participants