The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
259 add navigation hotkeys for command menu level 2 (#10043)
Raphaël Bosi9838bec0041e
diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.tsindex fe5dc1365ff..a5824599858 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts@@ -13,9 +13,9 @@ import { Key } from 'ts-key-enum';export const useCommandMenuHotKeys = () => {const {- closeCommandMenu,openRecordsSearchPage,toggleCommandMenu,+ goBackFromCommandMenu,setGlobalCommandMenuContext,} = useCommandMenu();@@ -37,7 +37,7 @@ export const useCommandMenuHotKeys = () => {toggleCommandMenu();},AppHotkeyScope.CommandMenu,- [toggleCommandMenu],+ [closeKeyboardShortcutMenu, toggleCommandMenu],);useScopedHotkeys(@@ -55,18 +55,21 @@ export const useCommandMenuHotKeys = () => {useScopedHotkeys([Key.Escape],() => {- closeCommandMenu();+ goBackFromCommandMenu();},AppHotkeyScope.CommandMenuOpen,- [closeCommandMenu],+ [goBackFromCommandMenu],);useScopedHotkeys([Key.Backspace, Key.Delete],() => {+ if (isNonEmptyString(commandMenuSearch)) {+ return;+ }+if (commandMenuPage === CommandMenuPages.Root &&- !isNonEmptyString(commandMenuSearch) &&!(contextStoreTargetedRecordsRuleComponent.mode === 'selection' &&contextStoreTargetedRecordsRuleComponent.selectedRecordIds.length ===@@ -75,9 +78,18 @@ export const useCommandMenuHotKeys = () => {) {setGlobalCommandMenuContext();}+ if (commandMenuPage !== CommandMenuPages.Root) {+ goBackFromCommandMenu();+ }},AppHotkeyScope.CommandMenuOpen,- [closeCommandMenu],+ [+ commandMenuPage,+ commandMenuSearch,+ contextStoreTargetedRecordsRuleComponent,+ goBackFromCommandMenu,+ setGlobalCommandMenuContext,+ ],{preventDefault: false,},