feat: fast navigation — gg/G (top/bottom) and Page Up/Down#71
Conversation
There was a problem hiding this comment.
Pull request overview
Adds fast navigation shortcuts to the interactive TUI to make moving through large result sets significantly faster, aligning with the TUI navigation epic.
Changes:
- Implement
gg(top) andG(bottom) cursor jumps in the TUI. - Implement Page Up/Down paging via
Page Up/Page Downand Vim-styleCtrl+U/Ctrl+D. - Update help overlay, status bar hints, tests, and keyboard shortcuts documentation to reflect the new bindings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/tui.ts | Adds key handling for gg, G, PgUp/PgDn, Ctrl+U/Ctrl+D navigation behaviors. |
| src/render.ts | Updates help overlay and status bar hint line to document new shortcuts. |
| src/render.test.ts | Adds tests asserting help overlay and status bar include the new shortcut labels. |
| docs/reference/keyboard-shortcuts.md | Documents the new navigation shortcuts in the Navigation table. |
Closes #68 - gg: two consecutive g presses jump to the first row - G (Shift+G): jumps to the last row - Page Up / Ctrl+U: scroll up one full page - Page Down / Ctrl+D: scroll down one full page - All jumps skip section-header rows and keep cursor visible - pendingFirstG state tracks the first g keypress; reset on any other key - renderHelpOverlay: add gg/G and PgUp/PgDn lines - Status bar hint line: add gg/G top/bot and PgUp/Dn page entries - Tests: overlay and status bar contain the new shortcut labels - docs/reference/keyboard-shortcuts.md: documents all new shortcuts
…section skip, fix docs
a8094dc to
54460e9
Compare
|
All 4 review points addressed in commit
Also rebased onto the updated |
Context
Part of the 🗂 TUI — Navigation & result management EPIC #66.
Closes #68.
Root cause / motivation
With hundreds of results, line-by-line navigation (
↑/↓) is slow. Power users expect Vim-stylegg/Gjumps and paged scrolling.What changed
src/tui.tsgg(two consecutiveg): jump to first row.G(Shift+G): jump to last row.Page Up/Ctrl+U: scroll up one page.Page Down/Ctrl+D: scroll down one page. AddedKEY_PAGE_UP,KEY_PAGE_DOWN,KEY_CTRL_U,KEY_CTRL_Dconstants.pendingFirstGboolean tracks the firstgkeypress and is reset on every other key.src/render.tsrenderHelpOverlay: newgg/GandPgUp/PgDnlines. Status bar hint:gg/G top/bot PgUp/Dn page.src/render.test.tsdocs/reference/keyboard-shortcuts.mdHow to test manually
Validation