From d6f088f7203f87c344f3eea8a3697b517afacc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bosi?= <71827178+bosiraphael@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:22:44 +0100 Subject: [PATCH] [DASHBOARDS] Hide pinned workflow actions when dashboard is in edit mode (#17341) ## Before https://github.com/user-attachments/assets/85fe3929-eebf-4412-bdb6-e069e623838d ## After https://github.com/user-attachments/assets/5fd6d3ea-d667-4c70-86c1-ace57d3aee2f --- .../hooks/useRunWorkflowRecordActions.tsx | 9 ++++++++- .../hooks/useRunWorkflowRecordAgnosticActions.tsx | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/run-workflow-actions/hooks/useRunWorkflowRecordActions.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/run-workflow-actions/hooks/useRunWorkflowRecordActions.tsx index 7d8e68bfb6..cc7d0fea6f 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/run-workflow-actions/hooks/useRunWorkflowRecordActions.tsx +++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/run-workflow-actions/hooks/useRunWorkflowRecordActions.tsx @@ -2,6 +2,7 @@ import { Action } from '@/action-menu/actions/components/Action'; import { isBulkRecordsManualTrigger } from '@/action-menu/actions/record-actions/utils/isBulkRecordsManualTrigger'; import { ActionScope } from '@/action-menu/actions/types/ActionScope'; import { ActionType } from '@/action-menu/actions/types/ActionType'; +import { contextStoreIsPageInEditModeComponentState } from '@/context-store/states/contextStoreIsPageInEditModeComponentState'; import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState'; import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState'; @@ -31,6 +32,10 @@ export const useRunWorkflowRecordActions = ({ contextStoreTargetedRecordsRuleComponentState, ); + const isPageInEditMode = useRecoilComponentValue( + contextStoreIsPageInEditModeComponentState, + ); + const selectedRecordIds = contextStoreTargetedRecordsRule.mode === 'selection' ? contextStoreTargetedRecordsRule.selectedRecordIds @@ -130,7 +135,9 @@ export const useRunWorkflowRecordActions = ({ shortLabel: name, position: index, Icon, - isPinned: activeWorkflowVersion.trigger?.settings?.isPinned, + isPinned: + !isPageInEditMode && + activeWorkflowVersion.trigger?.settings?.isPinned, shouldBeRegistered: () => true, component: ( { const { getIcon } = useIcons(); + const isPageInEditMode = useRecoilComponentValue( + contextStoreIsPageInEditModeComponentState, + ); + const { actionMenuType } = useContext(ActionMenuContext); const { records: activeWorkflowVersions } = @@ -43,7 +49,9 @@ export const useRunWorkflowRecordAgnosticActions = () => { label: name, shortLabel: name, position: index, - isPinned: activeWorkflowVersion.trigger?.settings?.isPinned, + isPinned: + !isPageInEditMode && + activeWorkflowVersion.trigger?.settings?.isPinned, Icon, shouldBeRegistered: () => true, component: (