Skip to content

feat(tui): wrap-around arrow navigation for list pickers - #359

Merged
shayne-snap merged 1 commit into
mainfrom
worktree-arrows-loop
Aug 6, 2026
Merged

feat(tui): wrap-around arrow navigation for list pickers#359
shayne-snap merged 1 commit into
mainfrom
worktree-arrows-loop

Conversation

@shayne-snap

Copy link
Copy Markdown
Contributor

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:

  • Slash-command option lists (/model, /permissions, /stats, ...), @ file suggestions, $ skill suggestions
  • Permissions menu, /model picker (model/effort/thinking stages), request_user_input option modal, plan-implementation confirm
  • /review menu and branch/commit/PR target picker, help panel
  • Workflow launch confirm, workflow panel runs/phases/tasks/detail sections
  • Plugins / config / skills managers, hooks manager (events + handlers), session picker

A 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

  • gofmt clean, go build ./internal/tui/ ok
  • New unit tests for wrapSelection plus behavior tests covering slash/skill/file suggestions, permissions menu, help panel, workflow launch, and session picker wrap-around
  • go test ./... passes locally (full suite)

@shayne-snap

Copy link
Copy Markdown
Contributor Author

Reopening to trigger CI — no workflow run was created on open

@shayne-snap shayne-snap closed this Aug 6, 2026
@shayne-snap shayne-snap reopened this Aug 6, 2026
@shayne-snap
shayne-snap merged commit 7413cb2 into main Aug 6, 2026
4 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