diff --git a/packages/twenty-front/src/modules/action-menu/actions/components/ActionModal.tsx b/packages/twenty-front/src/modules/action-menu/actions/components/ActionModal.tsx index 2ba6e1e718..d42265c52e 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/components/ActionModal.tsx +++ b/packages/twenty-front/src/modules/action-menu/actions/components/ActionModal.tsx @@ -1,5 +1,4 @@ import { type ReactNode, useContext } from 'react'; -import { createPortal } from 'react-dom'; import { ActionDisplay } from '@/action-menu/actions/display/components/ActionDisplay'; import { ActionConfigContext } from '@/action-menu/contexts/ActionConfigContext'; @@ -63,19 +62,17 @@ export const ActionModal = ({ return ( <> - {isModalOpened && - createPortal( - , - document.body, - )} + {isModalOpened && ( + + )} ); }; diff --git a/packages/twenty-front/src/modules/action-menu/actions/components/ActionOpenSidePanelPage.tsx b/packages/twenty-front/src/modules/action-menu/actions/components/ActionOpenSidePanelPage.tsx index 6482d421f4..4a54d8b732 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/components/ActionOpenSidePanelPage.tsx +++ b/packages/twenty-front/src/modules/action-menu/actions/components/ActionOpenSidePanelPage.tsx @@ -2,11 +2,12 @@ import { ActionDisplay } from '@/action-menu/actions/display/components/ActionDi import { ActionConfigContext } from '@/action-menu/contexts/ActionConfigContext'; import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu'; import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState'; +import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState'; import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages'; import { type MessageDescriptor } from '@lingui/core'; import { t } from '@lingui/core/macro'; import { useContext } from 'react'; -import { useSetRecoilState } from 'recoil'; +import { useRecoilValue, useSetRecoilState } from 'recoil'; import { type IconComponent } from 'twenty-ui/display'; export const ActionOpenSidePanelPage = ({ @@ -28,6 +29,8 @@ export const ActionOpenSidePanelPage = ({ const setCommandMenuSearchState = useSetRecoilState(commandMenuSearchState); + const isCommandMenuOpened = useRecoilValue(isCommandMenuOpenedState); + if (!actionConfig) { return null; } @@ -39,6 +42,7 @@ export const ActionOpenSidePanelPage = ({ page, pageTitle: t(pageTitle), pageIcon, + resetNavigationStack: isCommandMenuOpened, }); if (shouldResetSearchState) { diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/multiple-records/components/DeleteMultipleRecordsAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/multiple-records/components/DeleteMultipleRecordsAction.tsx index 6400d11453..0f7deb15ac 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/multiple-records/components/DeleteMultipleRecordsAction.tsx +++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/multiple-records/components/DeleteMultipleRecordsAction.tsx @@ -1,4 +1,4 @@ -import { ActionModal } from '@/action-menu/actions/components/ActionModal'; +import { Action } from '@/action-menu/actions/components/Action'; import { ActionConfigContext } from '@/action-menu/contexts/ActionConfigContext'; import { computeProgressText } from '@/action-menu/utils/computeProgressText'; import { getActionLabel } from '@/action-menu/utils/getActionLabel'; @@ -14,7 +14,6 @@ import { useFilterValueDependencies } from '@/object-record/record-filter/hooks/ import { useRecordIndexIdFromCurrentContextStore } from '@/object-record/record-index/hooks/useRecordIndexIdFromCurrentContextStore'; import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection'; import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue'; -import { t } from '@lingui/core/macro'; import { useContext } from 'react'; import { isDefined } from 'twenty-shared/utils'; @@ -92,12 +91,7 @@ export const DeleteMultipleRecordsAction = () => { return ( - + ); }; diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DeleteSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DeleteSingleRecordAction.tsx index a29d602a73..99597b27bc 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DeleteSingleRecordAction.tsx +++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DeleteSingleRecordAction.tsx @@ -1,11 +1,10 @@ -import { ActionModal } from '@/action-menu/actions/components/ActionModal'; +import { Action } from '@/action-menu/actions/components/Action'; import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow'; import { useDeleteFavorite } from '@/favorites/hooks/useDeleteFavorite'; import { useFavorites } from '@/favorites/hooks/useFavorites'; import { useDeleteOneRecord } from '@/object-record/hooks/useDeleteOneRecord'; import { useRecordIndexIdFromCurrentContextStore } from '@/object-record/record-index/hooks/useRecordIndexIdFromCurrentContextStore'; import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection'; -import { t } from '@lingui/core/macro'; import { isDefined } from 'twenty-shared/utils'; export const DeleteSingleRecordAction = () => { @@ -37,12 +36,5 @@ export const DeleteSingleRecordAction = () => { await deleteOneRecord(recordId); }; - return ( - - ); + return ; }; 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 2be7c8699d..b4a8ddaddd 100644 --- a/packages/twenty-front/src/modules/action-menu/components/CmdEnterActionButton.tsx +++ b/packages/twenty-front/src/modules/action-menu/components/CmdEnterActionButton.tsx @@ -25,7 +25,7 @@ export const CmdEnterActionButton = ({ title={title} variant={disabled ? 'secondary' : 'primary'} accent="blue" - size="medium" + size="small" onClick={onClick} disabled={disabled} hotkeys={[getOsControlSymbol(), '⏎']} diff --git a/packages/twenty-front/src/modules/action-menu/components/CommandMenuActionMenuDropdown.tsx b/packages/twenty-front/src/modules/action-menu/components/CommandMenuActionMenuDropdown.tsx index d9ec84428a..90c6c2c5b9 100644 --- a/packages/twenty-front/src/modules/action-menu/components/CommandMenuActionMenuDropdown.tsx +++ b/packages/twenty-front/src/modules/action-menu/components/CommandMenuActionMenuDropdown.tsx @@ -66,7 +66,11 @@ export const CommandMenuActionMenuDropdown = () => { dropdownId={dropdownId} data-select-disable clickableComponent={ -