Skip to content

feat(tui): navigate panels via Up/Down arrow overflow at list boundaries#2287

Open
varshaprasad96 wants to merge 1 commit into
NVIDIA:mainfrom
varshaprasad96:feat/tui-arrow-overflow-2273
Open

feat(tui): navigate panels via Up/Down arrow overflow at list boundaries#2287
varshaprasad96 wants to merge 1 commit into
NVIDIA:mainfrom
varshaprasad96:feat/tui-arrow-overflow-2273

Conversation

@varshaprasad96

Copy link
Copy Markdown

Summary

When the cursor reaches the boundary of a TUI dashboard panel list, Up/Down arrow keys now overflow into the adjacent panel instead of clamping silently. Down at the bottom of a panel moves focus to the next panel (cursor at first item); Up at the top moves to the previous panel (cursor at last item). Empty panels are skipped. The ring wraps: Gateways → Providers/GlobalSettings → Sandboxes → Gateways.

Related Issue

Closes #2273

Changes

  • Added DASHBOARD_PANELS const array defining the panel ring order
  • Added panel_item_count() helper that returns item count for any panel, respecting the active middle-pane tab (Providers vs GlobalSettings)
  • Added set_panel_cursor() helper to set the selected index for any panel
  • Added overflow_focus_down() and overflow_focus_up() methods that walk the panel ring to find the next/previous non-empty panel
  • Modified all four dashboard key handlers (handle_gateways_key, handle_providers_key, handle_global_settings_key, handle_sandboxes_key) to call overflow helpers at list boundaries instead of clamping

Testing

  • rustfmt --edition 2024 --check passes
  • cargo check -p openshell-tui compiles cleanly
  • Unit tests added/updated — App::new requires a gRPC client, making isolated unit tests impractical without test infrastructure changes
  • E2E tests added/updated (if applicable)
  • Manually tested with a live gateway and sandbox:
    • Down at bottom of each panel → moves to next panel (cursor at first item)
    • Up at top of each panel → moves to previous panel (cursor at last item)
    • Wrap-around works in both directions
    • Empty panels are skipped
    • Mid-list Up/Down scrolls normally within a panel
    • TAB navigation unaffected
    • Middle pane tab switching (h/l) unaffected
    • GlobalSettings tab respects overflow correctly

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

When at the bottom of a panel's item list, pressing Down/j now moves
focus to the next panel instead of being a silent no-op. Likewise,
pressing Up/k at the top moves to the previous panel with the cursor
on its last item. Empty panels are skipped and the ring wraps around.

Closes NVIDIA#2273

Signed-off-by: Varsha Prasad Narsing <vnarsing@nvidia.com>
Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@varshaprasad96

Copy link
Copy Markdown
Author

I have read the DCO document and I hereby sign the DCO.

@johntmyers

Copy link
Copy Markdown
Collaborator

recheck

@johntmyers johntmyers added the gator:in-review Gator is reviewing or awaiting PR review feedback label Jul 15, 2026
@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

PR Review Status

Validation: This is a small, concentrated TUI enhancement implementing the clear user path in #2273. The change stays within the dashboard navigation subsystem and covers the Providers/Global Settings middle-pane variant.

Head SHA: b3251b8bbefc65b99fd8cef1f7f8c1ba63c9498b

Thanks @johntmyers — I checked the current head after your recheck comment, including the full diff, surrounding list-refresh behavior, linked issue requirements, docs impact, and existing checks.

Review findings:

  • Author action required: The four Up handlers check only whether the selected cursor is greater than zero. When a previously populated gateways, providers, global-settings, or sandboxes list becomes empty, refresh logic can leave a nonzero cursor behind. Pressing Up then decrements that invisible cursor instead of immediately skipping the empty panel. Please gate each decrement on the active list still having items, as the Down handlers already do (for example, self.provider_count > 0 && self.provider_selected > 0), with equivalent guards for the other three lists.
  • Automated coverage is recommended for forward/backward wraparound, consecutive empty panels, both middle-pane tabs, and a list becoming empty with a stale cursor. The ring calculation can be extracted into a pure helper without constructing a gRPC-backed App.

Docs: Missing for this direct user-facing keyboard behavior. Please add a short dashboard-navigation note to docs/sandboxes/manage-sandboxes.mdx describing Tab/Shift+Tab and Up/Down or j/k boundary overflow. No docs/index.yml change is needed because the existing page is already in navigation.

E2E: No test:* label is needed for this local TUI focus-state change.

Next state: gator:in-review

@johntmyers

Copy link
Copy Markdown
Collaborator

/ok to test b3251b8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:in-review Gator is reviewing or awaiting PR review feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tui): navigate panels via Up/Down arrow overflow at list boundaries

2 participants