unified-logs.ts92 lines · main
1// @ts-nocheck
2import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'
3import { RegistryDefinations } from '../types'
4
5/**
6 * Shortcuts scoped to the Unified Logs page (`components/interfaces/UnifiedLogs`).
7 * They are page-scoped: each is only active while the relevant Unified Logs
8 * component is mounted.
9 *
10 * Grid/detail-panel bindings (prev/next, close) mirror the Logs Explorer
11 * (`logs-preview`) and Table Editor patterns so the keyboard model stays
12 * consistent across our data-grid surfaces. Copying selected logs reuses the
13 * shared `results.copy-*` shortcuts (see `RowSelectionHeader`).
14 */
15export const UNIFIED_LOGS_SHORTCUT_IDS = {
16 UNIFIED_LOGS_RESET_FOCUS: 'unified-logs.reset-focus',
17 UNIFIED_LOGS_REFRESH: 'unified-logs.refresh',
18 UNIFIED_LOGS_DOWNLOAD: 'unified-logs.download',
19 UNIFIED_LOGS_FOCUS_FILTER: 'unified-logs.focus-filter',
20 UNIFIED_LOGS_CLEAR_FILTERS: 'unified-logs.clear-filters',
21 UNIFIED_LOGS_PREV_ROW: 'unified-logs.prev-row',
22 UNIFIED_LOGS_NEXT_ROW: 'unified-logs.next-row',
23 UNIFIED_LOGS_CLOSE_PANEL: 'unified-logs.close-panel',
24}
25
26export type UnifiedLogsShortcutId =
27 (typeof UNIFIED_LOGS_SHORTCUT_IDS)[keyof typeof UNIFIED_LOGS_SHORTCUT_IDS]
28
29export const unifiedLogsRegistry: RegistryDefinations<UnifiedLogsShortcutId> = {
30 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_RESET_FOCUS]: {
31 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_RESET_FOCUS,
32 label: 'Reset focus in logs',
33 sequence: ['Mod+.'],
34 showInSettings: false,
35 },
36 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_REFRESH]: {
37 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_REFRESH,
38 label: 'Refresh logs',
39 sequence: ['Shift+R'],
40 showInSettings: false,
41 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
42 options: { ignoreInputs: true, registerInCommandMenu: true },
43 },
44 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_DOWNLOAD]: {
45 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_DOWNLOAD,
46 label: 'Download logs',
47 sequence: ['Shift+E'],
48 showInSettings: false,
49 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
50 options: { ignoreInputs: true, registerInCommandMenu: true },
51 },
52 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_FOCUS_FILTER]: {
53 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_FOCUS_FILTER,
54 label: 'Focus filter bar',
55 sequence: ['Shift+F'],
56 showInSettings: false,
57 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
58 options: { ignoreInputs: true, registerInCommandMenu: true },
59 },
60 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_CLEAR_FILTERS]: {
61 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_CLEAR_FILTERS,
62 label: 'Clear filters',
63 sequence: ['F', 'C'],
64 showInSettings: false,
65 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
66 options: { ignoreInputs: true, registerInCommandMenu: true },
67 },
68 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_PREV_ROW]: {
69 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_PREV_ROW,
70 label: 'Previous log',
71 sequence: ['ArrowUp'],
72 showInSettings: false,
73 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
74 options: { ignoreInputs: true },
75 },
76 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_NEXT_ROW]: {
77 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_NEXT_ROW,
78 label: 'Next log',
79 sequence: ['ArrowDown'],
80 showInSettings: false,
81 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
82 options: { ignoreInputs: true },
83 },
84 [UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_CLOSE_PANEL]: {
85 id: UNIFIED_LOGS_SHORTCUT_IDS.UNIFIED_LOGS_CLOSE_PANEL,
86 label: 'Close log details panel',
87 sequence: ['Escape'],
88 showInSettings: false,
89 referenceGroup: SHORTCUT_REFERENCE_GROUPS.UNIFIED_LOGS,
90 options: { ignoreInputs: true, conflictBehavior: 'allow' },
91 },
92}