diff --git a/docs/src/commands/tui.md b/docs/src/commands/tui.md index eac7cb2..832ec43 100644 --- a/docs/src/commands/tui.md +++ b/docs/src/commands/tui.md @@ -23,7 +23,7 @@ Shows the same tree as `git loom status` with files enabled, plus a live diff pa │ ├╯ ││ │ │ ● 9999999 (upstream) ... ││ │ └──────────────────────────────────────┘└───────────────────────────────┘ - Navigate: ↑/↓ | Fold/unfold: ←/→ | Select: space | Commit: c/C | ... + Navigate: ↑/↓ | Close/open: ←/→ | Select: space | Commit: c/C | ... ``` Short IDs are displayed like in `git loom status`, so the tree doubles as a cheat-sheet for manual commands. Commit rows leave out the abbreviated hash: the short ID already names the commit for every loom command. @@ -33,8 +33,8 @@ Short IDs are displayed like in `git loom status`, so the tree doubles as a chea | Key | Effect | |-----|--------| | `↑`/`k`, `↓`/`j` | Move the cursor (tree focused) or scroll the diff (diff focused) | -| `→`/`l` / `←`/`h` | Unfold / fold the current row; `←` on a file row jumps to its parent | -| `Enter` | Toggle fold (or confirm a fold target — see below) | +| `←`/`h` / `→`/`l` | Close / open the current row; `←` on a file row jumps to its parent | +| `Enter` | Toggle open/close (or confirm a fold target — see below) | | `Tab` | Switch focus between tree and diff pane | | `Ctrl-←` / `Ctrl-→` | Narrow / widen the left pane (2% per press, clamped to 10–90%) | | `PgUp`/`PgDn` | Scroll the diff by a page | @@ -44,7 +44,7 @@ Short IDs are displayed like in `git loom status`, so the tree doubles as a chea | `Esc` | Cancel fold, commit, rename, or new-branch mode → clear selection → quit (first that applies) | | `q` / `Ctrl-C` | Quit | -Commits are collapsed by default; unfolding reveals one row per changed file. Local changes start expanded. Expansion state survives reloads. +Commits are collapsed by default; opening one reveals a row per changed file. Local changes start expanded. Expansion state survives reloads. ### Selection diff --git a/specs/020-tui.md b/specs/020-tui.md index 58f215b..9e6847d 100644 --- a/specs/020-tui.md +++ b/specs/020-tui.md @@ -5,7 +5,7 @@ `git loom tui` opens an interactive, full-screen view of the integration branch: the branch-aware status tree on the left (the same structure as `loom status`), and the diff of the item under the cursor on the right. -Rows can be unfolded to reveal the files a commit changed, one or more rows +Rows can be opened to reveal the files a commit changed, one or more rows can be selected, and common loom actions (commit, fold, branch, drop, reword) run directly from the tree without leaving it: prompts are popups, results go to a log and the status bar. After every action the tree reloads @@ -38,7 +38,7 @@ No arguments or flags. The global `--theme` and `--no-color` options apply. │ ├╯ ││ │ │ ● 9999999 (upstream) ... ││ │ └──────────────────────────────┘└───────────────────────────────┘ - Navigate: ↑/↓ | Fold/unfold: ←/→ | Select: space | Commit: c/C | Fold: f | ... + Navigate: ↑/↓ | Close/open: ←/→ | Select: space | Commit: c/C | Fold: f | ... ``` Short IDs are displayed like in `loom status`, so the tree doubles as a @@ -58,19 +58,19 @@ stay readable — the hunk selector uses the same highlight. [Diff Pane](#diff-pane)). Cached per row until the tree reloads. - **Status bar**: available shortcuts, mode hints, or a transient notice. -## Tree Content and Folding +## Tree Content and Open/Close -The tree mirrors `loom status -f`, with folding: +The tree mirrors `loom status -f`, with rows that open and close: - **Commits are collapsed by default.** A collapsed commit with files shows - a dim `(N files)` hint. Unfolding reveals one row per changed file, with + a dim `(N files)` hint. Opening one reveals a row per changed file, with its `:` short ID. - **Local changes start expanded**, listing every staged, unstaged, and untracked file. -- `→`/`l`/`Enter` unfolds, `←`/`h` folds. Pressing `←` on a child file row - jumps to its parent and folds it. +- `→`/`l`/`Enter` opens, `←`/`h` closes. Pressing `←` on a child file row + jumps to its parent and closes it. - Expansion state is keyed by commit OID, so it survives reloads (a commit - rewritten by an action gets a new OID and folds again — acceptable). + rewritten by an action gets a new OID and closes again — acceptable). ## Navigation diff --git a/src/tui/app.rs b/src/tui/app.rs index 90e6dd3..6e41a3d 100644 --- a/src/tui/app.rs +++ b/src/tui/app.rs @@ -2017,7 +2017,7 @@ impl ShellApp for App<'_> { fn status_hints(&self, _focused: PaneId) -> Vec> { vec![ "Navigate: ↑/↓".into(), - "Fold/unfold: ←/→".into(), + "Close/open: ←/→".into(), "Select: space".into(), "Commit: c/C".into(), "Fold: f".into(), diff --git a/src/tui/app_test.rs b/src/tui/app_test.rs index 7001f4a..169898a 100644 --- a/src/tui/app_test.rs +++ b/src/tui/app_test.rs @@ -2170,7 +2170,7 @@ fn status_bar_matches_spec() { .collect(); assert!( last_row.starts_with( - " Navigate: ↑/↓ | Fold/unfold: ←/→ | Select: space | Commit: c/C | Fold: f \ + " Navigate: ↑/↓ | Close/open: ←/→ | Select: space | Commit: c/C | Fold: f \ | Branch: b | Drop: d | Reword: r | Log: L | Refresh: R | Quit: q" ), "got: {:?}",