Repository navigation
feat(terminal): add interactive arrow key navigation and scrolling to selection lists - #25
Merged
Conversation
… selection lists
- Implement reusable SelectMenu component in cmd/myf5/selector.go with raw-mode TTY detection and non-TTY fallback
- Support Up/Down arrow keys, vim j/k keys, PageUp/PageDown, Home/End, direct number jumping, and Enter confirmation
- Implement bounded viewport scrolling with dynamic terminal height detection and ▲/▼ overflow indicators
- Prevent cursor drift during ANSI redraws via strict terminal width line clamping
- Support live keyword filtering ('/') and seamless back/quit navigation ('b', 'q', Esc, Ctrl+C)
- Integrate SelectMenu into downloads interactive catalog browser (family, line, version, category, container, file)
- Integrate SelectMenu into support case wizard (auto-detection, priority, reason for contact, review edits)
- Add comprehensive unit test coverage in cmd/myf5/selector_test.go
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.
Summary
Implements interactive arrow key selection and bounded viewport scrolling across the CLI's selection menus (MyF5 Software Downloads catalog browser and Support Case Wizard).
Key Features & Improvements
\x1b[A,\x1b[B,\x1bOA,\x1bOB) as well as vimj/kkeys.▲ (N more above)▼ (N more below)\x1b[5~,\x1b[6~): Jump by full page.\x1b[H,\x1b[F): Jump directly to the top or bottom of the list.1-9) to immediately jump to and highlight corresponding numbered items./to start filtering items by search string in real time. PressEscor clear the query to restore the full view.b/Escto navigate back, orq/Ctrl+Cto quit.golang.org/x/term.\033[?25l) and guarantees cursor restoration on exit (\033[?25h).truncateRunes) to prevent unhandled terminal wrapping from miscalculating ANSI redraw cursor lines.Scope of Changes
cmd/myf5/selector.go:SelectMenu,SelectConfig,SelectItem,runInteractiveLoop,readKey, andselectFallback.selectNavField.cmd/myf5/selector_test.go:cmd/myf5/wizard.go:selectNavField.cmd/myf5/main.go:SelectMenufor Product Families, Product Lines, Versions, Categories, Containers, and Files.Verification
make all(fmt, vet, unit tests, build): PASSgo test -v -race ./cmd/myf5/...: PASSgo test -v ./internal_docs/oas/...: PASS./bin/myf5 doctor: PASS (Zero secret exposure, verified clean)