fix: trace explorer and home page keyboard shortcut (#8934)

This commit is contained in:
Vishal Sharma 2025-08-27 23:49:54 +05:30 committed by GitHub
parent f6bc30050b
commit df54e6350d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -25,11 +25,11 @@ export const GlobalShortcutsName = {
export const GlobalShortcutsDescription = { export const GlobalShortcutsDescription = {
NavigateToHome: 'Navigate to Home', NavigateToHome: 'Navigate to Home',
NavigateToServices: 'Navigate to Services page', NavigateToServices: 'Navigate to Services page',
NavigateToTraces: 'Navigate to Traces page', NavigateToTraces: 'Navigate to Traces Explorer',
NavigateToLogs: 'Navigate to logs page', NavigateToLogs: 'Navigate to Logs Explorer',
NavigateToDashboards: 'Navigate to dashboards page', NavigateToDashboards: 'Navigate to Dashboards List',
NavigateToAlerts: 'Navigate to alerts page', NavigateToAlerts: 'Navigate to Alerts List',
NavigateToExceptions: 'Navigate to Exceptions page', NavigateToExceptions: 'Navigate to Exceptions List',
NavigateToMessagingQueues: 'Navigate to Messaging Queues page', NavigateToMessagingQueues: 'Navigate to Messaging Queues',
ToggleSidebar: 'Toggle sidebar visibility', ToggleSidebar: 'Toggle sidebar visibility',
}; };

View File

@ -647,11 +647,14 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
}; };
useEffect(() => { useEffect(() => {
registerShortcut(GlobalShortcuts.NavigateToHome, () =>
onClickHandler(ROUTES.HOME, null),
);
registerShortcut(GlobalShortcuts.NavigateToServices, () => registerShortcut(GlobalShortcuts.NavigateToServices, () =>
onClickHandler(ROUTES.APPLICATION, null), onClickHandler(ROUTES.APPLICATION, null),
); );
registerShortcut(GlobalShortcuts.NavigateToTraces, () => registerShortcut(GlobalShortcuts.NavigateToTraces, () =>
onClickHandler(ROUTES.TRACE, null), onClickHandler(ROUTES.TRACES_EXPLORER, null),
); );
registerShortcut(GlobalShortcuts.NavigateToLogs, () => registerShortcut(GlobalShortcuts.NavigateToLogs, () =>
@ -674,6 +677,7 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
); );
return (): void => { return (): void => {
deregisterShortcut(GlobalShortcuts.NavigateToHome);
deregisterShortcut(GlobalShortcuts.NavigateToServices); deregisterShortcut(GlobalShortcuts.NavigateToServices);
deregisterShortcut(GlobalShortcuts.NavigateToTraces); deregisterShortcut(GlobalShortcuts.NavigateToTraces);
deregisterShortcut(GlobalShortcuts.NavigateToLogs); deregisterShortcut(GlobalShortcuts.NavigateToLogs);