functions-nav.ts36 lines · main
1// @ts-nocheck
2import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'
3import { RegistryDefinations } from '../types'
4
5/**
6 * Contextual chords for jumping between Edge Functions sub-pages — `F + <letter>`.
7 *
8 * Active only while EdgeFunctionsLayout is mounted (i.e. the user is somewhere
9 * under `/project/<ref>/functions/*`). Mirrors the database-nav / auth-nav /
10 * storage-nav pattern: the leading `F` is layout-scoped so it doesn't burn a
11 * global key.
12 */
13export const FUNCTIONS_NAV_SHORTCUT_IDS = {
14 NAV_FUNCTIONS_OVERVIEW: 'nav.functions-overview',
15 NAV_FUNCTIONS_SECRETS: 'nav.functions-secrets',
16}
17
18export type FunctionsNavShortcutId =
19 (typeof FUNCTIONS_NAV_SHORTCUT_IDS)[keyof typeof FUNCTIONS_NAV_SHORTCUT_IDS]
20
21export const functionsNavRegistry: RegistryDefinations<FunctionsNavShortcutId> = {
22 [FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_OVERVIEW]: {
23 id: FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_OVERVIEW,
24 label: 'Go to Functions',
25 sequence: ['F', 'O'],
26 showInSettings: false,
27 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTIONS,
28 },
29 [FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_SECRETS]: {
30 id: FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_SECRETS,
31 label: 'Go to Secrets',
32 sequence: ['F', 'K'],
33 showInSettings: false,
34 referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTIONS,
35 },
36}