You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reviewing a builder's diff, the file shown in the diff editor and the file selected/highlighted in the Builders sidebar can drift out of sync.
This became visible once cross-file keyboard navigation landed (#1060: codev.diffNextFile / codev.diffPreviousFile, Ctrl+Alt+] / Ctrl+Alt+[). Stepping through files moves the diff editor correctly, but the Builders sidebar keeps whatever row was last clicked highlighted — so the tree no longer tells you "this is the file you're looking at." The same drift happens when clicking a file inside the multi-file View Diff editor: the editor moves, the sidebar selection doesn't follow.
Proposed mechanic
A single, general "reveal active builder-diff file in the Builders view" sync — analogous to the Explorer's Reveal active file / explorer.autoReveal:
On onDidChangeActiveTextEditor, if the active editor is a tracked builder-diff file (resolve via the diff-inject registry → { builderId, relPath }), locate the matching BuilderFileTreeItem and buildersView.reveal(item, { select: true, expand: true }).
Gate it so it only reveals tracked builder files (never hijacks selection for unrelated editors), and consider honoring explorer.autoReveal (or a dedicated codev.* setting) so users who dislike auto-reveal can turn it off.
One listener covers every entry point — keyboard navigation (#1060), clicking a file inside the multi-file View Diff editor, and the per-file diff opened from a sidebar click — instead of bolting sync onto each command.
buildersView is created with createTreeView, so reveal() is available — but revealing a file row needs groundwork that #1060 deliberately stayed out of:
getParent is builder-row-only today.BuildersProvider.getParent returns parents only for BuilderTreeItem (for the accordion); for BuilderFileTreeItem / BuilderFolderTreeItem it returns undefined. reveal needs the full parent chain: file → folder(s) (tree mode) → builder → group.
File/folder rows have no stable id.reveal matches recreated elements by id; file and folder rows need stable, unique ids (e.g. <builderId>::<relPath>).
Tree-mode folder hierarchy. In file-tree view mode, a file's parent is a folder row from buildFilePathTree; getParent has to reconstruct that hierarchy to find it.
This is real work in a recently-reworked, fiddly view, so it's cleanly separable from the navigation feature.
Acceptance criteria
Changing the active builder-diff editor (via keyboard nav, multi-file View Diff click, or per-file diff) selects/highlights the matching row in the Builders sidebar, expanding ancestors as needed.
Works in both Builders view modes (flat list and file-tree), and under both grouping axes (stage / area).
No selection hijack for non-builder editors (a normal source file or unrelated diff leaves the sidebar selection alone).
Respects an opt-out (honor explorer.autoReveal or add a codev.* toggle).
No regression to existing Builders tree behavior (accordion, decorations, per-file diff open).
Suggested protocol
PIR — the dev-approval gate is load-bearing here ("looks fine in unit tests, subtly off when you actually walk it across modes"), and the getParent / id-versioning interaction with the accordion deserves a look at the running tree.
Problem
When reviewing a builder's diff, the file shown in the diff editor and the file selected/highlighted in the Builders sidebar can drift out of sync.
This became visible once cross-file keyboard navigation landed (#1060:
codev.diffNextFile/codev.diffPreviousFile, Ctrl+Alt+] / Ctrl+Alt+[). Stepping through files moves the diff editor correctly, but the Builders sidebar keeps whatever row was last clicked highlighted — so the tree no longer tells you "this is the file you're looking at." The same drift happens when clicking a file inside the multi-file View Diff editor: the editor moves, the sidebar selection doesn't follow.Proposed mechanic
A single, general "reveal active builder-diff file in the Builders view" sync — analogous to the Explorer's Reveal active file /
explorer.autoReveal:onDidChangeActiveTextEditor, if the active editor is a tracked builder-diff file (resolve via the diff-inject registry →{ builderId, relPath }), locate the matchingBuilderFileTreeItemandbuildersView.reveal(item, { select: true, expand: true }).explorer.autoReveal(or a dedicatedcodev.*setting) so users who dislike auto-reveal can turn it off.One listener covers every entry point — keyboard navigation (#1060), clicking a file inside the multi-file View Diff editor, and the per-file diff opened from a sidebar click — instead of bolting sync onto each command.
Why this is its own issue (and not part of #1060)
buildersViewis created withcreateTreeView, soreveal()is available — but revealing a file row needs groundwork that #1060 deliberately stayed out of:getParentis builder-row-only today.BuildersProvider.getParentreturns parents only forBuilderTreeItem(for the accordion); forBuilderFileTreeItem/BuilderFolderTreeItemit returnsundefined.revealneeds the full parent chain: file → folder(s) (tree mode) → builder → group.id.revealmatches recreated elements byid; file and folder rows need stable, unique ids (e.g.<builderId>::<relPath>).AccordionRowIds; the reconstructed parent chain must use the current version sorevealcan match whatgetChildrenreturns.buildFilePathTree;getParenthas to reconstruct that hierarchy to find it.This is real work in a recently-reworked, fiddly view, so it's cleanly separable from the navigation feature.
Acceptance criteria
explorer.autoRevealor add acodev.*toggle).Suggested protocol
PIR — the dev-approval gate is load-bearing here ("looks fine in unit tests, subtly off when you actually walk it across modes"), and the
getParent/ id-versioning interaction with the accordion deserves a look at the running tree.Related
explorer.autoReveal.Out of scope