Skip to content

feat: fast navigation — gg/G (top/bottom) and Page Up/Page Down #69

Description

@shouze

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions