feat(desktop): reveal sidebar jump shortcuts while holding ⌘

NW
2mo ago
+514-60

What & why

Holding ⌘ (Ctrl on Windows/Linux) for 400ms reveals ⌘1–⌘9 on every mapped session and workspace row in the v2 dashboard sidebar, including the collapsed rail. Hovering a single row was the only way to see a shortcut, so the jump map was not scannable.

Chords such as ⌘C cancel before the overlay appears. Release, blur, or any other key hides it. Pinned rows are unchanged; they are still excluded from the shortcut map.

How I tested it

  • bun test apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useHoldJumpShortcutReveal/holdJumpShortcutReveal.test.ts (12 pass)
  • npx @biomejs/biome@2.4.2 check on the touched files (clean)

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

Made with Cursor


Summary by cubic

Holding the jump modifier reveals sidebar jump shortcuts so the map is scannable. Previously hints only appeared on hover; now holding ⌘ (Ctrl on Windows/Linux) for 400ms shows ⌘1–⌘9 on all session and workspace rows, including the collapsed rail; the collapsed overlay now displays the full label (⌘N), not just the digit.

  • Introduces useHoldJumpShortcutReveal with a platform-aware reducer. Listens to keydown/keyup, blur, and visibilitychange; ignores key repeat; starts a 400ms timer (HOLD_JUMP_SHORTCUT_REVEAL_MS) when the modifier is held alone.
  • Mac: ⌘1–⌘9 (no Shift). Windows/Linux: Ctrl+Shift+1–9; Shift may remain held without hiding the overlay. Pressing the jump digit hides the overlay so the chord fires; releasing the modifier or any unrelated key hides it.
  • Propagates data-jump-shortcuts="true" to the sidebar container to toggle visibility. Shows shortcutLabel on expanded rows and the collapsed rail; hides action icons while the overlay is active.
  • Adds unit tests for reducer behavior across platforms and cancellation paths in apps/desktop/.../useHoldJumpShortcutReveal/holdJumpShortcutReveal.test.ts.

Summary by CodeRabbit

  • New Features

    • Hold the platform-specific modifier key to reveal jump-to-workspace keyboard shortcuts in the dashboard sidebar.
    • Collapsed workspaces now display their configured shortcut number when shortcut hints are visible.
    • Workspace action controls are temporarily hidden while shortcut hints are displayed.
  • Bug Fixes

    • Improved shortcut hint behavior across macOS, Windows, and Linux, including key repeats, cancellation, and focus changes.