Skip to content

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

Open
nwangtw wants to merge 2 commits into
ParadevAI:mainfrom
nwangtw:feat/hold-cmd-sidebar-shortcuts
Open

nwangtw wants to merge 2 commits into
ParadevAI:mainfrom
nwangtw:feat/hold-cmd-sidebar-shortcuts

Conversation

@nwangtw

@nwangtw nwangtw commented Aug 13, 2026 •

Copy link
Copy Markdown

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/[email protected] 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.

Written for commit cd33ca1. Summary will update on new commits.

Review in cubic

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.

Holding the jump modifier shows ⌘1–⌘9 on session and workspace rows so the mapping is scannable without hovering each one.

Co-authored-by: Cursor <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: effa0d1a-5390-4b45-a8ee-eb20667ef412

📥 Commits

Reviewing files that changed from the base of the PR and between bd119f2 and cd33ca1.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx

📝 Walkthrough

Walkthrough

The sidebar now reveals workspace jump shortcut labels after a platform-specific modifier key is held. The change adds reducer and hook logic, connects shortcut labels to workspace items, and updates collapsed and expanded workspace rendering.

Changes

Jump shortcut reveal

Layer / File(s) Summary
Reveal state reducer and validation
apps/desktop/.../hooks/useHoldJumpShortcutReveal/holdJumpJumpShortcutReveal.ts, apps/desktop/.../hooks/useHoldJumpShortcutReveal/holdJumpShortcutReveal.test.ts
The reducer handles platform-specific modifier chords, delayed visibility, repeats, key release, cancellation, reset events, and timer cleanup. Tests cover Mac and Windows behavior.
Keyboard listener hook
apps/desktop/.../hooks/useHoldJumpShortcutReveal/useHoldJumpShortcutReveal.ts, apps/desktop/.../hooks/useHoldJumpShortcutReveal/index.ts
The hook manages keyboard and document event listeners, timers, visibility resets, and the boolean reveal state.
Sidebar shortcut rendering
apps/desktop/.../DashboardSidebar.tsx, apps/desktop/.../DashboardSidebarSessionsSection.tsx, apps/desktop/.../DashboardSidebarWorkspaceItem*
The sidebar sets data-jump-shortcuts during reveal. Workspace items pass shortcut labels to collapsed and expanded controls, which render shortcut labels and hide conflicting actions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: ⚪ Minimal · up to cd33c

The PR adds a localized sidebar shortcut-reveal interaction with focused tests and no actionable merge-blocking risk remaining; it is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant KeyboardEvents
  participant useHoldJumpShortcutReveal
  participant DashboardSidebar
  participant WorkspaceItems
  KeyboardEvents->>useHoldJumpShortcutReveal: Hold supported modifier
  useHoldJumpShortcutReveal->>useHoldJumpShortcutReveal: Wait for reveal delay
  useHoldJumpShortcutReveal-->>DashboardSidebar: Set reveal state
  DashboardSidebar->>WorkspaceItems: Render jump shortcut mode
  WorkspaceItems-->>DashboardSidebar: Display shortcut labels
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional commit format and clearly describes the main sidebar shortcut change.
Description check ✅ Passed The description explains the change, testing performed, and checklist status, with relevant behavior and limitations documented.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The hold-modifier overlay on the collapsed rail was digit-only; match expanded rows and show the full ⌘1–⌘9 label.

Co-authored-by: Cursor <[email protected]>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This PR has had no activity for 53 days and will close in 7 days unless there is new activity. If this contribution is still important or relevant, please leave a comment to keep it open. If it closes, you are welcome to reopen it or ask a maintainer to reopen it. Thank you for contributing!

@github-actions github-actions Bot added the stale label Oct 6, 2026

This branch has not been deployed

No deployments
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