The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix(studio): add a keyboard shortcut for the Compute sidebar item (#50361)
Ali Waseem2cd9b42e8032
diff --git a/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.test.tsx b/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.test.tsxindex 329eef1fc33..1e1e7ed1e1c 100644--- a/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.test.tsx+++ b/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.test.tsx@@ -90,6 +90,11 @@ describe('generateProductRoutes', () => {expect(keys(generateProductRoutes(REF, activeProject, { compute: true }))).toContain('compute')})+ it('gives every product route a navigation shortcut', () => {+ const routes = generateProductRoutes(REF, activeProject, { compute: true })+ expect(routes.filter((r) => !r.shortcutId)).toEqual([])+ })+it('excludes auth when auth feature is disabled', () => {const routes = generateProductRoutes(REF, activeProject, { auth: false })expect(keys(routes)).not.toContain('auth')diff --git a/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.tsx b/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.tsxindex f56f2279759..f453ecba0f3 100644--- a/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.tsx+++ b/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.tsx@@ -178,6 +178,7 @@ export const generateProductRoutes = (icon: <Compute size={ICON_SIZE} strokeWidth={ICON_STROKE_WIDTH} />,link: ref && (isProjectBuilding ? buildingUrl : `/project/${ref}/compute`),isNew: true,+ shortcutId: SHORTCUT_IDS.NAV_COMPUTE,},]: []),diff --git a/apps/studio/state/shortcuts/registry.ts b/apps/studio/state/shortcuts/registry.tsindex e2260bfb426..22e108c3cdf 100644--- a/apps/studio/state/shortcuts/registry.ts+++ b/apps/studio/state/shortcuts/registry.ts@@ -59,6 +59,7 @@ import { STORAGE_NAV_SHORTCUT_IDS, storageNavRegistry } from './registry/storageimport { TABLE_EDITOR_SHORTCUT_IDS, tableEditorRegistry } from './registry/table-editor'import { UNIFIED_LOGS_SHORTCUT_IDS, unifiedLogsRegistry } from './registry/unified-logs'import { ShortcutDefinition } from './types'+import { PRODUCT_NAME } from '@/lib/constants/compute'/*** The canonical list of shortcut IDs. Add new shortcuts here first, then@@ -96,6 +97,7 @@ export const SHORTCUT_IDS = {NAV_AUTH: 'nav.auth',NAV_STORAGE: 'nav.storage',NAV_FUNCTIONS: 'nav.functions',+ NAV_COMPUTE: 'nav.compute',NAV_REALTIME: 'nav.realtime',NAV_ADVISORS: 'nav.advisors',NAV_OBSERVABILITY: 'nav.observability',@@ -391,6 +393,13 @@ export const SHORTCUT_DEFINITIONS: Record<ShortcutId, ShortcutDefinition> = {showInSettings: false,referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL,},+ [SHORTCUT_IDS.NAV_COMPUTE]: {+ id: SHORTCUT_IDS.NAV_COMPUTE,+ label: `Go to ${PRODUCT_NAME}`,+ sequence: ['G', 'C'],+ showInSettings: false,+ referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_GLOBAL,+ },[SHORTCUT_IDS.NAV_REALTIME]: {id: SHORTCUT_IDS.NAV_REALTIME,label: 'Go to Realtime',