From 03197226f47944a81c4785b15cf13082234d8a69 Mon Sep 17 00:00:00 2001 From: martmull Date: Fri, 24 Jan 2025 17:46:56 +0100 Subject: [PATCH] Fix Cmd enter to test code step (#9841) --- .../action-menu/components/CmdEnterActionButton.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/action-menu/components/CmdEnterActionButton.tsx b/packages/twenty-front/src/modules/action-menu/components/CmdEnterActionButton.tsx index 84951d3b2..48fa4680e 100644 --- a/packages/twenty-front/src/modules/action-menu/components/CmdEnterActionButton.tsx +++ b/packages/twenty-front/src/modules/action-menu/components/CmdEnterActionButton.tsx @@ -1,7 +1,10 @@ -import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope'; import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys'; import { Key } from 'ts-key-enum'; import { Button, getOsControlSymbol } from 'twenty-ui'; +import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope'; +import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope'; +import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; +import { FeatureFlagKey } from '~/generated/graphql'; export const CmdEnterActionButton = ({ title, @@ -10,10 +13,15 @@ export const CmdEnterActionButton = ({ title: string; onClick: () => void; }) => { + const isCommandMenuV2Enabled = useIsFeatureEnabled( + FeatureFlagKey.IsCommandMenuV2Enabled, + ); useScopedHotkeys( [`${Key.Control}+${Key.Enter}`, `${Key.Meta}+${Key.Enter}`], () => onClick(), - RightDrawerHotkeyScope.RightDrawer, + isCommandMenuV2Enabled + ? AppHotkeyScope.CommandMenuOpen + : RightDrawerHotkeyScope.RightDrawer, [onClick], );