Skip to content

fix(ui): keep the GitHub mark on its label's line when chat wraps - #123355

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
fix/github-chip-orphan-glyph
Aug 15, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
fix/github-chip-orphan-glyph

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

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.com links, 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 ::before with display: 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 carry line-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 own padding-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 the em sizing that tracks --chat-text-size are unchanged.

The sibling file-link fix could not be reused. #123310 answers the same invariant for a.markdown-file-link by 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 behavior line-break: anywhere exists 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-url rule is updated in the same change: it justified line-break: anywhere partly 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 new ui/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 reading getClientRects() on each anchor.

Column widths where the mark is stranded on the previous line:

Link form Label Before After
Humanized item reference openclaw/openclaw#123309 252, 256, 496, 500 none
Bare GitHub URL https://github.com/.../text.css#L254 272, 276, 516, 520 none
Authored label the sibling chip rule 204, 208, 212, 216, 396, 400, 404, 408, 412 none

Unused space on the line preceding the reference, averaged across the sweep — the cost the atomic alternative would have charged:

Link form Before After (this PR) If made atomic
Humanized item reference 10.1px 10.5px 59.1px
Bare GitHub URL 8.4px 8.6px 210.1px
Authored label 5.1px 6.1px 28.2px

Before and after, both themes, at the column widths where each form strands the mark:

Before After
Light Light theme: the octocat mark stranded at the end of a line in all three GitHub link forms Light theme: the mark kept on the same line as its label in all three forms
Dark Dark theme: the octocat mark stranded at the end of a line in all three GitHub link forms Dark theme: the mark kept on the same line as its label in all three forms

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 width runs 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 whole asserts 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) and node 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-url to an item URL and then rewrites its label to owner/repo#number (ui/src/components/markdown-parser.ts:497 and :516), so a humanized reference keeps line-break: anywhere even though its label is no longer a URL — it can break as openclaw/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

  • Full PR head, current main, the complete chat stylesheet, Markdown parser ownership, sibling file-link behavior, scoped guidance, and relevant history were inspected.
  • The earlier checks-ui failure was related: the new node-driven Chromium layout test was omitted from nodeDrivenBrowserLayoutTests, so Vite attempted to bundle Playwright and failed on its optional kerberos import. The test is now routed through the canonical node-driven layout lane.
  • Focused Testbox proof is green: Actions run 31863845676 passed the GitHub-link test (3/3) and sibling file-link test (6/6). This supersedes the earlier declared Vitest execution gap.
  • The +9 net production-line delta remains confined to the owning CSS rule and its invariant comments; no smaller atomic-link treatment preserves long-URL fragmentation.
  • All ClawSweeper review points and Rank-up moves are addressed. No security, owner-boundary, or crash-consistency concern remains.

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.
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 13, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 13, 2026 22:40
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 7:31 PM ET / 23:31 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 3 items remain

Keep 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
Reviewed head: a9df4139c4ba6d99dd3281b9af6628432b435258

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The contributor evidence is strong for this visible layout change, but the review environment could not independently inspect the complete patch or current integration state.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.
Evidence reviewed 3 items Submitted CSS owner-rule change: The supplied patch moves the GitHub mark out of flow and reserves its space on the anchor, targeting the reported break opportunity without making the full anchor atomic.
Contributor real-browser proof: The PR body provides before/after Chrome screenshots and a 200–900px width sweep for humanized references, bare URLs, and authored labels, reporting no stranded-mark widths after the change.
Local inspection infrastructure failure: Read-only commands could not start: the sandbox returned bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted, so repository files, scoped policy, history, and CI logs were not inspected locally.
Findings None None.
Security None None.

How this fits together

Control 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]
Loading

Before merge

  • Resolve merge risk (P1) - The review sandbox could not inspect the full PR head, current main, scoped UI guidance, or failed checks-ui logs; a qualified maintainer should repeat those checks before merge.
  • Resolve merge risk (P1) - The patch has a net production increase of 9 lines; the submitted rationale attributes it to the required positioning declarations and a layout-invariant comment, but this could not be verified against the complete stylesheet.
  • Complete next step (P2) - The author is a member and the PR carries the protected maintainer label; complete source and failed-check inspection also needs a qualified human review.
Agent review details

Security

None.

PR surface

Source +9, Tests +178. Total +187 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 16 7 +9
Tests 1 178 0 +178
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 194 7 +187

Review metrics

Metric Value Why it matters
Production versus test LOC production +9 net (+16/-7), tests +178 The production growth is small and has a stated layout-invariant rationale, but bug-fix growth needs a fresh complete-style review.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a localized Control UI presentation fix with no demonstrated security, availability, data, or delivery impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.

Label justifications:

  • P3: This is a localized Control UI presentation fix with no demonstrated security, availability, data, or delivery impact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body supplies direct before/after browser screenshots plus a measured Chrome width sweep showing the repaired layout while bare URLs still fragment.

Evidence

What I checked:

  • Submitted CSS owner-rule change: The supplied patch moves the GitHub mark out of flow and reserves its space on the anchor, targeting the reported break opportunity without making the full anchor atomic. (ui/src/styles/chat/text.css:255, a9df4139c4ba)
  • Contributor real-browser proof: The PR body provides before/after Chrome screenshots and a 200–900px width sweep for humanized references, bare URLs, and authored labels, reporting no stranded-mark widths after the change. (a9df4139c4ba)
  • Local inspection infrastructure failure: Read-only commands could not start: the sandbox returned bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted, so repository files, scoped policy, history, and CI logs were not inspected locally.

Likely related people:

  • vyctorbrzezowski: The supplied context shows this member authored the linked report and the focused UI patch; current-main ownership history could not be read locally. (role: reported defect and proposed repair; confidence: low; commits: a9df4139c4ba; files: ui/src/styles/chat/text.css, ui/src/styles/chat-github-link-presentation.browser.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Re-run the browser presentation test and inspect the failed checks-ui log on the exact head.
  • Have a qualified reviewer confirm the positioned pseudo-element remains aligned across the supported chat surfaces.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

ClawSweeper findings and Rank-up moves are addressed: the complete head and current main were inspected, the related checks-ui failure was repaired at the canonical Vitest routing owner, the production delta was reviewed, and the positioned mark was verified across all parser-produced chat forms, both themes, and the sibling file-link behavior.

The repository-native review sequence was completed for exact head 53261a76285ed534e527a4021d9eee12f5f39dcf; focused Testbox proof passed 9/9 and hosted CI is fully green, including openclaw/ci-gate.

@vyctorbrzezowski
vyctorbrzezowski merged commit 9837ad5 into main Aug 15, 2026
174 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the fix/github-chip-orphan-glyph branch August 15, 2026 04:26
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI chat strands the GitHub mark on the previous line when a link wraps

1 participant