feat(tui): navigate panels via Up/Down arrow overflow at list boundaries#2287
Conversation
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>
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
PR Review StatusValidation: 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: 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:
Docs: Missing for this direct user-facing keyboard behavior. Please add a short dashboard-navigation note to E2E: No Next state: |
|
/ok to test b3251b8 |
The Down handlers already check whether the list is non-empty before incrementing the cursor, but the Up handlers only checked cursor > 0. When a list becomes empty after a refresh with a nonzero cursor, Up would decrement the stale cursor instead of overflowing to the previous panel. Add the same non-empty guard to all four Up arms. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Describe Tab/Shift+Tab panel cycling, Up/Down and j/k boundary overflow, and middle-pane tab switching in the OpenShell Terminal section. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
|
The review comments have been addressed. |
Re-check After Author UpdateThanks @varshaprasad96. I re-evaluated head What I checked: the full current diff, the prior stale-cursor finding across all four dashboard handlers, empty-panel skipping, both middle-pane tabs, linked issue #2273, and the Fern documentation update. Disposition: resolved. Each Up handler now verifies that its active list is non-empty before decrementing, so a stale nonzero cursor on an empty list overflows immediately. The dashboard keyboard behavior is now documented on the existing Manage Sandboxes page; no Review findings:
E2E: No Next state: |
|
/ok to test 2d885e9 |
Monitoring CompleteMonitoring is complete because this PR has merged. Final status: Head I removed the active |
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
DASHBOARD_PANELSconst array defining the panel ring orderpanel_item_count()helper that returns item count for any panel, respecting the active middle-pane tab (Providers vs GlobalSettings)set_panel_cursor()helper to set the selected index for any paneloverflow_focus_down()andoverflow_focus_up()methods that walk the panel ring to find the next/previous non-empty panelhandle_gateways_key,handle_providers_key,handle_global_settings_key,handle_sandboxes_key) to call overflow helpers at list boundaries instead of clampingTesting
rustfmt --edition 2024 --checkpassescargo check -p openshell-tuicompiles cleanlyApp::newrequires a gRPC client, making isolated unit tests impractical without test infrastructure changesChecklist