Skip to content

feat: pager navigation β€” search, jump-to-line, page indicator, arrow keys#882

Open
makingmusic wants to merge 1 commit intocharmbracelet:masterfrom
makingmusic:pager-navigation
Open

feat: pager navigation β€” search, jump-to-line, page indicator, arrow keys#882
makingmusic wants to merge 1 commit intocharmbracelet:masterfrom
makingmusic:pager-navigation

Conversation

@makingmusic
Copy link
Copy Markdown

Summary

  • In-document search: / to search, n/N to cycle through matches, match counter in status bar
  • Jump to line or percentage: :42 jumps to line 42, :50% jumps to 50% of the document
  • Page indicator: pg X/Y shown in the status bar when content exceeds one page
  • Arrow key paging: ←/β†’ to page back/forward (full viewport page)
  • Comprehensive test suite: 1,200+ lines of tests covering utils, UI components (pager, stash, markdown, sort), and E2E CLI integration

Design notes

  • Search operates on raw Body content (pre-glamour) to avoid false matches on ANSI codes and line-number gutters
  • New pager states (pagerStateSearch, pagerStateJumpToLine) integrate with the existing state machine
  • inInputMode() gates top-level key interception in ui.go so search/jump inputs receive esc, q, etc.
  • left arrow repurposed from "back to listing" (still available via h/delete/esc) to page-back navigation

Test plan

  • go test ./... passes (unit + E2E)
  • Manual TUI testing: open a long document, verify /, n/N, :N, :N%, ←/β†’, page indicator
  • Verify esc clears search before returning to file listing
  • Verify h/delete still return to file listing

πŸ€– Generated with Claude Code

…row key paging

Add several navigation features to the pager view:

- In-document search (/ to search, n/N for next/prev match)
- Jump to line (:42) or percentage (:50%)
- Page indicator (pg X/Y) in status bar when content exceeds one page
- Left/right arrow keys for page back/forward
- Comprehensive test suite covering utils, UI logic, and E2E CLI tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@makingmusic makingmusic requested a review from a team as a code owner February 14, 2026 01:52
@makingmusic makingmusic requested review from andreynering and raphamorim and removed request for a team February 14, 2026 01:52
@aleexharris
Copy link
Copy Markdown

What issue is this based on?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants