Skip to content

Conversation

@wesm
Copy link
Owner

@wesm wesm commented Feb 6, 2026

Summary

  • Off-by-one fix: Page up/down now moves by visibleRows() (pageSize-1) instead of pageSize, accounting for the info line that occupies one row
  • Position preservation: Cursor and scrollOffset move together during paging, so the cursor stays at the same relative position in the viewport instead of snapping to the edge
  • Thread view: Same fixes applied to thread view page up/down in keys.go

Changes

  • navigation.go: Added visibleRows() helper, fixed navigateList page up/down to move cursor+scrollOffset together and return early (skipping ensureCursorVisible), simplified ensureCursorVisible/ensureThreadCursorVisible
  • keys.go: Fixed thread view page up/down with same pattern
  • nav_test.go: Added table-driven tests for page down, page up, and visibleRows() edge cases

Test plan

  • go test ./internal/tui/ -v — all pass
  • make lint — clean
  • make test — all pass

🤖 Generated with Claude Code

wesm and others added 2 commits February 6, 2026 06:34
Page up/down was using pageSize instead of visibleRows (pageSize-1),
moving one row too far per page. Additionally, ensureCursorVisible()
was snapping the cursor to the viewport edge after paging, losing the
user's relative position. Now both cursor and scrollOffset move together
by visibleRows, and the same fix is applied to thread view paging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover the thread view paging code path in keys.go with table-driven
tests for page down and page up, including empty and small thread edge
cases. Addresses review finding about missing thread view test coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesm wesm merged commit 598b386 into main Feb 6, 2026
3 checks passed
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.

1 participant