Skip to content

The open alternative to Salesforce, designed for AI.

Fix Cmd enter to test code step (#9841)

martmull03197226f479
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 84951d3b24e..48fa4680e97 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],
);