Problem
When reviewing a builder's diff via codev.viewDiff, the diff editor shows a unified diff for one file at a time with a file-list pane on the left. To move to the next file's diff, the reviewer has to take their hands off the editor and click in the file list (or focus the tree and arrow-key + Enter through it).
VSCode's built-in diff editor handles within-file change navigation natively — editor.action.diffReview.next / prev (F7 / Shift+F7) walk between hunks. But there is no equivalent for cross-file navigation in a multi-file diff session. Neither VSCode nor Codev wires a "next file in this diff session" command.
This is a real friction point for PR-review workflows. GitHub's PR review UI has j / k for exactly this. The Codev View Diff surface should have the equivalent.
Proposed mechanic
Two new commands scoped to the active Codev diff session:
codev.diffNextFile — advance the diff editor to the next file in the file-list pane.
codev.diffPreviousFile — go back to the previous file.
Both are keyboard-shortcut bindable, palette-discoverable, and operate on whatever file the diff editor is currently showing relative to its position in the ordered file list. They do not require the file-list pane to be focused — the focus stays on the diff editor.
Plan-gate decisions to lock
These are the design calls that affect the v1 shape; plan-approval picks each.
-
Default keybindings. Three reasonable conventions:
Cmd/Ctrl+Alt+Down / Cmd/Ctrl+Alt+Up (close to VSCode's "next/previous editor" semantics)
Alt+J / Alt+K (mirrors GitHub PR review's j / k)
Cmd/Ctrl+Shift+F7 / Cmd/Ctrl+Shift+Shift+F7 (extends VSCode's F7 in-file convention)
- No default binding, palette-only (smallest blast radius; users add to
keybindings.json themselves)
Lean: palette-only by default + documentation, so we don't conflict with the user's existing custom bindings. Adopters who use the feature heavily bind it themselves.
-
Edge behavior at the start / end of the file list:
- No-op silently (do nothing if already at first / last)
- Wrap-around to the other end
- Show a status-bar message ("First / last file in diff session")
Lean: status-bar message + no wrap. Wrapping invites accidental loops; silent no-op feels broken.
-
Scope context resolution. Two scoping models:
- Per-diff-session: track the currently-shown file for the active diff session and walk that session's file list.
- Generic active diff editor: any diff editor (including non-Codev ones the user happens to open). Reads the file list from whatever provider is active.
Lean: per-diff-session for v1 (Codev's View Diff only). Generic mode is a future enhancement once the basic flow proves the UX shape.
-
Behavior when the file list isn't visible. If the user has collapsed the left pane, do the commands still work? Lean: yes, file list visibility is a display preference and shouldn't gate the keyboard navigation.
-
Saving state across sessions. If the reviewer pauses (closes the diff editor) and re-opens for the same builder, should the diff editor restore to the file they were last viewing? Out of scope for this issue; cleanest to just open at the first file each time, and let the user navigate from there.
Acceptance criteria
Why PIR, not AIR
UI / UX shape benefits from plan-gate design review (the five plan-gate decisions above are real choices, not implementation details). And the behavior is the kind that's "looks right in unit test, awkward in practice" until you actually walk it on a real builder's diff — dev-approval gate is load-bearing for that visual / kinesthetic verification.
Implementation is small (~50-100 LOC + tests) but design discipline matters here.
Out of scope
- Generic-mode (any-diff-editor) navigation. v1 is Codev-diff-session-only; generic is a follow-up if there's demand.
- Restoring last-viewed file on re-opening the diff session.
- Cross-builder navigation ("next builder's diff after I'm done with this one's last file"). Different UX entirely; if useful, file separately.
- Rebinding the existing within-file F7 / Shift+F7 — those stay as-is.
- A visual breadcrumb / current-file indicator in the diff editor title. Useful but additive; the file-list pane already shows which file is active.
Related
Problem
When reviewing a builder's diff via
codev.viewDiff, the diff editor shows a unified diff for one file at a time with a file-list pane on the left. To move to the next file's diff, the reviewer has to take their hands off the editor and click in the file list (or focus the tree and arrow-key + Enter through it).VSCode's built-in diff editor handles within-file change navigation natively —
editor.action.diffReview.next/prev(F7 / Shift+F7) walk between hunks. But there is no equivalent for cross-file navigation in a multi-file diff session. Neither VSCode nor Codev wires a "next file in this diff session" command.This is a real friction point for PR-review workflows. GitHub's PR review UI has
j/kfor exactly this. The CodevView Diffsurface should have the equivalent.Proposed mechanic
Two new commands scoped to the active Codev diff session:
codev.diffNextFile— advance the diff editor to the next file in the file-list pane.codev.diffPreviousFile— go back to the previous file.Both are keyboard-shortcut bindable, palette-discoverable, and operate on whatever file the diff editor is currently showing relative to its position in the ordered file list. They do not require the file-list pane to be focused — the focus stays on the diff editor.
Plan-gate decisions to lock
These are the design calls that affect the v1 shape; plan-approval picks each.
Default keybindings. Three reasonable conventions:
Cmd/Ctrl+Alt+Down/Cmd/Ctrl+Alt+Up(close to VSCode's "next/previous editor" semantics)Alt+J/Alt+K(mirrors GitHub PR review'sj/k)Cmd/Ctrl+Shift+F7/Cmd/Ctrl+Shift+Shift+F7(extends VSCode's F7 in-file convention)keybindings.jsonthemselves)Lean: palette-only by default + documentation, so we don't conflict with the user's existing custom bindings. Adopters who use the feature heavily bind it themselves.
Edge behavior at the start / end of the file list:
Lean: status-bar message + no wrap. Wrapping invites accidental loops; silent no-op feels broken.
Scope context resolution. Two scoping models:
Lean: per-diff-session for v1 (Codev's
View Diffonly). Generic mode is a future enhancement once the basic flow proves the UX shape.Behavior when the file list isn't visible. If the user has collapsed the left pane, do the commands still work? Lean: yes, file list visibility is a display preference and shouldn't gate the keyboard navigation.
Saving state across sessions. If the reviewer pauses (closes the diff editor) and re-opens for the same builder, should the diff editor restore to the file they were last viewing? Out of scope for this issue; cleanest to just open at the first file each time, and let the user navigate from there.
Acceptance criteria
codev.diffNextFileandcodev.diffPreviousFileare registered as palette-discoverable commands.codev.viewDiffflow or the within-file F7 / Shift+F7 navigation (those continue to work, walking hunks within the currently-selected file).Why PIR, not AIR
UI / UX shape benefits from plan-gate design review (the five plan-gate decisions above are real choices, not implementation details). And the behavior is the kind that's "looks right in unit test, awkward in practice" until you actually walk it on a real builder's diff — dev-approval gate is load-bearing for that visual / kinesthetic verification.
Implementation is small (~50-100 LOC + tests) but design discipline matters here.
Out of scope
Related
codev.viewDiffsurface).editor.action.diffReview.next/editor.action.diffReview.prev— the within-file equivalents that this issue extends across files.