diff --git a/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.test.tsx b/apps/studio/components/layouts/Navigation/NavigationBar/NavigationBar.utils.test.tsx index 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.tsx index 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: , 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.ts index 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/storage import { 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 = { 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',