Add flat list view toggle for staged/unstaged changes#2981
Open
9init wants to merge 1 commit into
Open
Conversation
Adds a toggleable flat file list mode (Ctrl+T) similar to VS Code's Source Control panel. Files are shown with full paths without directory tree nodes, and Left/Right arrows navigate between panels. - options: persisted per-repo in .git/gitui (default: tree) - key bindings: status_toggle_tree -> Ctrl+T - flat mode: FileTreeItems::new_flat() skips directory nodes - StatusTree: Left/Right no-ops in flat, updated tests - StatusTreeComponent: renders full paths in flat mode - ChangesComponent/Status: toggle handler and integration - strings: 'Tree View'/'List View' command help
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.
Motivation
Navigating scattered changes across deeply nested directories is cumbersome in the default tree view. Expanding and collapsing folders to find modified files slows down the workflow, especially in large projects. VS Code's Source Control panel offers a flat "List" view that many developers find more intuitive, this PR brings that option to gitui.
What it does
Adds a toggleable flat file list mode (default key:
Ctrl+T) for the staged and unstaged changes panels. In flat mode, files are shown with their full paths (e.g.,M src/components/changes.rs) without directory tree nodes. Left/Right arrow keys navigate between the unstaged/staged panels instead of expanding/collapsing directories.The setting is persisted per-repository in
.git/gituiand defaults to the existing tree view, so this is fully backward compatible.Usage
Ctrl+Twhen focus is on either the "Unstaged Changes" or "Staged Changes" panelkey_bindings.ron(status_toggle_tree)I followed the checklist:
make checkwithout errors