feat(history): auto-expand commits on file navigation boundary#212
feat(history): auto-expand commits on file navigation boundary#212fredrikaverpil wants to merge 1 commit intoesmuellert:mainfrom
Conversation
6738053 to
1e7f481
Compare
1e7f481 to
0918d10
Compare
|
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 |
018bf28 to
b13b169
Compare
|
@esmuellert I rebased on main and tidied up the implementation — unified the internal And I'm not sure what changed, but the cursor doesn't disappear off-screen anymore, as in my video recording above. It works/looks just as expected 🚀 |
Thanks for your continous work! I have been working on other features, but one of my proposed enhancements is supporting more fancy history view like a git merge history graph like we see in LazyGit. It requires major data structure (like DAG or tree) change to the commits list, so I would like to hold this change a bit. I will work on this feature soon. When I decide the new design, I might merge this one then work on it, or absort it in my changes. |
b13b169 to
b13887b
Compare
|
@esmuellert sounds great. Until then, I'll maintain this branch and rebase it from time to time. |
b13887b to
cb22bfd
Compare
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 filecycle_next_fileconfig — wraps around when enabled, stops with a warning when disabledImplementation 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 positionAlso renames
_load_commit_filestoload_commit_filesfor consistency.Notes
load_commit_fileswith callback pattern for responsive UIlistandtreeview modeskeymaps.view.next_file/prev_file)Recording
trimmed.mov