The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
[FRONT COMPONENTS] Headless components (#18096)
Raphaël Bosi7da845007589
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex 75bf1889ea6..c8aa14be5d6 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -1675,6 +1675,7 @@ export type FrontComponent = {createdAt: Scalars['DateTime'];description?: Maybe<Scalars['String']>;id: Scalars['UUID'];+ isHeadless: Scalars['Boolean'];name: Scalars['String'];sourceComponentPath: Scalars['String'];universalIdentifier?: Maybe<Scalars['UUID']>;@@ -5744,12 +5745,12 @@ export type ListPlansQueryVariables = Exact<{ [key: string]: never; }>;export type ListPlansQuery = { __typename?: 'Query', listPlans: Array<{ __typename?: 'BillingPlanOutput', planKey: BillingPlanKey, licensedProducts: Array<{ __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }>, meteredProducts: Array<{ __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceMetered', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTier', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }> }> };-export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, isPinned: boolean, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string } | null };+export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, isPinned: boolean, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null };export type FindManyCommandMenuItemsQueryVariables = Exact<{ [key: string]: never; }>;-export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuItems: Array<{ __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, isPinned: boolean, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string } | null }> };+export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuItems: Array<{ __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, isPinned: boolean, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null }> };export type PageLayoutFragmentFragment = { __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, deletedAt?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?: { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode } | { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number } | { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number } | null, configuration: { __typename?: 'AggregateChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, label?: string | null, displayDataLabel?: boolean | null, format?: string | null, description?: string | null, filter?: any | null, prefix?: string | null, suffix?: string | null, timezone?: string | null, firstDayOfTheWeek?: number | null, ratioAggregateConfig?: { __typename?: 'RatioAggregateConfig', fieldMetadataId: string, optionValue: string } | null } | { __typename?: 'BarChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, primaryAxisGroupByFieldMetadataId: string, primaryAxisGroupBySubFieldName?: string | null, primaryAxisDateGranularity?: ObjectRecordGroupByDateGranularity | null, primaryAxisOrderBy?: GraphOrderBy | null, primaryAxisManualSortOrder?: Array<string> | null, secondaryAxisGroupByFieldMetadataId?: string | null, secondaryAxisGroupBySubFieldName?: string | null, secondaryAxisGroupByDateGranularity?: ObjectRecordGroupByDateGranularity | null, secondaryAxisOrderBy?: GraphOrderBy | null, secondaryAxisManualSortOrder?: Array<string> | null, omitNullValues?: boolean | null, axisNameDisplay?: AxisNameDisplay | null, displayDataLabel?: boolean | null, displayLegend?: boolean | null, rangeMin?: number | null, rangeMax?: number | null, color?: string | null, description?: string | null, filter?: any | null, groupMode?: BarChartGroupMode | null, layout: BarChartLayout, isCumulative?: boolean | null, splitMultiValueFields?: boolean | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'CalendarConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'EmailsConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FieldConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FieldRichTextConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FieldsConfiguration', configurationType: WidgetConfigurationType, viewId?: string | null } | { __typename?: 'FilesConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FrontComponentConfiguration', configurationType: WidgetConfigurationType, frontComponentId: string } | { __typename?: 'GaugeChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, displayDataLabel?: boolean | null, color?: string | null, description?: string | null, filter?: any | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'IframeConfiguration', configurationType: WidgetConfigurationType, url?: string | null } | { __typename?: 'LineChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, primaryAxisGroupByFieldMetadataId: string, primaryAxisGroupBySubFieldName?: string | null, primaryAxisDateGranularity?: ObjectRecordGroupByDateGranularity | null, primaryAxisOrderBy?: GraphOrderBy | null, primaryAxisManualSortOrder?: Array<string> | null, secondaryAxisGroupByFieldMetadataId?: string | null, secondaryAxisGroupBySubFieldName?: string | null, secondaryAxisGroupByDateGranularity?: ObjectRecordGroupByDateGranularity | null, secondaryAxisOrderBy?: GraphOrderBy | null, secondaryAxisManualSortOrder?: Array<string> | null, omitNullValues?: boolean | null, axisNameDisplay?: AxisNameDisplay | null, displayDataLabel?: boolean | null, displayLegend?: boolean | null, rangeMin?: number | null, rangeMax?: number | null, color?: string | null, description?: string | null, filter?: any | null, isStacked?: boolean | null, isCumulative?: boolean | null, splitMultiValueFields?: boolean | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'NotesConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'PieChartConfiguration', configurationType: WidgetConfigurationType, groupByFieldMetadataId: string, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, groupBySubFieldName?: string | null, dateGranularity?: ObjectRecordGroupByDateGranularity | null, orderBy?: GraphOrderBy | null, manualSortOrder?: Array<string> | null, displayDataLabel?: boolean | null, showCenterMetric?: boolean | null, displayLegend?: boolean | null, hideEmptyCategory?: boolean | null, splitMultiValueFields?: boolean | null, color?: string | null, description?: string | null, filter?: any | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'StandaloneRichTextConfiguration', configurationType: WidgetConfigurationType, body: { __typename?: 'RichTextV2Body', blocknote?: string | null, markdown?: string | null } } | { __typename?: 'TasksConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'TimelineConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'ViewConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'WorkflowConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'WorkflowRunConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'WorkflowVersionConfiguration', configurationType: WidgetConfigurationType } }> | null }> | null };@@ -5808,7 +5809,7 @@ export type FindOneFrontComponentQueryVariables = Exact<{}>;-export type FindOneFrontComponentQuery = { __typename?: 'Query', frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, applicationId: string, builtComponentChecksum: string, applicationTokenPair?: { __typename?: 'ApplicationTokenPair', applicationAccessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, applicationRefreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } | null } | null };+export type FindOneFrontComponentQuery = { __typename?: 'Query', frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, applicationId: string, builtComponentChecksum: string, isHeadless: boolean, applicationTokenPair?: { __typename?: 'ApplicationTokenPair', applicationAccessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, applicationRefreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } | null } | null };export type LogicFunctionFieldsFragment = { __typename?: 'LogicFunction', id: string, name: string, description?: string | null, runtime: string, timeoutSeconds: number, sourceHandlerPath: string, handlerName: string, toolInputSchema?: any | null, isTool: boolean, applicationId?: string | null, createdAt: string, updatedAt: string };@@ -7121,6 +7122,7 @@ export const CommandMenuItemFieldsFragmentDoc = gql`frontComponent {idname+ isHeadless}labelicon@@ -10662,6 +10664,7 @@ export const FindOneFrontComponentDocument = gql`nameapplicationIdbuiltComponentChecksum+ isHeadlessapplicationTokenPair {applicationAccessToken {tokendiff --git a/packages/twenty-front/src/modules/action-menu/actions/components/ActionOpenSidePanelPage.tsx b/packages/twenty-front/src/modules/action-menu/actions/components/ActionOpenSidePanelPage.tsxindex 6482d421f4b..e301a6559ff 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,11 @@ import { ActionDisplay } from '@/action-menu/actions/display/components/ActionDiimport { ActionConfigContext } from '@/action-menu/contexts/ActionConfigContext';import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState';-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 { type CommandMenuPages } from 'twenty-shared/types';import { type IconComponent } from 'twenty-ui/display';export const ActionOpenSidePanelPage = ({diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-agnostic-actions/constants/RecordAgnosticActionsConfig.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-agnostic-actions/constants/RecordAgnosticActionsConfig.tsxindex c157861fb28..042ad9db165 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-agnostic-actions/constants/RecordAgnosticActionsConfig.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-agnostic-actions/constants/RecordAgnosticActionsConfig.tsx@@ -4,8 +4,8 @@ import { type ActionConfig } from '@/action-menu/actions/types/ActionConfig';import { ActionScope } from '@/action-menu/actions/types/ActionScope';import { ActionType } from '@/action-menu/actions/types/ActionType';import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { msg } from '@lingui/core/macro';+import { CommandMenuPages } from 'twenty-shared/types';import { IconHistory, IconSearch, IconSparkles } from 'twenty-ui/display';export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<string, ActionConfig> = {diff --git a/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx b/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsxindex 7ea8faf5b49..304a8d48599 100644--- a/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx+++ b/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx@@ -11,6 +11,7 @@ import { ClientConfigProviderEffect } from '@/client-config/components/ClientConimport { MainContextStoreProvider } from '@/context-store/components/MainContextStoreProvider';import { ErrorMessageEffect } from '@/error-handler/components/ErrorMessageEffect';import { PromiseRejectionEffect } from '@/error-handler/components/PromiseRejectionEffect';+import { HeadlessFrontComponentMountRoot } from '@/front-components/components/HeadlessFrontComponentMountRoot';import { ApolloCoreProvider } from '@/object-metadata/components/ApolloCoreProvider';import { ObjectMetadataItemsLoadEffect } from '@/object-metadata/components/ObjectMetadataItemsLoadEffect';import { ObjectMetadataItemsProvider } from '@/object-metadata/components/ObjectMetadataItemsProvider';@@ -68,6 +69,7 @@ export const AppRouterProviders = () => {<PageFavicon /><Outlet /><GlobalFilePreviewModal />+ <HeadlessFrontComponentMountRoot /></StrictMode></DialogManager></DialogComponentInstanceContext.Provider>diff --git a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsxindex 6cd97dc19f4..ab3b69989e4 100644--- a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx+++ b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx@@ -18,7 +18,6 @@ import { isCaptchaScriptLoadedState } from '@/captcha/states/isCaptchaScriptLoadimport { isCaptchaRequiredForPath } from '@/captcha/utils/isCaptchaRequiredForPath';import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId';import { contextStoreCurrentViewIdComponentState } from '@/context-store/states/contextStoreCurrentViewIdComponentState';import { contextStoreCurrentViewTypeComponentState } from '@/context-store/states/contextStoreCurrentViewTypeComponentState';@@ -37,7 +36,7 @@ import { PageFocusId } from '@/types/PageFocusId';import { useResetFocusStackToFocusItem } from '@/ui/utilities/focus/hooks/useResetFocusStackToFocusItem';import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';-import { AppBasePath, AppPath } from 'twenty-shared/types';+import { AppBasePath, AppPath, CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { AnalyticsType } from '~/generated-metadata/graphql';import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';diff --git a/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts b/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.tsindex 08ee2ff4d6a..790af60cafa 100644--- a/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts+++ b/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts@@ -8,6 +8,7 @@ export const COMMAND_MENU_ITEM_FRAGMENT = gql`frontComponent {idname+ isHeadless}labelicondiff --git a/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemFrontComponentActions.tsx b/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemFrontComponentActions.tsxindex 60b806b098b..d411a0e803b 100644--- a/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemFrontComponentActions.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemFrontComponentActions.tsx@@ -6,6 +6,7 @@ import { useOpenFrontComponentInCommandMenu } from '@/command-menu/hooks/useOpenimport { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';import { contextStoreIsPageInEditModeComponentState } from '@/context-store/states/contextStoreIsPageInEditModeComponentState';import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState';+import { useMountHeadlessFrontComponent } from '@/front-components/hooks/useMountHeadlessFrontComponent';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useContext } from 'react';@@ -35,6 +36,7 @@ type BuildActionFromItemParams = {pageTitle: string;pageIcon: IconComponent;}) => void;+ mountHeadlessFrontComponent: (frontComponentId: string) => void;};const buildActionFromItem = ({@@ -44,11 +46,26 @@ const buildActionFromItem = ({isPinned,getIcon,openFrontComponentInCommandMenu,+ mountHeadlessFrontComponent,}: BuildActionFromItemParams) => {const displayLabel = item.label;const Icon = getIcon(item.icon, COMMAND_MENU_DEFAULT_ICON);+ const isHeadless = item.frontComponent?.isHeadless === true;++ const handleClick = () => {+ if (isHeadless) {+ mountHeadlessFrontComponent(item.frontComponentId);+ } else {+ openFrontComponentInCommandMenu({+ frontComponentId: item.frontComponentId,+ pageTitle: displayLabel,+ pageIcon: Icon,+ });+ }+ };+return {type: ActionType.FrontComponent,key: `command-menu-item-front-component-${item.id}`,@@ -61,14 +78,8 @@ const buildActionFromItem = ({shouldBeRegistered: () => true,component: (<Action- onClick={() =>- openFrontComponentInCommandMenu({- frontComponentId: item.frontComponentId,- pageTitle: displayLabel,- pageIcon: Icon,- })- }- closeSidePanelOnCommandMenuListActionExecution={false}+ onClick={handleClick}+ closeSidePanelOnCommandMenuListActionExecution={isHeadless}/>),};@@ -78,6 +89,7 @@ export const useCommandMenuItemFrontComponentActions = () => {const { getIcon } = useIcons();const { openFrontComponentInCommandMenu } =useOpenFrontComponentInCommandMenu();+ const mountHeadlessFrontComponent = useMountHeadlessFrontComponent();const isPageInEditMode = useRecoilComponentValue(contextStoreIsPageInEditModeComponentState,@@ -140,6 +152,7 @@ export const useCommandMenuItemFrontComponentActions = () => {isPinned: !isPageInEditMode && item.isPinned,getIcon,openFrontComponentInCommandMenu,+ mountHeadlessFrontComponent,}),);@@ -151,6 +164,7 @@ export const useCommandMenuItemFrontComponentActions = () => {isPinned: !isPageInEditMode && item.isPinned,getIcon,openFrontComponentInCommandMenu,+ mountHeadlessFrontComponent,}),);diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuContextChip.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuContextChip.tsxindex 93ce4906732..bd101ddbaeb 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuContextChip.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuContextChip.tsx@@ -1,8 +1,8 @@-import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import styled from '@emotion/styled';import { t } from '@lingui/core/macro';import { isNonEmptyString } from '@sniptt/guards';import { Fragment } from 'react/jsx-runtime';+import { type CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { OverflowingTextWithTooltip } from 'twenty-ui/display';diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageInfo.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageInfo.tsxindex ec1ff212514..87bb1d21c0e 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageInfo.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageInfo.tsx@@ -10,11 +10,11 @@ import { CommandMenuObjectViewRecordInfo } from '@/command-menu/components/Commaimport { CommandMenuPageLayoutInfo } from '@/command-menu/components/CommandMenuPageLayoutInfo';import { CommandMenuRecordInfo } from '@/command-menu/components/CommandMenuRecordInfo';import { CommandMenuWorkflowStepInfo } from '@/command-menu/components/CommandMenuWorkflowStepInfo';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { NavigationMenuItemType } from '@/navigation-menu-item/constants/NavigationMenuItemType';import { useWorkspaceSectionItems } from '@/navigation-menu-item/hooks/useWorkspaceSectionItems';import { selectedNavigationMenuItemInEditModeStateV2 } from '@/navigation-menu-item/states/selectedNavigationMenuItemInEditModeStateV2';import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';+import { CommandMenuPages } from 'twenty-shared/types';import { type CommandMenuContextChipProps } from './CommandMenuContextChip';diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageLayoutInfoContent.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageLayoutInfoContent.tsxindex 569f4bc4a55..ed38acedac8 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageLayoutInfoContent.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuPageLayoutInfoContent.tsx@@ -3,7 +3,6 @@ import { useUpdateCommandMenuPageInfo } from '@/command-menu/hooks/useUpdateCommimport { commandMenuPageInfoState } from '@/command-menu/states/commandMenuPageInfoState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';import { commandMenuShouldFocusTitleInputComponentState } from '@/command-menu/states/commandMenuShouldFocusTitleInputComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useUpdatePageLayoutTab } from '@/page-layout/hooks/useUpdatePageLayoutTab';import { useUpdatePageLayoutWidget } from '@/page-layout/hooks/useUpdatePageLayoutWidget';import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';@@ -16,6 +15,7 @@ import { useTheme } from '@emotion/react';import { isNonEmptyString } from '@sniptt/guards';import { useState } from 'react';import { useRecoilValue } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useIcons } from 'twenty-ui/display';import { CommandMenuPageInfoLayout } from './CommandMenuPageInfoLayout';diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsxindex f8cdeabe8d3..5bb58a09785 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx@@ -11,7 +11,6 @@ import { useCommandMenuContextChips } from '@/command-menu/hooks/useCommandMenuCimport { commandMenuNavigationStackState } from '@/command-menu/states/commandMenuNavigationStackState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';@@ -21,6 +20,7 @@ import { useLingui } from '@lingui/react/macro';import { AnimatePresence, motion } from 'framer-motion';import { useRef } from 'react';import { useRecoilState, useRecoilValue } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { IconX } from 'twenty-ui/display';import { IconButton } from 'twenty-ui/input';import { useIsMobile } from 'twenty-ui/utilities';diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarInputFocusEffect.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarInputFocusEffect.tsxindex 74da53d4282..fec745d997f 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarInputFocusEffect.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarInputFocusEffect.tsx@@ -1,8 +1,8 @@import { useRecoilValue } from 'recoil';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useEffect } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';type CommandMenuTopBarInputFocusEffectProps = {inputRef: React.RefObject<HTMLInputElement>;diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarRightCornerIcon.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarRightCornerIcon.tsxindex 68759dee451..29683399097 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarRightCornerIcon.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBarRightCornerIcon.tsx@@ -1,10 +1,10 @@import { useOpenAskAIPageInCommandMenu } from '@/command-menu/hooks/useOpenAskAIPageInCommandMenu';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import styled from '@emotion/styled';import { t } from '@lingui/core/macro';import { useRecoilValue } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { IconEdit, IconSparkles } from 'twenty-ui/display';import { IconButton } from 'twenty-ui/input';import { useIsMobile } from 'twenty-ui/utilities';diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuWorkflowStepInfo.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuWorkflowStepInfo.tsxindex e9ed92830b9..a0bb489b911 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuWorkflowStepInfo.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuWorkflowStepInfo.tsx@@ -2,7 +2,6 @@ import { useUpdateCommandMenuPageInfo } from '@/command-menu/hooks/useUpdateCommimport { useCommandMenuWorkflowIdOrThrow } from '@/command-menu/pages/workflow/hooks/useCommandMenuWorkflowIdOrThrow';import { commandMenuWorkflowStepIdComponentState } from '@/command-menu/pages/workflow/states/commandMenuWorkflowStepIdComponentState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';import { TitleInput } from '@/ui/input/components/TitleInput';@@ -22,6 +21,7 @@ import { useTheme } from '@emotion/react';import { t } from '@lingui/core/macro';import { useState } from 'react';import { useRecoilValue } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';import { useIcons } from 'twenty-ui/display';diff --git a/packages/twenty-front/src/modules/command-menu/components/__stories__/CommandMenu.stories.tsx b/packages/twenty-front/src/modules/command-menu/components/__stories__/CommandMenu.stories.tsxindex a5056915db5..65dc4ae5cfa 100644--- a/packages/twenty-front/src/modules/command-menu/components/__stories__/CommandMenu.stories.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/__stories__/CommandMenu.stories.tsx@@ -28,12 +28,12 @@ import { COMMAND_MENU_COMPONENT_INSTANCE_ID } from '@/command-menu/constants/Comimport { SIDE_PANEL_FOCUS_ID } from '@/command-menu/constants/SidePanelFocusId';import { commandMenuNavigationStackState } from '@/command-menu/states/commandMenuNavigationStackState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';import { RecordComponentInstanceContextsWrapper } from '@/object-record/components/RecordComponentInstanceContextsWrapper';import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';import { HttpResponse, graphql } from 'msw';+import { CommandMenuPages } from 'twenty-shared/types';import { IconDotsVertical } from 'twenty-ui/display';import { JestContextStoreSetter } from '~/testing/jest/JestContextStoreSetter';diff --git a/packages/twenty-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.ts b/packages/twenty-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.tsindex 3a8df0a0a11..1a5c44269cc 100644--- a/packages/twenty-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.ts+++ b/packages/twenty-front/src/modules/command-menu/components/hooks/usePageLayoutHeaderInfo.ts@@ -1,11 +1,11 @@import { GRAPH_TYPE_INFORMATION } from '@/command-menu/pages/page-layout/constants/GraphTypeInformation';import { getCurrentGraphTypeFromConfig } from '@/command-menu/pages/page-layout/utils/getCurrentGraphTypeFromConfig';import { isWidgetConfigurationOfTypeGraph } from '@/command-menu/pages/page-layout/utils/isWidgetConfigurationOfTypeGraph';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';import { useTheme } from '@emotion/react';import { t } from '@lingui/core/macro';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {IconAppWindow,diff --git a/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx b/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsxindex 272810176d6..dc30d3e7176 100644--- a/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx+++ b/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx@@ -24,7 +24,7 @@ import { CommandMenuWorkflowEditStepType } from '@/command-menu/pages/workflow/simport { CommandMenuWorkflowRunViewStep } from '@/command-menu/pages/workflow/step/view-run/components/CommandMenuWorkflowRunViewStep';import { CommandMenuWorkflowViewStep } from '@/command-menu/pages/workflow/step/view/components/CommandMenuWorkflowViewStep';import { CommandMenuWorkflowSelectTriggerType } from '@/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerType';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';export const COMMAND_MENU_PAGES_CONFIG = new Map<CommandMenuPages,diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenu.test.tsxindex bb674f32769..3aaa5e2ab8f 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenu.test.tsx@@ -8,7 +8,7 @@ import { commandMenuNavigationStackState } from '@/command-menu/states/commandMeimport { commandMenuPageInfoState } from '@/command-menu/states/commandMenuPageInfoState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import { IconDotsVertical } from 'twenty-ui/display';const Wrapper = ({ children }: { children: React.ReactNode }) => (diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuCloseAnimationCompleteCleanup.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuCloseAnimationCompleteCleanup.test.tsxindex 095e20884c4..cca8a59ea57 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuCloseAnimationCompleteCleanup.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuCloseAnimationCompleteCleanup.test.tsx@@ -15,8 +15,8 @@ import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchSimport { hasUserSelectedCommandState } from '@/command-menu/states/hasUserSelectedCommandState';import { isCommandMenuClosingState } from '@/command-menu/states/isCommandMenuClosingState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';+import { CommandMenuPages } from 'twenty-shared/types';import { IconList } from 'twenty-ui/display';const mockCloseDropdown = jest.fn();diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuHistory.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuHistory.test.tsxindex efef9a91a83..74d7dd5442f 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuHistory.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useCommandMenuHistory.test.tsx@@ -10,7 +10,7 @@ import { commandMenuNavigationStackState } from '@/command-menu/states/commandMeimport { commandMenuPageInfoState } from '@/command-menu/states/commandMenuPageInfoState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import { IconList, IconSearch } from 'twenty-ui/display';const Wrapper = ({ children }: { children: React.ReactNode }) => (diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useNavigateCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useNavigateCommandMenu.test.tsxindex baf558c6b24..bad5eb1fa0f 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useNavigateCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useNavigateCommandMenu.test.tsx@@ -7,8 +7,8 @@ import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMimport { commandMenuNavigationStackState } from '@/command-menu/states/commandMenuNavigationStackState';import { commandMenuPageInfoState } from '@/command-menu/states/commandMenuPageInfoState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';+import { CommandMenuPages } from 'twenty-shared/types';import { Icon123, useIcons } from 'twenty-ui/display';import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenAskAIPageInCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenAskAIPageInCommandMenu.test.tsxindex 514e110f90b..41223c0f64a 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenAskAIPageInCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenAskAIPageInCommandMenu.test.tsx@@ -1,12 +1,12 @@-import { renderHook, act } from '@testing-library/react';+import { act, renderHook } from '@testing-library/react';import { Provider as JotaiProvider } from 'jotai';import { type ReactNode } from 'react';import { RecoilRoot } from 'recoil';-import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useOpenAskAIPageInCommandMenu } from '@/command-menu/hooks/useOpenAskAIPageInCommandMenu';+import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';+import { CommandMenuPages } from 'twenty-shared/types';import { IconSparkles } from 'twenty-ui/display';const navigateCommandMenuMock = jest.fn();diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenCalendarEventInCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenCalendarEventInCommandMenu.test.tsxindex dc7b79af3ac..0be5b688eab 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenCalendarEventInCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenCalendarEventInCommandMenu.test.tsx@@ -4,9 +4,9 @@ import { act } from 'react';import { COMMAND_MENU_COMPONENT_INSTANCE_ID } from '@/command-menu/constants/CommandMenuComponentInstanceId';import { useOpenCalendarEventInCommandMenu } from '@/command-menu/hooks/useOpenCalendarEventInCommandMenu';import { viewableRecordIdComponentState } from '@/command-menu/pages/record-page/states/viewableRecordIdComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';+import { CommandMenuPages } from 'twenty-shared/types';import { IconCalendarEvent } from 'twenty-ui/display';import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenEmailThreadInCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenEmailThreadInCommandMenu.test.tsxindex ffa4cad18f9..8597d04a8a4 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenEmailThreadInCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenEmailThreadInCommandMenu.test.tsx@@ -4,9 +4,9 @@ import { act } from 'react';import { COMMAND_MENU_COMPONENT_INSTANCE_ID } from '@/command-menu/constants/CommandMenuComponentInstanceId';import { useOpenEmailThreadInCommandMenu } from '@/command-menu/hooks/useOpenEmailThreadInCommandMenu';import { viewableRecordIdComponentState } from '@/command-menu/pages/record-page/states/viewableRecordIdComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';+import { CommandMenuPages } from 'twenty-shared/types';import { IconMail } from 'twenty-ui/display';import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenRecordInCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenRecordInCommandMenu.test.tsxindex afe012bf6e4..13d927f87e7 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenRecordInCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenRecordInCommandMenu.test.tsx@@ -8,13 +8,13 @@ import { viewableRecordIdComponentState } from '@/command-menu/pages/record-pageimport { viewableRecordNameSingularComponentState } from '@/command-menu/pages/record-page/states/viewableRecordNameSingularComponentState';import { commandMenuNavigationMorphItemsByPageState } from '@/command-menu/states/commandMenuNavigationMorphItemsByPageState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';import { contextStoreCurrentViewTypeComponentState } from '@/context-store/states/contextStoreCurrentViewTypeComponentState';import { contextStoreNumberOfSelectedRecordsComponentState } from '@/context-store/states/contextStoreNumberOfSelectedRecordsComponentState';import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState';import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';+import { CommandMenuPages } from 'twenty-shared/types';import { useIcons } from 'twenty-ui/display';import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useUpdateCommandMenuPageInfo.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useUpdateCommandMenuPageInfo.test.tsxindex 25be05a3d5d..5d723946bb0 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useUpdateCommandMenuPageInfo.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useUpdateCommandMenuPageInfo.test.tsx@@ -1,10 +1,10 @@import { useUpdateCommandMenuPageInfo } from '@/command-menu/hooks/useUpdateCommandMenuPageInfo';import { commandMenuNavigationStackState } from '@/command-menu/states/commandMenuNavigationStackState';import { commandMenuPageInfoState } from '@/command-menu/states/commandMenuPageInfoState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { renderHook } from '@testing-library/react';import { act } from 'react';import { RecoilRoot, useRecoilValue } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { IconArrowDown, IconDotsVertical } from 'twenty-ui/display';const mockedPageInfo = {diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsxindex b4aae2f0e8c..cf6707e93b1 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx@@ -2,13 +2,13 @@ import { renderHook } from '@testing-library/react';import { useRecoilValue } from 'recoil';import { COMMAND_MENU_COMPONENT_INSTANCE_ID } from '@/command-menu/constants/CommandMenuComponentInstanceId';+import { useWorkflowCommandMenu } from '@/command-menu/hooks/useWorkflowCommandMenu';import { viewableRecordIdComponentState } from '@/command-menu/pages/record-page/states/viewableRecordIdComponentState';import { viewableRecordNameSingularComponentState } from '@/command-menu/pages/record-page/states/viewableRecordNameSingularComponentState';import { commandMenuWorkflowIdComponentState } from '@/command-menu/pages/workflow/states/commandMenuWorkflowIdComponentState';import { commandMenuWorkflowVersionIdComponentState } from '@/command-menu/pages/workflow/states/commandMenuWorkflowVersionIdComponentState';import { commandMenuNavigationMorphItemsByPageState } from '@/command-menu/states/commandMenuNavigationMorphItemsByPageState';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';import { contextStoreCurrentViewTypeComponentState } from '@/context-store/states/contextStoreCurrentViewTypeComponentState';import { contextStoreNumberOfSelectedRecordsComponentState } from '@/context-store/states/contextStoreNumberOfSelectedRecordsComponentState';@@ -17,10 +17,10 @@ import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewTypeimport { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { t } from '@lingui/core/macro';import { act } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';import { IconBolt, IconSettingsAutomation, useIcons } from 'twenty-ui/display';import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';-import { useWorkflowCommandMenu } from '@/command-menu/hooks/useWorkflowCommandMenu';jest.mock('uuid', () => ({v4: jest.fn().mockReturnValue('mocked-uuid'),diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.tsindex caf418c819a..c495ace9281 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts@@ -6,14 +6,14 @@ import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchSimport { isCommandMenuClosingState } from '@/command-menu/states/isCommandMenuClosingState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { addToNavPayloadRegistryStateV2 } from '@/navigation-menu-item/states/addToNavPayloadRegistryStateV2';import { useCloseAnyOpenDropdown } from '@/ui/layout/dropdown/hooks/useCloseAnyOpenDropdown';import { emitSidePanelOpenEvent } from '@/ui/layout/right-drawer/utils/emitSidePanelOpenEvent';-import { useStore } from 'jotai';import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';import { t } from '@lingui/core/macro';+import { useStore } from 'jotai';import { useCallback } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';import { IconDotsVertical } from 'twenty-ui/display';export const useCommandMenu = () => {diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuCloseAnimationCompleteCleanup.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuCloseAnimationCompleteCleanup.tsindex 8926d4f13b7..9a3bf3b7982 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuCloseAnimationCompleteCleanup.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuCloseAnimationCompleteCleanup.ts@@ -12,7 +12,6 @@ import { hasUserSelectedCommandState } from '@/command-menu/states/hasUserSelectimport { isCommandMenuClosingState } from '@/command-menu/states/isCommandMenuClosingState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState';import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';@@ -28,6 +27,7 @@ import { WORKFLOW_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID } from '@/workflow/workflimport { WorkflowLogicFunctionTabId } from '@/workflow/workflow-steps/workflow-actions/code-action/types/WorkflowLogicFunctionTabId';import { useStore } from 'jotai';import { useRecoilCallback } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';export const useCommandMenuCloseAnimationCompleteCleanup = () => {diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuContextChips.tsx b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuContextChips.tsxindex f0597f598ec..883fcdff181 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuContextChips.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuContextChips.tsx@@ -2,7 +2,7 @@ import { CommandMenuContextRecordChipAvatars } from '@/command-menu/components/Cimport { useCommandMenuHistory } from '@/command-menu/hooks/useCommandMenuHistory';import { commandMenuNavigationMorphItemsByPageState } from '@/command-menu/states/commandMenuNavigationMorphItemsByPageState';import { commandMenuNavigationStackState } from '@/command-menu/states/commandMenuNavigationStackState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';import { recordStoreIdentifiersFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreIdentifiersSelector';import { recordStoreRecordsSelector } from '@/object-record/record-store/states/selectors/recordStoreRecordsSelector';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.tsindex 5b42cf9870e..e0cd2dfc099 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts@@ -7,7 +7,6 @@ import { useOpenRecordsSearchPageInCommandMenu } from '@/command-menu/hooks/useOimport { useSetGlobalCommandMenuContext } from '@/command-menu/hooks/useSetGlobalCommandMenuContext';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState';import { useKeyboardShortcutMenu } from '@/keyboard-shortcut-menu/hooks/useKeyboardShortcutMenu';import { useGlobalHotkeys } from '@/ui/utilities/hotkey/hooks/useGlobalHotkeys';@@ -17,6 +16,7 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { isNonEmptyString } from '@sniptt/guards';import { useRecoilValue } from 'recoil';import { Key } from 'ts-key-enum';+import { CommandMenuPages } from 'twenty-shared/types';import { FeatureFlagKey } from '~/generated-metadata/graphql';export const useCommandMenuHotKeys = () => {diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useNavigateCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useNavigateCommandMenu.tsindex f21e784b1ed..e49d7387244 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useNavigateCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useNavigateCommandMenu.ts@@ -11,12 +11,12 @@ import { hasUserSelectedCommandState } from '@/command-menu/states/hasUserSelectimport { isCommandMenuClosingState } from '@/command-menu/states/isCommandMenuClosingState';import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState';import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';-import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId';import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';import { useStore } from 'jotai';import { useRecoilCallback } from 'recoil';+import { type CommandMenuPages } from 'twenty-shared/types';import { type IconComponent } from 'twenty-ui/display';import { v4 } from 'uuid';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenAskAIPageInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenAskAIPageInCommandMenu.tsindex 1f64488de77..90b564f3522 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenAskAIPageInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenAskAIPageInCommandMenu.ts@@ -1,9 +1,9 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';import { t } from '@lingui/core/macro';import { useCallback } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';import { IconSparkles } from 'twenty-ui/display';import { v4 } from 'uuid';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenCalendarEventInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenCalendarEventInCommandMenu.tsindex 08e63f7d96c..184178d19d6 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenCalendarEventInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenCalendarEventInCommandMenu.ts@@ -1,10 +1,10 @@import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';import { viewableRecordIdComponentState } from '@/command-menu/pages/record-page/states/viewableRecordIdComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { t } from '@lingui/core/macro';import { useRecoilCallback } from 'recoil';-import { v4 } from 'uuid';+import { CommandMenuPages } from 'twenty-shared/types';import { IconCalendarEvent } from 'twenty-ui/display';+import { v4 } from 'uuid';export const useOpenCalendarEventInCommandMenu = () => {const { navigateCommandMenu } = useNavigateCommandMenu();diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenEmailThreadInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenEmailThreadInCommandMenu.tsindex 1720d75d7a3..565415bf082 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenEmailThreadInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenEmailThreadInCommandMenu.ts@@ -1,10 +1,10 @@import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';import { viewableRecordIdComponentState } from '@/command-menu/pages/record-page/states/viewableRecordIdComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { t } from '@lingui/core/macro';import { useRecoilCallback } from 'recoil';-import { v4 } from 'uuid';+import { CommandMenuPages } from 'twenty-shared/types';import { IconMail } from 'twenty-ui/display';+import { v4 } from 'uuid';export const useOpenEmailThreadInCommandMenu = () => {const { navigateCommandMenu } = useNavigateCommandMenu();diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenFrontComponentInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenFrontComponentInCommandMenu.tsindex 13ef5055096..22ccc914cf9 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenFrontComponentInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenFrontComponentInCommandMenu.ts@@ -1,7 +1,7 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { viewableFrontComponentIdComponentState } from '@/command-menu/pages/front-component/states/viewableFrontComponentIdComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useRecoilCallback } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { type IconComponent } from 'twenty-ui/display';import { v4 } from 'uuid';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenMergeRecordsPageInCommandMenu.tsx b/packages/twenty-front/src/modules/command-menu/hooks/useOpenMergeRecordsPageInCommandMenu.tsxindex 009e385f33e..cf939c86b50 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenMergeRecordsPageInCommandMenu.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenMergeRecordsPageInCommandMenu.tsx@@ -1,10 +1,10 @@import { useCommandMenuUpdateNavigationMorphItemsByPage } from '@/command-menu/hooks/useCommandMenuUpdateNavigationMorphItemsByPage';import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';import { useLazyFindManyRecords } from '@/object-record/hooks/useLazyFindManyRecords';import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';+import { CommandMenuPages } from 'twenty-shared/types';import { msg, t } from '@lingui/core/macro';import { useRecoilCallback } from 'recoil';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.tsindex c881ba9e2e6..5f5135d4928 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts@@ -3,7 +3,6 @@ import { viewableRecordIdComponentState } from '@/command-menu/pages/record-pageimport { viewableRecordNameSingularComponentState } from '@/command-menu/pages/record-page/states/viewableRecordNameSingularComponentState';import { commandMenuNavigationMorphItemsByPageState } from '@/command-menu/states/commandMenuNavigationMorphItemsByPageState';import { commandMenuNavigationStackState } from '@/command-menu/states/commandMenuNavigationStackState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId';import { contextStoreCurrentObjectMetadataItemIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataItemIdComponentState';import { contextStoreCurrentViewIdComponentState } from '@/context-store/states/contextStoreCurrentViewIdComponentState';@@ -17,6 +16,7 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSiimport { getIconColorForObjectType } from '@/object-metadata/utils/getIconColorForObjectType';import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';+import { CommandMenuPages } from 'twenty-shared/types';import { useRunWorkflowRunOpeningInCommandMenuSideEffects } from '@/workflow/hooks/useRunWorkflowRunOpeningInCommandMenuSideEffects';import { useTheme } from '@emotion/react';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordsSearchPageInCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordsSearchPageInCommandMenu.tsindex f0051db1d94..f6d8be0f1b8 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordsSearchPageInCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordsSearchPageInCommandMenu.ts@@ -1,10 +1,10 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { isCommandMenuOpenedStateV2 } from '@/command-menu/states/isCommandMenuOpenedStateV2';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';import { t } from '@lingui/core/macro';-import { v4 } from 'uuid';+import { CommandMenuPages } from 'twenty-shared/types';import { IconSearch } from 'twenty-ui/display';+import { v4 } from 'uuid';export const useOpenRecordsSearchPageInCommandMenu = () => {const { navigateCommandMenu } = useCommandMenu();diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useOpenUpdateMultipleRecordsPageInCommandMenu.tsx b/packages/twenty-front/src/modules/command-menu/hooks/useOpenUpdateMultipleRecordsPageInCommandMenu.tsxindex c59daadf8bf..bfbfaa9a8d6 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useOpenUpdateMultipleRecordsPageInCommandMenu.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/useOpenUpdateMultipleRecordsPageInCommandMenu.tsx@@ -1,5 +1,5 @@import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import { msg, t } from '@lingui/core/macro';import { useRecoilCallback } from 'recoil';diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useRichTextCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useRichTextCommandMenu.tsindex 42b0b5c43cc..87b0629d8e3 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useRichTextCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useRichTextCommandMenu.ts@@ -1,9 +1,9 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { viewableRichTextComponentStateV2 } from '@/command-menu/pages/rich-text-page/states/viewableRichTextComponentStateV2';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';-import { useStore } from 'jotai';import { t } from '@lingui/core/macro';+import { useStore } from 'jotai';import { useCallback } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';import { IconPencil } from 'twenty-ui/display';export const useRichTextCommandMenu = () => {diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.tsindex 397d88e8131..c3d1f27a24d 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts+++ b/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts@@ -3,12 +3,12 @@ import { commandMenuWorkflowIdComponentState } from '@/command-menu/pages/workflimport { commandMenuWorkflowRunIdComponentState } from '@/command-menu/pages/workflow/states/commandMenuWorkflowRunIdComponentState';import { commandMenuWorkflowStepIdComponentState } from '@/command-menu/pages/workflow/states/commandMenuWorkflowStepIdComponentState';import { commandMenuWorkflowVersionIdComponentState } from '@/command-menu/pages/workflow/states/commandMenuWorkflowVersionIdComponentState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { type WorkflowRunStepStatus } from '@/workflow/types/Workflow';import { useSetInitialWorkflowRunRightDrawerTab } from '@/workflow/workflow-diagram/hooks/useSetInitialWorkflowRunRightDrawerTab';import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeComponentState';import { t } from '@lingui/core/macro';import { useRecoilCallback } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {IconBolt,diff --git a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/hooks/useNavigationMenuItemEditOrganizeActions.ts b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/hooks/useNavigationMenuItemEditOrganizeActions.tsindex cc8f47c04b7..d5a84059880 100644--- a/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/hooks/useNavigationMenuItemEditOrganizeActions.ts+++ b/packages/twenty-front/src/modules/command-menu/pages/navigation-menu-item/hooks/useNavigationMenuItemEditOrganizeActions.ts@@ -5,15 +5,15 @@ import { IconPlus } from 'twenty-ui/display';import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';import { type OrganizeActionsProps } from '@/command-menu/pages/navigation-menu-item/components/CommandMenuEditOrganizeActions';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useNavigationMenuItemMoveRemove } from '@/navigation-menu-item/hooks/useNavigationMenuItemMoveRemove';import { useNavigationMenuItemsDraftState } from '@/navigation-menu-item/hooks/useNavigationMenuItemsDraftState';import { useWorkspaceSectionItems } from '@/navigation-menu-item/hooks/useWorkspaceSectionItems';import { addMenuItemInsertionContextStateV2 } from '@/navigation-menu-item/states/addMenuItemInsertionContextStateV2';import { selectedNavigationMenuItemInEditModeStateV2 } from '@/navigation-menu-item/states/selectedNavigationMenuItemInEditModeStateV2';+import { type AddMenuItemInsertionContext } from '@/navigation-menu-item/types/AddMenuItemInsertionContext';import { useRecoilValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilValueV2';import { useSetRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoilStateV2';-import { type AddMenuItemInsertionContext } from '@/navigation-menu-item/types/AddMenuItemInsertionContext';+import { CommandMenuPages } from 'twenty-shared/types';const getAddMenuItemInsertionContext = (selectedItem: { id: string; folderId?: string | null },diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutFieldsSettings.tsx b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutFieldsSettings.tsxindex fbe96d4951b..5cde68619a3 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutFieldsSettings.tsx+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutFieldsSettings.tsx@@ -5,11 +5,11 @@ import { WidgetSettingsFooter } from '@/command-menu/pages/page-layout/componentimport { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';import { usePageLayoutIdForRecordPageLayoutFromContextStoreTargetedRecord } from '@/command-menu/pages/page-layout/hooks/usePageLayoutIdForRecordPageLayoutFromContextStoreTargetedRecord';import { useWidgetInEditMode } from '@/command-menu/pages/page-layout/hooks/useWidgetInEditMode';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useFieldsWidgetGroups } from '@/page-layout/widgets/fields/hooks/useFieldsWidgetGroups';import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { IconLayoutSidebarRight } from 'twenty-ui/display';import { type FieldsConfiguration } from '~/generated-metadata/graphql';diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutWidgetTypeSelect.tsx b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutWidgetTypeSelect.tsxindex daa26ae9e7d..d47b65d5b7e 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutWidgetTypeSelect.tsx+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutWidgetTypeSelect.tsx@@ -6,7 +6,6 @@ import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layoimport { usePageLayoutIdFromContextStoreTargetedRecord } from '@/command-menu/pages/page-layout/hooks/usePageLayoutFromContextStoreTargetedRecord';import { getFrontComponentWidgetTypeSelectItemId } from '@/command-menu/pages/page-layout/utils/getFrontComponentWidgetTypeSelectItemId';import { isExistingWidgetMissingOrDifferentType } from '@/command-menu/pages/page-layout/utils/isExistingWidgetMissingOrDifferentType';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { FIND_MANY_FRONT_COMPONENTS } from '@/front-components/graphql/queries/findManyFrontComponents';import { useCreatePageLayoutFrontComponentWidget } from '@/page-layout/hooks/useCreatePageLayoutFrontComponentWidget';import { useCreatePageLayoutGraphWidget } from '@/page-layout/hooks/useCreatePageLayoutGraphWidget';@@ -22,6 +21,7 @@ import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hoimport { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useQuery } from '@apollo/client';import { t } from '@lingui/core/macro';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {IconAlignBoxLeftTop,diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/chart-settings/ChartSettingItem.tsx b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/chart-settings/ChartSettingItem.tsxindex d519ac951f7..90e8a498056 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/chart-settings/ChartSettingItem.tsx+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/chart-settings/ChartSettingItem.tsx@@ -14,7 +14,6 @@ import { type ChartConfiguration } from '@/command-menu/pages/page-layout/types/import { CHART_CONFIGURATION_SETTING_IDS } from '@/command-menu/pages/page-layout/types/ChartConfigurationSettingIds';import { type ChartSettingsItem } from '@/command-menu/pages/page-layout/types/ChartSettingsGroup';import { isMinMaxRangeValid } from '@/command-menu/pages/page-layout/utils/isMinMaxRangeValid';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { useCloseAnyOpenDropdown } from '@/ui/layout/dropdown/hooks/useCloseAnyOpenDropdown';import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';@@ -22,6 +21,7 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selecimport { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';import { t } from '@lingui/core/macro';import { isString } from '@sniptt/guards';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';type ChartSettingItemProps = {diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/types/PageLayoutCommandMenuPage.ts b/packages/twenty-front/src/modules/command-menu/pages/page-layout/types/PageLayoutCommandMenuPage.tsindex c0c0c5e7d30..02c64c6a611 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/types/PageLayoutCommandMenuPage.ts+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/types/PageLayoutCommandMenuPage.ts@@ -1,4 +1,4 @@-import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { type CommandMenuPages } from 'twenty-shared/types';export type PageLayoutCommandMenuPage =| CommandMenuPages.PageLayoutWidgetTypeSelectdiff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutIcon.ts b/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutIcon.tsindex 73789d114e5..53478c30fc3 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutIcon.ts+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutIcon.ts@@ -1,5 +1,5 @@import { type PageLayoutCommandMenuPage } from '@/command-menu/pages/page-layout/types/PageLayoutCommandMenuPage';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import { assertUnreachable } from 'twenty-shared/utils';import {IconAppWindow,diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutPageTitle.ts b/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutPageTitle.tsindex 97d9d218526..a9c07bd1b16 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutPageTitle.ts+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/utils/getPageLayoutPageTitle.ts@@ -1,6 +1,6 @@import { type PageLayoutCommandMenuPage } from '@/command-menu/pages/page-layout/types/PageLayoutCommandMenuPage';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { t } from '@lingui/core/macro';+import { CommandMenuPages } from 'twenty-shared/types';import { assertUnreachable } from 'twenty-shared/utils';export const getPageLayoutPageTitle = (page: PageLayoutCommandMenuPage) => {diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.tsindex baef93b4653..312e979e29f 100644--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts@@ -1,6 +1,6 @@-import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages';-import { type IconComponent } from 'twenty-ui/display';import { createState } from '@/ui/utilities/state/utils/createState';+import { type CommandMenuPages } from 'twenty-shared/types';+import { type IconComponent } from 'twenty-ui/display';export type CommandMenuNavigationStackItem = {page: CommandMenuPages;diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.tsindex e76205f3080..bdf20a5a697 100644--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts@@ -1,5 +1,5 @@-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { createState } from '@/ui/utilities/state/utils/createState';+import { CommandMenuPages } from 'twenty-shared/types';export const commandMenuPageState = createState<CommandMenuPages>({key: 'command-menu/commandMenuPageState',diff --git a/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx b/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsxindex f9e852bf3b8..8b5fd2eb92e 100644--- a/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx+++ b/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx@@ -20,7 +20,7 @@ export const FrontComponentRenderer = ({const theme = useTheme();const { enqueueErrorSnackBar } = useSnackBar();const { executionContext, frontComponentHostCommunicationApi } =- useFrontComponentExecutionContext();+ useFrontComponentExecutionContext({ frontComponentId });const handleError = useCallback((error?: Error) => {diff --git a/packages/twenty-front/src/modules/front-components/components/HeadlessFrontComponentMountRoot.tsx b/packages/twenty-front/src/modules/front-components/components/HeadlessFrontComponentMountRoot.tsxnew file mode 100644index 00000000000..211e3ef4fb6--- /dev/null+++ b/packages/twenty-front/src/modules/front-components/components/HeadlessFrontComponentMountRoot.tsx@@ -0,0 +1,31 @@+import { Suspense, lazy } from 'react';++import { useRecoilValue } from 'recoil';++import { mountedHeadlessFrontComponentIdsState } from '@/front-components/states/mountedHeadlessFrontComponentIdsState';++const FrontComponentRenderer = lazy(() =>+ import('@/front-components/components/FrontComponentRenderer').then(+ (module) => ({ default: module.FrontComponentRenderer }),+ ),+);++export const HeadlessFrontComponentMountRoot = () => {+ const mountedHeadlessFrontComponentIds = useRecoilValue(+ mountedHeadlessFrontComponentIdsState,+ );++ if (mountedHeadlessFrontComponentIds.size === 0) {+ return null;+ }++ return (+ <>+ {[...mountedHeadlessFrontComponentIds].map((frontComponentId) => (+ <Suspense key={frontComponentId} fallback={null}>+ <FrontComponentRenderer frontComponentId={frontComponentId} />+ </Suspense>+ ))}+ </>+ );+};diff --git a/packages/twenty-front/src/modules/front-components/graphql/queries/findOneFrontComponent.ts b/packages/twenty-front/src/modules/front-components/graphql/queries/findOneFrontComponent.tsindex af80db411de..99d530bc887 100644--- a/packages/twenty-front/src/modules/front-components/graphql/queries/findOneFrontComponent.ts+++ b/packages/twenty-front/src/modules/front-components/graphql/queries/findOneFrontComponent.ts@@ -7,6 +7,7 @@ export const FIND_ONE_FRONT_COMPONENT = gql`nameapplicationIdbuiltComponentChecksum+ isHeadlessapplicationTokenPair {applicationAccessToken {tokendiff --git a/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts b/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.tsindex 77e12464a75..78a3cd3bddd 100644--- a/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts+++ b/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts@@ -1,4 +1,4 @@-import { useRecoilValue } from 'recoil';+import { useRecoilValue, useSetRecoilState } from 'recoil';import {type FrontComponentExecutionContext,type FrontComponentHostCommunicationApi,@@ -6,14 +6,26 @@ import {import { type AppPath } from 'twenty-shared/types';import { currentUserState } from '@/auth/states/currentUserState';+import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';+import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState';+import { useUnmountHeadlessFrontComponent } from '@/front-components/hooks/useUnmountHeadlessFrontComponent';+import { useIcons } from 'twenty-ui/display';import { useNavigateApp } from '~/hooks/useNavigateApp';-export const useFrontComponentExecutionContext = (): {+export const useFrontComponentExecutionContext = ({+ frontComponentId,+}: {+ frontComponentId: string;+}): {executionContext: FrontComponentExecutionContext;frontComponentHostCommunicationApi: FrontComponentHostCommunicationApi;} => {const currentUser = useRecoilValue(currentUserState);const navigateApp = useNavigateApp();+ const { navigateCommandMenu } = useNavigateCommandMenu();+ const setCommandMenuSearchState = useSetRecoilState(commandMenuSearchState);+ const { getIcon } = useIcons();+ const unmountHeadlessFrontComponent = useUnmountHeadlessFrontComponent();const navigate: FrontComponentHostCommunicationApi['navigate'] = async (to,@@ -29,13 +41,33 @@ export const useFrontComponentExecutionContext = (): {);};+ const openSidePanelPage: FrontComponentHostCommunicationApi['openSidePanelPage'] =+ async ({ page, pageTitle, pageIcon, shouldResetSearchState }) => {+ navigateCommandMenu({+ page,+ pageTitle,+ pageIcon: getIcon(pageIcon),+ });++ if (shouldResetSearchState === true) {+ setCommandMenuSearchState('');+ }+ };+const executionContext: FrontComponentExecutionContext = {userId: currentUser?.id ?? null,};+ const unmountFrontComponent: FrontComponentHostCommunicationApi['unmountFrontComponent'] =+ async () => {+ unmountHeadlessFrontComponent(frontComponentId);+ };+const frontComponentHostCommunicationApi: FrontComponentHostCommunicationApi ={navigate,+ openSidePanelPage,+ unmountFrontComponent,};return {diff --git a/packages/twenty-front/src/modules/front-components/hooks/useMountHeadlessFrontComponent.ts b/packages/twenty-front/src/modules/front-components/hooks/useMountHeadlessFrontComponent.tsnew file mode 100644index 00000000000..6f419afac7b--- /dev/null+++ b/packages/twenty-front/src/modules/front-components/hooks/useMountHeadlessFrontComponent.ts@@ -0,0 +1,17 @@+import { useRecoilCallback } from 'recoil';++import { mountedHeadlessFrontComponentIdsState } from '@/front-components/states/mountedHeadlessFrontComponentIdsState';++export const useMountHeadlessFrontComponent = () => {+ const mountHeadlessFrontComponent = useRecoilCallback(+ ({ set }) =>+ (frontComponentId: string) => {+ set(mountedHeadlessFrontComponentIdsState, (previousIds) =>+ new Set(previousIds).add(frontComponentId),+ );+ },+ [],+ );++ return mountHeadlessFrontComponent;+};diff --git a/packages/twenty-front/src/modules/front-components/hooks/useUnmountHeadlessFrontComponent.ts b/packages/twenty-front/src/modules/front-components/hooks/useUnmountHeadlessFrontComponent.tsnew file mode 100644index 00000000000..121909f0121--- /dev/null+++ b/packages/twenty-front/src/modules/front-components/hooks/useUnmountHeadlessFrontComponent.ts@@ -0,0 +1,19 @@+import { useRecoilCallback } from 'recoil';++import { mountedHeadlessFrontComponentIdsState } from '@/front-components/states/mountedHeadlessFrontComponentIdsState';++export const useUnmountHeadlessFrontComponent = () => {+ const unmountHeadlessFrontComponent = useRecoilCallback(+ ({ set }) =>+ (frontComponentId: string) => {+ set(mountedHeadlessFrontComponentIdsState, (previousIds) => {+ const next = new Set(previousIds);+ next.delete(frontComponentId);+ return next;+ });+ },+ [],+ );++ return unmountHeadlessFrontComponent;+};diff --git a/packages/twenty-front/src/modules/front-components/states/mountedHeadlessFrontComponentIdsState.ts b/packages/twenty-front/src/modules/front-components/states/mountedHeadlessFrontComponentIdsState.tsnew file mode 100644index 00000000000..4b7604afd6b--- /dev/null+++ b/packages/twenty-front/src/modules/front-components/states/mountedHeadlessFrontComponentIdsState.ts@@ -0,0 +1,6 @@+import { atom } from 'recoil';++export const mountedHeadlessFrontComponentIdsState = atom<Set<string>>({+ key: 'mountedHeadlessFrontComponentIdsState',+ default: new Set(),+});diff --git a/packages/twenty-front/src/modules/navigation-menu-item/components/NavigationMenuEditModeBar.tsx b/packages/twenty-front/src/modules/navigation-menu-item/components/NavigationMenuEditModeBar.tsxindex c5e8f81a2a7..b388c13d469 100644--- a/packages/twenty-front/src/modules/navigation-menu-item/components/NavigationMenuEditModeBar.tsx+++ b/packages/twenty-front/src/modules/navigation-menu-item/components/NavigationMenuEditModeBar.tsx@@ -1,6 +1,5 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useNavigationMenuItemsDraftState } from '@/navigation-menu-item/hooks/useNavigationMenuItemsDraftState';import { useSaveNavigationMenuItemsDraft } from '@/navigation-menu-item/hooks/useSaveNavigationMenuItemsDraft';import { isNavigationMenuInEditModeStateV2 } from '@/navigation-menu-item/states/isNavigationMenuInEditModeStateV2';@@ -16,6 +15,7 @@ import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useState } from 'react';import { useRecoilValue } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { IconCheck, useIcons } from 'twenty-ui/display';import { FeatureFlagKey } from '~/generated-metadata/graphql';diff --git a/packages/twenty-front/src/modules/navigation-menu-item/components/WorkspaceNavigationMenuItems.tsx b/packages/twenty-front/src/modules/navigation-menu-item/components/WorkspaceNavigationMenuItems.tsxindex 1791827d9a2..62031e5bc06 100644--- a/packages/twenty-front/src/modules/navigation-menu-item/components/WorkspaceNavigationMenuItems.tsx+++ b/packages/twenty-front/src/modules/navigation-menu-item/components/WorkspaceNavigationMenuItems.tsx@@ -7,7 +7,6 @@ import { LightIconButton } from 'twenty-ui/input';import { FeatureFlagKey } from '~/generated-metadata/graphql';import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { FOLDER_ICON_DEFAULT } from '@/navigation-menu-item/constants/FolderIconDefault';import { NavigationMenuItemType } from '@/navigation-menu-item/constants/NavigationMenuItemType';import { useOpenNavigationMenuItemInCommandMenu } from '@/navigation-menu-item/hooks/useOpenNavigationMenuItemInCommandMenu';@@ -31,6 +30,7 @@ import { useSetRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useSetRecoimport { useStore } from 'jotai';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { isNonEmptyString } from '@sniptt/guards';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';const StyledRightIconsContainer = styled.div`diff --git a/packages/twenty-front/src/modules/navigation-menu-item/hooks/useOpenNavigationMenuItemInCommandMenu.ts b/packages/twenty-front/src/modules/navigation-menu-item/hooks/useOpenNavigationMenuItemInCommandMenu.tsindex fef054d5225..513b8b118a8 100644--- a/packages/twenty-front/src/modules/navigation-menu-item/hooks/useOpenNavigationMenuItemInCommandMenu.ts+++ b/packages/twenty-front/src/modules/navigation-menu-item/hooks/useOpenNavigationMenuItemInCommandMenu.ts@@ -1,5 +1,5 @@import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import type { IconComponent } from 'twenty-ui/display';export const useOpenNavigationMenuItemInCommandMenu = () => {diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsxindex 8a82f5bf99b..81145e83592 100644--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx@@ -1,5 +1,4 @@import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { PageLayoutLeftPanel } from '@/page-layout/components/PageLayoutLeftPanel';import { PageLayoutTabList } from '@/page-layout/components/PageLayoutTabList';import { PageLayoutTabListEffect } from '@/page-layout/components/PageLayoutTabListEffect';@@ -24,6 +23,7 @@ import { useSetRecoilComponentState } from '@/ui/utilities/state/component-stateimport { useRecoilComponentValueV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentValueV2';import styled from '@emotion/styled';import { t } from '@lingui/core/macro';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useIsMobile } from 'twenty-ui/utilities';diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabList.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabList.tsxindex d688940f121..7848fc71475 100644--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabList.tsx+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabList.tsx@@ -28,7 +28,6 @@ import { useSetRecoilComponentState } from '@/ui/utilities/state/component-stateimport { useRecoilComponentStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilComponentStateV2';import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { PAGE_LAYOUT_TAB_LIST_DROPPABLE_IDS } from '@/page-layout/components/PageLayoutTabListDroppableIds';import { PageLayoutTabListReorderableOverflowDropdown } from '@/page-layout/components/PageLayoutTabListReorderableOverflowDropdown';import { PageLayoutTabListStaticOverflowDropdown } from '@/page-layout/components/PageLayoutTabListStaticOverflowDropdown';@@ -45,6 +44,7 @@ import { TabListFromUrlOptionalEffect } from '@/ui/layout/tab-list/components/Taimport { type SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { type PageLayoutType } from '~/generated-metadata/graphql';diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListReorderableOverflowDropdown.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListReorderableOverflowDropdown.tsxindex 81799dc596e..315cd456e37 100644--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListReorderableOverflowDropdown.tsx+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListReorderableOverflowDropdown.tsx@@ -9,7 +9,6 @@ import {} from '@hello-pangea/dnd';import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { PAGE_LAYOUT_TAB_LIST_DROPPABLE_IDS } from '@/page-layout/components/PageLayoutTabListDroppableIds';import { PageLayoutTabListDroppableMoreButton } from '@/page-layout/components/PageLayoutTabListDroppableMoreButton';import { PageLayoutTabMenuItemSelectAvatar } from '@/page-layout/components/PageLayoutTabMenuItemSelectAvatar';@@ -29,6 +28,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/comimport { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState';import { useContext } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';import { type PageLayoutType } from '~/generated-metadata/graphql';const StyledOverflowDropdownListDraggableWrapper = styled.div`diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreateWidgetFromClick.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreateWidgetFromClick.test.tsxindex c23c8992453..27a7f2cfb55 100644--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreateWidgetFromClick.test.tsx+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreateWidgetFromClick.test.tsx@@ -1,11 +1,11 @@import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { useCreateWidgetFromClick } from '@/page-layout/hooks/useCreateWidgetFromClick';+import { pageLayoutDraggedAreaComponentState } from '@/page-layout/states/pageLayoutDraggedAreaComponentState';+import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pageLayoutEditingWidgetIdComponentState';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { act, renderHook } from '@testing-library/react';import { type ReactNode } from 'react';-import { pageLayoutDraggedAreaComponentState } from '@/page-layout/states/pageLayoutDraggedAreaComponentState';-import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pageLayoutEditingWidgetIdComponentState';-import { useCreateWidgetFromClick } from '@/page-layout/hooks/useCreateWidgetFromClick';+import { CommandMenuPages } from 'twenty-shared/types';import {PAGE_LAYOUT_TEST_INSTANCE_ID,PageLayoutTestWrapper,diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.tsxindex 665bcaca05e..3a8cc94c0b8 100644--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.tsx+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.tsx@@ -1,13 +1,13 @@import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { useEndPageLayoutDragSelection } from '@/page-layout/hooks/useEndPageLayoutDragSelection';+import { pageLayoutDraggedAreaComponentState } from '@/page-layout/states/pageLayoutDraggedAreaComponentState';+import { pageLayoutSelectedCellsComponentState } from '@/page-layout/states/pageLayoutSelectedCellsComponentState';+import { calculateGridBoundsFromSelectedCells } from '@/page-layout/utils/calculateGridBoundsFromSelectedCells';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { act, renderHook } from '@testing-library/react';import { type ReactNode } from 'react';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';-import { pageLayoutDraggedAreaComponentState } from '@/page-layout/states/pageLayoutDraggedAreaComponentState';-import { pageLayoutSelectedCellsComponentState } from '@/page-layout/states/pageLayoutSelectedCellsComponentState';-import { calculateGridBoundsFromSelectedCells } from '@/page-layout/utils/calculateGridBoundsFromSelectedCells';-import { useEndPageLayoutDragSelection } from '@/page-layout/hooks/useEndPageLayoutDragSelection';import {PAGE_LAYOUT_TEST_INSTANCE_ID,PageLayoutTestWrapper,diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreateWidgetFromClick.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreateWidgetFromClick.tsindex 3effad33240..d8135f56433 100644--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreateWidgetFromClick.ts+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreateWidgetFromClick.ts@@ -1,10 +1,10 @@import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { pageLayoutDraggedAreaComponentState } from '@/page-layout/states/pageLayoutDraggedAreaComponentState';import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pageLayoutEditingWidgetIdComponentState';import { parseCellIdToCoordinates } from '@/page-layout/utils/parseCellIdToCoordinates';import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackState';import { useRecoilCallback } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';export const useCreateWidgetFromClick = () => {const pageLayoutDraggedAreaState = useRecoilComponentCallbackState(diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useDuplicatePageLayoutTab.ts b/packages/twenty-front/src/modules/page-layout/hooks/useDuplicatePageLayoutTab.tsindex 1e47cc6e735..5574b52ee56 100644--- a/packages/twenty-front/src/modules/page-layout/hooks/useDuplicatePageLayoutTab.ts+++ b/packages/twenty-front/src/modules/page-layout/hooks/useDuplicatePageLayoutTab.ts@@ -1,6 +1,6 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { CommandMenuPages } from 'twenty-shared/types';import { PageLayoutComponentInstanceContext } from '@/page-layout/states/contexts/PageLayoutComponentInstanceContext';import { pageLayoutCurrentLayoutsComponentState } from '@/page-layout/states/pageLayoutCurrentLayoutsComponentState';import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useEditPageLayoutWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useEditPageLayoutWidget.tsindex bae3496ef2e..70a2a4041f4 100644--- a/packages/twenty-front/src/modules/page-layout/hooks/useEditPageLayoutWidget.ts+++ b/packages/twenty-front/src/modules/page-layout/hooks/useEditPageLayoutWidget.ts@@ -3,8 +3,8 @@ import { useSetRecoilState } from 'recoil';import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState';+import { CommandMenuPages } from 'twenty-shared/types';import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';import { PageLayoutComponentInstanceContext } from '@/page-layout/states/contexts/PageLayoutComponentInstanceContext';diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useEndPageLayoutDragSelection.ts b/packages/twenty-front/src/modules/page-layout/hooks/useEndPageLayoutDragSelection.tsindex 6ea20b3227a..2a202206e61 100644--- a/packages/twenty-front/src/modules/page-layout/hooks/useEndPageLayoutDragSelection.ts+++ b/packages/twenty-front/src/modules/page-layout/hooks/useEndPageLayoutDragSelection.ts@@ -1,14 +1,14 @@import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { PageLayoutComponentInstanceContext } from '@/page-layout/states/contexts/PageLayoutComponentInstanceContext';import { pageLayoutDraggedAreaComponentState } from '@/page-layout/states/pageLayoutDraggedAreaComponentState';import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pageLayoutEditingWidgetIdComponentState';+import { pageLayoutSelectedCellsComponentState } from '@/page-layout/states/pageLayoutSelectedCellsComponentState';+import { calculateGridBoundsFromSelectedCells } from '@/page-layout/utils/calculateGridBoundsFromSelectedCells';import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackState';import { useRecoilCallback } from 'recoil';+import { CommandMenuPages } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';-import { pageLayoutSelectedCellsComponentState } from '@/page-layout/states/pageLayoutSelectedCellsComponentState';-import { calculateGridBoundsFromSelectedCells } from '@/page-layout/utils/calculateGridBoundsFromSelectedCells';export const useEndPageLayoutDragSelection = (pageLayoutIdFromProps?: string,diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsxindex d7f49c461b1..0655a177ee6 100644--- a/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx@@ -1,5 +1,4 @@import { useNavigatePageLayoutCommandMenu } from '@/command-menu/pages/page-layout/hooks/useNavigatePageLayoutCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { useSetIsPageLayoutInEditMode } from '@/page-layout/hooks/useSetIsPageLayoutInEditMode';import { PageLayoutComponentInstanceContext } from '@/page-layout/states/contexts/PageLayoutComponentInstanceContext';import { isPageLayoutInEditModeComponentState } from '@/page-layout/states/isPageLayoutInEditModeComponentState';@@ -9,6 +8,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/comimport { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { t } from '@lingui/core/macro';import { Trans } from '@lingui/react/macro';+import { CommandMenuPages } from 'twenty-shared/types';import {AnimatedPlaceholder,AnimatedPlaceholderEmptyContainer,diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.tsindex dcbba27124b..db7d46bd8f4 100644--- a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts+++ b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts@@ -46,6 +46,7 @@ export const EXPECTED_MANIFEST: Manifest = {name: 'root-component',sourceComponentPath: 'src/root.front-component.tsx',universalIdentifier: 'a0a1a2a3-a4a5-4000-8000-000000000001',+ isHeadless: false,},{builtComponentPath: 'src/components/card.front-component.mjs',@@ -55,6 +56,7 @@ export const EXPECTED_MANIFEST: Manifest = {name: 'card-component',sourceComponentPath: 'src/components/card.front-component.tsx',universalIdentifier: '88c15ae2-5f87-4a6b-b48f-1974bbe62eb7',+ isHeadless: false,},{builtComponentPath: 'src/components/greeting.front-component.mjs',@@ -64,6 +66,7 @@ export const EXPECTED_MANIFEST: Manifest = {name: 'greeting-component',sourceComponentPath: 'src/components/greeting.front-component.tsx',universalIdentifier: '370ae182-743f-4ecb-b625-7ac48e21f0e5',+ isHeadless: false,},{builtComponentPath: 'src/components/test.front-component.mjs',@@ -73,6 +76,7 @@ export const EXPECTED_MANIFEST: Manifest = {name: 'test-component',sourceComponentPath: 'src/components/test.front-component.tsx',universalIdentifier: 'f1234567-abcd-4000-8000-000000000001',+ isHeadless: false,},],diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/expected-manifest.ts b/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/expected-manifest.tsindex eb172411860..aa9efd32453 100644--- a/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/expected-manifest.ts+++ b/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/expected-manifest.ts@@ -343,6 +343,7 @@ export const EXPECTED_MANIFEST: Manifest = {sourceComponentPath: 'my.front-component.tsx',builtComponentPath: 'my.front-component.mjs',builtComponentChecksum: '[checksum]',+ isHeadless: false,},],views: [],diff --git a/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts b/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.tsindex 5163115c829..1ce70842b71 100644--- a/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts+++ b/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts@@ -227,6 +227,7 @@ export const buildManifest = async (sourceComponentPath: relativeFilePath,builtComponentPath: relativeFilePath.replace(/\.tsx?$/, '.mjs'),builtComponentChecksum: '',+ isHeadless: rest.isHeadless ?? false,};frontComponents.push(config);diff --git a/packages/twenty-sdk/src/front-component-renderer/remote/components/FrontComponentWorkerEffect.tsx b/packages/twenty-sdk/src/front-component-renderer/remote/components/FrontComponentWorkerEffect.tsxindex 2f2e2c00d37..16fe1efdcb1 100644--- a/packages/twenty-sdk/src/front-component-renderer/remote/components/FrontComponentWorkerEffect.tsx+++ b/packages/twenty-sdk/src/front-component-renderer/remote/components/FrontComponentWorkerEffect.tsx@@ -29,38 +29,32 @@ export const FrontComponentWorkerEffect = ({setThread,setError,}: FrontComponentWorkerEffectProps) => {- const frontComponentHostCommunicationApiRef = useRef(- frontComponentHostCommunicationApi,- );- frontComponentHostCommunicationApiRef.current =- frontComponentHostCommunicationApi;+ const isInitializedRef = useRef(false);useEffect(() => {+ if (isInitializedRef.current) {+ return;+ }+const newReceiver = new RemoteReceiver({ retain, release });const worker = createRemoteWorker();worker.onerror = (event: ErrorEvent) => {const workerError =- event.error ??- new Error(event.message || 'Unknown worker error');+ event.error ?? new Error(event.message || 'Unknown worker error');console.error('[FrontComponentRenderer] Worker error:', workerError);setError(workerError);};- const stableFrontComponentHostCommunicationApi: FrontComponentHostCommunicationApi =- {- navigate: (...args) =>- frontComponentHostCommunicationApiRef.current.navigate(...args),- };-const thread = new ThreadWebWorker<WorkerExports,FrontComponentHostCommunicationApi>(worker, {- exports: stableFrontComponentHostCommunicationApi,+ exports: frontComponentHostCommunicationApi,});+setThread(thread);thread.imports@@ -74,6 +68,7 @@ export const FrontComponentWorkerEffect = ({});setReceiver(newReceiver);+ isInitializedRef.current = true;return () => {setThread(null);@@ -86,6 +81,7 @@ export const FrontComponentWorkerEffect = ({setError,setReceiver,setThread,+ frontComponentHostCommunicationApi,]);return null;diff --git a/packages/twenty-sdk/src/front-component-renderer/remote/worker/remote-worker.ts b/packages/twenty-sdk/src/front-component-renderer/remote/worker/remote-worker.tsindex 1785846ea06..7c3da1c9fff 100644--- a/packages/twenty-sdk/src/front-component-renderer/remote/worker/remote-worker.ts+++ b/packages/twenty-sdk/src/front-component-renderer/remote/worker/remote-worker.ts@@ -17,7 +17,6 @@ import { installStylePropertyOnRemoteElements } from '@/front-component-rendererimport { patchRemoteElementSetAttribute } from '@/front-component-renderer/remote/utils/patchRemoteElementSetAttribute';import { HTML_TAG_TO_CUSTOM_ELEMENT_TAG } from '@/sdk/front-component-api/constants/HtmlTagToRemoteComponent';import { setFrontComponentExecutionContext } from '@/sdk/front-component-api/context/frontComponentContext';-import { setNavigate } from '@/sdk/front-component-api/functions/navigate';import { type FrontComponentExecutionContext } from '../../types/FrontComponentExecutionContext';import { type FrontComponentHostCommunicationApi } from '../../types/FrontComponentHostCommunicationApi';@@ -89,7 +88,12 @@ const initializeHostCommunicationApi: WorkerExports['initializeHostCommunicationasync () => {const hostApi =ThreadWebWorker.self.import<FrontComponentHostCommunicationApi>();- setNavigate(hostApi.navigate);++ frontComponentHostCommunicationApi.navigate = hostApi.navigate;+ frontComponentHostCommunicationApi.openSidePanelPage =+ hostApi.openSidePanelPage;+ frontComponentHostCommunicationApi.unmountFrontComponent =+ hostApi.unmountFrontComponent;};const updateContext: WorkerExports['updateContext'] = async (diff --git a/packages/twenty-sdk/src/front-component-renderer/types/FrontComponentHostCommunicationApi.ts b/packages/twenty-sdk/src/front-component-renderer/types/FrontComponentHostCommunicationApi.tsindex ef088c2e232..e40b85c0a83 100644--- a/packages/twenty-sdk/src/front-component-renderer/types/FrontComponentHostCommunicationApi.ts+++ b/packages/twenty-sdk/src/front-component-renderer/types/FrontComponentHostCommunicationApi.ts@@ -1,10 +1,11 @@-import { type AppPath, type NavigateOptions } from 'twenty-shared/types';+import {+ type NavigateFunction,+ type OpenSidePanelPageFunction,+ type UnmountFrontComponentFunction,+} from '../../sdk/front-component-api/globals/frontComponentHostCommunicationApi';export type FrontComponentHostCommunicationApi = {- navigate: (- to: AppPath,- params?: Record<string, string | null>,- queryParams?: Record<string, unknown>,- options?: NavigateOptions,- ) => Promise<void>;+ navigate: NavigateFunction;+ openSidePanelPage: OpenSidePanelPageFunction;+ unmountFrontComponent: UnmountFrontComponentFunction;};diff --git a/packages/twenty-sdk/src/sdk/action/Action.tsx b/packages/twenty-sdk/src/sdk/action/Action.tsxnew file mode 100644index 00000000000..0d3242f4be1--- /dev/null+++ b/packages/twenty-sdk/src/sdk/action/Action.tsx@@ -0,0 +1,31 @@+import { useEffect, useState } from 'react';++import { unmountFrontComponent } from '../front-component-api';++export type ActionProps = {+ execute: () => void | Promise<void>;+};++export const Action = ({ execute }: ActionProps) => {+ const [hasExecuted, setHasExecuted] = useState(false);++ useEffect(() => {+ if (hasExecuted) {+ return;+ }++ setHasExecuted(true);++ const run = async () => {+ try {+ await execute();+ } finally {+ await unmountFrontComponent();+ }+ };++ run();+ }, [execute, hasExecuted]);++ return null;+};diff --git a/packages/twenty-sdk/src/sdk/action/ActionLink.tsx b/packages/twenty-sdk/src/sdk/action/ActionLink.tsxnew file mode 100644index 00000000000..454fd72bd8e--- /dev/null+++ b/packages/twenty-sdk/src/sdk/action/ActionLink.tsx@@ -0,0 +1,42 @@+import { useEffect, useState } from 'react';++import { type NavigateOptions } from 'react-router-dom';+import { type AppPath } from 'twenty-shared/types';+import { type getAppPath } from 'twenty-shared/utils';+import { navigate, unmountFrontComponent } from '../front-component-api';++export type ActionLinkProps<T extends AppPath> = {+ to: T;+ params?: Parameters<typeof getAppPath<T>>[1];+ queryParams?: Record<string, any>;+ options?: NavigateOptions;+};++export const ActionLink = <T extends AppPath>({+ to,+ params,+ queryParams,+ options,+}: ActionLinkProps<T>) => {+ const [hasExecuted, setHasExecuted] = useState(false);++ useEffect(() => {+ if (hasExecuted) {+ return;+ }++ setHasExecuted(true);++ const run = async () => {+ try {+ await navigate(to, params, queryParams, options);+ } finally {+ await unmountFrontComponent();+ }+ };++ run();+ }, [to, params, queryParams, options, hasExecuted]);++ return null;+};diff --git a/packages/twenty-sdk/src/sdk/action/ActionOpenSidePanelPage.tsx b/packages/twenty-sdk/src/sdk/action/ActionOpenSidePanelPage.tsxnew file mode 100644index 00000000000..bfbffb256b0--- /dev/null+++ b/packages/twenty-sdk/src/sdk/action/ActionOpenSidePanelPage.tsx@@ -0,0 +1,52 @@+import {+ openSidePanelPage,+ unmountFrontComponent,+} from '@/sdk/front-component-api';+import { useEffect, useState } from 'react';++import { type CommandMenuPages } from 'twenty-shared/types';++export type ActionOpenSidePanelPageProps = {+ page: CommandMenuPages;+ pageTitle: string;+ pageIcon: string;+ onClick?: () => void;+ shouldResetSearchState?: boolean;+};++export const ActionOpenSidePanelPage = ({+ page,+ pageTitle,+ pageIcon,+ onClick,+ shouldResetSearchState = false,+}: ActionOpenSidePanelPageProps) => {+ const [hasExecuted, setHasExecuted] = useState(false);++ useEffect(() => {+ if (hasExecuted) {+ return;+ }++ setHasExecuted(true);++ const run = async () => {+ onClick?.();++ try {+ await openSidePanelPage({+ page,+ pageTitle,+ pageIcon,+ shouldResetSearchState,+ });+ } finally {+ await unmountFrontComponent();+ }+ };++ run();+ }, [page, pageTitle, pageIcon, shouldResetSearchState, onClick, hasExecuted]);++ return null;+};diff --git a/packages/twenty-sdk/src/sdk/action/index.ts b/packages/twenty-sdk/src/sdk/action/index.tsnew file mode 100644index 00000000000..712559c9fe8--- /dev/null+++ b/packages/twenty-sdk/src/sdk/action/index.ts@@ -0,0 +1,6 @@+export { Action } from './Action';+export type { ActionProps } from './Action';+export { ActionLink } from './ActionLink';+export type { ActionLinkProps } from './ActionLink';+export { ActionOpenSidePanelPage } from './ActionOpenSidePanelPage';+export type { ActionOpenSidePanelPageProps } from './ActionOpenSidePanelPage';diff --git a/packages/twenty-sdk/src/sdk/front-component-api/functions/navigate.ts b/packages/twenty-sdk/src/sdk/front-component-api/functions/navigate.tsindex bbc3890eda7..64caeeb3494 100644--- a/packages/twenty-sdk/src/sdk/front-component-api/functions/navigate.ts+++ b/packages/twenty-sdk/src/sdk/front-component-api/functions/navigate.ts@@ -1,30 +1,17 @@-import { type AppPath, type NavigateOptions } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';-type NavigateFunction = (- to: AppPath,- params?: Record<string, string | null>,- queryParams?: Record<string, unknown>,- options?: NavigateOptions,-) => Promise<void>;--// State is stored on globalThis so the worker's SDK instance and each-// front component's bundled SDK copy share the same backing store.-const NAVIGATE_KEY = '__twentySdkNavigateFunction__';--export const setNavigate = (fn: NavigateFunction): void => {- (globalThis as Record<string, unknown>)[NAVIGATE_KEY] = fn;-};+import {+ frontComponentHostCommunicationApi,+ type NavigateFunction,+} from '../globals/frontComponentHostCommunicationApi';export const navigate: NavigateFunction = (- to: AppPath,- params?: Record<string, string | null>,- queryParams?: Record<string, unknown>,- options?: NavigateOptions,-): Promise<void> => {- const navigateFunction = (globalThis as Record<string, unknown>)[- NAVIGATE_KEY- ] as NavigateFunction | undefined;+ to,+ params,+ queryParams,+ options,+) => {+ const navigateFunction = frontComponentHostCommunicationApi.navigate;if (!isDefined(navigateFunction)) {throw new Error('navigateFunction is not set');diff --git a/packages/twenty-sdk/src/sdk/front-component-api/functions/openSidePanelPage.ts b/packages/twenty-sdk/src/sdk/front-component-api/functions/openSidePanelPage.tsnew file mode 100644index 00000000000..e761bb86417--- /dev/null+++ b/packages/twenty-sdk/src/sdk/front-component-api/functions/openSidePanelPage.ts@@ -0,0 +1,17 @@+import { isDefined } from 'twenty-shared/utils';++import {+ frontComponentHostCommunicationApi,+ type OpenSidePanelPageFunction,+} from '../globals/frontComponentHostCommunicationApi';++export const openSidePanelPage: OpenSidePanelPageFunction = (params) => {+ const openSidePanelPageFunction =+ frontComponentHostCommunicationApi.openSidePanelPage;++ if (!isDefined(openSidePanelPageFunction)) {+ throw new Error('openSidePanelPageFunction is not set');+ }++ return openSidePanelPageFunction(params);+};diff --git a/packages/twenty-sdk/src/sdk/front-component-api/functions/unmountFrontComponent.ts b/packages/twenty-sdk/src/sdk/front-component-api/functions/unmountFrontComponent.tsnew file mode 100644index 00000000000..0958c7c4d5b--- /dev/null+++ b/packages/twenty-sdk/src/sdk/front-component-api/functions/unmountFrontComponent.ts@@ -0,0 +1,17 @@+import { isDefined } from 'twenty-shared/utils';++import {+ frontComponentHostCommunicationApi,+ type UnmountFrontComponentFunction,+} from '../globals/frontComponentHostCommunicationApi';++export const unmountFrontComponent: UnmountFrontComponentFunction = () => {+ const unmountFrontComponentFunction =+ frontComponentHostCommunicationApi.unmountFrontComponent;++ if (!isDefined(unmountFrontComponentFunction)) {+ throw new Error('unmountFrontComponentFunction is not set');+ }++ return unmountFrontComponentFunction();+};diff --git a/packages/twenty-sdk/src/sdk/front-component-api/globals/frontComponentHostCommunicationApi.ts b/packages/twenty-sdk/src/sdk/front-component-api/globals/frontComponentHostCommunicationApi.tsnew file mode 100644index 00000000000..43167b6dab6--- /dev/null+++ b/packages/twenty-sdk/src/sdk/front-component-api/globals/frontComponentHostCommunicationApi.ts@@ -0,0 +1,37 @@+import {+ type AppPath,+ type CommandMenuPages,+ type NavigateOptions,+} from 'twenty-shared/types';+import { type getAppPath } from 'twenty-shared/utils';++export type NavigateFunction = <T extends AppPath>(+ to: T,+ params?: Parameters<typeof getAppPath<T>>[1],+ queryParams?: Record<string, any>,+ options?: NavigateOptions,+) => Promise<void>;++export type OpenSidePanelPageFunction = (params: {+ page: CommandMenuPages;+ pageTitle: string;+ pageIcon?: string;+ shouldResetSearchState?: boolean;+}) => Promise<void>;++export type UnmountFrontComponentFunction = () => Promise<void>;++export type FrontComponentHostCommunicationApiStore = {+ navigate?: NavigateFunction;+ openSidePanelPage?: OpenSidePanelPageFunction;+ unmountFrontComponent?: UnmountFrontComponentFunction;+};++declare global {+ var frontComponentHostCommunicationApi: FrontComponentHostCommunicationApiStore;+}++globalThis.frontComponentHostCommunicationApi ??= {};++export const frontComponentHostCommunicationApi =+ globalThis.frontComponentHostCommunicationApi;diff --git a/packages/twenty-sdk/src/sdk/front-component-api/index.ts b/packages/twenty-sdk/src/sdk/front-component-api/index.tsindex 325b1a31436..fe2a5ae6d7b 100644--- a/packages/twenty-sdk/src/sdk/front-component-api/index.ts+++ b/packages/twenty-sdk/src/sdk/front-component-api/index.ts@@ -1,11 +1,13 @@export { setFrontComponentExecutionContext } from './context/frontComponentContext';-export { navigate, setNavigate } from './functions/navigate';+export { navigate } from './functions/navigate';+export { openSidePanelPage } from './functions/openSidePanelPage';+export { unmountFrontComponent } from './functions/unmountFrontComponent';export { useFrontComponentExecutionContext } from './hooks/useFrontComponentExecutionContext';export { useUserId } from './hooks/useUserId';export type { FrontComponentExecutionContext } from './types/FrontComponentExecutionContext';-export type { AllowedHtmlElement } from './constants/AllowedHtmlElements';export { ALLOWED_HTML_ELEMENTS } from './constants/AllowedHtmlElements';+export type { AllowedHtmlElement } from './constants/AllowedHtmlElements';export { COMMON_HTML_EVENTS } from './constants/CommonHtmlEvents';export { EVENT_TO_REACT } from './constants/EventToReact';export { HTML_COMMON_PROPERTIES } from './constants/HtmlCommonProperties';diff --git a/packages/twenty-sdk/src/sdk/index.ts b/packages/twenty-sdk/src/sdk/index.tsindex a6c99f93838..f3dcc751f19 100644--- a/packages/twenty-sdk/src/sdk/index.ts+++ b/packages/twenty-sdk/src/sdk/index.ts@@ -63,14 +63,26 @@ export { defineSkill } from './skills/define-skill';export { defineView } from './views/define-view';export type { ViewConfig } from './views/view-config';+// Action components for front components+export { Action } from './action';+export type { ActionProps } from './action';+export { ActionLink } from './action';+export type { ActionLinkProps } from './action';+export { ActionOpenSidePanelPage } from './action';+export type { ActionOpenSidePanelPageProps } from './action';+// Front Component API exportsexport {navigate,+ openSidePanelPage,+ unmountFrontComponent,useFrontComponentExecutionContext,useUserId,} from './front-component-api';export type { FrontComponentExecutionContext } from './front-component-api';+export { AppPath, CommandMenuPages } from 'twenty-shared/types';+// Front Component Common exportsexport {ALLOWED_HTML_ELEMENTS,diff --git a/packages/twenty-server/src/database/typeorm/core/migrations/common/1771509478665-add-is-headless-to-front-component.ts b/packages/twenty-server/src/database/typeorm/core/migrations/common/1771509478665-add-is-headless-to-front-component.tsnew file mode 100644index 00000000000..bd8924ffbc8--- /dev/null+++ b/packages/twenty-server/src/database/typeorm/core/migrations/common/1771509478665-add-is-headless-to-front-component.ts@@ -0,0 +1,19 @@+import { type MigrationInterface, type QueryRunner } from 'typeorm';++export class AddIsHeadlessToFrontComponent1771509478665+ implements MigrationInterface+{+ name = 'AddIsHeadlessToFrontComponent1771509478665';++ public async up(queryRunner: QueryRunner): Promise<void> {+ await queryRunner.query(+ `ALTER TABLE "core"."frontComponent" ADD "isHeadless" boolean NOT NULL DEFAULT false`,+ );+ }++ public async down(queryRunner: QueryRunner): Promise<void> {+ await queryRunner.query(+ `ALTER TABLE "core"."frontComponent" DROP COLUMN "isHeadless"`,+ );+ }+}diff --git a/packages/twenty-server/src/engine/core-modules/application/utils/from-front-component-manifest-to-universal-flat-front-component.util.ts b/packages/twenty-server/src/engine/core-modules/application/utils/from-front-component-manifest-to-universal-flat-front-component.util.tsindex 10057415dd9..b848d922dcf 100644--- a/packages/twenty-server/src/engine/core-modules/application/utils/from-front-component-manifest-to-universal-flat-front-component.util.ts+++ b/packages/twenty-server/src/engine/core-modules/application/utils/from-front-component-manifest-to-universal-flat-front-component.util.ts@@ -20,6 +20,7 @@ export const fromFrontComponentManifestToUniversalFlatFrontComponent = ({builtComponentPath: frontComponentManifest.builtComponentPath,componentName: frontComponentManifest.componentName,builtComponentChecksum: frontComponentManifest.builtComponentChecksum,+ isHeadless: frontComponentManifest.isHeadless ?? false,createdAt: now,updatedAt: now,};diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snapindex 3bab5b4738c..36ff560e1ed 100644--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap@@ -59,6 +59,7 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma"sourceComponentPath","builtComponentPath","componentName",+ "isHeadless",],"propertiesToStringify": [],},diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.tsindex ba8edf0d8e8..09ba08db54d 100644--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts@@ -1221,6 +1221,11 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = {toStringify: false,universalProperty: undefined,},+ isHeadless: {+ toCompare: true,+ toStringify: false,+ universalProperty: undefined,+ },createdAt: {toCompare: false,toStringify: false,diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/constants/flat-front-component-editable-properties.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/constants/flat-front-component-editable-properties.constant.tsindex c7ad99815d8..561087b04ac 100644--- a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/constants/flat-front-component-editable-properties.constant.ts+++ b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/constants/flat-front-component-editable-properties.constant.ts@@ -7,4 +7,5 @@ export const FLAT_FRONT_COMPONENT_EDITABLE_PROPERTIES = ['sourceComponentPath','builtComponentPath','componentName',+ 'isHeadless',] as const satisfies MetadataEntityPropertyName<'frontComponent'>[];diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-create-front-component-input-to-flat-front-component-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-create-front-component-input-to-flat-front-component-to-create.util.tsindex c5e8c5579c4..5e9d2669ad5 100644--- a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-create-front-component-input-to-flat-front-component-to-create.util.ts+++ b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-create-front-component-input-to-flat-front-component-to-create.util.ts@@ -33,6 +33,7 @@ export const fromCreateFrontComponentInputToFlatFrontComponentToCreate = ({builtComponentPath: createFrontComponentInput.builtComponentPath,componentName: createFrontComponentInput.componentName,builtComponentChecksum: createFrontComponentInput.builtComponentChecksum,+ isHeadless: false,workspaceId,createdAt: now,updatedAt: now,diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-flat-front-component-to-front-component-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-flat-front-component-to-front-component-dto.util.tsindex d6a17c056e6..0d4f1e1dfce 100644--- a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-flat-front-component-to-front-component-dto.util.ts+++ b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-flat-front-component-to-front-component-dto.util.ts@@ -20,6 +20,7 @@ export const fromFlatFrontComponentToFrontComponentDto = (: undefined,workspaceId: flatFrontComponent.workspaceId,applicationId: flatFrontComponent.applicationId,+ isHeadless: flatFrontComponent.isHeadless,createdAt: new Date(flatFrontComponent.createdAt),updatedAt: new Date(flatFrontComponent.updatedAt),});diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-front-component-entity-to-flat-front-component.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-front-component-entity-to-flat-front-component.util.tsindex 388117df097..04ae15c704d 100644--- a/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-front-component-entity-to-flat-front-component.util.ts+++ b/packages/twenty-server/src/engine/metadata-modules/flat-front-component/utils/from-front-component-entity-to-flat-front-component.util.ts@@ -31,6 +31,7 @@ export const fromFrontComponentEntityToFlatFrontComponent = ({builtComponentPath: frontComponentEntity.builtComponentPath,componentName: frontComponentEntity.componentName,builtComponentChecksum: frontComponentEntity.builtComponentChecksum,+ isHeadless: frontComponentEntity.isHeadless,workspaceId: frontComponentEntity.workspaceId,universalIdentifier: frontComponentEntity.universalIdentifier,applicationId: frontComponentEntity.applicationId,diff --git a/packages/twenty-server/src/engine/metadata-modules/front-component/dtos/front-component.dto.ts b/packages/twenty-server/src/engine/metadata-modules/front-component/dtos/front-component.dto.tsindex b73cbdc7f28..8a26cbc81ec 100644--- a/packages/twenty-server/src/engine/metadata-modules/front-component/dtos/front-component.dto.ts+++ b/packages/twenty-server/src/engine/metadata-modules/front-component/dtos/front-component.dto.ts@@ -1,6 +1,7 @@import { Field, HideField, ObjectType } from '@nestjs/graphql';import {+ IsBoolean,IsDateString,IsNotEmpty,IsOptional,@@ -63,6 +64,10 @@ export class FrontComponentDTO {@Field()updatedAt: Date;+ @IsBoolean()+ @Field()+ isHeadless: boolean;+@Field(() => ApplicationTokenPairDTO, { nullable: true })applicationTokenPair?: ApplicationTokenPairDTO;}diff --git a/packages/twenty-server/src/engine/metadata-modules/front-component/entities/front-component.entity.ts b/packages/twenty-server/src/engine/metadata-modules/front-component/entities/front-component.entity.tsindex 61a286a87da..fb2ce1a1e42 100644--- a/packages/twenty-server/src/engine/metadata-modules/front-component/entities/front-component.entity.ts+++ b/packages/twenty-server/src/engine/metadata-modules/front-component/entities/front-component.entity.ts@@ -34,6 +34,9 @@ export class FrontComponentEntity@Column({ nullable: false })builtComponentChecksum: string;+ @Column({ default: false })+ isHeadless: boolean;+@CreateDateColumn({ type: 'timestamptz' })createdAt: Date;diff --git a/packages/twenty-shared/src/application/frontComponentManifestType.ts b/packages/twenty-shared/src/application/frontComponentManifestType.tsindex f8ab8eedb11..e85d5822205 100644--- a/packages/twenty-shared/src/application/frontComponentManifestType.ts+++ b/packages/twenty-shared/src/application/frontComponentManifestType.ts@@ -22,5 +22,6 @@ export type FrontComponentManifest = {builtComponentPath: string;builtComponentChecksum: string;componentName: string;+ isHeadless?: boolean;command?: FrontComponentCommandManifest;};diff --git a/packages/twenty-front/src/modules/command-menu/types/CommandMenuPages.ts b/packages/twenty-shared/src/types/CommandMenuPages.tssimilarity index 100%rename from packages/twenty-front/src/modules/command-menu/types/CommandMenuPages.tsrename to packages/twenty-shared/src/types/CommandMenuPages.tsdiff --git a/packages/twenty-shared/src/types/index.ts b/packages/twenty-shared/src/types/index.tsindex 90339dda261..febd5dcfd64 100644--- a/packages/twenty-shared/src/types/index.ts+++ b/packages/twenty-shared/src/types/index.ts@@ -14,6 +14,7 @@ export { AppBasePath } from './AppBasePath';export { AppPath } from './AppPath';export type { Arrayable } from './Arrayable';export type { ArraySortDirection } from './ArraySortDirection';+export { CommandMenuPages } from './CommandMenuPages';export type { ActorMetadata } from './composite-types/actor.composite-type';export {FieldActorSource,