Repository navigation
fix(review): land a Checks-pane comment in the diff that carries its hunks - #199
Merged
nplez1 merged 4 commits intoOct 28, 2026
Merged
Conversation
…hunks (#192) Following a review comment forced `mode: 'edit'`, so the jump landed in a plain Monaco tab: no inline hunks, no add-note overlay, and the thread drawn against file text instead of the lines it reviews. - Route the jump to the file's branch diff (merge base -> head, the review's own diff) when the worktree has a ready compare, to Changes mode when only the working tree changed, and to a plain tab only when no surface holds a hunk for the file at all. - Key Changes mode by the opened file's id rather than its path, which is not the id for a remote owner. - Warm the branch compare from the Checks pane: it replaces the Source Control tab, which was the only loader of the diff basis the jump depends on.
- Defer the diff viewer's first-change auto-scroll to a review-thread reveal, which it otherwise undid in a diff tab with no stored view state. - Only claim the review's diff when the stored compare is against the review's own base branch, and keep landing in Changes mode — which explains itself — whenever that compare is unknown rather than falling back to a silent plain tab. - Resolve the warm-up's base the way the Source Control tab does, so the two writers cannot replace each other's compare on every tab switch; stop re-asking for a compare that already answered or failed for the same base and head, and keep a result that lands after the panel hides. - Write a line reveal only for a tab that can consume one. - Pin the routing with a hook test, and export the compare-base branch helper the guard needs.
- Accept an exact base-ref match as well as the branch-name match, so a review whose base branch is named `release/2.0` still gets its own diff. - Memoize the warm-up's ask only once a result arrives, so a host that was not connected is asked again instead of being frozen out until the head moves. - Poll for the reveal in the routing test rather than waiting a fixed 40ms.
The flaky-test ratchet rejects a real-time wait in a test, and it is right: the reveal lands two animation frames after the open, so advance them instead.
nplez1
deleted the
nplez1/bug-following-a-pr-comment-from-the-checks-pane
branch
October 28, 2026 03:42
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.
Closes #192.
The bug
Clicking a review comment in the Checks pane forced
mode: 'edit', so the jump landed in a plainMonaco tab: no inline hunks, no add-note overlay, and the thread drawn against file text instead of
the lines it reviews. The plain tab draws review threads (
MonacoEditormountsusePRCommentInlineDecorator) but passes an emptycommentableLineNumbersand mounts no local-notedecorator, so the "+" affordance could not exist there at all.
The fix
pr-comment-code-navigation.tsnow lands on the surface that can actually show the comment, rankedby how many of the lines it was written about that surface holds:
are mounted there, so the thread, its reply/resolve affordances, and the add-note "+" all exist.
Accepted only when the stored compare is against the review's own base branch (exact ref or the
same branch name), because hunks against another base are not the review's.
surface, and its own "No uncommitted changes." banner is the explanation when the review's diff is
not known to be empty for the file.
review nor the working tree, i.e. when this checkout holds no hunks for it anywhere.
The reveal is unchanged in kind: a diff surface scrolls to the thread by id, a Monaco tab by line —
but the line reveal is now written only for a tab that can consume it, and it is keyed by the opened
file's id rather than its path (which is not the id for a remote owner).
Why the second half is here
The branch compare was loaded only by the Source Control tab, which the Checks tab replaces, and git
status invalidates it on every HEAD move — so in the reported flow the jump would rarely have had a
compare to work with.
useChecksPanelBranchCompareWarmupasks for it once per (worktree, base, head)while the pane is visible, through the existing store actions, resolving its base exactly as
use-source-control-base-refs.tsdoes so the two tabs can never replace each other's result. Itskips when a compare already answers for that base and head, does not memoize a failed ask (a
reconnecting host is asked again), and keeps a result that lands after the pane hides.
DiffVieweralso now defers its first-change auto-scroll to a review-thread reveal; without that, afreshly opened diff tab scrolled away from the thread it had just revealed.
Verification
pnpm test src/renderer/src/components/pr-comment-inline src/renderer/src/components/right-sidebar—367 test files / 3,133 tests green (includes the checks panel, source-control and diff-comment
suites).
pr-comment-code-navigation.hook.test.tsxpins all four routes (branch diff, Changes mode,plain tab with a line reveal, outdated-comment refusal);
pr-comment-code-navigation.test.tspinsthe ranking, the foreign-base and slash-base cases;
use-checks-panel-branch-compare-warmup.test.tsxpins load-once, reuse, skip-when-hidden andretry-after-failure.
pnpm tcclean;orca-queue node local/gate-lint.mjs→lint gate @94eeb30977: PASS — 39 green, 0 failing;pnpm run check:code-quality:changedclean; pre-commit oxlint/ast-grep/oxfmt green.fork-main-tests.yml+ the release gate) — this diff touchesno global input. Not validated in a running app: that needs a live PR with review comments.
Reviewed by Opus 5.5, high: R1 (3 SHOULD-FIX and 5 MINOR fixed in R2), delta clean on R2..R3, plus
two more MINOR notes from that delta taken in R3; a third round would need to be asked for. Findings
left as notes rather than fixed:
collapseUnchangedRegionsmay put a commented line inside a collapsed region on theChanges/branch-diff route; not verified whether the decorator's reveal expands it.
the commented lines are invisible there. The review's own hunks win over the live buffer, because
the thread's line comes from the PR head.
warm-up has no base to ask for, so the branch-diff route needs the Source Control tab to have loaded
the compare first and otherwise falls back to Changes mode.
comment.lineon themodified editor.