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

Copy link
Copy Markdown

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


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


You can retrigger this bot by commenting recheck in this Pull Request. 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.

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.

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

1 participant