unified-logs.ts 3.6 KB

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