Skip to content

feat(diff): file tree sidebar + palette fuzzy-jump#86

Merged
denolehov merged 1 commit into
mainfrom
file-tree
Jul 10, 2026
Merged

feat(diff): file tree sidebar + palette fuzzy-jump#86
denolehov merged 1 commit into
mainfrom
file-tree

Conversation

@denolehov

Copy link
Copy Markdown
Owner

Cmd/Ctrl+B toggles a sidebar listing every changed file in a diff with its +/- counts. Clicking a file scrolls to it; the row for the file currently in view stays highlighted. The : palette gains a Files namespace that does the same jump by fuzzy search, hidden outside diff sessions.

Also fixes current-file tracking: useContentTracking derived the current file from hunk boundaries alone, but a file's header lines sit above its first hunk, so any header line resolved to the previous file - visible in the Header breadcrumb when scrolling a file header to the top of the viewport. A separate file-only ContentTracker now resolves currentFileIndex. hunkTracker is left hunk-only because useSelectionBounds walks its boundaries pairwise to clamp selections to a hunk.

@denolehov denolehov marked this pull request as ready for review July 10, 2026 13:03
Cmd/Ctrl+B toggles a sidebar listing every changed file in a diff with its
+/- counts. Clicking a file scrolls to it; the row for the file currently in
view stays highlighted. The `:` palette gains a Files namespace that does the
same jump by fuzzy search, hidden outside diff sessions.

Navigation reads DiffMetadata.files, which was already on the wire and unused.
deriveFileEntries() in src/lib/file-tree.ts is the single seam binding the
sidebar to the diff wire model.

Also fixes current-file tracking, which was wrong before this feature existed:
useContentTracking derived the current file from hunk boundaries alone, but a
file's header lines sit above its first hunk, so any header line resolved to
the *previous* file — visible in the Header breadcrumb when scrolling a file
header to the top of the viewport. A separate file-only ContentTracker now
resolves currentFileIndex. hunkTracker is left hunk-only because
useSelectionBounds walks its boundaries pairwise to clamp selections to a hunk.
@denolehov denolehov merged commit bf07f1d into main Jul 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant