Skip to content

feat: global fold/unfold — collapse or expand all repositories at once #68

@shouze

Description

@shouze

Context

Part of the 🗂 TUI — Navigation & result management EPIC #66.

Currently the TUI only supports / to fold/unfold a single repository at a time. This feature adds a single shortcut to toggle the folded state of all repositories simultaneously.

Acceptance criteria

  • A single shortcut (e.g. Shift+← / Shift+→, or Z) collapses / expands all repository sections at once
  • Toggling is idempotent: pressing "fold all" when all are already folded has no visible effect (or cycles to unfold)
  • The cursor remains visible after the toggle (scroll offset adjusts if needed)
  • Keyboard shortcut is documented in docs/reference/keyboard-shortcuts.md

Implementation notes

  • Logic lives in src/tui.ts (keyboard handler) — no pure-function module change needed unless toggling state warrants a helper
  • The per-repo fold state is stored in the foldedRepos set; "fold all" = add every repo key; "unfold all" = clear the set
  • After toggling, call the existing cursor-visibility logic to ensure the view scrolls correctly

Branch

feat/tui-global-fold-unfold → merge into feat/tui-navigation-result-management

Validation

bun test
bun run lint
bun run format:check
bun run knip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions