Skip to content

Add flat list view toggle for staged/unstaged changes#2981

Open
9init wants to merge 1 commit into
gitui-org:masterfrom
9init:master
Open

Add flat list view toggle for staged/unstaged changes#2981
9init wants to merge 1 commit into
gitui-org:masterfrom
9init:master

Conversation

@9init

@9init 9init commented Jun 24, 2026

Copy link
Copy Markdown

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/gitui and defaults to the existing tree view, so this is fully backward compatible.

Usage

  • Press Ctrl+T when focus is on either the "Unstaged Changes" or "Staged Changes" panel
  • The key is rebindable via key_bindings.ron (status_toggle_tree)
  • The command bar shows "Tree View" or "List View" depending on current mode

I followed the checklist:

  • I added unittests
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant