Studio Shortcuts studio-shortcuts
Keyboard shortcut conventions for Supabase Studio.
Use it when adding shortcuts for repeated actions, toolbars, list/table operations, or sub-page navigation, or when adding a search/filter Input (staged-Escape handler). Covers the shortcut registry, useShortcut, ShortcutTooltip/ShortcutBadge, reference sheet, and collisions.
- Our test
- —
- not tested yet
- GitHub stars
- 116k
- supabase/supabase
- Added by
- 0
- members
- Updated
- Dec 6
- commit 9140cc7
- Content
- 1 file
- no scripts · 4 KB
- License
- Apache 2.0
- free to use
What our test found
Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.
name: studio-shortcuts description: Keyboard shortcut conventions for Supabase Studio. Use when adding shortcuts for repeated actions, toolbars, list/table operations, or sub-page navigation, or when adding a search/filter Input (staged-Escape handler). Covers the shortcut registry, useShortcut, ShortcutTooltip/ShortcutBadge, reference sheet, and collisions.
Studio Keyboard Shortcuts
When Studio UI changes introduce or materially alter repeated user actions, consider whether keyboard shortcut coverage should be added or updated. Shortcuts use the shared Studio shortcut system and must be discoverable from the visible UI.
Rules
- Never add a one-off
keydownlistener for a normal Studio action — register it through the shortcut registry anduseShortcut. - Every registered shortcut is exposed where the action is visible, via
ShortcutTooltip,ShortcutBadge, or a command-menu badge. G then …chords are reserved for navigation.- Avoid broad
Mod+lettershortcuts that overlap common browser, editor, system, copy/save/search, or devtools behavior. - Before adding a shortcut, check the registry and any remaining non-registry listeners for collisions.
- Every search/filter
<Input>getsonKeyDown={onSearchInputEscape(...)}— see .
Preferred pattern
- Add definitions in
apps/studio/state/shortcuts/registry.tsorapps/studio/state/shortcuts/registry/*. - Register with
useShortcut. - Gate availability with
enabled. - Surface visible actions with
ShortcutTooltiporShortcutBadge. - Prefer scoped, mnemonic sequential chords over global modifier chords.
- Set
showInSettings: falseon contextual shortcuts (scoped to a specific page state, sheet, or panel). - Active shortcuts appear in the reference sheet (
Shift+?) automatically; set group ordering viaSHORTCUT_REFERENCE_GROUP_ORDER(and labels forSHORTCUT_REFERENCE_GROUPSviaSHORTCUT_REFERENCE_GROUP_LABELS) inapps/studio/state/shortcuts/referenceGroups.ts, or add prefix-group labels toGROUP_LABELSinapps/studio/components/ui/GlobalShortcuts/ShortcutsReferenceSheet.tsx. - For sheet-scoped shortcuts (active only while a
<Sheet>is open), mountuseShortcutinside the sheet component gated by theopenprop ({ enabled: open }) —apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksDeliveryDetailsSheet.tsxis the canonical example. A shortcut that _opens_ a sheet from anywhere is global instead, gated by whatever makes the action valid (e.g.useConnectSheetShortcutchecks project health).
Search inputs
Every <Input> used as a search or filter field must include the staged-Escape handler from apps/studio/lib/keyboard.ts:
import { onSearchInputEscape } from '@/lib/keyboard'
;<Input
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={onSearchInputEscape(query, setQuery)}
/>Behavior:
- Escape while the input has a value → clears the value, keeps focus (so a second Escape then blurs)
- Escape while the input is empty → blurs the input
- Stops propagation on Escape so the keystroke does not accidentally close a parent dialog or sheet
When pairing with useShortcut(SHORTCUT_IDS.LIST_PAGE_FOCUS_SEARCH, ...) to focus a search input via keyboard, always also add onSearchInputEscape on the same input — focus and escape-to-blur are always a pair.
Key files
apps/studio/state/shortcuts/registry.ts, apps/studio/state/shortcuts/useShortcut.tsx, apps/studio/components/ui/Shortcut*.tsx, apps/studio/lib/keyboard.ts.
Tests
E2E tests for a feature with shortcuts cover both click interactions and the keyboard path — see studio-e2e-tests.