feat(ui): add , and . to move between files#7
Merged
Merged
Conversation
`[`/`]`/`J`/`K` only step hunk-by-hunk, so skipping past a large file meant pressing through every one of its hunks. `,` and `.` now jump to the previous / next file in the review stream, clamped at the ends, and land at the new file's header. Adds a clamped `moveToFile(delta)` to the review controller (reusing `selectFile` with header alignment, no-op at the edges so a clamped press doesn't re-trigger a scroll), binds `,`/`.` next to the hunk-nav keys, and documents both in `?` help. Backports modem-dev/hunk#280, adapted to dunk (no menu-bar wrapper). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Context
Backport of modem-dev/hunk#280. PR 3 of an expert-gated backport series.
[/]/J/Konly step hunk-by-hunk, so skipping past a large file meant pressing through every one of its hunks. This adds whole-file navigation.What was changed
,→ previous file,.→ next file, in review-stream order, clamped at the ends; the destination file lands at its header.moveToFile(delta)on the review controller, reusingselectFilewith header alignment. No-op at the edges and when the target is the current file, so a clamped press doesn't re-trigger a scroll/re-align.[/]hunk-nav handlers;?help gets a", / ."row.runAndCloseMenuwrapper).Expert-reviewed: implementation and input-context safety validated; incorporated the recommended filter-focus inertness PTY test and the symmetric backward-clamp unit assertion.
Verification
bun run typecheck,bun run lint: clean.useReviewController.test.tsx: 3 pass —moveToFileforward (resets hunk index, bumps align id), clamp-at-last no-op, backward, clamp-at-first no-op (align id unchanged).,/.file-jump test and a test asserting,/.are inert while the filter is focused (printable keys must go to the filter, not navigate).Out of scope
moveToAnnotatedFilestays cyclic;moveToFileis clamped — matches upstream intent and dunk'sgg/Gfeel.🤖 Generated with Claude Code