Repository navigation
fix(transcript): break a conversation chip with the line it sits on - #1410
Merged
Merged
Conversation
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.
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.
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:
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: inlineandwhite-space: normalon a button still measured one single rect — so theconversation chip carries its button role, its accessible name and its Enter /
Space behaviour on a
<span>that the message stylesheet lays out as an inlinerun (
display: inline,box-decoration-break: clone, the label allowed tobreak). 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 andasserts 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-transporttiming) 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,...}.Docs:
docs/spec/04-ux/08-component-spec.mdand its zh-CN mirror.