Skip to content

feat: add keyboard shortcuts and hints (#1138, #1222)#1232

Open
ad4mou wants to merge 6 commits into
mainfrom
feat/add-keyboard-shortcuts-1138-and-1222
Open

feat: add keyboard shortcuts and hints (#1138, #1222)#1232
ad4mou wants to merge 6 commits into
mainfrom
feat/add-keyboard-shortcuts-1138-and-1222

Conversation

@ad4mou

@ad4mou ad4mou commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Central keyboard-shortcut system: shared registry (lib/keyboard-shortcuts.ts), useKeyboardShortcuts hook (ignores keystrokes while typing in inputs/editors), and a platform.ts util (⌘ on macOS, Ctrl elsewhere), mounted once in _sidebar-layout.tsx.
  • Shortcuts: Mod+B toggle sidebar, Mod+K command palette, Shift+Mod+O new chat, Shift+Mod+S Stories, Mod+/ keyboard-shortcuts dialog.
  • Discoverability (feature: Add keyboard shortcut hints on hover #1222): sidebar rows show their shortcut inline on hover (existing style; Stories now shows ⇧⌘S), a Keyboard shortcuts help dialog, and "Keyboard shortcuts" + "Go to Stories" command-menu entries.
  • Cleanup: removed the buggy Mac-only ⇧⌘O listener and the duplicate ⌘K listener; de-duplicated navigator.platform checks via the shared util.

How to test

Just do Command/Ctrl + / to see this
CleanShot 2026-07-23 at 12 08 00@2x

Also check out the keyboard shortcut hint which shows when hovering over the toggle sidebar button

Closes #1138
Closes #1222

Review in cubic

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

URL https://pr-1232-eee05a6.preview.getnao.io
Commit eee05a6

⚠️ No LLM API keys configured - you'll see the API key setup flow when trying to chat.


Preview will be automatically removed when this PR is closed.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/frontend/src/hooks/use-keyboard-shortcuts.ts">

<violation number="1" location="apps/frontend/src/hooks/use-keyboard-shortcuts.ts:21">
P2: Platform-specific shortcuts also fire with the other platform's modifier: e.g. `Ctrl+B` toggles the sidebar on macOS despite the advertised `⌘B`. Make matching choose `metaKey` on macOS and `ctrlKey` elsewhere, matching displayed shortcuts.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/frontend/src/components/keyboard-shortcuts-dialog.tsx
Comment thread apps/frontend/src/hooks/use-keyboard-shortcuts.ts Outdated
Comment thread apps/frontend/src/hooks/use-keyboard-shortcuts.ts Outdated
Comment thread apps/frontend/src/components/command-menu.tsx Outdated

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/frontend/src/lib/stories-cache.ts">

<violation number="1" location="apps/frontend/src/lib/stories-cache.ts:12">
P2: Opening Stories through this helper can retain a stale archived shared-stories list for up to the query stale time. Include `story.listSharedArchived` with the other story cache keys.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread apps/frontend/src/lib/stories-cache.ts
@ad4mou
ad4mou requested a review from Bl3f July 22, 2026 10:18
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.

feature: Add keyboard shortcut hints on hover [feature] Keyboard shortcuts (e.g. Cmd+B side panel, Cmd+? story)

2 participants