Skip to content

Add Cmd+Arrow tab navigation in panel#351

Open
robinebers wants to merge 2 commits intomainfrom
robinebers/cmd-arrow-tabs
Open

Add Cmd+Arrow tab navigation in panel#351
robinebers wants to merge 2 commits intomainfrom
robinebers/cmd-arrow-tabs

Conversation

@robinebers
Copy link
Copy Markdown
Owner

@robinebers robinebers commented Apr 7, 2026

Description

Add Cmd+Up / Cmd+Down navigation for the open panel so the user can switch between Home and enabled provider tabs without reordering anything.
The shortcut works immediately after opening from either the tray icon or the global shortcut because the panel now reclaims focus when it becomes visible.
The cycle wraps at the ends and skips Settings, and the change is covered with focused panel and app regression tests.

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev
  • Ran bunx vitest run src/hooks/app/use-panel.test.ts src/App.test.tsx

Screenshots

Keyboard-only change; no screenshot attached.

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Note

Low Risk
Mostly adds client-side keyboard/focus handling with comprehensive tests; low risk aside from potential UX regressions from globally listening to keydown and changing focus behavior.

Overview
Adds Cmd+ArrowUp/ArrowDown keyboard navigation to cycle the panel sidebar between home and provider views (wrapping at ends), while skipping settings and ignoring key events originating from editable elements.

Ensures the shortcut works immediately after the panel is shown by making the panel container focusable (tabIndex={-1}) and auto-focusing it on window focus/visibility regain and after tray navigation/about events. Updates and expands hook/app tests to cover focus behavior and view-cycling edge cases.

Reviewed by Cursor Bugbot for commit 0d6e0ed. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Add Cmd+Up/Down navigation to switch between Home and provider tabs in the panel. The panel now reclaims focus on window focus/visibility and after tray/about actions so the shortcut works immediately.

  • New Features

    • Cmd+Up/Down cycles through Home and enabled provider tabs; wraps at ends and skips Settings.
    • Auto-focus on window focus and visibility change, and after tray navigation/about; AppShell container is focusable (tabIndex={-1}).
    • Shortcut is ignored when typing in inputs or contenteditable areas; tests added for navigation, focus, and editable targets.
  • Refactors

    • Consolidated focus logic into a single helper used by window, visibility, and tray listeners.

Written for commit 0d6e0ed. Summary will update on new commits.

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 7, 2026

🤖 Augment PR Summary

Summary: Adds Cmd+Up / Cmd+Down navigation to cycle between Home and enabled provider tabs in the panel.

Changes:

  • Make the panel container programmatically focusable via tabIndex=-1 so it can reclaim focus on show.
  • In usePanel, refocus the container on window focus / visibility restoration, and after tray-driven navigation/about events.
  • Add Cmd+Arrow key handling to compute the next view (wraps at ends, skips Settings) and update activeView.
  • Ignore Cmd+Arrow navigation when the event target is an editable control (inputs/contenteditable/role=textbox).
  • Tighten usePanel typing by switching displayPlugins from unknown[] to DisplayPluginState[].
  • Add focused regression tests for Cmd+Arrow navigation and focus recovery in use-panel and the full App.

Technical Notes: Key handling is attached at the window level and uses Meta-only (Cmd) with ArrowUp/ArrowDown; focus restoration is deferred via requestAnimationFrame.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cfe6a9. Configure here.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant