Skip to content

feat(tui): paginate keyboard shortcuts overlay#30

Merged
llcro merged 1 commit into
mainfrom
feat/tui-help-overlay-pages
May 1, 2026
Merged

feat(tui): paginate keyboard shortcuts overlay#30
llcro merged 1 commit into
mainfrom
feat/tui-help-overlay-pages

Conversation

@llcro
Copy link
Copy Markdown
Collaborator

@llcro llcro commented May 1, 2026

Summary

  • Single-page ? help modal was clipping Watchlist/Orders sections on ~30-row terminals (see beta feedback screenshot).
  • Splits into 4 pages: Global / Market & Detail / Chart & Watchlist / Trade & Orders.
  • / Tab / [ ] cycle pages (wrap both directions). Esc or any other key closes — preserves the familiar "any key dismisses" contract.
  • Modal shrunk from 33 → 26 rows; every page now fits on a 25-row terminal without clipping.
  • Opening via ? always lands on page 1 (Global) — fresh mental anchor every time.
  • Footer shows page counter n/4 and the nav hint inline.

Test plan

  • cargo test -p cdcx-tui --lib → 60 passed, 5 new, 0 failed
  • cargo fmt --all --check clean
  • cargo clippy --workspace --all-targets clean
  • Mutation-verified: forcing next_help_page to be a no-op fails right_arrow_inside_help_advances_page_without_closing; replacing the prev_help_page wrap with saturating_sub fails help_overlay_prev_page_wraps_from_first_to_last
  • Manual QA on a ~25-row terminal: open ?, cycle all 4 pages with / Tab / , confirm wrap in both directions, confirm Esc/letters dismiss, confirm reopen resets to page 1

The single-page help modal was clipping Watchlist/Orders sections on
short terminals. Now shows one logical group per page (Global / Market
& Detail / Chart & Watchlist / Trade & Orders) with left/right
navigation.

- `←` `→` / Tab / `[` `]` cycle pages (wrap both directions).
- Esc or any non-navigation key dismisses (preserves the legacy
  "any key closes" contract).
- Modal shrunk from 33 → 26 rows so each page fits on ~25-row terminals.
- Footer shows page counter + nav hint.
- Opening via `?` always resets to page 1 (Global).

Tests cover the cycle helpers (wrap both directions), the reset-on-open
contract, the critical "nav keys must not dismiss" guarantee, and the
unchanged "Esc closes" fallback. Mutation-verified.
@llcro llcro merged commit 974916c into main May 1, 2026
8 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