feat: (optional) arrow folder expansion in the file tree - #370
Open
N4M3Z wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Last larger feature I have in the pipeline, I'll send something cosmetic and that's gonna be it for a while. We should split app.rs into several modules so that we can also split off tests by concern, I might get to it in a couple week |
Owner
|
Thanks @N4M3Z let's split this into different PRs. I like the mouse down change but I don't want to repurpose also I'll break up |
Contributor
Author
|
Sure, I'll split it, but please give the folder expansion a shot, it makes it super quick to navigate the folder tree. |
N4M3Z
force-pushed
the
feat-arrow-folder-expansion
branch
2 times, most recently
from
May 23, 2026 18:55
4f607c3 to
75a69f9
Compare
N4M3Z
force-pushed
the
feat-arrow-folder-expansion
branch
from
May 23, 2026 21:33
75a69f9 to
6de6702
Compare
N4M3Z
force-pushed
the
feat-arrow-folder-expansion
branch
from
May 23, 2026 21:40
6de6702 to
036070c
Compare
7 tasks
Contributor
Author
|
Minimized the feature set, made the behaviour optional |
N4M3Z
force-pushed
the
feat-arrow-folder-expansion
branch
3 times, most recently
from
May 24, 2026 11:26
75ff4f8 to
c53fce8
Compare
When `arrow_tree_navigation = true`, `h` / `l` in the file list fall through to gitui-style tree nav at the horizontal scroll boundary: - `l` on a collapsed folder expands it; on an expanded folder descends to the first child; on a file jumps to the next folder below. - `h` on an expanded folder collapses it; otherwise ascends to the parent. At the top level it jumps to the previous folder above. Default is `false` so `h` / `l` stay as plain horizontal scroll, matching vim's character navigation. Folders are still expandable with `Enter` / `Space` regardless of the flag. With the flag on, moving the file-list cursor (`j` / `k`, arrows, or the tree-nav keys above) to a file also scrolls the diff to that file's header without changing focus. Folders are a no-op so arrowing past collapsed entries leaves the diff viewport alone. Enter still commits the selection and shifts focus. Horizontal scroll keeps the sticky prefix (indent, expand icon, checkbox, status badge) anchored at the left edge; only the filename portion slides. Scroll caps at "at least one column visible" so a name never disappears entirely. Leaving the file list resets `scroll_x` to 0. New `App::file_list_select_parent` / `_select_next_folder` / `_select_prev_folder` walk the visible tree to the relevant entry. `App::auto_jump_to_selected_file_if_enabled` syncs the diff to the file-list cursor when the flag is on. ADR: docs/decisions/FEAT-0014 Folder Expansion.md
N4M3Z
force-pushed
the
feat-arrow-folder-expansion
branch
from
May 26, 2026 23:47
c53fce8 to
235222b
Compare
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.
The default for
h/lis unchanged: they stay as horizontal scroll, matching vim's character navigation. Users who want gitui-style tree nav opt in via config.arrow_tree_navigation(defaultfalse). When set totrue,h/lin the file list fall through to gitui-style tree nav at the horizontal scroll boundary:lexpands a collapsed folder, descends into an expanded one, or jumps to the next folder below on a file;hcollapses an expanded folder, otherwise ascends to the parent (and at the top level jumps to the previous folder above).j/k, arrows, or the tree-nav keys above) to a file also scrolls the diff to that file's header without changing focus. Folders are a no-op so arrowing past collapsed entries leaves the diff alone. Matches gitui / lazygit preview behavior. Enter still commits the selection and shifts focus.scroll_xto 0.Enter/Spacestill toggle folders directly, regardless of the flag.Test plan
cargo fmt && cargo clippy -- -D warningscleanh/las plain horizontal scrollarrow_tree_navigation = true,lon a folder expands; secondldescends;lon a file jumps to the next folderarrow_tree_navigation = true,hon an expanded folder collapses; on a file jumps to the containing folder; at top level jumps to the previous folderarrow_tree_navigation = true, arrowing the file-list cursor across files scrolls the diff to the new file's header; arrowing over folders does not move the diff; focus stays on the file listarrow_tree_navigation = false, arrowing the file-list cursor leaves the diff viewport alone (Enter still required to jump)