From 0ad35549ace190277f9f0f48bf9da7026547efd0 Mon Sep 17 00:00:00 2001 From: brendanlaschke Date: Wed, 2 Aug 2023 07:11:07 +0200 Subject: [PATCH] Fix hotkeys for tasks page (#1034) - fix hotkeys for tasks --- front/src/AppNavbar.tsx | 1 + .../modules/command-menu/components/CommandMenu.tsx | 12 +++++++++--- front/src/modules/types/PageHotkeyScope.ts | 1 + front/src/sync-hooks/AuthAutoRouter.tsx | 5 +++++ front/src/sync-hooks/GotoHotkeysHooks.tsx | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/front/src/AppNavbar.tsx b/front/src/AppNavbar.tsx index 544db676b132..0b6f09bc4ae7 100644 --- a/front/src/AppNavbar.tsx +++ b/front/src/AppNavbar.tsx @@ -49,6 +49,7 @@ export function AppNavbar() { } /> diff --git a/front/src/modules/command-menu/components/CommandMenu.tsx b/front/src/modules/command-menu/components/CommandMenu.tsx index 765f7dc149d5..842c6322a56c 100644 --- a/front/src/modules/command-menu/components/CommandMenu.tsx +++ b/front/src/modules/command-menu/components/CommandMenu.tsx @@ -98,6 +98,11 @@ export function CommandMenu() { label: 'Go to Settings', shortcuts: ['G', 'S'], }, + { + to: '/tasks', + label: 'Go to Tasks', + shortcuts: ['G', 'T'], + }, ]; const matchingCommand = commands.find( @@ -162,7 +167,6 @@ export function CommandMenu() { {matchingCommand && ( {commands - .filter((cmd) => - cmd.shortcuts?.join('').includes(search?.toUpperCase()), + .filter( + (cmd) => + cmd.shortcuts?.join('').includes(search?.toUpperCase()) || + cmd.label?.toUpperCase().includes(search?.toUpperCase()), ) .map((cmd) => ( ; }