advisors-page.ts62 lines · main
| 1 | // @ts-nocheck |
| 2 | import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups' |
| 3 | import { RegistryDefinations } from '../types' |
| 4 | |
| 5 | /** |
| 6 | * Shortcuts scoped to the Security and Performance Advisor pages — tab digit |
| 7 | * shortcuts, refresh, and detail panel close. The tab digits mirror the |
| 8 | * functions-detail-nav pattern (`ignoreInputs: true` so they don't fire from |
| 9 | * inputs), and `Escape` follows the auth-users close-panel pattern with |
| 10 | * `conflictBehavior: 'allow'` since other surfaces also use Escape. |
| 11 | */ |
| 12 | export const ADVISORS_PAGE_SHORTCUT_IDS = { |
| 13 | ADVISORS_TAB_ERRORS: 'advisors-page.tab-errors', |
| 14 | ADVISORS_TAB_WARNINGS: 'advisors-page.tab-warnings', |
| 15 | ADVISORS_TAB_INFO: 'advisors-page.tab-info', |
| 16 | ADVISORS_REFRESH: 'advisors-page.refresh', |
| 17 | ADVISORS_CLOSE_DETAIL: 'advisors-page.close-detail', |
| 18 | } |
| 19 | |
| 20 | export type AdvisorsPageShortcutId = |
| 21 | (typeof ADVISORS_PAGE_SHORTCUT_IDS)[keyof typeof ADVISORS_PAGE_SHORTCUT_IDS] |
| 22 | |
| 23 | export const advisorsPageRegistry: RegistryDefinations<AdvisorsPageShortcutId> = { |
| 24 | [ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_TAB_ERRORS]: { |
| 25 | id: ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_TAB_ERRORS, |
| 26 | label: 'Switch to Errors', |
| 27 | sequence: ['1'], |
| 28 | showInSettings: false, |
| 29 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 30 | referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS, |
| 31 | }, |
| 32 | [ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_TAB_WARNINGS]: { |
| 33 | id: ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_TAB_WARNINGS, |
| 34 | label: 'Switch to Warnings', |
| 35 | sequence: ['2'], |
| 36 | showInSettings: false, |
| 37 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 38 | referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS, |
| 39 | }, |
| 40 | [ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_TAB_INFO]: { |
| 41 | id: ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_TAB_INFO, |
| 42 | label: 'Switch to Info', |
| 43 | sequence: ['3'], |
| 44 | showInSettings: false, |
| 45 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 46 | referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS, |
| 47 | }, |
| 48 | [ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_REFRESH]: { |
| 49 | id: ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_REFRESH, |
| 50 | label: 'Refresh advisor', |
| 51 | sequence: ['Shift+R'], |
| 52 | showInSettings: false, |
| 53 | options: { ignoreInputs: true, registerInCommandMenu: true }, |
| 54 | }, |
| 55 | [ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_CLOSE_DETAIL]: { |
| 56 | id: ADVISORS_PAGE_SHORTCUT_IDS.ADVISORS_CLOSE_DETAIL, |
| 57 | label: 'Close lint details panel', |
| 58 | sequence: ['Escape'], |
| 59 | showInSettings: false, |
| 60 | options: { ignoreInputs: true, conflictBehavior: 'allow' }, |
| 61 | }, |
| 62 | } |