feat: global fold/unfold — Z to collapse or expand all repositories at once#70
Conversation
Closes #67 - Z folds all repos if any is unfolded; unfolds all when all are folded - Clamps cursor and scrollOffset after bulk fold to keep view consistent - renderHelpOverlay: adds Z line next to ← / → fold bindings - Status bar hint line: adds 'Z fold-all' entry - Tests: help overlay contains 'Z' + 'fold / unfold all repos', renderGroups status bar contains 'Z fold-all' - docs/reference/keyboard-shortcuts.md: documents the new shortcut
There was a problem hiding this comment.
Pull request overview
Adds a global fold/unfold shortcut to the interactive TUI so users can collapse/expand all repositories at once, improving navigation when many repos are present.
Changes:
- Add
Zkey handling in the TUI to fold all repos if any are unfolded, otherwise unfold all. - Update TUI help overlay + status bar hints to document the new shortcut.
- Add tests and update the keyboard shortcuts reference docs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tui.ts | Implements Z global fold/unfold behavior and cursor/scroll clamping after bulk fold. |
| src/render.ts | Documents Z in the help overlay and status bar hint line. |
| src/render.test.ts | Adds regression tests asserting Z appears in help overlay and status bar hints. |
| docs/reference/keyboard-shortcuts.md | Documents Z in the Navigation shortcuts table. |
- tui.ts: when Z folds all repos from an extract row, preserve cursor context by finding the repo header row in newRows rather than doing a blind numeric clamp — avoids landing on a different repository - keyboard-shortcuts.md: remove incorrect 'must be typed in lowercase' claim; note that some bindings (Z, G) require uppercase
|
Addressed in commit 9cf3ba2: Cursor preservation (lines 398-401): implemented the exact approach suggested — when Intro sentence in Closes #67 reference: confirmed correct — #67 is the "global fold/unfold" issue, which is precisely what this PR implements. |
Context
Part of the 🗂 TUI — Navigation & result management EPIC #66.
Closes #67.
Root cause / motivation
The TUI only allows folding/unfolding one repo at a time (
←/→). With many repositories in the result set, collapsing everything to get a quick overview required pressing←dozens of times.What changed
src/tui.tsZkeypress: fold all repos if any is unfolded; unfold all if all are folded. Clamps cursor + scrollOffset after bulk fold.src/render.tsrenderHelpOverlay: new lineZ fold / unfold all repos. Status bar hint:Z fold-all.src/render.test.tsZ+fold / unfold all repos; status bar containsZ fold-all.docs/reference/keyboard-shortcuts.mdHow to test manually
Validation