Repository navigation
fix(links): give every link in the app the link context menu - #266
Merged
Merged
Conversation
The root link menu resolves its address from an `a[href]` or a declared `data-link-url`, so a button-styled link that declared neither right-clicked into nothing: the Checks-panel PR id, the folder-workspace PR row, the Jira status row, task-page and project rows, and the settings doc links all had no menu at all. Fifty-one surfaces now declare the address they open, and resolution falls through to a declaration when the anchor it sits in is an in-app route rather than a web URL. A new ast-grep rule fails the lint gate when an inline onClick opens a web link without declaring it, so the next link cannot miss the menu.
Round 1 (Opus, high) raised no blockers and two should-fix items.
Surfaces it caught, all of which open a web page through a handler reference
the new lint rule cannot see: the Jira issue action rows (`onClick={item.action}`),
the two artifact "open in browser" buttons (a wrapper one call deep), and the
PR files view's "Open files on GitHub" section header, whose address every
section shares. The new-workspace source chip had the same shape.
Its minor findings are fixed too: a non-web anchor the declaration wraps now
keeps the browser's own menu instead of borrowing the row's address, the rule
test exercises its self-closing branch and an href-less anchor, the rule's
header says which shapes it cannot see, the project view error address is
computed once, and the icon button and error state carry tests.
…pper The delta re-check closed both should-fix findings and left two minor ones partly done; both were one-hunk fixes, so they are here rather than in the PR body. A declaration nested inside a web anchor now wins over the anchor, which is what "the innermost claim is the most specific" has meant everywhere else. The rule test drops a case that asserted nothing and gains the artifact wrapper the rule's regex names.
The comment ratchet is red: 6068 added comment lines against a frozen 6051, and 11 of those are mine from #268 while 6 are this branch's. LOCAL-PATCHES.md forbids fork rationale above upstream code because it is conflict adjacency, so the one-liners that only restate an attribute's name are gone, and the DST rationale stays under a `fork-comment-ok:` marker — that reason cannot live in the PR body, because the next reader of the call site is the one who needs it.
The delta round on the comment cleanup found the rule LOCAL-PATCHES.md states: a marker is not added without a reason in the ledger. Both reasons are the DST ambiguity and the printer/parser pairing, neither of which is visible in the code the marker guards.
nplez1
force-pushed
the
nplez1/Link-Context-Menu
branch
from
November 1, 2026 10:53
5573a39 to
8e65a1e
Compare
nplez1
added a commit
that referenced
this pull request
Nov 1, 2026
Round 1 of the gate-2 review (Opus 5.5, high) returned BLOCKING against the ledger entry, not the code: the deletion and the overlay rows were clean, but the entry stated one invariant wrongly and left two recorded nowhere. - The pick is display-only in Source Control only. In the Checks pane it is operational: HostedReviewActions gets the shown review and a mutation's refresh goes to the pick first. Scoped the bullet and stated the other half. - Added the two invariants that lost their only guard: the shown-review switch effect (fires on a change rather than on mount, clears the previous review's rows, raises loading flags only for a pick) and the pick-first tab-entry and post-mutation refresh. Neither hook is rendered by any test under right-sidebar/**, which is why the ledger has to carry them. - Corrected the refresh bullet's reason: refreshRequestKeyRef is per-request, so a switch never changes it and isCurrentRequest cannot see one — it is the result key that cannot tell a switch from this review's own head moving. Added the two test-pinned clauses (re-check the pick after the await and before claiming asyncResultKeyRef; compare pickedRequestKey as a local because isCurrentAsyncResult reads the ref). - Added "a pick's read must not retractStalePRRefreshError", pinned at use-checks-panel-polling.test.tsx. - Fixed the figures: the ratchet counts 118 of the deleted lines (the diff deletes 120; two are JSX comment continuation lines the line rule skips), and the baseline measured 6062 at #267's parent, not 6051 — #268's 11 were already in the tree and #266 removed them afterwards, which is the 6169 this branch carried. - The two overlay rows named the cache key by position; they name use-workspace-review-selection.ts instead, so a prune or reorder cannot break the pointer. Both ratchets still green (6051/6051, 0 stale; 664 focus reads). No code changed, so the unit-gate verdict for e88b0f0 still stands and the review is not voided by this commit (LOCAL-PATCHES.md only).
nplez1
added a commit
that referenced
this pull request
Nov 1, 2026
…s reads The lint gate was 42/44 on this branch, both reds from #267 and both entirely inside src/renderer/src/components/right-sidebar/**: - check-upstream-file-comments: 6180 against a 6051 baseline. #267 added 118 comment lines across 12 files upstream owns. All 118 are removed rather than marked `fork-comment-ok`: each was prose above upstream's code explaining a fork decision, and the fork's own modules (workspace-review-selection.ts, use-workspace-review-selection.ts, WorkspaceReviewSwitcher.tsx) already state the same design without a hunk to resolve on every sync. Total is back to exactly 6051 with 0 stale entries, so no re-baseline was needed. - check:focus-read-ratchet: three files at 1 read each. They are one transitive read, not three routing decisions: use-workspace-review-selection.ts builds its hosted-review cache key through getWorkspaceReferenceRuntimeVersion, which folds getProviderRuntimeContextKey(null) in — null is this app, not the focused host — and it reuses the sidebar card's key on purpose so a switch does not overwrite the branch's entry. The two panes then count because they call the hook. Recorded in config/focus-setting-read-baseline.fork.txt with the reason, the same shape as the 2026-10-16 use-linked-issue-pane-actions.ts row, rather than restructuring reviewed code to dodge a regex. The invariants those comments guarded (display-only pick, the one suppressedGitHubPR tombstone, row-not-slot unlink, renderable rows, the store as the refresh switch test, no branch argument for a picked review) now live in LOCAL-PATCHES.md § local(lint), next to #266's marker note. Verified: check-upstream-file-comments and check:focus-read-ratchet green; tc:web clean; the 9 test files covering the touched hooks and components pass.
nplez1
added a commit
that referenced
this pull request
Nov 1, 2026
Round 1 of the gate-2 review (Opus 5.5, high) returned BLOCKING against the ledger entry, not the code: the deletion and the overlay rows were clean, but the entry stated one invariant wrongly and left two recorded nowhere. - The pick is display-only in Source Control only. In the Checks pane it is operational: HostedReviewActions gets the shown review and a mutation's refresh goes to the pick first. Scoped the bullet and stated the other half. - Added the two invariants that lost their only guard: the shown-review switch effect (fires on a change rather than on mount, clears the previous review's rows, raises loading flags only for a pick) and the pick-first tab-entry and post-mutation refresh. Neither hook is rendered by any test under right-sidebar/**, which is why the ledger has to carry them. - Corrected the refresh bullet's reason: refreshRequestKeyRef is per-request, so a switch never changes it and isCurrentRequest cannot see one — it is the result key that cannot tell a switch from this review's own head moving. Added the two test-pinned clauses (re-check the pick after the await and before claiming asyncResultKeyRef; compare pickedRequestKey as a local because isCurrentAsyncResult reads the ref). - Added "a pick's read must not retractStalePRRefreshError", pinned at use-checks-panel-polling.test.tsx. - Fixed the figures: the ratchet counts 118 of the deleted lines (the diff deletes 120; two are JSX comment continuation lines the line rule skips), and the baseline measured 6062 at #267's parent, not 6051 — #268's 11 were already in the tree and #266 removed them afterwards, which is the 6169 this branch carried. - The two overlay rows named the cache key by position; they name use-workspace-review-selection.ts instead, so a prune or reorder cannot break the pointer. Both ratchets still green (6051/6051, 0 stale; 664 focus reads). No code changed, so the unit-gate verdict for e88b0f0 still stands and the review is not voided by this commit (LOCAL-PATCHES.md only).
nplez1
added a commit
that referenced
this pull request
Nov 1, 2026
* fix(lint): remove #267's fork comments and record its transitive focus reads The lint gate was 42/44 on this branch, both reds from #267 and both entirely inside src/renderer/src/components/right-sidebar/**: - check-upstream-file-comments: 6180 against a 6051 baseline. #267 added 118 comment lines across 12 files upstream owns. All 118 are removed rather than marked `fork-comment-ok`: each was prose above upstream's code explaining a fork decision, and the fork's own modules (workspace-review-selection.ts, use-workspace-review-selection.ts, WorkspaceReviewSwitcher.tsx) already state the same design without a hunk to resolve on every sync. Total is back to exactly 6051 with 0 stale entries, so no re-baseline was needed. - check:focus-read-ratchet: three files at 1 read each. They are one transitive read, not three routing decisions: use-workspace-review-selection.ts builds its hosted-review cache key through getWorkspaceReferenceRuntimeVersion, which folds getProviderRuntimeContextKey(null) in — null is this app, not the focused host — and it reuses the sidebar card's key on purpose so a switch does not overwrite the branch's entry. The two panes then count because they call the hook. Recorded in config/focus-setting-read-baseline.fork.txt with the reason, the same shape as the 2026-10-16 use-linked-issue-pane-actions.ts row, rather than restructuring reviewed code to dodge a regex. The invariants those comments guarded (display-only pick, the one suppressedGitHubPR tombstone, row-not-slot unlink, renderable rows, the store as the refresh switch test, no branch argument for a picked review) now live in LOCAL-PATCHES.md § local(lint), next to #266's marker note. Verified: check-upstream-file-comments and check:focus-read-ratchet green; tc:web clean; the 9 test files covering the touched hooks and components pass. * local(lint): correct the #267 ledger entry the gate-2 review caught Round 1 of the gate-2 review (Opus 5.5, high) returned BLOCKING against the ledger entry, not the code: the deletion and the overlay rows were clean, but the entry stated one invariant wrongly and left two recorded nowhere. - The pick is display-only in Source Control only. In the Checks pane it is operational: HostedReviewActions gets the shown review and a mutation's refresh goes to the pick first. Scoped the bullet and stated the other half. - Added the two invariants that lost their only guard: the shown-review switch effect (fires on a change rather than on mount, clears the previous review's rows, raises loading flags only for a pick) and the pick-first tab-entry and post-mutation refresh. Neither hook is rendered by any test under right-sidebar/**, which is why the ledger has to carry them. - Corrected the refresh bullet's reason: refreshRequestKeyRef is per-request, so a switch never changes it and isCurrentRequest cannot see one — it is the result key that cannot tell a switch from this review's own head moving. Added the two test-pinned clauses (re-check the pick after the await and before claiming asyncResultKeyRef; compare pickedRequestKey as a local because isCurrentAsyncResult reads the ref). - Added "a pick's read must not retractStalePRRefreshError", pinned at use-checks-panel-polling.test.tsx. - Fixed the figures: the ratchet counts 118 of the deleted lines (the diff deletes 120; two are JSX comment continuation lines the line rule skips), and the baseline measured 6062 at #267's parent, not 6051 — #268's 11 were already in the tree and #266 removed them afterwards, which is the 6169 this branch carried. - The two overlay rows named the cache key by position; they name use-workspace-review-selection.ts instead, so a prune or reorder cannot break the pointer. Both ratchets still green (6051/6051, 0 stale; 664 focus reads). No code changed, so the unit-gate verdict for e88b0f0 still stands and the review is not voided by this commit (LOCAL-PATCHES.md only). * local(lint): fix the two MINOR wording errors the delta re-check found Round 2 (the R1..R2 delta re-check, Opus 5.5 high) resolved all seven round-1 findings and reported two MINOR wording errors in the bullet R2 added. Both are one-hunk text fixes, so they are fixed here rather than listed in the PR body: - The bullet title said the switch effect and the tab-entry refresh "are a pick's only re-reads". They are not: the switch effect reads nothing (it clears rows and sets flags), and a manual refresh and polling both read a pick. The title now names what the bullet actually guards, which is that neither hook is rendered by a test. - The mount-guard reason was wrong. In an ordinary single-review workspace shownReviewKey is '' and the unguarded effect would clear rows that are already empty and raise no flags. The guard earns its place on a remount where the pick's cache entry is already warm: showsPickedReview resolves true on the first render, so the unguarded effect would clear rows and raise loading flags with no switch and no read in flight, and setChecksLoading/setCommentsLoading are otherwise written only by a manual refresh, so nothing would clear them. Both ratchets still green. LOCAL-PATCHES.md only: no code changed, so the unit gate verdict for e88b0f0 still stands for that revision, and this commit does not void the review. No third review round: AGENTS.md requires the user's approval for one, and these are the reviewer's own suggested fixes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
The link context menu was mounted once at the app root and resolved its address from an
a[href]or adeclared
data-link-url. The mechanism worked — verified live over CDP — but coverage did not. Anearlier PR tagged ten surfaces; every other button-styled link declared nothing, so right-click
produced no menu at all. The Checks-panel PR id was the clearest case: a
<button onClick>with noaddress, right-clicking into nothing.
The fix
AppLinkContextMenu.tsx): a non-web anchor no longer swallows the lookup, so adeclaration on the row or button still resolves. The innermost claim wins — a declaration nested in
an anchor beats the anchor, an anchor nested in a declaration beats the row — and a claim that is
not a web address keeps the browser's own menu rather than borrowing the other's. Values are
trimmed and must be absolute
http(s).PR row, Jira status row, transition controls and issue action rows, source-control branch row, issue
panes, PR page and PR-files section header, GitHub/GitLab item dialogs, artifact open buttons, task
page (GitHub/GitLab/Linear rows, tables, board cards), editor check panel, Linear and GitHub project
views, new-workspace source chip, settings integration and doc links, update cards, onboarding,
landing, first-launch banner, feature wall, feedback dialog.
config/ast-grep/rules/link-affordance-declares-url.ymlfails the lint gate when aninline
onClickcalls one of the openers without declaringdata-link-url. Its header states thegap it cannot close: a handler passed by reference (
onClick={onOpenReview}) or a wrapper one calldeep is invisible to it, so those still need a human.
Each link now offers the three rows the request named: Open in Orca Browser, Open in System
Browser, Copy Link. The first appears only with an active workspace, which is the destination it
needs.
Deliberate exclusions
downloads, localhost port forwards (
local-port-row,ssh-forwarded-port-row,ssh-ports-panel).These call
openUrlInSystemBrowseron purpose and an in-app row would be wrong. Surfaces that callshell.openUrlinstead (Linear API keys, Bitbucket credentials, the Jira credential guide) arenot in this class: that bridge relays into the router and already honours the in-app preference,
so the menu matching it is consistent.
ShareSkillsSettingsPane— "Manage in Skills" navigates in-app (openSkillsSharedLinks), itdoes not open a browser, so it carries no address.
owner.
Nits left here rather than fixed
pendingdisables it. Chromiumdoes not dispatch
contextmenuon a disabled form control, so the menu cannot open there; theattribute is inert rather than harmful.
onClick={onOpenReview},onClick={item.action}) or through a wrapper one call deep, so those sites were tagged by hand:ProjectRow, the Jira issue action rows (which now carryurlthrough their action list), bothartifact "open in browser" buttons, the PR-files section header, and the new-workspace source chip.
The rule's header states that blind spot rather than implying coverage it does not have.
Verification
AppLinkContextMenu.test.tsx— 20 cases, including nested-claim precedence both ways, a mailtoinside a declared row, a padded value, and non-web values.
review-header.test.tsxpins the reported bug;header-icon-button.test.tsxandProjectViewStates.test.tsxcover the two places an attribute is forwarded through a prop.task page, editor, Jira workspace, PR files and project views.
pnpm tc:webclean,ast-grep scan --min-severity warning srcclean, rule tests pass,check:code-quality:changedclean.Open in System Browser/Copy Linkwith no page errors.Gates
The diff touches
config/**, so gate 1 wants the full suite on this revision. Main was red when thisbranch was first opened — six unit failures and a lint ratchet over its baseline — so #268 fixed those
first. On the rebased revision:
pnpm tcis clean, andcheck:code-quality:changedreports 0 new findings across 69 changed files.The earlier gate-1 waiver is gone: it existed only because the base revision was red.
One lint red was this branch's own: the comment ratchet counts fork rationale in upstream-owned files,
and 17 lines were over its 6051 baseline — 11 from #268 and 6 from here. The one-liners that only
restated an attribute name are deleted; the DST rationale stays under two
fork-comment-ok:markers,recorded in
LOCAL-PATCHES.md, because that reason has to sit next to the call site. The ratchet isback at 6051/6051.
Reviewed by Opus 5.5, high: R1 (2 blocking fixed), delta clean on R2, comment-only delta clean on R4
Gate 2 detail: no BLOCKER was raised; the two blocking findings were SHOULD-FIX (surfaces opening a
link through a handler reference, and the rule over-claiming what it guards). Both fixed, plus the
round-1 MINORs and the two the delta re-check found partly done. A third delta round covered the
comment cleanup, which touched files inside the reviewed range: it found no code change, one doc-only
item (the
LOCAL-PATCHES.mdmarker entry, added in a docs-only commit), and two nits recorded here:fork-comment-ok:markers from that patch.LC_ALLgate inthe probe test, and what
openSectionUrlmeans when unset.