Files
supabase/apps/studio/components/ui/GlobalShortcuts/GlobalShortcuts.tsx
Danny White ec7233b33c feat(studio): add keyboard shortcuts reference (#45197)
## What kind of change does this PR introduce?

Feature.

## What is the current behaviour?

Keyboard shortcuts can be discovered piecemeal through command palette
entries, tooltips, and preferences, but there is no universal shortcut
reference surface.

## What is the new behaviour?

Adds a global `Mod+/` shortcut and command palette action to open a
keyboard shortcuts reference sheet. The sheet renders registered
shortcuts grouped from general dashboard actions through navigation and
more specific surfaces.

| Preview |
| --- |
| <img width="820" height="928" alt="CleanShot 2026-04-24 at 11 27
51@2x"
src="https://github.com/user-attachments/assets/8ceb4a35-7adc-474b-8702-5c08a4219d25"
/> |


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added a comprehensive keyboard shortcuts reference sheet that displays
all available shortcuts organized into logical categories.
* New keyboard shortcut Mod+/ (Cmd+/ on Mac) opens the reference sheet
instantly from anywhere within the application.
* Shortcuts are displayed with their formatted keyboard combinations,
with multi-step sequences clearly separated for easy reference and
discovery.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-24 07:20:42 -06:00

25 lines
717 B
TypeScript

import { useState } from 'react'
import { useSetCommandMenuOpen } from 'ui-patterns/CommandMenu'
import { ShortcutsReferenceSheet } from './ShortcutsReferenceSheet'
import { SHORTCUT_IDS } from '@/state/shortcuts/registry'
import { useShortcut } from '@/state/shortcuts/useShortcut'
export function GlobalShortcuts() {
const [referenceOpen, setReferenceOpen] = useState(false)
const setCommandMenuOpen = useSetCommandMenuOpen()
useShortcut(
SHORTCUT_IDS.SHORTCUTS_OPEN_REFERENCE,
() => {
setCommandMenuOpen(false)
setReferenceOpen(true)
},
{
registerInCommandMenu: true,
}
)
return <ShortcutsReferenceSheet open={referenceOpen} onOpenChange={setReferenceOpen} />
}