feat(history): auto-expand commits on file navigation boundary#212
Open
fredrikaverpil wants to merge 1 commit intoesmuellert:mainfrom
Open
feat(history): auto-expand commits on file navigation boundary#212fredrikaverpil wants to merge 1 commit intoesmuellert:mainfrom
fredrikaverpil wants to merge 1 commit intoesmuellert:mainfrom
Conversation
6738053 to
1e7f481
Compare
When navigating files in history mode with ]f/[f, reaching the boundary of a commit now automatically expands the adjacent commit: - navigate_next at last file → expands next commit, selects first file - navigate_prev at first file → expands previous commit, selects last file - wrap-around supported (last commit → first, first → last) Implementation uses shared helpers to reduce code duplication: - collect_commit_files: recursively collects files (handles tree mode) - find_current_position: locates commit/file indices for boundary detection - update_cursor: updates history panel cursor position Store load_commit_files on history object for access in navigation functions, enabling async commit expansion with callback pattern.
1e7f481 to
0918d10
Compare
This was referenced Jan 29, 2026
Owner
|
The idea is good, and currently we indeed can't automatically expand the commit and open files in it, but I might need to take some time to look at the PR and evaluate it |
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.
Why?
When browsing repository history with
:CodeDiff history, reaching the last file in a commit and pressing]fwraps back to the first file of the same commit. This creates friction when reviewing changes across multiple commits.What?
Auto-expand commits when navigating across commit boundaries:
]f): At last file → expands next commit, selects its first file[f): At first file → expands previous commit, selects its last fileImplementation uses shared helpers:
collect_commit_files: Recursively collects files (handles tree mode with nested directories)find_current_position: Locates commit/file indices for boundary detectionupdate_cursor: Updates history panel cursor positionNotes
load_commit_fileswith callback pattern for responsive UIlistandtreeview modeskeymaps.view.next_file/prev_file)Recording
trimmed.mov