Repository navigation
fix(ui): keep the GitHub mark on its label's line when chat wraps - #123355
Conversation
The mark is an in-flow atomic inline, which carries a soft wrap opportunity after it, so a chat line could end on the octocat and start the next one with the reference it labels. Painting the mark out of flow and reserving its space with the anchor's own padding removes that opportunity: nothing inside the anchor precedes the label any more. The anchor stays inline, so a long bare URL still fills the line it starts on instead of moving down whole -- the sibling file-link chip's atomic treatment could not be reused here.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 7:31 PM ET / 23:31 UTC. ClawSweeper reviewWhat this changesThe PR changes Control UI GitHub-link styling so the octocat mark stays with its label across a line wrap while long bare URLs can still wrap internally. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for maintainer review. The supplied patch and real-browser evidence describe a focused UI repair, but the local read-only inspection environment failed before repository policy, current main, or full test source could be read. Priority: P3 Review scores
Verification
How this fits togetherControl UI parses Markdown chat messages into anchors and styles GitHub links with an octocat mark. Browser layout then wraps those anchors in chat transcripts and detail panels. flowchart LR
A[Markdown chat message] --> B[GitHub link parsing]
B --> C[Chat link anchor]
C --> D[CSS mark and wrap rules]
D --> E[Wrapped chat transcript]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +178. Total +187 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the focused CSS-owner repair if a fresh qualified review confirms the browser test covers the real parser output and the failed UI check is unrelated or repaired. Do we have a high-confidence way to reproduce the issue? No—the reviewer could not execute the supplied browser sweep because the read-only sandbox failed before commands launched; the PR body nevertheless supplies a concrete Chrome reproduction and after-fix measurement path. Is this the best way to solve the issue? Unclear—the proposed out-of-flow mark is plausibly narrower than making the whole link atomic, but complete owner, caller, test, and current-main inspection was unavailable. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against c574f403e947. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper findings and Rank-up moves are addressed: the complete head and current main were inspected, the related The repository-native review sequence was completed for exact head |
|
Merged via squash.
|
…enclaw#123355) * fix(ui): keep the GitHub mark on its label's line when chat wraps The mark is an in-flow atomic inline, which carries a soft wrap opportunity after it, so a chat line could end on the octocat and start the next one with the reference it labels. Painting the mark out of flow and reserving its space with the anchor's own padding removes that opportunity: nothing inside the anchor precedes the label any more. The anchor stays inline, so a long bare URL still fills the line it starts on instead of moving down whole -- the sibling file-link chip's atomic treatment could not be reused here. * test(ui): route GitHub link layout test through Node
Closes #123353
What Problem This Solves
Fixes an issue where users reading a Control UI chat transcript would see a GitHub reference split across two lines, with the octocat mark left alone at the end of one line and the reference —
openclaw/openclaw#123309, a URL, or an authored label — starting the next. The mark carries no meaning on its own, so the reference reads as two fragments.It affects all three shapes the Markdown parser produces for
github.comlinks, on the default path with no configuration involved, whenever a link lands near the right edge of a line — so narrow columns, split view, and mobile widths hit it most. Agents cite issues and PRs constantly, so these links are common in transcripts.This is the sibling case named as follow-up work in #123309 and in #123310.
Why This Change Was Made
The octocat is painted as a
::beforewithdisplay: inline-block. An atomic inline carries a soft wrap opportunity on both sides, so the line was always allowed to break between the mark and the label it marks; the anchor rule had never declared anything to prevent it. Bare URLs additionally carryline-break: anywhere, which narrows that window but does not close it — the break simply happens at the last opportunity that fits, and when only the mark fits, that opportunity is the one right after it.The mark is now painted out of flow (
position: absolute) and its space reserved by the anchor's ownpadding-inline-start: 1.3em— the mark's 1em box plus the 0.3em gap it previously carried as a margin. Nothing inside the anchor precedes the label any more, so no break opportunity exists between them; the only remaining one is before the whole reference. Spacing, size, color, and theemsizing that tracks--chat-text-sizeare unchanged.The sibling file-link fix could not be reused. #123310 answers the same invariant for
a.markdown-file-linkby making the whole anchor atomic (display: inline-block). An atomic anchor never fragments, so a long bare URL would move to the next line whole instead of breaking inside it — the exact behaviorline-break: anywhereexists to prevent. Measured over the same column sweep, that treatment raises the average unused space on the line preceding a bare URL from 8.4px to 210.1px (max 496.5px): it trades a stranded mark for a ragged column. Keeping the anchor inline and moving only the mark is what lets both invariants hold at once.The comment on the
markdown-bare-urlrule is updated in the same change: it justifiedline-break: anywherepartly by the mark being stranded, which is no longer a consequence the rule has to defend against.User Impact
GitHub references in chat prose now keep their mark and their label on the same line, in every form and at every column width. Long URLs still fill the line they start on and break inside themselves, exactly as before. Nothing about clicking, hovering, the hovercard, copying, or the mark's colors, spacing, or size changes — a reference that fits on one line renders identically to before.
Evidence
CSS-only change at the owning rule, plus a regression test. Production LOC delta:
ui/src/styles/chat/text.css+16/-7 — 2 added declarations (position,padding-inline-start), 3 declarations swapped for 3 on the::before(display/margin-inline-end/vertical-align→position/inset-inline-start/top), and the rest comments for a non-obvious layout invariant. Tests: +178 in a newui/src/styles/chat-github-link-presentation.browser.test.ts.The test is a new file rather than an addition to
chat-file-link-presentation.browser.test.ts: that suite is scoped to workspace file links, #123310 is currently open against it, and the surfaces assert different invariants — file chips must never fragment, GitHub links must always be able to.Real-browser proof. The three link forms were rendered in Chrome against the shipped stylesheets (
ui/src/styles/base.css+ui/src/styles/chat/text.css, unmodified and patched), sweeping a chat column from 200px to 900px in 4px steps and readinggetClientRects()on each anchor.Column widths where the mark is stranded on the previous line:
openclaw/openclaw#123309https://github.com/.../text.css#L254the sibling chip ruleUnused space on the line preceding the reference, averaged across the sweep — the cost the atomic alternative would have charged:
Before and after, both themes, at the column widths where each form strands the mark:
Note in the "after" bare-URL panel that the URL still breaks mid-token to fill its line — the wrap regime is preserved, only the mark moved.
Regression test.
keeps the GitHub mark on its label's line at every column widthruns the same sweep in both themes and asserts, for each form, that the first character of the label shares a line with the start of the anchor box — which is where the mark is painted. That invariant needs no magic constant and fails on pre-fix code for the reason the issue reports: at the widths listed above the label's first line differs from the anchor's. A vacuity guard first asserts the reference actually changes lines across the sweep, so the test cannot pass on a fixture that never wraps.keeps GitHub links breaking across lines instead of moving wholeasserts both the bare URL and the authored label still fragment, which is what would regress if this were ever "simplified" into the file-link chip's atomic treatment.The probe logic in the test was executed against the real committed stylesheets before and after the patch: pre-fix it reports the stranded widths in the table above for all three forms; post-fix it reports none, with the vacuity and fragmentation guards satisfied in both cases.
Validation run locally:
oxfmt(clean on both files) andnode scripts/run-oxlint.mjs ui/src/styles/chat-github-link-presentation.browser.test.ts(exit 0).Known proof gap — declared: the machine this was prepared on had under 500MB of free disk for most of the task, so the branch could not get its own dependency install and the added Vitest browser test has not been executed by Vitest; its probe was validated by running the identical measurement in Chrome against the same stylesheets, as described above. CI is the first Vitest execution of the new test.
Follow-up observed, not fixed here: the parser applies
markdown-bare-urlto an item URL and then rewrites its label toowner/repo#number(ui/src/components/markdown-parser.ts:497and:516), so a humanized reference keepsline-break: anywhereeven though its label is no longer a URL — it can break asopenclaw/openc/law#123309. That is a producer-side classification question, separate from this invariant, and is left alone rather than folded in blind.Landing review update — August 15, 2026
main, the complete chat stylesheet, Markdown parser ownership, sibling file-link behavior, scoped guidance, and relevant history were inspected.checks-uifailure was related: the new node-driven Chromium layout test was omitted fromnodeDrivenBrowserLayoutTests, so Vite attempted to bundle Playwright and failed on its optionalkerberosimport. The test is now routed through the canonical node-driven layout lane.