Files
supabase/apps/studio/state/shortcuts/referenceGroups.ts
Ali WaseemandDanny White 3d9fb2f98d feat(realtime): shortcuts for realtime (#46001)
## What kind of change does this PR introduce?

Feature — adds keyboard shortcuts for the Realtime section in Studio.

## What is the current behavior?

No keyboard shortcuts exist for Realtime navigation or inspector
actions.

## What is the new behavior?

### Navigation chords (layout-scoped, active on any Realtime page)

| Shortcut | Action |
|---|---|
| `R I` | Go to Inspector |
| `R P` | Go to Policies |
| `R S` | Go to Settings |

### Inspector actions (active on the Inspector page)

| Shortcut | Action | Gating |
|---|---|---|
| `Shift+J` | Join a channel | Only when no channel is joined |
| `Shift+L` | Start/Stop listening | Only when a channel is joined |
| `Shift+F` | Open filter popover | Only when a channel is joined |
| `Shift+B` | Broadcast a message | Only when listening |
| `Mod+Shift+C` | Copy selected message | Only when a message is
selected |


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

* **New Features**
* Realtime Inspector: new keyboard shortcuts (join channel, toggle
listening, toggle filters, broadcast) and a copy-message shortcut with
toast feedback.
* Channel & Filter popovers support controlled/uncontrolled open state;
header now wires popover state through props.
* Shortcut tooltips added to copy and broadcast actions; realtime page
navigation shortcuts and menu shortcuts added.
* **Tests**
* Shortcut reference sheet tests updated to include realtime navigation
and inspector groups.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46001?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2026-05-19 11:12:54 -06:00

52 lines
1.7 KiB
TypeScript

export const SHORTCUT_REFERENCE_GROUPS = {
NAVIGATION_GLOBAL: 'navigation.global',
NAVIGATION_DATABASE: 'navigation.database',
NAVIGATION_AUTH: 'navigation.auth',
NAVIGATION_STORAGE: 'navigation.storage',
NAVIGATION_FUNCTIONS: 'navigation.functions',
NAVIGATION_FUNCTION_DETAIL: 'navigation.function-detail',
NAVIGATION_REALTIME: 'navigation.realtime',
} as const
export const SHORTCUT_REFERENCE_GROUP_LABELS: Record<string, string> = {
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL]: 'Global Navigation',
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_DATABASE]: 'Database Navigation',
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH]: 'Auth Navigation',
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_STORAGE]: 'Storage Navigation',
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTIONS]: 'Edge Functions Navigation',
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTION_DETAIL]: 'Edge Function Tabs',
[SHORTCUT_REFERENCE_GROUPS.NAVIGATION_REALTIME]: 'Realtime Navigation',
}
export const SHORTCUT_REFERENCE_GROUP_ORDER = [
'command-menu',
'shortcuts',
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL,
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_DATABASE,
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_AUTH,
'auth-users',
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_STORAGE,
'storage-buckets',
'storage-explorer',
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTIONS,
'functions-list',
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTION_DETAIL,
'functions-detail',
'functions-overview',
SHORTCUT_REFERENCE_GROUPS.NAVIGATION_REALTIME,
'realtime-inspector',
'logs-preview',
'nav',
'ai-assistant',
'inline-editor',
'sql-editor',
'results',
'data-table',
'table-editor',
'schema-visualizer',
'list-page',
'action-bar',
'operation-queue',
'unified-logs',
]