Skip to content

fix(ui): keep GitHub deep-link labels destination-specific - #124252

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/github-deeplink-labels
Aug 15, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/github-deeplink-labels

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Fixes #124241

What Problem This Solves

Fixes an issue where Control UI chat would collapse GitHub deep links — pull request /files and /commits tabs, issue comment anchors, and links with a query string — down to a generic owner/repo#123 label. 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 narrow isGitHubItemRootPath() check and only compacts the label when the URL is exactly the item root (/owner/repo/issues/N or /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#123 as 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#3434 instead 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 --check on 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 /files deep link, an #issuecomment fragment, 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 to openclaw/openclaw#124252.

    Control UI: deep links keep full labels, item-root link compacts

    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 to openclaw/openclaw#3434 instead of the full deep URL) before this change, and passing after.

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.
@clawsweeper

clawsweeper Bot commented Aug 15, 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: XS maintainer Maintainer-authored PR labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 15, 2026 19:28
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:31 PM ET / 21:31 UTC.

ClawSweeper review

What this changes

The PR limits Control UI’s compact GitHub issue and pull-request labels to exact item-root URLs, preserving visible deep-link destinations.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned repair with direct UI proof and targeted regression coverage.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
Evidence reviewed 4 items Current-main defect: Current main still parses the first four path segments and unconditionally replaces a generated GitHub item label, so a deep URL such as a files tab, query, or fragment loses its visible destination.
Owner-boundary repair: The branch keeps deep-link parsing for navigation and hovercards but gates only visible-label compaction on a root-path predicate.
Regression coverage and real UI proof: Five table-driven cases cover path, query, and fragment deep destinations; the PR body also supplies an after-fix built Control UI screenshot showing deep labels retained alongside a compact root link.
Findings None None.
Security None None.

How this fits together

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

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; refresh the exact merge result and required checks before landing.
  • Resolve merge risk (P1) - Production code is +14 net lines for this bug fix. The separate predicate preserves the needed distinction between item identity and safe label compaction, but it is a one-caller exported helper that merits a final scope check.
Agent review details

Security

None.

PR surface

Source +14, Tests +17. Total +31 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 16 2 +14
Tests 1 17 0 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 33 2 +31

Review metrics

Metric Value Why it matters
Production vs test LOC production +16/-2 (net +14); tests +17/-0 The added predicate and its explanatory boundary are small but represent positive production growth in a bug fix.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #124241
Summary: This PR is the candidate fix for the linked, source-reproducible Control UI deep-link label defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the narrow compaction predicate, leave deep-link parsing and hovercard identity unchanged, and land after the normal maintainer exact-head validation.
  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 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 ui/src/components/markdown-parser.ts:517 follows any successfully parsed GitHub item, including a deep URL with extra path, query, or fragment data.

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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a bounded Control UI label-clarity bug; links still navigate to the correct destination.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides an after-fix screenshot from a built mock Control UI showing deep URLs retain their destination labels while an exact root URL remains compact.

Evidence

What I checked:

Likely related people:

  • vyctorbrzezowski: Commit 65f4320 introduced GitHub item-link humanization in this renderer path. (role: introduced the compact-label behavior; confidence: high; commits: 65f432014758; files: ui/src/components/markdown-parser.ts, ui/src/components/github-link-target.ts)
  • Peter Steinberger: Current-main blame attributes the active renderer block to the recent Control UI refactor commit. (role: recent area contributor; confidence: medium; commits: 1610771b1d7a; files: ui/src/components/markdown-parser.ts)

Rank-up moves

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

  • Refresh the exact merge result and required checks after rebasing or otherwise updating against current main.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-15T19:35:20.909Z sha 0b3548d :: found issues before merge. :: [P2] Add before/after Control UI proof

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit ac69406 into main Aug 15, 2026
235 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/github-deeplink-labels branch August 15, 2026 21:47
@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
…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.
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

Do not collapse GitHub deep-link labels to generic issue references

1 participant