Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/src/commands/tui.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 |
Expand All @@ -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

Expand Down
16 changes: 8 additions & 8 deletions specs/020-tui.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 `<commit-sid>:<index>` 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

Expand Down
2 changes: 1 addition & 1 deletion src/tui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ impl ShellApp for App<'_> {
fn status_hints(&self, _focused: PaneId) -> Vec<Cow<'static, str>> {
vec![
"Navigate: ↑/↓".into(),
"Fold/unfold: ←/→".into(),
"Close/open: ←/→".into(),
"Select: space".into(),
"Commit: c/C".into(),
"Fold: f".into(),
Expand Down
2 changes: 1 addition & 1 deletion src/tui/app_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {:?}",
Expand Down
Loading