Skip to content

The open alternative to Salesforce, designed for AI.

Add native call recording transcript tab to the calendar event record page (#23909)

nitinc8bd0ae30700
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index e598895d21c..fbfe7b6ab7a 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -1740,6 +1740,7 @@ enum FeatureFlagKey {
IS_WORKFLOW_VERSION_IN_CORE_ENABLED
IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED
IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED
+ IS_NATIVE_CALL_RECORDING_TABS_ENABLED
}
type WorkspaceUrls {
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 6edd8d4bcdb..b96ec32a368 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -1395,7 +1395,7 @@ export interface FeatureFlag {
__typename: 'FeatureFlag'
}
-export type FeatureFlagKey = 'IS_AI_CHAT_PAGE_ENABLED' | 'IS_APP_CLAIMING_ENABLED' | 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_CALENDAR_WEEK_VIEW_ENABLED' | 'IS_EMAIL_GROUP_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_LIST_VIEW_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' | 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' | 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' | 'IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED' | 'IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED'
+export type FeatureFlagKey = 'IS_AI_CHAT_PAGE_ENABLED' | 'IS_APP_CLAIMING_ENABLED' | 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_CALENDAR_WEEK_VIEW_ENABLED' | 'IS_EMAIL_GROUP_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_LIST_VIEW_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' | 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' | 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' | 'IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED' | 'IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED' | 'IS_NATIVE_CALL_RECORDING_TABS_ENABLED'
export interface WorkspaceUrls {
customUrl?: Scalars['String']
@@ -9654,7 +9654,8 @@ export const enumFeatureFlagKey = {
IS_SETTINGS_DISCOVERY_HERO_ENABLED: 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' as const,
IS_WORKFLOW_VERSION_IN_CORE_ENABLED: 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' as const,
IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED: 'IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED' as const,
- IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED: 'IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED' as const
+ IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED: 'IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED' as const,
+ IS_NATIVE_CALL_RECORDING_TABS_ENABLED: 'IS_NATIVE_CALL_RECORDING_TABS_ENABLED' as const
}
export const enumIdentityProviderType = {
diff --git a/packages/twenty-front/src/generated-admin/graphql.ts b/packages/twenty-front/src/generated-admin/graphql.ts
index 781160320ee..3a2ec743a33 100644
--- a/packages/twenty-front/src/generated-admin/graphql.ts
+++ b/packages/twenty-front/src/generated-admin/graphql.ts
@@ -376,6 +376,7 @@ export enum FeatureFlagKey {
IS_JUNCTION_RELATIONS_ENABLED = 'IS_JUNCTION_RELATIONS_ENABLED',
IS_LIST_VIEW_ENABLED = 'IS_LIST_VIEW_ENABLED',
IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED',
+ IS_NATIVE_CALL_RECORDING_TABS_ENABLED = 'IS_NATIVE_CALL_RECORDING_TABS_ENABLED',
IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT',
IS_SETTINGS_DISCOVERY_HERO_ENABLED = 'IS_SETTINGS_DISCOVERY_HERO_ENABLED',
IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED',
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index d4f5ec7b18a..428237c3aef 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -1820,6 +1820,7 @@ export enum FeatureFlagKey {
IS_JUNCTION_RELATIONS_ENABLED = 'IS_JUNCTION_RELATIONS_ENABLED',
IS_LIST_VIEW_ENABLED = 'IS_LIST_VIEW_ENABLED',
IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED',
+ IS_NATIVE_CALL_RECORDING_TABS_ENABLED = 'IS_NATIVE_CALL_RECORDING_TABS_ENABLED',
IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT',
IS_SETTINGS_DISCOVERY_HERO_ENABLED = 'IS_SETTINGS_DISCOVERY_HERO_ENABLED',
IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED',
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutSingleTabRenderer.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutSingleTabRenderer.tsx
index 629b6217559..6003faa53fb 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutSingleTabRenderer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutSingleTabRenderer.tsx
@@ -7,6 +7,7 @@ import { PageLayoutRecordPageCustomizationSessionRegistrationEffect } from '@/pa
import { PageLayoutContentProvider } from '@/page-layout/contexts/PageLayoutContentContext';
import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
import { useIsPageLayoutInEditMode } from '@/page-layout/hooks/useIsPageLayoutInEditMode';
+import { usePageLayoutTabsFilteredByFeatureFlags } from '@/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags';
import { usePageLayoutTabWithVisibleWidgetsOrThrow } from '@/page-layout/hooks/usePageLayoutTabWithVisibleWidgetsOrThrow';
import { PageLayoutComponentInstanceContext } from '@/page-layout/states/contexts/PageLayoutComponentInstanceContext';
import { pageLayoutIsInitializedComponentState } from '@/page-layout/states/pageLayoutIsInitializedComponentState';
@@ -19,6 +20,7 @@ import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingC
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { TabListComponentInstanceContext } from '@/ui/layout/tab-list/states/contexts/TabListComponentInstanceContext';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
+import { isDefined } from 'twenty-shared/utils';
type PageLayoutSingleTabRendererProps = {
pageLayoutId: string;
@@ -37,19 +39,43 @@ const PageLayoutSingleTabRendererContent = () => {
};
const PageLayoutSingleTabRendererInner = () => {
- const { currentPageLayout } = useCurrentPageLayoutOrThrow();
+ const { featureFilteredPageLayoutTabs } =
+ usePageLayoutTabsFilteredByFeatureFlags();
const targetRecordIdentifier = useTargetRecord();
const { isInSidePanel } = useLayoutRenderingContext();
- const isPageLayoutInEditMode = useIsPageLayoutInEditMode();
const sortedActiveTabs = sortTabsByPosition(
- currentPageLayout.tabs.filter((tab) => tab.isActive),
+ featureFilteredPageLayoutTabs.filter((tab) => tab.isActive),
);
- const firstTab = sortedActiveTabs[0];
+ const firstTab = sortedActiveTabs.at(0);
+
+ return (
+ <>
+ <SummaryCard
+ objectNameSingular={targetRecordIdentifier.targetObjectNameSingular}
+ objectRecordId={targetRecordIdentifier.id}
+ isInSidePanel={isInSidePanel}
+ />
- const firstTabWithVisibleWidgets = usePageLayoutTabWithVisibleWidgetsOrThrow(
- firstTab.id,
+ {isDefined(firstTab) && (
+ <PageLayoutSingleTabRendererTabContent firstTabId={firstTab.id} />
+ )}
+ </>
);
+};
+
+type PageLayoutSingleTabRendererTabContentProps = {
+ firstTabId: string;
+};
+
+const PageLayoutSingleTabRendererTabContent = ({
+ firstTabId,
+}: PageLayoutSingleTabRendererTabContentProps) => {
+ const { currentPageLayout } = useCurrentPageLayoutOrThrow();
+ const isPageLayoutInEditMode = useIsPageLayoutInEditMode();
+
+ const firstTabWithVisibleWidgets =
+ usePageLayoutTabWithVisibleWidgetsOrThrow(firstTabId);
const layoutMode = getTabLayoutMode({
tab: firstTabWithVisibleWidgets,
@@ -63,25 +89,17 @@ const PageLayoutSingleTabRendererInner = () => {
});
return (
- <>
- <SummaryCard
- objectNameSingular={targetRecordIdentifier.targetObjectNameSingular}
- objectRecordId={targetRecordIdentifier.id}
- isInSidePanel={isInSidePanel}
- />
-
- <PageLayoutContentProvider
- value={{
- tabId: firstTab.id,
- layoutMode,
- presentation,
- }}
- >
- <PageLayoutWidgetDndProvider>
- <PageLayoutContent />
- </PageLayoutWidgetDndProvider>
- </PageLayoutContentProvider>
- </>
+ <PageLayoutContentProvider
+ value={{
+ tabId: firstTabId,
+ layoutMode,
+ presentation,
+ }}
+ >
+ <PageLayoutWidgetDndProvider>
+ <PageLayoutContent />
+ </PageLayoutWidgetDndProvider>
+ </PageLayoutContentProvider>
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
index 921e0f1daae..8795749c134 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
@@ -1,4 +1,4 @@
-import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
+import { usePageLayoutTabsFilteredByFeatureFlags } from '@/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags';
import { useUpdatePageLayoutTab } from '@/page-layout/hooks/useUpdatePageLayoutTab';
import { pageLayoutTabSettingsOpenTabIdComponentState } from '@/page-layout/states/pageLayoutTabSettingsOpenTabIdComponentState';
import { isReactivatableTab } from '@/page-layout/utils/isReactivatableTab';
@@ -13,7 +13,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useLingui } from '@lingui/react/macro';
-import { useCallback, useMemo } from 'react';
+import { useCallback } from 'react';
import { SidePanelPages } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus, useIcons } from 'twenty-ui/icon';
@@ -32,7 +32,8 @@ export const PageLayoutTabListNewTabDropdownContent = ({
const { getIcon } = useIcons();
const { closeDropdown } = useCloseDropdown();
- const { currentPageLayout } = useCurrentPageLayoutOrThrow();
+ const { featureFilteredPageLayoutTabs } =
+ usePageLayoutTabsFilteredByFeatureFlags();
const { updatePageLayoutTab } = useUpdatePageLayoutTab();
const setActiveTabId = useSetAtomComponentState(activeTabIdComponentState);
@@ -41,9 +42,8 @@ export const PageLayoutTabListNewTabDropdownContent = ({
);
const { navigatePageLayoutSidePanel } = useNavigatePageLayoutSidePanel();
- const inactiveTabs = useMemo(
- () => sortTabsByPosition(currentPageLayout.tabs.filter(isReactivatableTab)),
- [currentPageLayout.tabs],
+ const inactiveTabs = sortTabsByPosition(
+ featureFilteredPageLayoutTabs.filter(isReactivatableTab),
);
const handleCreateEmptyTab = useCallback(() => {
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
index d03c956aa81..44f1efd8afc 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
@@ -93,7 +93,7 @@ export const PageLayoutTabsRenderer = () => {
const sortedTabs = sortTabsByPosition(tabsToRenderInTabList);
- const activeTabExistsInCurrentPageLayout = currentPageLayout.tabs.some(
+ const activeTabExistsInRenderableTabs = sortedTabs.some(
(tab) => tab.id === activeTabId,
);
@@ -134,7 +134,7 @@ export const PageLayoutTabsRenderer = () => {
)}
defaultEnableXScroll={false}
>
- {isDefined(activeTabId) && activeTabExistsInCurrentPageLayout && (
+ {isDefined(activeTabId) && activeTabExistsInRenderableTabs && (
<PageLayoutMainContent tabId={activeTabId} />
)}
</ScrollWrapper>
diff --git a/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutTabsRenderer.test.tsx b/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutTabsRenderer.test.tsx
new file mode 100644
index 00000000000..c23dfa929b3
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutTabsRenderer.test.tsx
@@ -0,0 +1,123 @@
+import { PageLayoutTabsRenderer } from '@/page-layout/components/PageLayoutTabsRenderer';
+import { render, screen } from '@testing-library/react';
+import { type ReactNode } from 'react';
+import {
+ PageLayoutTabLayoutMode,
+ PageLayoutType,
+} from '~/generated-metadata/graphql';
+
+let mockActiveTabId = 'hidden-transcript-tab-id';
+const mockSetActiveTabId = jest.fn();
+
+const homeTab = {
+ __typename: 'PageLayoutTab' as const,
+ id: 'home-tab-id',
+ title: 'Home',
+ position: 0,
+ icon: 'IconHome',
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ widgets: [],
+ pageLayoutId: 'page-layout-id',
+ createdAt: '2026-08-07T00:00:00.000Z',
+ updatedAt: '2026-08-07T00:00:00.000Z',
+ deletedAt: null,
+};
+
+jest.mock('@/page-layout/components/dnd/PageLayoutWidgetDndProvider', () => ({
+ PageLayoutWidgetDndProvider: ({ children }: { children: ReactNode }) => (
+ <>{children}</>
+ ),
+}));
+
+jest.mock('@/page-layout/components/PageLayoutLeftPanel', () => ({
+ PageLayoutLeftPanel: () => null,
+}));
+
+jest.mock('@/page-layout/components/PageLayoutTabList', () => ({
+ PageLayoutTabList: () => null,
+}));
+
+jest.mock('@/page-layout/hooks/useCurrentPageLayoutOrThrow', () => ({
+ useCurrentPageLayoutOrThrow: () => ({
+ currentPageLayout: {
+ id: 'page-layout-id',
+ type: PageLayoutType.RECORD_PAGE,
+ tabs: [homeTab],
+ defaultTabToFocusOnMobileAndSidePanelId: null,
+ },
+ }),
+}));
+
+jest.mock('@/page-layout/hooks/useIsPageLayoutInEditMode', () => ({
+ useIsPageLayoutInEditMode: () => false,
+}));
+
+jest.mock('@/page-layout/hooks/usePageLayoutAddTabStrategy', () => ({
+ usePageLayoutAddTabStrategy: () => ({ type: 'insert' }),
+}));
+
+jest.mock('@/page-layout/hooks/usePageLayoutRenderableTabs', () => ({
+ usePageLayoutRenderableTabs: () => ({
+ tabsToRenderInTabList: [homeTab],
+ pinnedLeftTab: undefined,
+ }),
+}));
+
+jest.mock('@/page-layout/PageLayoutMainContent', () => ({
+ PageLayoutMainContent: ({ tabId }: { tabId: string }) => (
+ <div>Rendered tab: {tabId}</div>
+ ),
+}));
+
+jest.mock('@/ui/layout/contexts/LayoutRenderingContext', () => ({
+ useLayoutRenderingContext: () => ({
+ isInSidePanel: false,
+ layoutType: 'record-page',
+ targetRecordIdentifier: {
+ id: 'calendar-event-id',
+ targetObjectNameSingular: 'calendarEvent',
+ },
+ }),
+}));
+
+jest.mock(
+ '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue',
+ () => ({
+ useAtomComponentStateValue: () => mockActiveTabId,
+ }),
+);
+
+jest.mock('@/ui/utilities/state/jotai/hooks/useAtomComponentState', () => ({
+ useAtomComponentState: () => [mockActiveTabId, mockSetActiveTabId],
+}));
+
+jest.mock('@/ui/utilities/responsive/hooks/useIsMobile', () => ({
+ useIsMobile: () => false,
+}));
+
+jest.mock('@/ui/utilities/scroll/components/ScrollWrapper', () => ({
+ ScrollWrapper: ({ children }: { children: ReactNode }) => <>{children}</>,
+}));
+
+describe('PageLayoutTabsRenderer', () => {
+ beforeEach(() => {
+ mockSetActiveTabId.mockClear();
+ });
+
+ it('does not render content for an active tab filtered out of the tab list', () => {
+ mockActiveTabId = 'hidden-transcript-tab-id';
+
+ render(<PageLayoutTabsRenderer />);
+
+ expect(screen.queryByText(/Rendered tab:/)).not.toBeInTheDocument();
+ expect(mockSetActiveTabId).toHaveBeenCalledWith('home-tab-id');
+ });
+
+ it('renders content when the active tab remains renderable', () => {
+ mockActiveTabId = 'home-tab-id';
+
+ render(<PageLayoutTabsRenderer />);
+
+ expect(screen.getByText('Rendered tab: home-tab-id')).toBeVisible();
+ });
+});
diff --git a/packages/twenty-front/src/modules/page-layout/constants/WidgetTypeToRelationFieldName.ts b/packages/twenty-front/src/modules/page-layout/constants/WidgetTypeToRelationFieldName.ts
index 220365ce76e..2d2275b2eb4 100644
--- a/packages/twenty-front/src/modules/page-layout/constants/WidgetTypeToRelationFieldName.ts
+++ b/packages/twenty-front/src/modules/page-layout/constants/WidgetTypeToRelationFieldName.ts
@@ -9,4 +9,5 @@ export const WIDGET_TYPE_TO_RELATION_FIELD_NAME: Partial<
[WidgetType.TIMELINE]: 'timelineActivities',
[WidgetType.EMAILS]: 'messageParticipants',
[WidgetType.CALENDAR]: 'calendarEventParticipants',
+ [WidgetType.CALL_RECORDING_TRANSCRIPT]: 'callRecordings',
};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/WidgetTypesRequiringRelationField.ts b/packages/twenty-front/src/modules/page-layout/constants/WidgetTypesRequiringRelationField.ts
index 040f7480630..bb1d361463d 100644
--- a/packages/twenty-front/src/modules/page-layout/constants/WidgetTypesRequiringRelationField.ts
+++ b/packages/twenty-front/src/modules/page-layout/constants/WidgetTypesRequiringRelationField.ts
@@ -9,4 +9,5 @@ export const WIDGET_TYPES_REQUIRING_RELATION_FIELD: WidgetType[] = [
WidgetType.NOTES,
WidgetType.FILES,
WidgetType.TIMELINE,
+ WidgetType.CALL_RECORDING_TRANSCRIPT,
];
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx
new file mode 100644
index 00000000000..ca7d020c3dd
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx
@@ -0,0 +1,81 @@
+import { usePageLayoutRenderableTabs } from '@/page-layout/hooks/usePageLayoutRenderableTabs';
+import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
+import { renderHook } from '@testing-library/react';
+import { PageLayoutType } from '~/generated-metadata/graphql';
+
+let mockIsMobile = false;
+let mockIsInSidePanel = false;
+
+const featureFilteredHomeTab: PageLayoutTab = {
+ id: 'home-tab-id',
+ applicationId: 'application-id',
+ isActive: true,
+ pageLayoutId: 'page-layout-id',
+ title: 'Home',
+ position: 0,
+ widgets: [],
+ createdAt: '2026-08-07T00:00:00.000Z',
+ updatedAt: '2026-08-07T00:00:00.000Z',
+};
+
+jest.mock('@/object-metadata/hooks/useObjectMetadataItems', () => ({
+ useObjectMetadataItems: () => ({ objectMetadataItems: [] }),
+}));
+
+jest.mock('@/page-layout/hooks/useCurrentPageLayoutOrThrow', () => ({
+ useCurrentPageLayoutOrThrow: () => ({
+ currentPageLayout: {
+ id: 'page-layout-id',
+ type: PageLayoutType.RECORD_PAGE,
+ },
+ }),
+}));
+
+jest.mock('@/page-layout/hooks/useIsPageLayoutInEditMode', () => ({
+ useIsPageLayoutInEditMode: () => false,
+}));
+
+jest.mock(
+ '@/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags',
+ () => ({
+ usePageLayoutTabsFilteredByFeatureFlags: () => ({
+ featureFilteredPageLayoutTabs: [featureFilteredHomeTab],
+ }),
+ }),
+);
+
+jest.mock('@/ui/layout/contexts/LayoutRenderingContext', () => ({
+ useLayoutRenderingContext: () => ({
+ isInSidePanel: mockIsInSidePanel,
+ targetRecordIdentifier: undefined,
+ }),
+}));
+
+jest.mock('twenty-ui/utilities', () => ({
+ useIsMobile: () => mockIsMobile,
+}));
+
+describe('usePageLayoutRenderableTabs', () => {
+ beforeEach(() => {
+ mockIsMobile = false;
+ mockIsInSidePanel = false;
+ });
+
+ it.each([
+ { context: 'full record page', isMobile: false, isInSidePanel: false },
+ { context: 'mobile record page', isMobile: true, isInSidePanel: false },
+ { context: 'record side panel', isMobile: false, isInSidePanel: true },
+ ])(
+ 'uses the feature-filtered tabs on the $context',
+ ({ isMobile, isInSidePanel }) => {
+ mockIsMobile = isMobile;
+ mockIsInSidePanel = isInSidePanel;
+
+ const { result } = renderHook(() => usePageLayoutRenderableTabs());
+
+ expect(result.current.tabsToRenderInTabList).toEqual([
+ featureFilteredHomeTab,
+ ]);
+ },
+ );
+});
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutAddTabStrategy.ts b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutAddTabStrategy.ts
index 2ba3242b1ea..c5087406c4b 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutAddTabStrategy.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutAddTabStrategy.ts
@@ -1,6 +1,7 @@
import { useCreatePageLayoutTab } from '@/page-layout/hooks/useCreatePageLayoutTab';
import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
import { useIsPageLayoutInEditMode } from '@/page-layout/hooks/useIsPageLayoutInEditMode';
+import { usePageLayoutTabsFilteredByFeatureFlags } from '@/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags';
import { pageLayoutTabSettingsOpenTabIdComponentState } from '@/page-layout/states/pageLayoutTabSettingsOpenTabIdComponentState';
import { type PageLayoutAddTabStrategy } from '@/page-layout/types/PageLayoutAddTabStrategy';
import { isReactivatableTab } from '@/page-layout/utils/isReactivatableTab';
@@ -22,6 +23,8 @@ export const usePageLayoutAddTabStrategy = ({
tabListInstanceId: string;
}): PageLayoutAddTabStrategy | undefined => {
const { currentPageLayout } = useCurrentPageLayoutOrThrow();
+ const { featureFilteredPageLayoutTabs } =
+ usePageLayoutTabsFilteredByFeatureFlags();
const isPageLayoutInEditMode = useIsPageLayoutInEditMode();
const { createPageLayoutTab } = useCreatePageLayoutTab({
@@ -67,7 +70,8 @@ export const usePageLayoutAddTabStrategy = ({
return undefined;
}
- const hasInactiveTabs = currentPageLayout.tabs.some(isReactivatableTab);
+ const hasInactiveTabs =
+ featureFilteredPageLayoutTabs.some(isReactivatableTab);
const mode =
currentPageLayout.type === PageLayoutType.RECORD_PAGE && hasInactiveTabs
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutRenderableTabs.ts b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutRenderableTabs.ts
index 15a364f1872..4997596ce70 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutRenderableTabs.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutRenderableTabs.ts
@@ -1,6 +1,7 @@
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
import { useIsPageLayoutInEditMode } from '@/page-layout/hooks/useIsPageLayoutInEditMode';
+import { usePageLayoutTabsFilteredByFeatureFlags } from '@/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags';
import { getTabsByDisplayMode } from '@/page-layout/utils/getTabsByDisplayMode';
import { getTabsRenderableForTargetObject } from '@/page-layout/utils/getTabsRenderableForTargetObject';
import { getTabsWithVisibleWidgets } from '@/page-layout/utils/getTabsWithVisibleWidgets';
@@ -14,6 +15,8 @@ export const usePageLayoutRenderableTabs = () => {
const isMobile = useIsMobile();
const { isInSidePanel, targetRecordIdentifier } = useLayoutRenderingContext();
const { currentPageLayout } = useCurrentPageLayoutOrThrow();
+ const { featureFilteredPageLayoutTabs } =
+ usePageLayoutTabsFilteredByFeatureFlags();
const isPageLayoutInEditMode = useIsPageLayoutInEditMode();
const { objectMetadataItems } = useObjectMetadataItems();
@@ -25,7 +28,7 @@ export const usePageLayoutRenderableTabs = () => {
: undefined;
const tabsWithVisibleWidgets = getTabsWithVisibleWidgets({
- tabs: currentPageLayout.tabs,
+ tabs: featureFilteredPageLayoutTabs,
isMobile,
isInSidePanel,
isEditMode: isPageLayoutInEditMode,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabWithVisibleWidgetsOrThrow.ts b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabWithVisibleWidgetsOrThrow.ts
index 0d37519af55..3b1aa2ca330 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabWithVisibleWidgetsOrThrow.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabWithVisibleWidgetsOrThrow.ts
@@ -1,6 +1,6 @@
import { recordStoreFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreFamilySelector';
-import { useCurrentPageLayout } from '@/page-layout/hooks/useCurrentPageLayout';
import { useIsPageLayoutInEditMode } from '@/page-layout/hooks/useIsPageLayoutInEditMode';
+import { usePageLayoutTabsFilteredByFeatureFlags } from '@/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags';
import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
import { buildWidgetVisibilityContext } from '@/page-layout/utils/buildWidgetVisibilityContext';
import { filterVisibleWidgets } from '@/page-layout/utils/filterVisibleWidgets';
@@ -14,10 +14,11 @@ import { PageLayoutTabLayoutMode } from '~/generated-metadata/graphql';
export const usePageLayoutTabWithVisibleWidgetsOrThrow = (
tabId: string,
): PageLayoutTab => {
- const { currentPageLayout } = useCurrentPageLayout();
const isMobile = useIsMobile();
const { isInSidePanel, targetRecordIdentifier } = useLayoutRenderingContext();
const isPageLayoutInEditMode = useIsPageLayoutInEditMode();
+ const { featureFilteredPageLayoutTabs } =
+ usePageLayoutTabsFilteredByFeatureFlags();
const targetRecordStatus = useAtomFamilySelectorValue(
recordStoreFamilySelector,
@@ -28,11 +29,7 @@ export const usePageLayoutTabWithVisibleWidgetsOrThrow = (
? [{ id: targetRecordIdentifier.id, status: targetRecordStatus }]
: [];
- if (!isDefined(currentPageLayout)) {
- throw new Error('currentPageLayout is not defined');
- }
-
- const tab = currentPageLayout.tabs.find((t) => t.id === tabId);
+ const tab = featureFilteredPageLayoutTabs.find((tab) => tab.id === tabId);
if (!isDefined(tab)) {
throw new Error('Tab not found');
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags.ts b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags.ts
new file mode 100644
index 00000000000..57fb232d13a
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutTabsFilteredByFeatureFlags.ts
@@ -0,0 +1,19 @@
+import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
+import { filterPageLayoutTabsByFeatureFlags } from '@/page-layout/utils/filterPageLayoutTabsByFeatureFlags';
+import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
+import { FeatureFlagKey } from '~/generated-metadata/graphql';
+
+export const usePageLayoutTabsFilteredByFeatureFlags = () => {
+ const { currentPageLayout } = useCurrentPageLayoutOrThrow();
+
+ const isNativeCallRecordingTabsEnabled = useIsFeatureEnabled(
+ FeatureFlagKey.IS_NATIVE_CALL_RECORDING_TABS_ENABLED,
+ );
+
+ const featureFilteredPageLayoutTabs = filterPageLayoutTabsByFeatureFlags({
+ tabs: currentPageLayout.tabs,
+ isNativeCallRecordingTabsEnabled,
+ });
+
+ return { featureFilteredPageLayoutTabs };
+};
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts
new file mode 100644
index 00000000000..d2304b6dd87
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts
@@ -0,0 +1,124 @@
+import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
+import { filterPageLayoutTabsByFeatureFlags } from '@/page-layout/utils/filterPageLayoutTabsByFeatureFlags';
+import {
+ WidgetConfigurationType,
+ WidgetType,
+} from '~/generated-metadata/graphql';
+
+const createMockWidget = (
+ id: string,
+ type: WidgetType,
+): PageLayoutTab['widgets'][0] => ({
+ __typename: 'PageLayoutWidget',
+ id,
+ applicationId: '',
+ isActive: true,
+ pageLayoutTabId: 'tab-1',
+ title: `Widget ${id}`,
+ type,
+ objectMetadataId: null,
+ gridPosition: {
+ __typename: 'GridPosition',
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
+ configuration: {
+ __typename: 'FieldsConfiguration',
+ configurationType: WidgetConfigurationType.FIELDS,
+ viewId: null,
+ },
+ createdAt: '2024-01-01T00:00:00.000Z',
+ updatedAt: '2024-01-01T00:00:00.000Z',
+ deletedAt: null,
+ conditionalDisplay: null,
+});
+
+const createMockTab = (
+ id: string,
+ widgets: PageLayoutTab['widgets'],
+): PageLayoutTab => ({
+ __typename: 'PageLayoutTab',
+ applicationId: '',
+ id,
+ isActive: true,
+ pageLayoutId: 'page-layout-1',
+ title: `Tab ${id}`,
+ position: 0,
+ widgets,
+ createdAt: '2024-01-01T00:00:00.000Z',
+ updatedAt: '2024-01-01T00:00:00.000Z',
+ deletedAt: null,
+});
+
+describe('filterPageLayoutTabsByFeatureFlags', () => {
+ it('removes a native call recording tab when the feature is disabled', () => {
+ const tabs = [
+ createMockTab('transcript-tab', [
+ createMockWidget(
+ 'transcript-widget',
+ WidgetType.CALL_RECORDING_TRANSCRIPT,
+ ),
+ ]),
+ ];
+
+ expect(
+ filterPageLayoutTabsByFeatureFlags({
+ tabs,
+ isNativeCallRecordingTabsEnabled: false,
+ }),
+ ).toEqual([]);
+ });
+
+ it('preserves unrelated widgets in a mixed tab', () => {
+ const tabs = [
+ createMockTab('mixed-tab', [
+ createMockWidget('fields-widget', WidgetType.FIELDS),
+ createMockWidget(
+ 'transcript-widget',
+ WidgetType.CALL_RECORDING_TRANSCRIPT,
+ ),
+ ]),
+ ];
+
+ const filteredTabs = filterPageLayoutTabsByFeatureFlags({
+ tabs,
+ isNativeCallRecordingTabsEnabled: false,
+ });
+
+ expect(filteredTabs).toHaveLength(1);
+ expect(filteredTabs[0].widgets.map((widget) => widget.id)).toEqual([
+ 'fields-widget',
+ ]);
+ });
+
+ it('preserves an unrelated tab that was already empty', () => {
+ const emptyTab = createMockTab('empty-tab', []);
+
+ expect(
+ filterPageLayoutTabsByFeatureFlags({
+ tabs: [emptyTab],
+ isNativeCallRecordingTabsEnabled: false,
+ }),
+ ).toEqual([emptyTab]);
+ });
+
+ it('returns all tabs unchanged when the feature is enabled', () => {
+ const tabs = [
+ createMockTab('transcript-tab', [
+ createMockWidget(
+ 'transcript-widget',
+ WidgetType.CALL_RECORDING_TRANSCRIPT,
+ ),
+ ]),
+ ];
+
+ expect(
+ filterPageLayoutTabsByFeatureFlags({
+ tabs,
+ isNativeCallRecordingTabsEnabled: true,
+ }),
+ ).toBe(tabs);
+ });
+});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts
index 9c4017fdcd5..5ced3398596 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts
@@ -108,6 +108,31 @@ describe('getTabsRenderableForTargetObject', () => {
expect(result.map((tab) => tab.id)).toEqual(['tab-4']);
});
+ it('requires call recordings for the native transcript widget', () => {
+ const tabs = [
+ createMockTab('transcript-tab', [
+ createMockWidget(
+ 'transcript-widget',
+ WidgetType.CALL_RECORDING_TRANSCRIPT,
+ ),
+ ]),
+ ];
+
+ expect(
+ getTabsRenderableForTargetObject({
+ tabs,
+ targetObjectFields: [],
+ }),
+ ).toEqual([]);
+
+ expect(
+ getTabsRenderableForTargetObject({
+ tabs,
+ targetObjectFields: [createRelationField('callRecordings')],
+ }).map((tab) => tab.id),
+ ).toEqual(['transcript-tab']);
+ });
+
it('should drop tabs whose relation field exists but is deactivated', () => {
const tabs = [
createMockTab('tab-1', [createMockWidget('widget-1', WidgetType.TASKS)]),
diff --git a/packages/twenty-front/src/modules/page-layout/utils/filterPageLayoutTabsByFeatureFlags.ts b/packages/twenty-front/src/modules/page-layout/utils/filterPageLayoutTabsByFeatureFlags.ts
new file mode 100644
index 00000000000..5691fa9ec60
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/utils/filterPageLayoutTabsByFeatureFlags.ts
@@ -0,0 +1,36 @@
+import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
+import { WidgetType } from '~/generated-metadata/graphql';
+
+const NATIVE_CALL_RECORDING_WIDGET_TYPES = new Set<WidgetType>([
+ WidgetType.CALL_RECORDING_TRANSCRIPT,
+]);
+
+type FilterPageLayoutTabsByFeatureFlagsParams = {
+ tabs: PageLayoutTab[];
+ isNativeCallRecordingTabsEnabled: boolean;
+};
+
+export const filterPageLayoutTabsByFeatureFlags = ({
+ tabs,
+ isNativeCallRecordingTabsEnabled,
+}: FilterPageLayoutTabsByFeatureFlagsParams): PageLayoutTab[] => {
+ if (isNativeCallRecordingTabsEnabled) {
+ return tabs;
+ }
+
+ return tabs.flatMap((tab) => {
+ const featureEnabledWidgets = tab.widgets.filter(
+ (widget) => !NATIVE_CALL_RECORDING_WIDGET_TYPES.has(widget.type),
+ );
+
+ if (featureEnabledWidgets.length === tab.widgets.length) {
+ return [tab];
+ }
+
+ if (featureEnabledWidgets.length === 0) {
+ return [];
+ }
+
+ return [{ ...tab, widgets: featureEnabledWidgets }];
+ });
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx
new file mode 100644
index 00000000000..42cdabcaadb
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx
@@ -0,0 +1,67 @@
+import { CallRecordingTranscriptEntryList } from '@/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList';
+import { type CalendarEventCallRecordingTranscriptWidgetState } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptWidgetState';
+import { getCallRecordingTranscriptStateMessage } from '@/page-layout/widgets/call-recording-transcript/utils/getCallRecordingTranscriptStateMessage';
+import { PageLayoutWidgetErrorDisplay } from '@/page-layout/widgets/components/PageLayoutWidgetErrorDisplay';
+import { PageLayoutWidgetForbiddenDisplay } from '@/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay';
+import { PageLayoutWidgetMessageDisplay } from '@/page-layout/widgets/components/PageLayoutWidgetMessageDisplay';
+import { WidgetSkeletonLoader } from '@/page-layout/widgets/components/WidgetSkeletonLoader';
+import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
+import { styled } from '@linaria/react';
+import { IconFileText } from 'twenty-ui/icon';
+
+const StyledForbiddenContainer = styled.div`
+ align-items: center;
+ display: flex;
+ justify-content: center;
+`;
+
+type CallRecordingTranscriptBodyProps = {
+ callRecordingTranscriptState: CalendarEventCallRecordingTranscriptWidgetState;
+};
+
+export const CallRecordingTranscriptBody = ({
+ callRecordingTranscriptState,
+}: CallRecordingTranscriptBodyProps) => {
+ const widget = useCurrentWidget();
+
+ if (callRecordingTranscriptState.state === 'LOADING') {
+ return <WidgetSkeletonLoader />;
+ }
+
+ if (callRecordingTranscriptState.state === 'READY') {
+ return (
+ <CallRecordingTranscriptEntryList
+ entries={callRecordingTranscriptState.entries}
+ />
+ );
+ }
+
+ if (callRecordingTranscriptState.state === 'QUERY_ERROR') {
+ return (
+ <PageLayoutWidgetErrorDisplay
+ widgetId={widget.id}
+ error={callRecordingTranscriptState.error}
+ />
+ );
+ }
+
+ if (callRecordingTranscriptState.state === 'FORBIDDEN') {
+ return (
+ <StyledForbiddenContainer>
+ <PageLayoutWidgetForbiddenDisplay
+ widgetId={widget.id}
+ restriction={callRecordingTranscriptState.restriction}
+ />
+ </StyledForbiddenContainer>
+ );
+ }
+
+ return (
+ <PageLayoutWidgetMessageDisplay
+ Icon={IconFileText}
+ message={getCallRecordingTranscriptStateMessage(
+ callRecordingTranscriptState.state,
+ )}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx
new file mode 100644
index 00000000000..2e8f5107e14
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx
@@ -0,0 +1,27 @@
+import { CallRecordingTranscriptEntryListItem } from '@/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem';
+import { styled } from '@linaria/react';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+import { type CallRecordingParsedTranscriptEntry } from 'twenty-shared/types';
+
+const StyledEntryList = styled.ul`
+ display: flex;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[6]};
+ list-style: none;
+ margin: 0;
+ padding: ${themeCssVariables.spacing[6]};
+`;
+
+type CallRecordingTranscriptEntryListProps = {
+ entries: CallRecordingParsedTranscriptEntry[];
+};
+
+export const CallRecordingTranscriptEntryList = ({
+ entries,
+}: CallRecordingTranscriptEntryListProps) => (
+ <StyledEntryList>
+ {entries.map((entry, entryIndex) => (
+ <CallRecordingTranscriptEntryListItem key={entryIndex} entry={entry} />
+ ))}
+ </StyledEntryList>
+);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx
new file mode 100644
index 00000000000..f94e422c786
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx
@@ -0,0 +1,71 @@
+import { formatCallRecordingTranscriptTimestamp } from '@/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp';
+import { styled } from '@linaria/react';
+import { t } from '@lingui/core/macro';
+import { Avatar, Chip, ChipVariant } from 'twenty-ui/data-display';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+import { type CallRecordingParsedTranscriptEntry } from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+
+const StyledEntry = styled.li`
+ display: flex;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[2]};
+`;
+
+const StyledEntryHeader = styled.div`
+ align-items: center;
+ display: flex;
+ gap: ${themeCssVariables.spacing[2]};
+ min-width: 0;
+`;
+
+const StyledTimestamp = styled.span`
+ color: ${themeCssVariables.font.color.tertiary};
+ font-size: ${themeCssVariables.font.size.xs};
+ font-variant-numeric: tabular-nums;
+`;
+
+const StyledText = styled.p`
+ color: ${themeCssVariables.font.color.primary};
+ font-size: ${themeCssVariables.font.size.md};
+ line-height: ${themeCssVariables.text.lineHeight.lg};
+ margin: 0;
+ overflow-wrap: break-word;
+ white-space: pre-wrap;
+`;
+
+type CallRecordingTranscriptEntryListItemProps = {
+ entry: CallRecordingParsedTranscriptEntry;
+};
+
+export const CallRecordingTranscriptEntryListItem = ({
+ entry,
+}: CallRecordingTranscriptEntryListItemProps) => {
+ const speakerName = entry.speakerName ?? t`Unknown speaker`;
+
+ return (
+ <StyledEntry>
+ <StyledEntryHeader>
+ <Chip
+ clickable={false}
+ label={speakerName}
+ variant={ChipVariant.Transparent}
+ leftComponent={
+ <Avatar
+ placeholder={speakerName}
+ placeholderColorSeed={speakerName}
+ size="sm"
+ type="rounded"
+ />
+ }
+ />
+ {isDefined(entry.startSeconds) && (
+ <StyledTimestamp>
+ {formatCallRecordingTranscriptTimestamp(entry.startSeconds)}
+ </StyledTimestamp>
+ )}
+ </StyledEntryHeader>
+ <StyledText>{entry.text}</StyledText>
+ </StyledEntry>
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidget.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidget.tsx
new file mode 100644
index 00000000000..90bdce4f902
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidget.tsx
@@ -0,0 +1,35 @@
+import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
+import { CallRecordingTranscriptBody } from '@/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody';
+import { CallRecordingTranscriptWidgetContent } from '@/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidgetContent';
+import { styled } from '@linaria/react';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
+
+const StyledWidgetContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ min-height: 0;
+ overflow: auto;
+ width: 100%;
+`;
+
+export const CallRecordingTranscriptWidget = () => {
+ const { objectMetadataItems } = useObjectMetadataItems();
+
+ const hasCallRecordingObjectMetadata = objectMetadataItems.some(
+ (objectMetadataItem) =>
+ objectMetadataItem.nameSingular === CoreObjectNameSingular.CallRecording,
+ );
+
+ return (
+ <StyledWidgetContainer>
+ {hasCallRecordingObjectMetadata ? (
+ <CallRecordingTranscriptWidgetContent />
+ ) : (
+ <CallRecordingTranscriptBody
+ callRecordingTranscriptState={{ state: 'UNAVAILABLE' }}
+ />
+ )}
+ </StyledWidgetContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidgetContent.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidgetContent.tsx
new file mode 100644
index 00000000000..053d2b356d4
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidgetContent.tsx
@@ -0,0 +1,13 @@
+import { CallRecordingTranscriptBody } from '@/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody';
+import { useCalendarEventCallRecordingTranscript } from '@/page-layout/widgets/call-recording-transcript/hooks/useCalendarEventCallRecordingTranscript';
+
+export const CallRecordingTranscriptWidgetContent = () => {
+ const { callRecordingTranscriptState } =
+ useCalendarEventCallRecordingTranscript();
+
+ return (
+ <CallRecordingTranscriptBody
+ callRecordingTranscriptState={callRecordingTranscriptState}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/hooks/__tests__/useCalendarEventCallRecordingTranscript.test.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/hooks/__tests__/useCalendarEventCallRecordingTranscript.test.tsx
new file mode 100644
index 00000000000..946863ae3aa
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/hooks/__tests__/useCalendarEventCallRecordingTranscript.test.tsx
@@ -0,0 +1,279 @@
+import { useCalendarEventCallRecordingTranscript } from '@/page-layout/widgets/call-recording-transcript/hooks/useCalendarEventCallRecordingTranscript';
+import { act, renderHook } from '@testing-library/react';
+import { CallRecordingStatus } from '~/generated/graphql';
+
+const mockUseFindManyRecords = jest.fn();
+const mockUseListenToEventsForQuery = jest.fn();
+
+const mockLayoutRenderingContext: {
+ targetRecordIdentifier?: {
+ id: string;
+ targetObjectNameSingular: string;
+ };
+} = {
+ targetRecordIdentifier: {
+ id: 'calendar-event-id',
+ targetObjectNameSingular: 'calendarEvent',
+ },
+};
+
+const requiredFields = ['status', 'transcript', 'createdAt'].map((name) => ({
+ id: `${name}-field-id`,
+ name,
+}));
+
+let mockCallRecordingObjectFields: { id: string; name: string }[];
+
+const mockCallRecordingPermissions: {
+ canReadObjectRecords: boolean;
+ restrictedFields: Record<string, { canRead: boolean }>;
+} = {
+ canReadObjectRecords: true,
+ restrictedFields: {},
+};
+
+let findManyRecordsResult: {
+ records: Record<string, unknown>[];
+ loading: boolean;
+ error: Error | undefined;
+ refetch: jest.Mock;
+};
+
+jest.mock('@/object-metadata/hooks/useObjectMetadataItem', () => ({
+ useObjectMetadataItem: () => ({
+ objectMetadataItem: {
+ id: 'call-recording-object-id',
+ labelSingular: 'Call Recording',
+ fields: mockCallRecordingObjectFields,
+ },
+ }),
+}));
+
+jest.mock('@/object-record/hooks/useObjectPermissionsForObject', () => ({
+ useObjectPermissionsForObject: () => mockCallRecordingPermissions,
+}));
+
+jest.mock('@/object-record/hooks/useFindManyRecords', () => ({
+ useFindManyRecords: (parameters: unknown) => {
+ mockUseFindManyRecords(parameters);
+
+ return findManyRecordsResult;
+ },
+}));
+
+jest.mock('@/ui/layout/contexts/LayoutRenderingContext', () => ({
+ useLayoutRenderingContext: () => mockLayoutRenderingContext,
+}));
+
+jest.mock('@/sse-db-event/hooks/useListenToEventsForQuery', () => ({
+ useListenToEventsForQuery: (parameters: unknown) => {
+ mockUseListenToEventsForQuery(parameters);
+ },
+}));
+
+jest.mock(
+ '@/browser-event/hooks/useListenToObjectRecordOperationBrowserEvent',
+ () => ({
+ useListenToObjectRecordOperationBrowserEvent: jest.fn(),
+ }),
+);
+
+const readyCallRecording = {
+ __typename: 'CallRecording',
+ id: 'ready-call-recording-id',
+ status: CallRecordingStatus.COMPLETED,
+ transcript: [
+ {
+ participant: { name: 'Ada' },
+ words: [{ text: 'Hello', start_timestamp: { relative: 0 } }],
+ },
+ ],
+ createdAt: '2026-08-07T09:55:00.000Z',
+};
+
+describe('useCalendarEventCallRecordingTranscript', () => {
+ beforeEach(() => {
+ mockUseFindManyRecords.mockClear();
+ mockUseListenToEventsForQuery.mockClear();
+ mockLayoutRenderingContext.targetRecordIdentifier = {
+ id: 'calendar-event-id',
+ targetObjectNameSingular: 'calendarEvent',
+ };
+ mockCallRecordingPermissions.canReadObjectRecords = true;
+ mockCallRecordingPermissions.restrictedFields = {};
+ mockCallRecordingObjectFields = requiredFields;
+ findManyRecordsResult = {
+ records: [],
+ loading: false,
+ error: undefined,
+ refetch: jest.fn(),
+ };
+ });
+
+ it('queries every transcript field for the current calendar event in arrival order', () => {
+ renderHook(() => useCalendarEventCallRecordingTranscript());
+
+ expect(mockUseFindManyRecords).toHaveBeenCalledWith(
+ expect.objectContaining({
+ objectNameSingular: 'callRecording',
+ filter: { calendarEventId: { eq: 'calendar-event-id' } },
+ orderBy: [{ createdAt: 'AscNullsLast' }, { id: 'AscNullsFirst' }],
+ recordGqlFields: {
+ id: true,
+ status: true,
+ transcript: true,
+ createdAt: true,
+ },
+ skip: false,
+ }),
+ );
+ });
+
+ it('refetches after the SSE client reconnects', async () => {
+ renderHook(() => useCalendarEventCallRecordingTranscript());
+
+ const { onSseReconnected } = mockUseListenToEventsForQuery.mock
+ .calls[0][0] as {
+ onSseReconnected: () => Promise<void>;
+ };
+
+ await act(async () => {
+ await onSseReconnected();
+ });
+
+ expect(findManyRecordsResult.refetch).toHaveBeenCalledTimes(1);
+ });
+
+ it('returns permission denied when the object cannot be read', () => {
+ mockCallRecordingPermissions.canReadObjectRecords = false;
+
+ const { result } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'FORBIDDEN',
+ restriction: { type: 'object', objectName: 'Call Recording' },
+ });
+ expect(mockUseFindManyRecords).toHaveBeenCalledWith(
+ expect.objectContaining({ skip: true }),
+ );
+ });
+
+ it('returns permission denied with the field name when a required field cannot be read', () => {
+ mockCallRecordingPermissions.restrictedFields = {
+ 'transcript-field-id': { canRead: false },
+ };
+
+ const { result } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'FORBIDDEN',
+ restriction: { type: 'field', fieldNames: ['transcript'] },
+ });
+ });
+
+ it('reports unavailable instead of forbidden when a required field has no metadata', () => {
+ mockCallRecordingObjectFields = requiredFields.filter(
+ (field) => field.name !== 'transcript',
+ );
+
+ const { result } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'UNAVAILABLE',
+ });
+ expect(mockUseFindManyRecords).toHaveBeenCalledWith(
+ expect.objectContaining({ skip: true }),
+ );
+ });
+
+ it('fails safely outside a calendar event record page', () => {
+ mockLayoutRenderingContext.targetRecordIdentifier = {
+ id: 'person-id',
+ targetObjectNameSingular: 'person',
+ };
+
+ const { result } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'UNSUPPORTED',
+ });
+ });
+
+ it('fails safely when there is no target record', () => {
+ mockLayoutRenderingContext.targetRecordIdentifier = undefined;
+
+ const { result } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'UNSUPPORTED',
+ });
+ });
+
+ it('distinguishes loading from no related recordings', () => {
+ findManyRecordsResult.loading = true;
+
+ const { result, rerender } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'LOADING',
+ });
+
+ act(() => {
+ findManyRecordsResult.loading = false;
+ rerender();
+ });
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'NO_RECORDING',
+ });
+ });
+
+ it('maps query failures without showing a no-recording state', () => {
+ const queryError = new Error('Query failed');
+ findManyRecordsResult.error = queryError;
+
+ const { result } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState).toEqual({
+ state: 'QUERY_ERROR',
+ error: queryError,
+ });
+ });
+
+ it('reacts when a cached pending recording receives a transcript', () => {
+ findManyRecordsResult.records = [
+ {
+ ...readyCallRecording,
+ status: CallRecordingStatus.PROCESSING,
+ transcript: { status: 'PENDING' },
+ },
+ ];
+
+ const { result, rerender } = renderHook(() =>
+ useCalendarEventCallRecordingTranscript(),
+ );
+
+ expect(result.current.callRecordingTranscriptState.state).toBe('PENDING');
+
+ act(() => {
+ findManyRecordsResult.records = [readyCallRecording];
+ rerender();
+ });
+
+ expect(result.current.callRecordingTranscriptState.state).toBe('READY');
+ });
+});
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/hooks/useCalendarEventCallRecordingTranscript.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/hooks/useCalendarEventCallRecordingTranscript.ts
new file mode 100644
index 00000000000..aa2bf31c980
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/hooks/useCalendarEventCallRecordingTranscript.ts
@@ -0,0 +1,191 @@
+import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
+import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
+import { useObjectPermissionsForObject } from '@/object-record/hooks/useObjectPermissionsForObject';
+import { type CalendarEventCallRecordingTranscriptCandidate } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptCandidate';
+import { type CalendarEventCallRecordingTranscriptWidgetState } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptWidgetState';
+import { selectCalendarEventCallRecordingTranscript } from '@/page-layout/widgets/call-recording-transcript/utils/selectCalendarEventCallRecordingTranscript';
+import { useListenToObjectRecordOperationBrowserEvent } from '@/browser-event/hooks/useListenToObjectRecordOperationBrowserEvent';
+import { useListenToEventsForQuery } from '@/sse-db-event/hooks/useListenToEventsForQuery';
+import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
+import { isNonEmptyString } from '@sniptt/guards';
+import { useCallback, useMemo } from 'react';
+import {
+ CoreObjectNameSingular,
+ type RecordGqlOperationGqlRecordFields,
+ type RecordGqlOperationOrderBy,
+} from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+
+const CALL_RECORDING_TRANSCRIPT_QUERY_LIMIT = 50;
+
+const CALL_RECORDING_TRANSCRIPT_RECORD_FIELDS = {
+ id: true,
+ status: true,
+ transcript: true,
+ createdAt: true,
+} as const satisfies RecordGqlOperationGqlRecordFields;
+
+const CALL_RECORDING_TRANSCRIPT_ORDER_BY: RecordGqlOperationOrderBy = [
+ { createdAt: 'AscNullsLast' },
+ { id: 'AscNullsFirst' },
+];
+
+const REQUIRED_CALL_RECORDING_FIELD_NAMES = [
+ 'status',
+ 'transcript',
+ 'createdAt',
+];
+
+export const useCalendarEventCallRecordingTranscript = (): {
+ callRecordingTranscriptState: CalendarEventCallRecordingTranscriptWidgetState;
+} => {
+ const { targetRecordIdentifier } = useLayoutRenderingContext();
+
+ const { objectMetadataItem: callRecordingObjectMetadataItem } =
+ useObjectMetadataItem({
+ objectNameSingular: CoreObjectNameSingular.CallRecording,
+ });
+
+ const callRecordingObjectPermissions = useObjectPermissionsForObject(
+ callRecordingObjectMetadataItem.id,
+ );
+
+ const calendarEventId =
+ targetRecordIdentifier?.targetObjectNameSingular ===
+ CoreObjectNameSingular.CalendarEvent
+ ? targetRecordIdentifier.id
+ : undefined;
+
+ const requiredFieldMetadataItems = REQUIRED_CALL_RECORDING_FIELD_NAMES.map(
+ (requiredFieldName) =>
+ callRecordingObjectMetadataItem.fields.find(
+ (field) => field.name === requiredFieldName,
+ ),
+ ).filter(isDefined);
+
+ const hasRequiredFieldMetadata =
+ requiredFieldMetadataItems.length ===
+ REQUIRED_CALL_RECORDING_FIELD_NAMES.length;
+
+ const restrictedFieldNames = requiredFieldMetadataItems
+ .filter(
+ (fieldMetadataItem) =>
+ callRecordingObjectPermissions.restrictedFields[fieldMetadataItem.id]
+ ?.canRead === false,
+ )
+ .map((fieldMetadataItem) =>
+ isNonEmptyString(fieldMetadataItem.label)
+ ? fieldMetadataItem.label
+ : fieldMetadataItem.name,
+ );
+
+ const canReadCallRecordingObjectRecords =
+ callRecordingObjectPermissions.canReadObjectRecords;
+
+ const shouldSkipQuery =
+ !isDefined(calendarEventId) ||
+ !hasRequiredFieldMetadata ||
+ !canReadCallRecordingObjectRecords ||
+ restrictedFieldNames.length > 0;
+
+ const callRecordingFilter = useMemo(
+ () =>
+ isDefined(calendarEventId)
+ ? { calendarEventId: { eq: calendarEventId } }
+ : undefined,
+ [calendarEventId],
+ );
+
+ const {
+ records: callRecordings,
+ loading,
+ error,
+ refetch,
+ } = useFindManyRecords<CalendarEventCallRecordingTranscriptCandidate>({
+ objectNameSingular: CoreObjectNameSingular.CallRecording,
+ filter: callRecordingFilter,
+ orderBy: CALL_RECORDING_TRANSCRIPT_ORDER_BY,
+ recordGqlFields: CALL_RECORDING_TRANSCRIPT_RECORD_FIELDS,
+ limit: CALL_RECORDING_TRANSCRIPT_QUERY_LIMIT,
+ skip: shouldSkipQuery,
+ });
+
+ const operationSignature = useMemo(
+ () => ({
+ objectNameSingular: CoreObjectNameSingular.CallRecording,
+ variables: {
+ filter: callRecordingFilter,
+ },
+ }),
+ [callRecordingFilter],
+ );
+
+ const refetchCallRecordingTranscriptOnSseReconnected =
+ useCallback(async () => {
+ await refetch();
+ }, [refetch]);
+
+ useListenToEventsForQuery({
+ queryId: `call-recording-transcript-${calendarEventId}`,
+ operationSignature,
+ skip: shouldSkipQuery,
+ onSseReconnected: refetchCallRecordingTranscriptOnSseReconnected,
+ });
+
+ const handleCallRecordingOperation = useCallback(() => {
+ if (shouldSkipQuery) {
+ return;
+ }
+
+ refetch();
+ }, [shouldSkipQuery, refetch]);
+
+ useListenToObjectRecordOperationBrowserEvent({
+ onObjectRecordOperationBrowserEvent: handleCallRecordingOperation,
+ objectMetadataItemId: callRecordingObjectMetadataItem.id,
+ });
+
+ const callRecordingTranscriptSelection = useMemo(
+ () => selectCalendarEventCallRecordingTranscript(callRecordings),
+ [callRecordings],
+ );
+
+ if (!isDefined(calendarEventId)) {
+ return { callRecordingTranscriptState: { state: 'UNSUPPORTED' } };
+ }
+
+ if (!hasRequiredFieldMetadata) {
+ return { callRecordingTranscriptState: { state: 'UNAVAILABLE' } };
+ }
+
+ if (!canReadCallRecordingObjectRecords) {
+ return {
+ callRecordingTranscriptState: {
+ state: 'FORBIDDEN',
+ restriction: {
+ type: 'object',
+ objectName: callRecordingObjectMetadataItem.labelSingular,
+ },
+ },
+ };
+ }
+
+ if (restrictedFieldNames.length > 0) {
+ return {
+ callRecordingTranscriptState: {
+ state: 'FORBIDDEN',
+ restriction: { type: 'field', fieldNames: restrictedFieldNames },
+ },
+ };
+ }
+
+ if (isDefined(error)) {
+ return { callRecordingTranscriptState: { state: 'QUERY_ERROR', error } };
+ }
+
+ if (loading) {
+ return { callRecordingTranscriptState: { state: 'LOADING' } };
+ }
+
+ return { callRecordingTranscriptState: callRecordingTranscriptSelection };
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptCandidate.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptCandidate.ts
new file mode 100644
index 00000000000..48ec56cc202
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptCandidate.ts
@@ -0,0 +1,9 @@
+import { type CallRecordingStatus } from '~/generated/graphql';
+
+export type CalendarEventCallRecordingTranscriptCandidate = {
+ __typename: 'CallRecording';
+ id: string;
+ status: CallRecordingStatus;
+ transcript: unknown;
+ createdAt: string | null | undefined;
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptSelection.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptSelection.ts
new file mode 100644
index 00000000000..b514cd75e81
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptSelection.ts
@@ -0,0 +1,9 @@
+import { type CallRecordingParsedTranscriptEntry } from 'twenty-shared/types';
+
+export type CalendarEventCallRecordingTranscriptSelection =
+ | {
+ state: 'READY';
+ entries: CallRecordingParsedTranscriptEntry[];
+ }
+ | { state: 'PENDING' | 'FAILED' | 'EMPTY' | 'MISSING' | 'UNRECOGNIZED' }
+ | { state: 'NO_RECORDING' };
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptWidgetState.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptWidgetState.ts
new file mode 100644
index 00000000000..0aec91e8fdf
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptWidgetState.ts
@@ -0,0 +1,8 @@
+import { type CalendarEventCallRecordingTranscriptSelection } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptSelection';
+import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
+
+export type CalendarEventCallRecordingTranscriptWidgetState =
+ | CalendarEventCallRecordingTranscriptSelection
+ | { state: 'LOADING' | 'UNSUPPORTED' | 'UNAVAILABLE' }
+ | { state: 'QUERY_ERROR'; error: unknown }
+ | { state: 'FORBIDDEN'; restriction: WidgetAccessDenialInfo };
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/__tests__/formatCallRecordingTranscriptTimestamp.test.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/__tests__/formatCallRecordingTranscriptTimestamp.test.ts
new file mode 100644
index 00000000000..55eea6d3e26
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/__tests__/formatCallRecordingTranscriptTimestamp.test.ts
@@ -0,0 +1,15 @@
+import { formatCallRecordingTranscriptTimestamp } from '@/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp';
+
+describe('formatCallRecordingTranscriptTimestamp', () => {
+ it.each([
+ [0, '0:00'],
+ [5.9, '0:05'],
+ [65, '1:05'],
+ [3661, '1:01:01'],
+ [-10, '0:00'],
+ ])('formats %s seconds as %s', (seconds, expectedTimestamp) => {
+ expect(formatCallRecordingTranscriptTimestamp(seconds)).toBe(
+ expectedTimestamp,
+ );
+ });
+});
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/__tests__/selectCalendarEventCallRecordingTranscript.test.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/__tests__/selectCalendarEventCallRecordingTranscript.test.ts
new file mode 100644
index 00000000000..f072eaa4e70
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/__tests__/selectCalendarEventCallRecordingTranscript.test.ts
@@ -0,0 +1,217 @@
+import { selectCalendarEventCallRecordingTranscript } from '@/page-layout/widgets/call-recording-transcript/utils/selectCalendarEventCallRecordingTranscript';
+import { CallRecordingStatus } from '~/generated/graphql';
+
+const createCallRecording = ({
+ id,
+ transcript,
+ status = CallRecordingStatus.COMPLETED,
+}: {
+ id: string;
+ transcript: unknown;
+ status?: CallRecordingStatus;
+}) => ({
+ __typename: 'CallRecording' as const,
+ id,
+ status,
+ transcript,
+ createdAt: '2026-08-01T00:00:00.000Z',
+});
+
+const VALID_TRANSCRIPT = [
+ {
+ participant: { name: 'Ada' },
+ words: [{ text: 'Readable transcript' }],
+ },
+];
+
+describe('selectCalendarEventCallRecordingTranscript', () => {
+ it('shows the first readable transcript even when a later attempt failed', () => {
+ const selection = selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'first-readable',
+ transcript: VALID_TRANSCRIPT,
+ }),
+ createCallRecording({
+ id: 'later-failed',
+ transcript: { status: 'FAILED' },
+ status: CallRecordingStatus.FAILED,
+ }),
+ ]);
+
+ expect(selection).toMatchObject({
+ state: 'READY',
+ entries: [{ speakerName: 'Ada', text: 'Readable transcript' }],
+ });
+ });
+
+ it('shows the first readable transcript when several are readable', () => {
+ const selection = selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'later-failed',
+ transcript: null,
+ status: CallRecordingStatus.FAILED,
+ }),
+ createCallRecording({
+ id: 'first-readable',
+ transcript: VALID_TRANSCRIPT,
+ }),
+ createCallRecording({
+ id: 'second-readable',
+ transcript: [
+ {
+ participant: { name: 'Grace' },
+ words: [{ text: 'Second transcript' }],
+ },
+ ],
+ }),
+ ]);
+
+ expect(selection).toMatchObject({
+ state: 'READY',
+ entries: [{ text: 'Readable transcript' }],
+ });
+ });
+
+ it('prefers a pending candidate over earlier terminal candidates', () => {
+ const selection = selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'first-failed',
+ transcript: { status: 'FAILED' },
+ status: CallRecordingStatus.FAILED,
+ }),
+ createCallRecording({
+ id: 'retry-pending',
+ transcript: null,
+ status: CallRecordingStatus.PROCESSING,
+ }),
+ ]);
+
+ expect(selection).toMatchObject({ state: 'PENDING' });
+ });
+
+ it('falls back to the first recording when nothing is readable or pending', () => {
+ const selection = selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'first-failed',
+ transcript: { status: 'FAILED' },
+ status: CallRecordingStatus.FAILED,
+ }),
+ createCallRecording({
+ id: 'later-empty',
+ transcript: [],
+ }),
+ ]);
+
+ expect(selection).toMatchObject({ state: 'FAILED' });
+ });
+
+ it.each([
+ {
+ expectedState: 'PENDING',
+ transcript: { status: 'PENDING' },
+ status: CallRecordingStatus.COMPLETED,
+ },
+ {
+ expectedState: 'FAILED',
+ transcript: { status: 'FAILED' },
+ status: CallRecordingStatus.COMPLETED,
+ },
+ {
+ expectedState: 'FAILED',
+ transcript: null,
+ status: CallRecordingStatus.NOT_RECORDED,
+ },
+ {
+ expectedState: 'EMPTY',
+ transcript: [],
+ status: CallRecordingStatus.COMPLETED,
+ },
+ {
+ expectedState: 'UNRECOGNIZED',
+ transcript: { status: 'UNKNOWN' },
+ status: CallRecordingStatus.COMPLETED,
+ },
+ {
+ expectedState: 'MISSING',
+ transcript: null,
+ status: CallRecordingStatus.COMPLETED,
+ },
+ ] as const)(
+ 'returns $expectedState for its corresponding terminal payload',
+ ({ expectedState, transcript, status }) => {
+ expect(
+ selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'recording',
+ transcript,
+ status,
+ }),
+ ]),
+ ).toMatchObject({ state: expectedState });
+ },
+ );
+
+ it.each([
+ {
+ expectedState: 'PENDING',
+ transcript: [],
+ status: CallRecordingStatus.PROCESSING,
+ },
+ {
+ expectedState: 'PENDING',
+ transcript: { unexpected: true },
+ status: CallRecordingStatus.RECORDING,
+ },
+ {
+ expectedState: 'FAILED',
+ transcript: [],
+ status: CallRecordingStatus.FAILED,
+ },
+ {
+ expectedState: 'FAILED',
+ transcript: { unexpected: true },
+ status: CallRecordingStatus.NOT_RECORDED,
+ },
+ {
+ expectedState: 'FAILED',
+ transcript: { status: 'PENDING' },
+ status: CallRecordingStatus.FAILED,
+ },
+ {
+ expectedState: 'FAILED',
+ transcript: { status: 'FAILED' },
+ status: CallRecordingStatus.PROCESSING,
+ },
+ ] as const)(
+ 'uses lifecycle and explicit failure precedence for $status with $transcript',
+ ({ expectedState, transcript, status }) => {
+ expect(
+ selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'recording',
+ transcript,
+ status,
+ }),
+ ]),
+ ).toMatchObject({ state: expectedState });
+ },
+ );
+
+ it('lets a readable transcript override a failed lifecycle status', () => {
+ expect(
+ selectCalendarEventCallRecordingTranscript([
+ createCallRecording({
+ id: 'recording',
+ transcript: VALID_TRANSCRIPT,
+ status: CallRecordingStatus.FAILED,
+ }),
+ ]),
+ ).toMatchObject({ state: 'READY' });
+ });
+
+ it('returns no recording for an empty candidate list', () => {
+ expect(selectCalendarEventCallRecordingTranscript([])).toEqual({
+ state: 'NO_RECORDING',
+ });
+ });
+});
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp.ts
new file mode 100644
index 00000000000..75b53edfec9
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp.ts
@@ -0,0 +1,16 @@
+export const formatCallRecordingTranscriptTimestamp = (
+ seconds: number,
+): string => {
+ const wholeSeconds = Math.max(0, Math.floor(seconds));
+ const hours = Math.floor(wholeSeconds / 3600);
+ const minutes = Math.floor((wholeSeconds % 3600) / 60);
+ const remainingSeconds = wholeSeconds % 60;
+
+ const paddedSeconds = remainingSeconds.toString().padStart(2, '0');
+
+ if (hours === 0) {
+ return `${minutes}:${paddedSeconds}`;
+ }
+
+ return `${hours}:${minutes.toString().padStart(2, '0')}:${paddedSeconds}`;
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/getCallRecordingTranscriptStateMessage.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/getCallRecordingTranscriptStateMessage.ts
new file mode 100644
index 00000000000..6504258af5c
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/getCallRecordingTranscriptStateMessage.ts
@@ -0,0 +1,28 @@
+import { type CalendarEventCallRecordingTranscriptWidgetState } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptWidgetState';
+import { t } from '@lingui/core/macro';
+
+export const getCallRecordingTranscriptStateMessage = (
+ state: Exclude<
+ CalendarEventCallRecordingTranscriptWidgetState['state'],
+ 'LOADING' | 'READY' | 'QUERY_ERROR' | 'FORBIDDEN'
+ >,
+): string => {
+ switch (state) {
+ case 'UNSUPPORTED':
+ return t`Open a calendar event to view its transcript.`;
+ case 'UNAVAILABLE':
+ return t`Call recording is not available in this workspace.`;
+ case 'NO_RECORDING':
+ return t`No call recording exists for this calendar event yet.`;
+ case 'PENDING':
+ return t`Transcript is being prepared…`;
+ case 'FAILED':
+ return t`The transcript could not be generated.`;
+ case 'EMPTY':
+ return t`The transcript is empty.`;
+ case 'MISSING':
+ return t`No transcript is available for this recording.`;
+ case 'UNRECOGNIZED':
+ return t`Unrecognized transcript format.`;
+ }
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/selectCalendarEventCallRecordingTranscript.ts b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/selectCalendarEventCallRecordingTranscript.ts
new file mode 100644
index 00000000000..2debf0a3771
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/utils/selectCalendarEventCallRecordingTranscript.ts
@@ -0,0 +1,88 @@
+import { type CalendarEventCallRecordingTranscriptCandidate } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptCandidate';
+import { type CalendarEventCallRecordingTranscriptSelection } from '@/page-layout/widgets/call-recording-transcript/types/CalendarEventCallRecordingTranscriptSelection';
+import { isArray } from '@sniptt/guards';
+import {
+ isCallRecordingTranscriptStatusMarker,
+ isDefined,
+ parseCallRecordingTranscriptEntries,
+} from 'twenty-shared/utils';
+import { CallRecordingStatus } from '~/generated/graphql';
+
+const IN_PROGRESS_CALL_RECORDING_STATUSES = new Set<CallRecordingStatus>([
+ CallRecordingStatus.SCHEDULED,
+ CallRecordingStatus.JOINING,
+ CallRecordingStatus.RECORDING,
+ CallRecordingStatus.PROCESSING,
+]);
+
+const UNAVAILABLE_CALL_RECORDING_STATUSES = new Set<CallRecordingStatus>([
+ CallRecordingStatus.FAILED,
+ CallRecordingStatus.NOT_RECORDED,
+]);
+
+type ClassifiedCallRecordingTranscript = Exclude<
+ CalendarEventCallRecordingTranscriptSelection,
+ { state: 'NO_RECORDING' }
+>;
+
+const classifyCallRecordingTranscript = (
+ callRecording: CalendarEventCallRecordingTranscriptCandidate,
+): ClassifiedCallRecordingTranscript => {
+ const entries = parseCallRecordingTranscriptEntries(callRecording.transcript);
+
+ if (isDefined(entries) && entries.length > 0) {
+ return { state: 'READY', entries };
+ }
+
+ if (UNAVAILABLE_CALL_RECORDING_STATUSES.has(callRecording.status)) {
+ return { state: 'FAILED' };
+ }
+
+ if (
+ isCallRecordingTranscriptStatusMarker(callRecording.transcript) &&
+ callRecording.transcript.status === 'FAILED'
+ ) {
+ return { state: 'FAILED' };
+ }
+
+ if (IN_PROGRESS_CALL_RECORDING_STATUSES.has(callRecording.status)) {
+ return { state: 'PENDING' };
+ }
+
+ if (isCallRecordingTranscriptStatusMarker(callRecording.transcript)) {
+ return { state: 'PENDING' };
+ }
+
+ if (isArray(callRecording.transcript)) {
+ return { state: 'EMPTY' };
+ }
+
+ if (isDefined(callRecording.transcript)) {
+ return { state: 'UNRECOGNIZED' };
+ }
+
+ return { state: 'MISSING' };
+};
+
+export const selectCalendarEventCallRecordingTranscript = (
+ callRecordingsInArrivalOrder: CalendarEventCallRecordingTranscriptCandidate[],
+): CalendarEventCallRecordingTranscriptSelection => {
+ let firstPendingSelection: ClassifiedCallRecordingTranscript | undefined;
+ let firstSelection: ClassifiedCallRecordingTranscript | undefined;
+
+ for (const callRecording of callRecordingsInArrivalOrder) {
+ const selection = classifyCallRecordingTranscript(callRecording);
+
+ if (selection.state === 'READY') {
+ return selection;
+ }
+
+ if (!isDefined(firstPendingSelection) && selection.state === 'PENDING') {
+ firstPendingSelection = selection;
+ }
+
+ firstSelection ??= selection;
+ }
+
+ return firstPendingSelection ?? firstSelection ?? { state: 'NO_RECORDING' };
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetMessageDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetMessageDisplay.tsx
new file mode 100644
index 00000000000..63210a6b79b
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetMessageDisplay.tsx
@@ -0,0 +1,42 @@
+import { styled } from '@linaria/react';
+import { useContext } from 'react';
+import { type IconComponent } from 'twenty-ui/icon';
+import { themeCssVariables, ThemeContext } from 'twenty-ui/theme-constants';
+
+const StyledMessageContainer = styled.div`
+ align-items: center;
+ color: ${themeCssVariables.font.color.tertiary};
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[3]};
+ justify-content: center;
+ padding: ${themeCssVariables.spacing[8]};
+ text-align: center;
+`;
+
+const StyledMessage = styled.div`
+ color: ${themeCssVariables.font.color.secondary};
+ font-size: ${themeCssVariables.font.size.sm};
+ line-height: ${themeCssVariables.text.lineHeight.lg};
+ max-width: 50%;
+`;
+
+type PageLayoutWidgetMessageDisplayProps = {
+ Icon: IconComponent;
+ message: string;
+};
+
+export const PageLayoutWidgetMessageDisplay = ({
+ Icon,
+ message,
+}: PageLayoutWidgetMessageDisplayProps) => {
+ const { theme } = useContext(ThemeContext);
+
+ return (
+ <StyledMessageContainer>
+ <Icon size={theme.icon.size.xl} />
+ <StyledMessage>{message}</StyledMessage>
+ </StyledMessageContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetContentRenderer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetContentRenderer.tsx
index dda1ea0e7d5..dd1059b567f 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetContentRenderer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetContentRenderer.tsx
@@ -1,5 +1,6 @@
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { CalendarWidget } from '@/page-layout/widgets/calendar/components/CalendarWidget';
+import { CallRecordingTranscriptWidget } from '@/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptWidget';
import { EmailThreadWidget } from '@/page-layout/widgets/email-thread/components/EmailThreadWidget';
import { EmailWidget } from '@/page-layout/widgets/emails/components/EmailWidget';
import { FieldRichTextWidgetRenderer } from '@/page-layout/widgets/field-rich-text/components/FieldRichTextWidgetRenderer';
@@ -89,6 +90,9 @@ export const WidgetContentRenderer = ({
case WidgetType.MESSAGE_CAMPAIGN_DETAILS:
return <MessageCampaignDetailsWidget />;
+ case WidgetType.CALL_RECORDING_TRANSCRIPT:
+ return <CallRecordingTranscriptWidget />;
+
default:
return null;
}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts
new file mode 100644
index 00000000000..1822c2666f9
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts
@@ -0,0 +1,18 @@
+import { Module } from '@nestjs/common';
+
+import { WorkspaceIteratorModule } from 'src/database/commands/command-runners/workspace-iterator.module';
+import { AddCalendarEventCallRecordingTabCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command';
+import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
+import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache.module';
+import { WorkspaceMigrationModule } from 'src/engine/workspace-manager/workspace-migration/workspace-migration.module';
+
+@Module({
+ imports: [
+ ApplicationModule,
+ WorkspaceCacheModule,
+ WorkspaceMigrationModule,
+ WorkspaceIteratorModule,
+ ],
+ providers: [AddCalendarEventCallRecordingTabCommand],
+})
+export class V2_31_UpgradeVersionCommandModule {}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.ts
new file mode 100644
index 00000000000..fa4ace15b9d
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.ts
@@ -0,0 +1,167 @@
+import { Command } from 'nest-commander';
+
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
+import { isDefined } from 'twenty-shared/utils';
+
+import { ProvisionedWorkspaceCommandRunner } from 'src/database/commands/command-runners/provisioned-workspace.command-runner';
+import { WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { type RunOnWorkspaceArgs } from 'src/database/commands/command-runners/workspace.command-runner';
+import { getStandardFlatEntitiesToCreateOrThrow } from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';
+import { computeCallRecordingTabPosition } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-call-recording-tab-position.util';
+import { ApplicationService } from 'src/engine/core-modules/application/application.service';
+import { RegisteredWorkspaceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-workspace-command.decorator';
+import { type FlatPageLayoutTab } from 'src/engine/metadata-modules/flat-page-layout-tab/types/flat-page-layout-tab.type';
+import { type FlatPageLayoutWidget } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget.type';
+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
+import { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
+
+const CALENDAR_EVENT_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
+ .universalIdentifier;
+
+const CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.universalIdentifier;
+
+const TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.widgets.transcript.universalIdentifier;
+
+@RegisteredWorkspaceCommand('2.31.0', 1786353778242)
+@Command({
+ name: 'upgrade:2-31:add-calendar-event-call-recording-tab',
+ description:
+ 'Add the Call Recording tab and transcript widget to the CalendarEvent record page in existing workspaces',
+})
+export class AddCalendarEventCallRecordingTabCommand extends ProvisionedWorkspaceCommandRunner {
+ constructor(
+ protected readonly workspaceIteratorService: WorkspaceIteratorService,
+ private readonly applicationService: ApplicationService,
+ private readonly workspaceCacheService: WorkspaceCacheService,
+ private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,
+ ) {
+ super(workspaceIteratorService);
+ }
+
+ override async runOnWorkspace({
+ workspaceId,
+ options,
+ }: RunOnWorkspaceArgs): Promise<void> {
+ const isDryRun = options.dryRun ?? false;
+
+ const { twentyStandardFlatApplication } =
+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
+ { workspaceId },
+ );
+
+ const { flatPageLayoutMaps, flatPageLayoutTabMaps, flatPageLayoutWidgetMaps } =
+ await this.workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatPageLayoutMaps',
+ 'flatPageLayoutTabMaps',
+ 'flatPageLayoutWidgetMaps',
+ ]);
+
+ const existingPageLayout =
+ flatPageLayoutMaps.byUniversalIdentifier[
+ CALENDAR_EVENT_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER
+ ];
+
+ if (!isDefined(existingPageLayout)) {
+ this.logger.log(
+ `CalendarEvent page layout does not exist for workspace ${workspaceId}, skipping`,
+ );
+
+ return;
+ }
+
+ const { allFlatEntityMaps: standardAllFlatEntityMaps } =
+ computeTwentyStandardApplicationAllFlatEntityMaps({
+ now: new Date().toISOString(),
+ workspaceId,
+ twentyStandardApplicationId: twentyStandardFlatApplication.id,
+ });
+
+ const pageLayoutTabsToCreate =
+ getStandardFlatEntitiesToCreateOrThrow<FlatPageLayoutTab>({
+ standardFlatEntityMaps: standardAllFlatEntityMaps.flatPageLayoutTabMaps,
+ existingFlatEntityMaps: flatPageLayoutTabMaps,
+ universalIdentifiers: [CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER],
+ }).map((pageLayoutTab) => ({
+ ...pageLayoutTab,
+ position: computeCallRecordingTabPosition({
+ existingPageLayoutTabs: Object.values(
+ flatPageLayoutTabMaps.byUniversalIdentifier,
+ )
+ .filter(isDefined)
+ .filter(
+ (existingPageLayoutTab) =>
+ existingPageLayoutTab.pageLayoutId === existingPageLayout.id,
+ ),
+ }),
+ }));
+
+ const pageLayoutWidgetsToCreate =
+ getStandardFlatEntitiesToCreateOrThrow<FlatPageLayoutWidget>({
+ standardFlatEntityMaps:
+ standardAllFlatEntityMaps.flatPageLayoutWidgetMaps,
+ existingFlatEntityMaps: flatPageLayoutWidgetMaps,
+ universalIdentifiers: [TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER],
+ });
+
+ const totalOperationCount =
+ pageLayoutTabsToCreate.length + pageLayoutWidgetsToCreate.length;
+
+ if (totalOperationCount === 0) {
+ this.logger.log(
+ `CalendarEvent record page already has the Call Recording tab for workspace ${workspaceId}, skipping`,
+ );
+
+ return;
+ }
+
+ this.logger.log(
+ `${isDryRun ? '[DRY RUN] ' : ''}Applying ${totalOperationCount} CalendarEvent Call Recording tab operation(s) for workspace ${workspaceId}`,
+ );
+
+ if (isDryRun) {
+ return;
+ }
+
+ const validateAndBuildResult =
+ await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
+ {
+ isSystemBuild: true,
+ applicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ workspaceId,
+ allFlatEntityOperationByMetadataName: {
+ pageLayoutTab: {
+ flatEntityToCreate: pageLayoutTabsToCreate,
+ flatEntityToDelete: [],
+ flatEntityToUpdate: [],
+ },
+ pageLayoutWidget: {
+ flatEntityToCreate: pageLayoutWidgetsToCreate,
+ flatEntityToDelete: [],
+ flatEntityToUpdate: [],
+ },
+ },
+ },
+ );
+
+ if (validateAndBuildResult.status === 'fail') {
+ throw new Error(
+ `Failed to add the CalendarEvent Call Recording tab for workspace ${workspaceId}: ${JSON.stringify(
+ validateAndBuildResult,
+ null,
+ 2,
+ )}`,
+ );
+ }
+
+ this.logger.log(
+ `Added the CalendarEvent Call Recording tab for workspace ${workspaceId}`,
+ );
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.spec.ts
new file mode 100644
index 00000000000..14b3f66dbcf
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.spec.ts
@@ -0,0 +1,264 @@
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
+
+import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { AddCalendarEventCallRecordingTabCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command';
+import { type ApplicationService } from 'src/engine/core-modules/application/application.service';
+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
+import { type WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
+
+jest.mock(
+ 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant',
+);
+
+const computeTwentyStandardApplicationAllFlatEntityMapsMock =
+ computeTwentyStandardApplicationAllFlatEntityMaps as jest.Mock;
+
+const WORKSPACE_ID = '20202020-0000-0000-0000-000000000001';
+const PAGE_LAYOUT_ID = '20202020-0000-0000-0000-000000000002';
+const STANDARD_APPLICATION = {
+ id: '20202020-0000-0000-0000-0000000000aa',
+ universalIdentifier: '20202020-0000-0000-0000-0000000000bb',
+};
+
+const CALENDAR_EVENT_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
+ .universalIdentifier;
+const HOME_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .universalIdentifier;
+const TIMELINE_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .timeline.universalIdentifier;
+const CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.universalIdentifier;
+const TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.widgets.transcript.universalIdentifier;
+
+const buildByUniversalIdentifierMap = <
+ T extends { universalIdentifier: string },
+>(flatEntities: T[]) => ({
+ byUniversalIdentifier: Object.fromEntries(
+ flatEntities.map((flatEntity) => [
+ flatEntity.universalIdentifier,
+ flatEntity,
+ ]),
+ ),
+});
+
+const buildPageLayoutTab = ({
+ universalIdentifier,
+ position,
+ isActive = true,
+ deletedAt = null,
+}: {
+ universalIdentifier: string;
+ position: number;
+ isActive?: boolean;
+ deletedAt?: string | null;
+}) => ({
+ universalIdentifier,
+ pageLayoutId: PAGE_LAYOUT_ID,
+ position,
+ isActive,
+ deletedAt,
+});
+
+describe('AddCalendarEventCallRecordingTabCommand', () => {
+ let command: AddCalendarEventCallRecordingTabCommand;
+ let getOrRecomputeMock: jest.Mock;
+ let validateBuildAndRunWorkspaceMigrationMock: jest.Mock;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+
+ getOrRecomputeMock = jest.fn();
+ validateBuildAndRunWorkspaceMigrationMock = jest
+ .fn()
+ .mockResolvedValue({ status: 'success' });
+
+ computeTwentyStandardApplicationAllFlatEntityMapsMock.mockReturnValue({
+ allFlatEntityMaps: {
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap([
+ {
+ universalIdentifier: CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER,
+ position: 30,
+ },
+ ]),
+ flatPageLayoutWidgetMaps: buildByUniversalIdentifierMap([
+ {
+ universalIdentifier: TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER,
+ },
+ ]),
+ },
+ });
+
+ command = new AddCalendarEventCallRecordingTabCommand(
+ {} as WorkspaceIteratorService,
+ {
+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest
+ .fn()
+ .mockResolvedValue({
+ twentyStandardFlatApplication: STANDARD_APPLICATION,
+ }),
+ } as unknown as ApplicationService,
+ {
+ getOrRecompute: getOrRecomputeMock,
+ } as unknown as WorkspaceCacheService,
+ {
+ validateBuildAndRunLegacyWorkspaceMigration:
+ validateBuildAndRunWorkspaceMigrationMock,
+ } as unknown as WorkspaceMigrationValidateBuildAndRunService,
+ );
+ });
+
+ const runOnWorkspace = (dryRun = false) =>
+ command.runOnWorkspace({
+ workspaceId: WORKSPACE_ID,
+ options: { dryRun },
+ index: 0,
+ total: 1,
+ });
+
+ const mockWorkspaceCache = ({
+ pageLayoutExists = true,
+ tabs = [],
+ widgets = [],
+ }: {
+ pageLayoutExists?: boolean;
+ tabs?: ReturnType<typeof buildPageLayoutTab>[];
+ widgets?: { universalIdentifier: string }[];
+ }) => {
+ getOrRecomputeMock.mockResolvedValue({
+ flatPageLayoutMaps: buildByUniversalIdentifierMap(
+ pageLayoutExists
+ ? [
+ {
+ id: PAGE_LAYOUT_ID,
+ universalIdentifier:
+ CALENDAR_EVENT_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ },
+ ]
+ : [],
+ ),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap(tabs),
+ flatPageLayoutWidgetMaps: buildByUniversalIdentifierMap(widgets),
+ });
+ };
+
+ it('passes the computed tab position to the migration', async () => {
+ mockWorkspaceCache({
+ tabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ buildPageLayoutTab({
+ universalIdentifier: TIMELINE_TAB_UNIVERSAL_IDENTIFIER,
+ position: 20,
+ }),
+ ],
+ });
+
+ await runOnWorkspace();
+
+ const [payload] = validateBuildAndRunWorkspaceMigrationMock.mock.calls[0];
+
+ expect(
+ payload.allFlatEntityOperationByMetadataName.pageLayoutTab
+ .flatEntityToCreate,
+ ).toEqual([
+ expect.objectContaining({
+ universalIdentifier: CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER,
+ position: 15,
+ }),
+ ]);
+ expect(
+ payload.allFlatEntityOperationByMetadataName.pageLayoutWidget
+ .flatEntityToCreate,
+ ).toEqual([
+ expect.objectContaining({
+ universalIdentifier: TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER,
+ }),
+ ]);
+ });
+
+ it('is idempotent when the tab and transcript already exist', async () => {
+ mockWorkspaceCache({
+ tabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ buildPageLayoutTab({
+ universalIdentifier: CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER,
+ position: 30,
+ }),
+ ],
+ widgets: [
+ { universalIdentifier: TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+
+ it('creates only the missing transcript widget without moving an existing tab', async () => {
+ mockWorkspaceCache({
+ tabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ buildPageLayoutTab({
+ universalIdentifier: CALL_RECORDING_TAB_UNIVERSAL_IDENTIFIER,
+ position: 73,
+ }),
+ ],
+ });
+
+ await runOnWorkspace();
+
+ const [payload] = validateBuildAndRunWorkspaceMigrationMock.mock.calls[0];
+
+ expect(
+ payload.allFlatEntityOperationByMetadataName.pageLayoutTab
+ .flatEntityToCreate,
+ ).toEqual([]);
+ expect(
+ payload.allFlatEntityOperationByMetadataName.pageLayoutWidget
+ .flatEntityToCreate,
+ ).toEqual([
+ expect.objectContaining({
+ universalIdentifier: TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER,
+ }),
+ ]);
+ });
+
+ it('does not write metadata in dry-run mode', async () => {
+ mockWorkspaceCache({
+ tabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ ],
+ });
+
+ await runOnWorkspace(true);
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+
+ it('skips workspaces without a Calendar Event page layout', async () => {
+ mockWorkspaceCache({ pageLayoutExists: false });
+
+ await runOnWorkspace();
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts
new file mode 100644
index 00000000000..15e0aa4e980
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts
@@ -0,0 +1,118 @@
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
+
+import { computeCallRecordingTabPosition } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-call-recording-tab-position.util';
+
+const HOME_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .universalIdentifier;
+const TIMELINE_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .timeline.universalIdentifier;
+
+const buildPageLayoutTab = ({
+ universalIdentifier,
+ position,
+ isActive = true,
+ deletedAt = null,
+}: {
+ universalIdentifier: string;
+ position: number;
+ isActive?: boolean;
+ deletedAt?: string | null;
+}) => ({ universalIdentifier, position, isActive, deletedAt });
+
+describe('computeCallRecordingTabPosition', () => {
+ it('places the tab directly after Home when Home is the last tab', () => {
+ expect(
+ computeCallRecordingTabPosition({
+ existingPageLayoutTabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ ],
+ }),
+ ).toBe(20);
+ });
+
+ it('uses a fractional position before a custom tab', () => {
+ expect(
+ computeCallRecordingTabPosition({
+ existingPageLayoutTabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ buildPageLayoutTab({
+ universalIdentifier: 'custom-tab',
+ position: 20,
+ }),
+ ],
+ }),
+ ).toBe(15);
+ });
+
+ it('uses a fractional position before the legacy Timeline tab', () => {
+ expect(
+ computeCallRecordingTabPosition({
+ existingPageLayoutTabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ buildPageLayoutTab({
+ universalIdentifier: TIMELINE_TAB_UNIVERSAL_IDENTIFIER,
+ position: 20,
+ }),
+ ],
+ }),
+ ).toBe(15);
+ });
+
+ it('appends the tab when Home is missing or inactive', () => {
+ expect(
+ computeCallRecordingTabPosition({
+ existingPageLayoutTabs: [
+ buildPageLayoutTab({ universalIdentifier: 'custom-tab', position: 50 }),
+ ],
+ }),
+ ).toBe(60);
+
+ expect(
+ computeCallRecordingTabPosition({
+ existingPageLayoutTabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ isActive: false,
+ }),
+ buildPageLayoutTab({ universalIdentifier: 'custom-tab', position: 20 }),
+ ],
+ }),
+ ).toBe(30);
+ });
+
+ it('uses the first standard position when no tabs exist', () => {
+ expect(
+ computeCallRecordingTabPosition({ existingPageLayoutTabs: [] }),
+ ).toBe(10);
+ });
+
+ it('ignores soft-deleted tabs', () => {
+ expect(
+ computeCallRecordingTabPosition({
+ existingPageLayoutTabs: [
+ buildPageLayoutTab({
+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,
+ position: 10,
+ }),
+ buildPageLayoutTab({
+ universalIdentifier: 'deleted-custom-tab',
+ position: 40,
+ deletedAt: '2026-01-01T00:00:00.000Z',
+ }),
+ ],
+ }),
+ ).toBe(20);
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-call-recording-tab-position.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-call-recording-tab-position.util.ts
new file mode 100644
index 00000000000..b65144948ce
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-call-recording-tab-position.util.ts
@@ -0,0 +1,49 @@
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
+import { isDefined } from 'twenty-shared/utils';
+
+import { type FlatPageLayoutTab } from 'src/engine/metadata-modules/flat-page-layout-tab/types/flat-page-layout-tab.type';
+
+const HOME_TAB_UNIVERSAL_IDENTIFIER =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .universalIdentifier;
+
+const TAB_POSITION_GAP = 10;
+
+export const computeCallRecordingTabPosition = ({
+ existingPageLayoutTabs,
+}: {
+ existingPageLayoutTabs: Pick<
+ FlatPageLayoutTab,
+ 'deletedAt' | 'isActive' | 'position' | 'universalIdentifier'
+ >[];
+}): number => {
+ const existingNonDeletedPageLayoutTabs = existingPageLayoutTabs.filter(
+ (pageLayoutTab) => !isDefined(pageLayoutTab.deletedAt),
+ );
+ const homeTab = existingNonDeletedPageLayoutTabs.find(
+ (pageLayoutTab) =>
+ pageLayoutTab.universalIdentifier === HOME_TAB_UNIVERSAL_IDENTIFIER &&
+ pageLayoutTab.isActive,
+ );
+
+ if (!isDefined(homeTab)) {
+ return (
+ Math.max(
+ ...existingNonDeletedPageLayoutTabs.map(
+ (pageLayoutTab) => pageLayoutTab.position,
+ ),
+ 0,
+ ) + TAB_POSITION_GAP
+ );
+ }
+
+ const nextTab = existingNonDeletedPageLayoutTabs
+ .filter((pageLayoutTab) => pageLayoutTab.position > homeTab.position)
+ .sort((a, b) => a.position - b.position)[0];
+
+ if (!isDefined(nextTab)) {
+ return homeTab.position + TAB_POSITION_GAP;
+ }
+
+ return (homeTab.position + nextTab.position) / 2;
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts
index cbacabac199..0b7f979f214 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts
@@ -28,6 +28,7 @@ import { V2_25_UpgradeVersionCommandModule } from 'src/database/commands/upgrade
import { V2_26_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-26/2-26-upgrade-version-command.module';
import { V2_27_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-27/2-27-upgrade-version-command.module';
import { V2_28_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-28/2-28-upgrade-version-command.module';
+import { V2_31_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module';
@Module({
imports: [
@@ -59,6 +60,7 @@ import { V2_28_UpgradeVersionCommandModule } from 'src/database/commands/upgrade
V2_26_UpgradeVersionCommandModule,
V2_27_UpgradeVersionCommandModule,
V2_28_UpgradeVersionCommandModule,
+ V2_31_UpgradeVersionCommandModule,
],
})
export class WorkspaceCommandProviderModule {}
diff --git a/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts b/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts
index b66e181afc3..4a564b43017 100644
--- a/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts
@@ -253,6 +253,7 @@ describe('WorkspaceEntityManager', () => {
IS_WORKFLOW_VERSION_IN_CORE_ENABLED: false,
IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED: false,
IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED: false,
+ IS_NATIVE_CALL_RECORDING_TABS_ENABLED: false,
},
userWorkspaceRoleMap: {},
apiKeyRoleMap: {},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap
index f1b9f8c6d0f..d0dd9b9ad73 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap
@@ -45,21 +45,21 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"calendarEventParticipantRecordPage": {
- "id": "00000000-0000-0000-0000-000000000028",
+ "id": "00000000-0000-0000-0000-000000000030",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000029",
+ "id": "00000000-0000-0000-0000-000000000031",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000030",
+ "id": "00000000-0000-0000-0000-000000000032",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000031",
+ "id": "00000000-0000-0000-0000-000000000033",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000032",
+ "id": "00000000-0000-0000-0000-000000000034",
},
},
},
@@ -68,6 +68,14 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
"calendarEventRecordPage": {
"id": "00000000-0000-0000-0000-000000000021",
"tabs": {
+ "callRecording": {
+ "id": "00000000-0000-0000-0000-000000000028",
+ "widgets": {
+ "transcript": {
+ "id": "00000000-0000-0000-0000-000000000029",
+ },
+ },
+ },
"home": {
"id": "00000000-0000-0000-0000-000000000022",
"widgets": {
@@ -93,210 +101,210 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"callRecordingRecordPage": {
- "id": "00000000-0000-0000-0000-000000000033",
+ "id": "00000000-0000-0000-0000-000000000035",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000034",
+ "id": "00000000-0000-0000-0000-000000000036",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000035",
+ "id": "00000000-0000-0000-0000-000000000037",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000036",
+ "id": "00000000-0000-0000-0000-000000000038",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000037",
+ "id": "00000000-0000-0000-0000-000000000039",
},
},
},
},
},
"companyRecordPage": {
- "id": "00000000-0000-0000-0000-000000000038",
+ "id": "00000000-0000-0000-0000-000000000040",
"tabs": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000053",
+ "id": "00000000-0000-0000-0000-000000000055",
"widgets": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000054",
+ "id": "00000000-0000-0000-0000-000000000056",
},
},
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000051",
+ "id": "00000000-0000-0000-0000-000000000053",
"widgets": {
"emails": {
- "id": "00000000-0000-0000-0000-000000000052",
+ "id": "00000000-0000-0000-0000-000000000054",
},
},
},
"files": {
- "id": "00000000-0000-0000-0000-000000000049",
+ "id": "00000000-0000-0000-0000-000000000051",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000050",
+ "id": "00000000-0000-0000-0000-000000000052",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000039",
+ "id": "00000000-0000-0000-0000-000000000041",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000040",
+ "id": "00000000-0000-0000-0000-000000000042",
},
"opportunities": {
- "id": "00000000-0000-0000-0000-000000000042",
+ "id": "00000000-0000-0000-0000-000000000044",
},
"people": {
- "id": "00000000-0000-0000-0000-000000000041",
+ "id": "00000000-0000-0000-0000-000000000043",
},
},
},
"notes": {
- "id": "00000000-0000-0000-0000-000000000047",
+ "id": "00000000-0000-0000-0000-000000000049",
"widgets": {
"notes": {
- "id": "00000000-0000-0000-0000-000000000048",
+ "id": "00000000-0000-0000-0000-000000000050",
},
},
},
"tasks": {
- "id": "00000000-0000-0000-0000-000000000045",
+ "id": "00000000-0000-0000-0000-000000000047",
"widgets": {
"tasks": {
- "id": "00000000-0000-0000-0000-000000000046",
+ "id": "00000000-0000-0000-0000-000000000048",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000043",
+ "id": "00000000-0000-0000-0000-000000000045",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000044",
+ "id": "00000000-0000-0000-0000-000000000046",
},
},
},
},
},
"messageCampaignRecordPage": {
- "id": "00000000-0000-0000-0000-000000000055",
+ "id": "00000000-0000-0000-0000-000000000057",
"tabs": {
"composer": {
- "id": "00000000-0000-0000-0000-000000000061",
+ "id": "00000000-0000-0000-0000-000000000063",
"widgets": {
"messageCampaign": {
- "id": "00000000-0000-0000-0000-000000000062",
+ "id": "00000000-0000-0000-0000-000000000064",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000056",
+ "id": "00000000-0000-0000-0000-000000000058",
"widgets": {
"details": {
- "id": "00000000-0000-0000-0000-000000000057",
+ "id": "00000000-0000-0000-0000-000000000059",
},
"fields": {
- "id": "00000000-0000-0000-0000-000000000060",
+ "id": "00000000-0000-0000-0000-000000000062",
},
"list": {
- "id": "00000000-0000-0000-0000-000000000058",
+ "id": "00000000-0000-0000-0000-000000000060",
},
"recipients": {
- "id": "00000000-0000-0000-0000-000000000059",
+ "id": "00000000-0000-0000-0000-000000000061",
},
},
},
},
},
"messageChannelMessageAssociationMessageFolderRecordPage": {
- "id": "00000000-0000-0000-0000-000000000068",
+ "id": "00000000-0000-0000-0000-000000000070",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000069",
+ "id": "00000000-0000-0000-0000-000000000071",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000070",
+ "id": "00000000-0000-0000-0000-000000000072",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000071",
+ "id": "00000000-0000-0000-0000-000000000073",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000072",
+ "id": "00000000-0000-0000-0000-000000000074",
},
},
},
},
},
"messageChannelMessageAssociationRecordPage": {
- "id": "00000000-0000-0000-0000-000000000063",
+ "id": "00000000-0000-0000-0000-000000000065",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000064",
+ "id": "00000000-0000-0000-0000-000000000066",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000065",
+ "id": "00000000-0000-0000-0000-000000000067",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000066",
+ "id": "00000000-0000-0000-0000-000000000068",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000067",
+ "id": "00000000-0000-0000-0000-000000000069",
},
},
},
},
},
"messageListRecordPage": {
- "id": "00000000-0000-0000-0000-000000000078",
+ "id": "00000000-0000-0000-0000-000000000080",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000079",
+ "id": "00000000-0000-0000-0000-000000000081",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000080",
+ "id": "00000000-0000-0000-0000-000000000082",
},
"members": {
- "id": "00000000-0000-0000-0000-000000000081",
+ "id": "00000000-0000-0000-0000-000000000083",
},
},
},
},
},
"messageParticipantRecordPage": {
- "id": "00000000-0000-0000-0000-000000000073",
+ "id": "00000000-0000-0000-0000-000000000075",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000074",
+ "id": "00000000-0000-0000-0000-000000000076",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000075",
+ "id": "00000000-0000-0000-0000-000000000077",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000076",
+ "id": "00000000-0000-0000-0000-000000000078",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000077",
+ "id": "00000000-0000-0000-0000-000000000079",
},
},
},
},
},
"messageThreadRecordPage": {
- "id": "00000000-0000-0000-0000-000000000082",
+ "id": "00000000-0000-0000-0000-000000000084",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000083",
+ "id": "00000000-0000-0000-0000-000000000085",
"widgets": {
"emailThread": {
- "id": "00000000-0000-0000-0000-000000000084",
+ "id": "00000000-0000-0000-0000-000000000086",
},
},
},
@@ -337,302 +345,302 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"noteRecordPage": {
- "id": "00000000-0000-0000-0000-000000000085",
+ "id": "00000000-0000-0000-0000-000000000087",
"tabs": {
"files": {
- "id": "00000000-0000-0000-0000-000000000093",
+ "id": "00000000-0000-0000-0000-000000000095",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000094",
+ "id": "00000000-0000-0000-0000-000000000096",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000086",
+ "id": "00000000-0000-0000-0000-000000000088",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000087",
+ "id": "00000000-0000-0000-0000-000000000089",
},
"noteRichText": {
- "id": "00000000-0000-0000-0000-000000000088",
+ "id": "00000000-0000-0000-0000-000000000090",
},
},
},
"note": {
- "id": "00000000-0000-0000-0000-000000000089",
+ "id": "00000000-0000-0000-0000-000000000091",
"widgets": {
"noteRichText": {
- "id": "00000000-0000-0000-0000-000000000090",
+ "id": "00000000-0000-0000-0000-000000000092",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000091",
+ "id": "00000000-0000-0000-0000-000000000093",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000092",
+ "id": "00000000-0000-0000-0000-000000000094",
},
},
},
},
},
"opportunityRecordPage": {
- "id": "00000000-0000-0000-0000-000000000095",
+ "id": "00000000-0000-0000-0000-000000000097",
"tabs": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000111",
+ "id": "00000000-0000-0000-0000-000000000113",
"widgets": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000112",
+ "id": "00000000-0000-0000-0000-000000000114",
},
},
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000109",
+ "id": "00000000-0000-0000-0000-000000000111",
"widgets": {
"emails": {
- "id": "00000000-0000-0000-0000-000000000110",
+ "id": "00000000-0000-0000-0000-000000000112",
},
},
},
"files": {
- "id": "00000000-0000-0000-0000-000000000107",
+ "id": "00000000-0000-0000-0000-000000000109",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000108",
+ "id": "00000000-0000-0000-0000-000000000110",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000096",
+ "id": "00000000-0000-0000-0000-000000000098",
"widgets": {
"company": {
- "id": "00000000-0000-0000-0000-000000000099",
+ "id": "00000000-0000-0000-0000-000000000101",
},
"fields": {
- "id": "00000000-0000-0000-0000-000000000097",
+ "id": "00000000-0000-0000-0000-000000000099",
},
"owner": {
- "id": "00000000-0000-0000-0000-000000000100",
+ "id": "00000000-0000-0000-0000-000000000102",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000098",
+ "id": "00000000-0000-0000-0000-000000000100",
},
},
},
"notes": {
- "id": "00000000-0000-0000-0000-000000000105",
+ "id": "00000000-0000-0000-0000-000000000107",
"widgets": {
"notes": {
- "id": "00000000-0000-0000-0000-000000000106",
+ "id": "00000000-0000-0000-0000-000000000108",
},
},
},
"tasks": {
- "id": "00000000-0000-0000-0000-000000000103",
+ "id": "00000000-0000-0000-0000-000000000105",
"widgets": {
"tasks": {
- "id": "00000000-0000-0000-0000-000000000104",
+ "id": "00000000-0000-0000-0000-000000000106",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000101",
+ "id": "00000000-0000-0000-0000-000000000103",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000102",
+ "id": "00000000-0000-0000-0000-000000000104",
},
},
},
},
},
"personRecordPage": {
- "id": "00000000-0000-0000-0000-000000000113",
+ "id": "00000000-0000-0000-0000-000000000115",
"tabs": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000129",
+ "id": "00000000-0000-0000-0000-000000000131",
"widgets": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000130",
+ "id": "00000000-0000-0000-0000-000000000132",
},
},
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000127",
+ "id": "00000000-0000-0000-0000-000000000129",
"widgets": {
"emails": {
- "id": "00000000-0000-0000-0000-000000000128",
+ "id": "00000000-0000-0000-0000-000000000130",
},
},
},
"files": {
- "id": "00000000-0000-0000-0000-000000000125",
+ "id": "00000000-0000-0000-0000-000000000127",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000126",
+ "id": "00000000-0000-0000-0000-000000000128",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000114",
+ "id": "00000000-0000-0000-0000-000000000116",
"widgets": {
"company": {
- "id": "00000000-0000-0000-0000-000000000116",
+ "id": "00000000-0000-0000-0000-000000000118",
},
"fields": {
- "id": "00000000-0000-0000-0000-000000000115",
+ "id": "00000000-0000-0000-0000-000000000117",
},
"listMemberships": {
- "id": "00000000-0000-0000-0000-000000000118",
+ "id": "00000000-0000-0000-0000-000000000120",
},
"pointOfContactForOpportunities": {
- "id": "00000000-0000-0000-0000-000000000117",
+ "id": "00000000-0000-0000-0000-000000000119",
},
},
},
"notes": {
- "id": "00000000-0000-0000-0000-000000000123",
+ "id": "00000000-0000-0000-0000-000000000125",
"widgets": {
"notes": {
- "id": "00000000-0000-0000-0000-000000000124",
+ "id": "00000000-0000-0000-0000-000000000126",
},
},
},
"tasks": {
- "id": "00000000-0000-0000-0000-000000000121",
+ "id": "00000000-0000-0000-0000-000000000123",
"widgets": {
"tasks": {
- "id": "00000000-0000-0000-0000-000000000122",
+ "id": "00000000-0000-0000-0000-000000000124",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000119",
+ "id": "00000000-0000-0000-0000-000000000121",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000120",
+ "id": "00000000-0000-0000-0000-000000000122",
},
},
},
},
},
"taskRecordPage": {
- "id": "00000000-0000-0000-0000-000000000131",
+ "id": "00000000-0000-0000-0000-000000000133",
"tabs": {
"files": {
- "id": "00000000-0000-0000-0000-000000000139",
+ "id": "00000000-0000-0000-0000-000000000141",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000140",
+ "id": "00000000-0000-0000-0000-000000000142",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000132",
+ "id": "00000000-0000-0000-0000-000000000134",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000133",
+ "id": "00000000-0000-0000-0000-000000000135",
},
"taskRichText": {
- "id": "00000000-0000-0000-0000-000000000134",
+ "id": "00000000-0000-0000-0000-000000000136",
},
},
},
"note": {
- "id": "00000000-0000-0000-0000-000000000135",
+ "id": "00000000-0000-0000-0000-000000000137",
"widgets": {
"taskRichText": {
- "id": "00000000-0000-0000-0000-000000000136",
+ "id": "00000000-0000-0000-0000-000000000138",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000137",
+ "id": "00000000-0000-0000-0000-000000000139",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000138",
+ "id": "00000000-0000-0000-0000-000000000140",
},
},
},
},
},
"workflowAutomatedTriggerRecordPage": {
- "id": "00000000-0000-0000-0000-000000000144",
+ "id": "00000000-0000-0000-0000-000000000146",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000145",
+ "id": "00000000-0000-0000-0000-000000000147",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000146",
+ "id": "00000000-0000-0000-0000-000000000148",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000147",
+ "id": "00000000-0000-0000-0000-000000000149",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000148",
+ "id": "00000000-0000-0000-0000-000000000150",
},
},
},
},
},
"workflowRecordPage": {
- "id": "00000000-0000-0000-0000-000000000141",
+ "id": "00000000-0000-0000-0000-000000000143",
"tabs": {
"flow": {
- "id": "00000000-0000-0000-0000-000000000142",
+ "id": "00000000-0000-0000-0000-000000000144",
"widgets": {
"workflow": {
- "id": "00000000-0000-0000-0000-000000000143",
+ "id": "00000000-0000-0000-0000-000000000145",
},
},
},
},
},
"workflowRunRecordPage": {
- "id": "00000000-0000-0000-0000-000000000155",
+ "id": "00000000-0000-0000-0000-000000000157",
"tabs": {
"flow": {
- "id": "00000000-0000-0000-0000-000000000159",
+ "id": "00000000-0000-0000-0000-000000000161",
"widgets": {
"workflowRun": {
- "id": "00000000-0000-0000-0000-000000000160",
+ "id": "00000000-0000-0000-0000-000000000162",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000156",
+ "id": "00000000-0000-0000-0000-000000000158",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000157",
+ "id": "00000000-0000-0000-0000-000000000159",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000158",
+ "id": "00000000-0000-0000-0000-000000000160",
},
},
},
},
},
"workflowVersionRecordPage": {
- "id": "00000000-0000-0000-0000-000000000149",
+ "id": "00000000-0000-0000-0000-000000000151",
"tabs": {
"flow": {
- "id": "00000000-0000-0000-0000-000000000153",
+ "id": "00000000-0000-0000-0000-000000000155",
"widgets": {
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000154",
+ "id": "00000000-0000-0000-0000-000000000156",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000150",
+ "id": "00000000-0000-0000-0000-000000000152",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000151",
+ "id": "00000000-0000-0000-0000-000000000153",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000152",
+ "id": "00000000-0000-0000-0000-000000000154",
},
},
},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
index 8faf0036049..786988615f4 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
@@ -2,9 +2,15 @@ import {
STANDARD_OBJECTS,
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
} from 'twenty-shared/metadata';
+import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
+import {
+ GRID_POSITIONS,
+ VERTICAL_LIST_LAYOUT_POSITIONS,
+} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
const WORKSPACE_ID = '20202020-1111-4111-8111-111111111111';
@@ -164,13 +170,48 @@ describe('CalendarEvent standard metadata build', () => {
Object.keys(
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs,
),
- ).toEqual(['home', 'timeline']);
+ ).toEqual(['home', 'timeline', 'callRecording']);
expect(timelineWidget?.universalConfiguration).toMatchObject({
configurationType: WidgetConfigurationType.TIMELINE,
});
});
+ it('configures the native call recording tab on the calendar event record page', () => {
+ const callRecordingTabUniversalIdentifier =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.universalIdentifier;
+ const transcriptWidgetUniversalIdentifier =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.widgets.transcript.universalIdentifier;
+
+ const callRecordingTab =
+ allFlatEntityMaps.flatPageLayoutTabMaps.byUniversalIdentifier[
+ callRecordingTabUniversalIdentifier
+ ];
+ const transcriptWidget =
+ allFlatEntityMaps.flatPageLayoutWidgetMaps.byUniversalIdentifier[
+ transcriptWidgetUniversalIdentifier
+ ];
+
+ expect(callRecordingTab).toMatchObject({
+ title: 'Call Recording',
+ icon: 'IconVideo',
+ position: 40,
+ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
+ });
+ expect(transcriptWidget).toMatchObject({
+ title: 'Transcript',
+ type: WidgetType.CALL_RECORDING_TRANSCRIPT,
+ pageLayoutTabUniversalIdentifier: callRecordingTabUniversalIdentifier,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
+ universalConfiguration: {
+ configurationType: WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
+ },
+ });
+ });
+
it('renders call recordings through a standard relation field widget', () => {
const callRecordingsWidget =
allFlatEntityMaps.flatPageLayoutWidgetMaps.byUniversalIdentifier[
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts
index 62aa6306790..a2f737de01b 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts
@@ -2,6 +2,7 @@ import {
STANDARD_OBJECTS,
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
} from 'twenty-shared/metadata';
+import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
@@ -69,6 +70,27 @@ const CALENDAR_EVENT_PAGE_TABS = {
},
},
},
+ // Reserve position 30 for the upcoming Summary tab.
+ callRecording: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .callRecording.universalIdentifier,
+ title: 'Call Recording',
+ position: 40,
+ icon: 'IconVideo',
+ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
+ widgets: {
+ transcript: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
+ .tabs.callRecording.widgets.transcript.universalIdentifier,
+ title: 'Transcript',
+ type: WidgetType.CALL_RECORDING_TRANSCRIPT,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
+ },
+ },
+ },
} as const satisfies Record<string, StandardPageLayoutTabConfig>;
export const STANDARD_CALENDAR_EVENT_PAGE_LAYOUT_CONFIG = {
diff --git a/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts
index f3a52a36a68..919e1dc103c 100644
--- a/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts
+++ b/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts
@@ -451,6 +451,14 @@ export const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = {
},
},
},
+ callRecording: {
+ universalIdentifier: 'a3dff71b-ca06-4709-9b39-ca4f30108ab4',
+ widgets: {
+ transcript: {
+ universalIdentifier: 'dc2f3511-d72e-400b-adc9-fdb8d930dda8',
+ },
+ },
+ },
},
},
calendarEventParticipantRecordPage: {
diff --git a/packages/twenty-shared/src/types/CallRecordingTranscript.ts b/packages/twenty-shared/src/types/CallRecordingTranscript.ts
new file mode 100644
index 00000000000..b73f84fb248
--- /dev/null
+++ b/packages/twenty-shared/src/types/CallRecordingTranscript.ts
@@ -0,0 +1,17 @@
+export type CallRecordingTranscriptStatusMarker = {
+ status: 'PENDING' | 'FAILED';
+} & Record<string, unknown>;
+
+export type CallRecordingParsedTranscriptWord = {
+ text: string;
+ startSeconds: number | undefined;
+ endSeconds: number | undefined;
+};
+
+export type CallRecordingParsedTranscriptEntry = {
+ speakerName: string | undefined;
+ startSeconds: number | undefined;
+ endSeconds: number | undefined;
+ text: string;
+ words: CallRecordingParsedTranscriptWord[];
+};
diff --git a/packages/twenty-shared/src/types/CoreObjectNameSingular.ts b/packages/twenty-shared/src/types/CoreObjectNameSingular.ts
index 29717a5bd4f..1ef200baa95 100644
--- a/packages/twenty-shared/src/types/CoreObjectNameSingular.ts
+++ b/packages/twenty-shared/src/types/CoreObjectNameSingular.ts
@@ -6,6 +6,7 @@ export enum CoreObjectNameSingular {
Blocklist = 'blocklist',
CalendarChannel = 'calendarChannel',
CalendarEvent = 'calendarEvent',
+ CallRecording = 'callRecording',
Comment = 'comment',
Company = 'company',
Dashboard = 'dashboard',
diff --git a/packages/twenty-shared/src/types/FeatureFlagKey.ts b/packages/twenty-shared/src/types/FeatureFlagKey.ts
index 92a89ee1fb3..1d146904181 100644
--- a/packages/twenty-shared/src/types/FeatureFlagKey.ts
+++ b/packages/twenty-shared/src/types/FeatureFlagKey.ts
@@ -13,4 +13,5 @@ export enum FeatureFlagKey {
IS_WORKFLOW_VERSION_IN_CORE_ENABLED = 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED',
IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED = 'IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED',
IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED = 'IS_WORKSPACE_CACHE_COMPACT_STORAGE_ENABLED',
+ IS_NATIVE_CALL_RECORDING_TABS_ENABLED = 'IS_NATIVE_CALL_RECORDING_TABS_ENABLED',
}
diff --git a/packages/twenty-shared/src/types/index.ts b/packages/twenty-shared/src/types/index.ts
index 8eba062cba1..a0663382335 100644
--- a/packages/twenty-shared/src/types/index.ts
+++ b/packages/twenty-shared/src/types/index.ts
@@ -21,6 +21,11 @@ export { CalendarChannelContactAutoCreationPolicy } from './CalendarChannelConta
export { CalendarChannelSyncStage } from './CalendarChannelSyncStage';
export { CalendarChannelSyncStatus } from './CalendarChannelSyncStatus';
export { CalendarChannelVisibility } from './CalendarChannelVisibility';
+export type {
+ CallRecordingTranscriptStatusMarker,
+ CallRecordingParsedTranscriptWord,
+ CallRecordingParsedTranscriptEntry,
+} from './CallRecordingTranscript';
export type { CommandMenuConfirmationModalResult } from './CommandMenuConfirmationModalResult';
export type { CommandMenuConfirmationModalResultBrowserEventDetail } from './CommandMenuConfirmationModalResultBrowserEventDetail';
export type { CommandMenuContextApi } from './CommandMenuContextApi';
diff --git a/packages/twenty-shared/src/utils/callRecording/__tests__/isCallRecordingTranscriptStatusMarker.spec.ts b/packages/twenty-shared/src/utils/callRecording/__tests__/isCallRecordingTranscriptStatusMarker.spec.ts
new file mode 100644
index 00000000000..3fb1476323c
--- /dev/null
+++ b/packages/twenty-shared/src/utils/callRecording/__tests__/isCallRecordingTranscriptStatusMarker.spec.ts
@@ -0,0 +1,26 @@
+import { isCallRecordingTranscriptStatusMarker } from '@/utils/callRecording/isCallRecordingTranscriptStatusMarker';
+
+describe('isCallRecordingTranscriptStatusMarker', () => {
+ it.each(['PENDING', 'FAILED'] as const)(
+ 'accepts a %s marker with provider-specific data',
+ (status) => {
+ expect(
+ isCallRecordingTranscriptStatusMarker({
+ status,
+ providerTranscriptId: 'provider-transcript-id',
+ }),
+ ).toBe(true);
+ },
+ );
+
+ it.each([
+ null,
+ undefined,
+ [],
+ 'PENDING',
+ { status: 'READY' },
+ { status: null },
+ ])('rejects unsupported marker value %#', (transcript) => {
+ expect(isCallRecordingTranscriptStatusMarker(transcript)).toBe(false);
+ });
+});
diff --git a/packages/twenty-shared/src/utils/callRecording/__tests__/parseCallRecordingTranscriptEntries.spec.ts b/packages/twenty-shared/src/utils/callRecording/__tests__/parseCallRecordingTranscriptEntries.spec.ts
new file mode 100644
index 00000000000..aba664bd6c9
--- /dev/null
+++ b/packages/twenty-shared/src/utils/callRecording/__tests__/parseCallRecordingTranscriptEntries.spec.ts
@@ -0,0 +1,178 @@
+import { parseCallRecordingTranscriptEntries } from '@/utils/callRecording/parseCallRecordingTranscriptEntries';
+
+describe('parseCallRecordingTranscriptEntries', () => {
+ it('parses a normal multi-speaker transcript', () => {
+ expect(
+ parseCallRecordingTranscriptEntries([
+ {
+ participant: { name: 'Ada' },
+ words: [{ text: 'Hello' }],
+ },
+ {
+ participant: { name: 'Grace' },
+ words: [{ text: 'Hi Ada' }],
+ },
+ ]),
+ ).toMatchObject([
+ { speakerName: 'Ada', text: 'Hello' },
+ { speakerName: 'Grace', text: 'Hi Ada' },
+ ]);
+ });
+
+ it('parses diarized entries into speaker, start time, and joined text', () => {
+ expect(
+ parseCallRecordingTranscriptEntries([
+ {
+ participant: { name: 'Ada Lovelace' },
+ words: [
+ {
+ text: 'Hello from',
+ start_timestamp: { relative: 1.2 },
+ end_timestamp: { relative: 1.6 },
+ },
+ {
+ text: 'there',
+ start_timestamp: { relative: 1.7 },
+ end_timestamp: { relative: 2.1 },
+ },
+ ],
+ },
+ ]),
+ ).toEqual([
+ {
+ speakerName: 'Ada Lovelace',
+ startSeconds: 1.2,
+ endSeconds: 2.1,
+ text: 'Hello from there',
+ words: [
+ { text: 'Hello from', startSeconds: 1.2, endSeconds: 1.6 },
+ { text: 'there', startSeconds: 1.7, endSeconds: 2.1 },
+ ],
+ },
+ ]);
+ });
+
+ it('returns an undefined speaker name when the participant has no name', () => {
+ expect(
+ parseCallRecordingTranscriptEntries([
+ { participant: { name: null }, words: [{ text: 'Hello' }] },
+ { words: [{ text: 'Hi' }] },
+ { participant: { name: ' ' }, words: [{ text: 'Welcome' }] },
+ ]),
+ ).toEqual([
+ {
+ speakerName: undefined,
+ startSeconds: undefined,
+ endSeconds: undefined,
+ text: 'Hello',
+ words: [
+ { text: 'Hello', startSeconds: undefined, endSeconds: undefined },
+ ],
+ },
+ {
+ speakerName: undefined,
+ startSeconds: undefined,
+ endSeconds: undefined,
+ text: 'Hi',
+ words: [{ text: 'Hi', startSeconds: undefined, endSeconds: undefined }],
+ },
+ {
+ speakerName: undefined,
+ startSeconds: undefined,
+ endSeconds: undefined,
+ text: 'Welcome',
+ words: [
+ {
+ text: 'Welcome',
+ startSeconds: undefined,
+ endSeconds: undefined,
+ },
+ ],
+ },
+ ]);
+ });
+
+ it('keeps zero timestamps and discards non-finite timestamps', () => {
+ expect(
+ parseCallRecordingTranscriptEntries([
+ {
+ participant: { name: 'Ada' },
+ words: [
+ {
+ text: 'First',
+ start_timestamp: { relative: 0 },
+ end_timestamp: { relative: Number.NaN },
+ },
+ {
+ text: 'second',
+ start_timestamp: { relative: Number.NEGATIVE_INFINITY },
+ end_timestamp: { relative: Number.POSITIVE_INFINITY },
+ },
+ ],
+ },
+ ]),
+ ).toEqual([
+ {
+ speakerName: 'Ada',
+ startSeconds: 0,
+ endSeconds: undefined,
+ text: 'First second',
+ words: [
+ { text: 'First', startSeconds: 0, endSeconds: undefined },
+ { text: 'second', startSeconds: undefined, endSeconds: undefined },
+ ],
+ },
+ ]);
+ });
+
+ it('skips malformed entries and unusable words', () => {
+ expect(
+ parseCallRecordingTranscriptEntries([
+ { participant: { name: 'No words' }, words: [] },
+ { participant: { name: 'Missing words' } },
+ {
+ participant: { name: 'Invalid words' },
+ words: [{ text: ' ' }, 42, null],
+ },
+ {
+ participant: { name: ' Kept speaker ' },
+ words: [{ text: ' Kept text ' }],
+ },
+ 'not an entry',
+ ]),
+ ).toEqual([
+ {
+ speakerName: 'Kept speaker',
+ startSeconds: undefined,
+ endSeconds: undefined,
+ text: 'Kept text',
+ words: [
+ {
+ text: 'Kept text',
+ startSeconds: undefined,
+ endSeconds: undefined,
+ },
+ ],
+ },
+ ]);
+ });
+
+ it('distinguishes an empty transcript from an unsupported payload', () => {
+ expect(parseCallRecordingTranscriptEntries([])).toEqual([]);
+ expect(
+ parseCallRecordingTranscriptEntries([{ words: [{ text: ' ' }] }]),
+ ).toEqual([]);
+ expect(parseCallRecordingTranscriptEntries(null)).toBeUndefined();
+ expect(parseCallRecordingTranscriptEntries('transcript')).toBeUndefined();
+ expect(
+ parseCallRecordingTranscriptEntries({ status: 'PENDING' }),
+ ).toBeUndefined();
+ });
+
+ it.each([undefined, 42, true, { entries: [] }])(
+ 'rejects the invalid top-level input %#',
+ (transcript) => {
+ expect(parseCallRecordingTranscriptEntries(transcript)).toBeUndefined();
+ },
+ );
+});
diff --git a/packages/twenty-shared/src/utils/callRecording/isCallRecordingTranscriptStatusMarker.ts b/packages/twenty-shared/src/utils/callRecording/isCallRecordingTranscriptStatusMarker.ts
new file mode 100644
index 00000000000..845f3dd55bf
--- /dev/null
+++ b/packages/twenty-shared/src/utils/callRecording/isCallRecordingTranscriptStatusMarker.ts
@@ -0,0 +1,15 @@
+import { isArray, isObject } from '@sniptt/guards';
+
+import { type CallRecordingTranscriptStatusMarker } from '@/types/CallRecordingTranscript';
+
+export const isCallRecordingTranscriptStatusMarker = (
+ transcript: unknown,
+): transcript is CallRecordingTranscriptStatusMarker => {
+ if (!isObject(transcript) || isArray(transcript)) {
+ return false;
+ }
+
+ const status = (transcript as Record<string, unknown>).status;
+
+ return status === 'PENDING' || status === 'FAILED';
+};
diff --git a/packages/twenty-shared/src/utils/callRecording/parseCallRecordingTranscriptEntries.ts b/packages/twenty-shared/src/utils/callRecording/parseCallRecordingTranscriptEntries.ts
new file mode 100644
index 00000000000..8ca13e18bec
--- /dev/null
+++ b/packages/twenty-shared/src/utils/callRecording/parseCallRecordingTranscriptEntries.ts
@@ -0,0 +1,94 @@
+import {
+ isArray,
+ isNumber,
+ isObject,
+ isString,
+ isUndefined,
+} from '@sniptt/guards';
+
+import {
+ type CallRecordingParsedTranscriptEntry,
+ type CallRecordingParsedTranscriptWord,
+} from '@/types/CallRecordingTranscript';
+import { isDefined } from '@/utils/validation';
+
+const asRecord = (value: unknown): Record<string, unknown> | undefined =>
+ isObject(value) && !isArray(value)
+ ? (value as Record<string, unknown>)
+ : undefined;
+
+const readRelativeTimestamp = (
+ timestamp: Record<string, unknown> | undefined,
+): number | undefined => {
+ const relativeTimestamp = timestamp?.relative;
+
+ return isNumber(relativeTimestamp) && Number.isFinite(relativeTimestamp)
+ ? relativeTimestamp
+ : undefined;
+};
+
+const readTrimmedString = (value: unknown): string | undefined => {
+ const trimmedValue = isString(value) ? value.trim() : '';
+
+ return trimmedValue === '' ? undefined : trimmedValue;
+};
+
+const readTranscriptWord = (
+ candidate: Record<string, unknown>,
+): CallRecordingParsedTranscriptWord | undefined => {
+ const text = readTrimmedString(candidate.text);
+
+ if (isUndefined(text)) {
+ return undefined;
+ }
+
+ return {
+ text,
+ startSeconds: readRelativeTimestamp(asRecord(candidate.start_timestamp)),
+ endSeconds: readRelativeTimestamp(asRecord(candidate.end_timestamp)),
+ };
+};
+
+const readSpeakerName = (
+ participant: Record<string, unknown> | undefined,
+): string | undefined => readTrimmedString(participant?.name);
+
+const readTranscriptEntry = (
+ candidate: Record<string, unknown>,
+): CallRecordingParsedTranscriptEntry | undefined => {
+ if (!isArray(candidate.words)) {
+ return undefined;
+ }
+
+ const words = candidate.words
+ .map(asRecord)
+ .filter(isDefined)
+ .map(readTranscriptWord)
+ .filter(isDefined);
+
+ if (words.length === 0) {
+ return undefined;
+ }
+
+ return {
+ speakerName: readSpeakerName(asRecord(candidate.participant)),
+ startSeconds: words[0].startSeconds,
+ endSeconds: words[words.length - 1].endSeconds,
+ text: words.map((word) => word.text).join(' '),
+ words,
+ };
+};
+
+export const parseCallRecordingTranscriptEntries = (
+ transcript: unknown,
+): CallRecordingParsedTranscriptEntry[] | undefined => {
+ if (!isArray(transcript)) {
+ return undefined;
+ }
+
+ return transcript
+ .map(asRecord)
+ .filter(isDefined)
+ .map(readTranscriptEntry)
+ .filter(isDefined);
+};
diff --git a/packages/twenty-shared/src/utils/index.ts b/packages/twenty-shared/src/utils/index.ts
index 93957fb215c..be8a89e776b 100644
--- a/packages/twenty-shared/src/utils/index.ts
+++ b/packages/twenty-shared/src/utils/index.ts
@@ -23,6 +23,8 @@ export { upsertIntoArrayOfObjectsComparingId } from './array/upsertIntoArrayOfOb
export { upsertPropertiesOfItemIntoArrayOfObjectsComparingId } from './array/upsertPropertiesOfItemIntoArrayOfObjectsComparingId';
export { assertUnreachable } from './assertUnreachable';
export { base64UrlEncode } from './base64UrlEncode';
+export { isCallRecordingTranscriptStatusMarker } from './callRecording/isCallRecordingTranscriptStatusMarker';
+export { parseCallRecordingTranscriptEntries } from './callRecording/parseCallRecordingTranscriptEntries';
export { conditionalAvailabilityParser } from './command-menu-items/conditionalAvailabilityParser';
export { evaluateConditionalAvailabilityExpression } from './command-menu-items/evaluateConditionalAvailabilityExpression';
export { interpolateCommandMenuItemTemplate } from './command-menu-items/interpolateCommandMenuItemTemplate';