Repository navigation
fix(ui): keep GitHub deep-link labels destination-specific - #124252
Conversation
Gate compact owner/repo#N label rewriting on exact issue/pull root URLs, so links with a trailing path segment, query, or fragment keep their full generated label instead of being collapsed to a generic item reference. Item identity parsing used by the hovercard preview and navigation is unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:31 PM ET / 21:31 UTC. ClawSweeper reviewWhat this changesThe PR limits Control UI’s compact GitHub issue and pull-request labels to exact item-root URLs, preserving visible deep-link destinations. Merge readinessKeep this PR open for normal maintainer handling: current main still unconditionally shortens deep GitHub URLs, while the branch separates identity parsing from label compaction and resolves the linked Control UI defect. The prior proof request is addressed by the PR’s built-Control-UI screenshot and focused validation evidence. Priority: P3 Review scores
Verification
How this fits togetherControl UI turns assistant Markdown into sanitized chat links. GitHub URLs are recognized for a visual mark and hovercard identity, while a separate decision determines whether their visible text can be shortened. flowchart LR
A[Assistant Markdown] --> B[Markdown renderer]
B --> C[GitHub URL recognition]
C --> D{Exact item root URL?}
D -->|Yes| E[Compact item label]
D -->|No| F[Keep destination label]
E --> G[Control UI chat]
F --> G[Control UI chat]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +17. Total +31 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the narrow compaction predicate, leave deep-link parsing and hovercard identity unchanged, and land after the normal maintainer exact-head validation. Do we have a high-confidence way to reproduce the issue? Yes—current main’s unconditional compaction at Is this the best way to solve the issue? Yes—the branch changes only the label-compaction decision while retaining the existing parsed item identity used by hovercard and navigation paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 73c45824e1e2. 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 (1 earlier review cycle)
|
|
Merged via squash.
|
…124252) Gate compact owner/repo#N label rewriting on exact issue/pull root URLs, so links with a trailing path segment, query, or fragment keep their full generated label instead of being collapsed to a generic item reference. Item identity parsing used by the hovercard preview and navigation is unchanged.
Fixes #124241
What Problem This Solves
Fixes an issue where Control UI chat would collapse GitHub deep links — pull request
/filesand/commitstabs, issue comment anchors, and links with a query string — down to a genericowner/repo#123label. The link still navigated to the correct destination, but the visible label no longer told the reader which specific page it pointed to, making deep references indistinguishable from plain issue/PR links when scanning a conversation.Why This Change Was Made
The Markdown renderer's GitHub-link pass reused the same parsed item identity both for deciding "does this link point at a GitHub issue or PR" and for deciding "is it safe to shorten this label to
owner/repo#N." Any URL with a recognizable owner/repo/issue-or-pull/number prefix qualified for compaction, even when it carried a more specific trailing path segment, query string, or fragment. This change adds a narrowisGitHubItemRootPath()check and only compacts the label when the URL is exactly the item root (/owner/repo/issues/Nor/owner/repo/pull/N, no extra segments/query/fragment). Item-identity parsing itself is untouched, so hovercard previews and navigation continue to resolve deep links normally — only the label-compaction decision is narrowed. Authored Markdown labels were never rewritten by this pass and remain unaffected.User Impact
Deep GitHub links (files tab, commits tab, comment anchors, query strings) now keep their full generated label so readers can see exactly what a link points to. Plain issue and pull request root links keep compacting to
owner/repo#123as before.Evidence
LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/components/markdown-links.test.ts— 77 passed (72 existing + 5 new destination-specific cases covering/files,/commits, an issue-comment fragment, a query string, and a diff anchor).Verified the 5 new cases fail against the pre-fix parser for the intended reason (compact
openclaw/openclaw#3434instead of the full deep URL), then pass after the fix.node scripts/check-changed.mjs -- ui/src/components/github-link-target.ts ui/src/components/markdown-parser.ts ui/src/components/markdown-links.test.ts— delegated Testbox run (tbx_01m03ds1xa7p1cyexqvqvrbzec) passed formatting, dead-export scan, i18n verification, core-test/UI typechecks, and changed-file lint, exit code 0.oxfmt --checkon the changed files — all matched files use the correct format.Control UI proof (built mock,
node --import tsx scripts/control-ui-mock-dev.ts): a chat message with a/filesdeep link, an#issuecommentfragment, and a?diff=query link all keep their full destination-specific URL as the label, while a plain item-root PR link in the same message still compacts toopenclaw/openclaw#124252.A live pre-fix "before" screenshot isn't practical from this branch (the fix and the mock share this checkout); the before-state is proven instead by the 5 new test cases in
markdown-links.test.ts, each confirmed failing against the pre-fix parser (compacting toopenclaw/openclaw#3434instead of the full deep URL) before this change, and passing after.