Skip to content

feat: add vim-style gg/G navigation to sessions and projects views#9

Merged
rnjn merged 1 commit intobase-14:mainfrom
saurabh-hirani:feat/vim-gg-G-navigation
Mar 10, 2026
Merged

feat: add vim-style gg/G navigation to sessions and projects views#9
rnjn merged 1 commit intobase-14:mainfrom
saurabh-hirani:feat/vim-gg-G-navigation

Conversation

@saurabh-hirani
Copy link
Copy Markdown
Contributor

@saurabh-hirani saurabh-hirani commented Mar 8, 2026

Problem

Session and project lists can get long — navigating item by item with j/k becomes tedious when the selection is far from the top or bottom.

Solution

Add vim-style gg (jump to first item) and G (jump to last item) keybindings to the Sessions and Projects list views. A lastKey field tracks the previous keypress to detect the gg sequence.

Testing

  • gg jumps to the first item from any position
  • G jumps to the last item
  • Works on both Sessions and Projects tabs

Test layers

View-level tests (sessions_test.go, projects_test.go): Unit tests that verify SessionsView.Update() and ProjectsView.Update() correctly handle g/G keypresses in isolation. These test the view's internal key handling logic.

App-level tests (app_test.go): Integration tests that verify app.Update() actually routes g/G keypresses through to the views. These catch routing bugs that view-level tests cannot — for example, if app.Update() silently dropped g/G keys, the view-level tests would still pass but the feature would be broken in the binary. Both layers are necessary to ensure correctness at each level of the architecture.

Add gg (jump to start) and G (jump to end) keybindings for SessionsView
and ProjectsView. Track the previous keypress with a lastKey field to
detect the gg sequence.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@rnjn rnjn merged commit e1ca880 into base-14:main Mar 10, 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.

2 participants