Repository navigation
fix(ui): show backtick-quoted GitHub links as chips with hover cards - #141446
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 7, 2026, 3:43 PM ET / 19:43 UTC. ClawSweeper reviewWhat this changesThe Control UI turns standalone backtick-quoted GitHub URLs into existing link chips and hover-card targets, with matching regression coverage and documentation. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: the change remains useful, the earlier mixed-content defect is addressed, and no new blocking code defect was found. Required visual evidence remains outstanding. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI Markdown renderer converts chat message text into sanitized HTML. GitHub anchors receive compact labels and connect to the existing hover-card presentation. flowchart LR
A[Chat Markdown] --> B[Parse inline tokens]
B --> C{Standalone GitHub URL in code?}
C -->|Yes| D[Existing GitHub link classification]
C -->|No| E[Preserve ordinary rendering]
D --> F[Sanitized chat HTML]
E --> F
F --> G[Chips and hover cards]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +38, Tests +34, Docs 0. Total +72 across 3 files. View PR surface stats
Review metricsNone. Mantis proof suggestionWeb UI chat proof can directly demonstrate the changed chip appearance and hover interaction. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep quoted URLs on the shared GitHub-link rendering path while preserving mixed-content code and authored links. Do we have a high-confidence way to reproduce the issue? Not applicable as an existing-contract bug: current code and prior documentation intentionally preserve code spans; this PR extends chip presentation to a selected code-span form. Is this the best way to solve the issue? Yes: promoting eligible tokens into the existing classifier avoids duplicating labels, styling, sanitization, or hover-card logic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc79a198dc0d. 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
HistoryReview history (2 earlier review cycles)
|
399a2ce to
1b7c442
Compare
|
Status: the |
A code span holding nothing but a github.com URL now renders like a bare URL: issue and pull-request links become the #number chip with icon, tooltip, and hover card; repository and file links get the short label with the GitHub mark. Fenced blocks, code spans with other text, non-GitHub URLs, and code spans inside authored links stay as code.
The URL parser percent-encodes inner whitespace instead of failing, so a backtick span like a GitHub item URL followed by prose was promoted with the prose folded into the href. Only a span that is entirely one URL is promoted now; trailing-prose and post-fragment cases are covered by tests.
Trimming before the guard let one-sided padding such as a trailing space bypass it. CommonMark already strips symmetric padding, so any remaining whitespace is content and the span stays code.
The URL parser strips or percent-encodes C0 controls, so a span holding a GitHub URL plus a control character was still promoted. The guard now rejects control characters alongside whitespace.
1b7c442 to
afb1bc9
Compare
|
Merged via squash.
|
…penclaw#141446) * fix(ui): show backtick-quoted GitHub links as chips with hover cards A code span holding nothing but a github.com URL now renders like a bare URL: issue and pull-request links become the #number chip with icon, tooltip, and hover card; repository and file links get the short label with the GitHub mark. Fenced blocks, code spans with other text, non-GitHub URLs, and code spans inside authored links stay as code. * fix(ui): keep code spans with prose after a GitHub URL as code The URL parser percent-encodes inner whitespace instead of failing, so a backtick span like a GitHub item URL followed by prose was promoted with the prose folded into the href. Only a span that is entirely one URL is promoted now; trailing-prose and post-fragment cases are covered by tests. * fix(ui): require whitespace-free code spans before promoting GitHub URLs Trimming before the guard let one-sided padding such as a trailing space bypass it. CommonMark already strips symmetric padding, so any remaining whitespace is content and the span stays code. * fix(ui): reject control characters when promoting GitHub URL code spans The URL parser strips or percent-encodes C0 controls, so a span holding a GitHub URL plus a control character was still promoted. The guard now rejects control characters alongside whitespace.
What Problem This Solves
Fixes an issue where users reading chat messages would see a GitHub pull request or issue link rendered as a plain grey code box when the model quoted the URL in backticks (
`https://github.com/openclaw/openclaw/pull/141131`), while the same URL written bare showed the compact#141131chip with its icon and hover card. Models quote links this way often, so a common message shape lost the reference affordance.Why This Change Was Made
markdown-it never linkifies inside code spans, so the existing GitHub link classification never saw these URLs. The parser now promotes a top-level code span whose CommonMark-normalized content is exactly one http(s)
github.comURL, with no whitespace or control characters, into the same link tokens linkify produces, so the existing chip, label, tooltip, and hover-card path applies unchanged and the emitted markup is identical to a bare URL. Fenced and indented code blocks, code spans with surrounding text, non-GitHub URLs, and code spans inside authored[label](url)links stay as code.User Impact
Backtick-quoted GitHub issue and pull request links in chat now show as
#numberchips with the issue or pull-request icon, keep the full URL in the tooltip, and open the hover card. Repository and file links quoted the same way get their short label with the GitHub mark. No change for other code spans or code blocks.Evidence
#1234references) landed; that rule runs before this one and only touches text tokens, so the two do not overlap.ui/src/components/markdown*.test.tsandgithub-link-hovercard.test.ts: 361 tests pass across 10 files, plus the hover-card provider suite.check:changedclean (Control UI i18n, UI typecheck, dead-export scan, lint lanes).docs/web/control-ui/feature-reference.mdupdated; it previously stated that GitHub marks never appear inside code spans.