Context
Part of the 🗂 TUI — Navigation & result management EPIC #66.
Currently the TUI only supports line-by-line scrolling (↑/↓). Power users expect Vim-style gg/G jumps and Page Up/Down for faster navigation through large result sets.
Acceptance criteria
gg (two consecutive g keypresses) moves the cursor to the very first row
G (capital G / Shift+G) moves the cursor to the last row
Page Up / Page Down (and optionally Ctrl+U / Ctrl+D) scroll by a full visible page
- Scroll offset adjusts so the cursor is always visible after each jump
- Works correctly with folded repositories (skips folded rows)
Implementation notes
gg requires detecting two consecutive g keys — a small stateful "pending key" buffer is sufficient (no need for a full key-sequence engine)
G is a single keypress (\x47 or detected via key.name === 'G')
- Page height = terminal rows minus the fixed header/footer lines (already computed in the render loop)
- Pure helper
clampCursor(rows, index) — keep in src/tui.ts or extract to src/render/rows.ts if reusable
Branch
feat/tui-fast-navigation → merge into feat/tui-navigation-result-management
Validation
bun test
bun run lint
bun run format:check
bun run knip
Context
Part of the 🗂 TUI — Navigation & result management EPIC #66.
Currently the TUI only supports line-by-line scrolling (
↑/↓). Power users expect Vim-stylegg/Gjumps and Page Up/Down for faster navigation through large result sets.Acceptance criteria
gg(two consecutivegkeypresses) moves the cursor to the very first rowG(capital G /Shift+G) moves the cursor to the last rowPage Up/Page Down(and optionallyCtrl+U/Ctrl+D) scroll by a full visible pageImplementation notes
ggrequires detecting two consecutivegkeys — a small stateful "pending key" buffer is sufficient (no need for a full key-sequence engine)Gis a single keypress (\x47or detected viakey.name === 'G')clampCursor(rows, index)— keep insrc/tui.tsor extract tosrc/render/rows.tsif reusableBranch
feat/tui-fast-navigation→ merge intofeat/tui-navigation-result-managementValidation
bun test bun run lint bun run format:check bun run knip