feat(tui): wrap-around arrow navigation for list pickers - #359
Merged
Conversation
Contributor
Author
|
Reopening to trigger CI — no workflow run was created on open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
All list-type pickers in the TUI now support wrap-around arrow-key navigation: pressing ↑ on the first item jumps to the last item, and pressing ↓ on the last item jumps back to the first.
Affected lists:
/model,/permissions,/stats, ...),@file suggestions,$skill suggestions/modelpicker (model/effort/thinking stages),request_user_inputoption modal, plan-implementation confirm/reviewmenu and branch/commit/PR target picker, help panelA shared
wrapSelection(selected, count, delta)helper handles the cycling safely for empty lists. Approval modal and worktree-exit already wrapped and are unchanged; input-history navigation is intentionally left as-is (it is history, not a list picker).Why
Arrow keys previously clamped at the boundaries, so moving up from the first item did nothing instead of cycling to the end. Wrap-around is the standard list UX (fzf/vim-style) and makes long lists faster to navigate in both directions.
What I tested
gofmtclean,go build ./internal/tui/okwrapSelectionplus behavior tests covering slash/skill/file suggestions, permissions menu, help panel, workflow launch, and session picker wrap-aroundgo test ./...passes locally (full suite)