Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(calls): open recordings in the calls view (#8095)

dev-rbbad386109fae
diff --git a/apps/web/src/components/app/split-layout/split-router/app-middleware.ts b/apps/web/src/components/app/split-layout/split-router/app-middleware.ts
index f70b469994..3aad7bbc3c 100644
--- a/apps/web/src/components/app/split-layout/split-router/app-middleware.ts
+++ b/apps/web/src/components/app/split-layout/split-router/app-middleware.ts
@@ -58,7 +58,7 @@ function redirectLegacyRoutes(
if (rootId === 'call-detail') {
const { callId } = routeParams(route);
if (typeof callId === 'string') {
- return redirect(`/drive/call/${encodeURIComponent(callId)}`);
+ return redirect(`/calls/call/${encodeURIComponent(callId)}`);
}
}
if (rootId === 'pr-detail') {
@@ -185,7 +185,7 @@ function migrateLegacySearch({
namespace: CALENDAR_SEARCH_NAMESPACE,
fields: [['eventId', 'eventId']] as const,
}))
- .with('call-detail', 'drive-call', () => ({
+ .with('call-detail', 'drive-call', 'calls-call', () => ({
namespace: 'call-detail',
fields: [
[CALL_URL_PARAMS.transcriptId, 'transcriptId'],
diff --git a/apps/web/src/features/block-call/route-views.tsx b/apps/web/src/features/block-call/route-views.tsx
index 6183d58374..bb1986f27f 100644
--- a/apps/web/src/features/block-call/route-views.tsx
+++ b/apps/web/src/features/block-call/route-views.tsx
@@ -1,27 +1,18 @@
-import { useAnalytics } from '@app/lib/analytics/analytics-context';
import { createSearchParams, useRouteParams } from '@app/lib/split-router';
import { callDetailRoute } from '@app/routes/routes';
import { withAuth } from '@components/app/split-layout/split-router/app-route-shell';
-import { lazy, onMount } from 'solid-js';
+import { lazy } from 'solid-js';
import { callDetailSearch } from './call-route';
-const StandaloneCallDetail = lazy(async () => ({
- default: (await import('./views/CallDetailView')).StandaloneCallDetail,
+const CallDetailView = lazy(async () => ({
+ default: (await import('./views/CallDetailView')).CallDetailView,
}));
export const CallDetailRouteView = withAuth(() => {
const params = useRouteParams(callDetailRoute);
const [search] = createSearchParams(callDetailSearch);
- const analytics = useAnalytics();
- onMount(() => {
- analytics.pageView('call');
- analytics.track('open_entity', {
- entityType: 'call',
- entityId: params.callId,
- });
- });
return (
- <StandaloneCallDetail
+ <CallDetailView
callId={params.callId}
transcriptId={search.transcriptId}
messageId={search.messageId}
diff --git a/apps/web/src/features/block-call/views/CallDetailView.tsx b/apps/web/src/features/block-call/views/CallDetailView.tsx
index a54bf122ab..44bae90eea 100644
--- a/apps/web/src/features/block-call/views/CallDetailView.tsx
+++ b/apps/web/src/features/block-call/views/CallDetailView.tsx
@@ -1,4 +1,5 @@
import { ViewShell } from '@app/components/view-shell';
+import { useAnalytics } from '@app/lib/analytics/analytics-context';
import { createSearchParams } from '@app/lib/split-router';
import { SidePanel } from '@components/app/side-panel';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
@@ -20,6 +21,7 @@ import { Button } from '@ui';
import {
type Accessor,
createMemo,
+ type JSX,
Match,
onMount,
type ParentProps,
@@ -204,22 +206,40 @@ export function CallDetailContent(props: {
);
}
-export function StandaloneCallDetail(props: {
+export function CallDetailView(props: {
callId: string;
transcriptId?: string;
messageId?: string;
seek?: string;
+ header?: (data: Accessor<CallDetailData | undefined>) => JSX.Element;
}) {
const detail = useCallDetail(() => props.callId);
+ const analytics = useAnalytics();
+ onMount(() => {
+ analytics.pageView('call');
+ analytics.track('open_entity', {
+ entityType: 'call',
+ entityId: props.callId,
+ });
+ });
return (
<CallDetailRoot callId={props.callId}>
<div class="flex size-full min-h-0 min-w-0 flex-col overflow-hidden @container">
<ViewShell.TopBar class="touch:flex">
<SplitPanel.CloseButton class="hidden shrink-0 touch:flex" />
- <PhoneCallIcon class="size-4 shrink-0 text-ink-muted" />
- <span class="min-w-0 truncate text-sm font-semibold">
- {detail.data()?.name ?? 'Call Recording'}
- </span>
+ <Show
+ when={props.header}
+ fallback={
+ <>
+ <PhoneCallIcon class="size-4 shrink-0 text-ink-muted" />
+ <span class="min-w-0 truncate text-sm font-semibold">
+ {detail.data()?.name ?? 'Call Recording'}
+ </span>
+ </>
+ }
+ >
+ {(header) => header()(detail.data)}
+ </Show>
<Show when={detail.data()}>
{(data) => (
<CallDetailActions
diff --git a/apps/web/src/features/calls-view/calls-hosted-content.ts b/apps/web/src/features/calls-view/calls-hosted-content.ts
new file mode 100644
index 0000000000..e6cd3ae363
--- /dev/null
+++ b/apps/web/src/features/calls-view/calls-hosted-content.ts
@@ -0,0 +1,21 @@
+import { paneRoute } from '@app/routes/app-route';
+import type { SplitContent } from '@components/app/split-layout/layoutManager';
+
+/** Open recordings in Calls without mounting a legacy call block. */
+export function callsHostedContent(content: {
+ type: string;
+ id: string;
+}): SplitContent | undefined {
+ if (content.type !== 'call') return;
+
+ return {
+ type: 'component',
+ id: 'calls',
+ entryMetadata: {
+ route: paneRoute(
+ { id: 'view-calls', params: {} },
+ { id: 'calls-call', params: { callId: content.id } }
+ ),
+ },
+ };
+}
diff --git a/apps/web/src/features/calls-view/components/calls-sidebar.tsx b/apps/web/src/features/calls-view/components/calls-sidebar.tsx
index 895379c0b9..5c17ead628 100644
--- a/apps/web/src/features/calls-view/components/calls-sidebar.tsx
+++ b/apps/web/src/features/calls-view/components/calls-sidebar.tsx
@@ -97,7 +97,7 @@ function Section(props: {
}
/** Views, audience, channel, and tag navigation for the Calls list. */
-export function CallsSidebar() {
+export function CallsSidebar(props: { onNavigate: () => void }) {
const soup = useSoup();
const view = useSoupView();
const { applyTabPreset } = useApplyPreset();
@@ -113,11 +113,13 @@ export function CallsSidebar() {
const activeTab = () => view.activeTab() ?? VIEW_TAB_PRESETS.calls.default;
- const selectAudience = (id: CallAudienceId) =>
+ const selectAudience = (id: CallAudienceId) => {
+ props.onNavigate();
soup.predicates.set(({ andIds, orIds }) => ({
and: selectCallAudience(andIds, id),
or: orIds,
}));
+ };
// Audience filters only narrow loaded pages, and a sparse page leaves no
// list to scroll, so keep paging until enough matches show or pages run out.
@@ -141,10 +143,12 @@ export function CallsSidebar() {
);
const activeChannelIds = () =>
view.queryFilters.state.include.callChannelId ?? [];
- const selectChannel = (id: string) =>
+ const selectChannel = (id: string) => {
+ props.onNavigate();
view.queryFilters.set({
include: { callChannelId: selectSidebarTag(activeChannelIds(), id) },
});
+ };
return (
<ViewSidebar.Root aria-label="Calls navigation">
@@ -155,9 +159,11 @@ export function CallsSidebar() {
</div>
</ViewSidebar.Header>
<ViewSidebar.Primary>
- <Layer depth={2}>
- <SoupSearchbar variant="secondary" placeholder="Search calls" />
- </Layer>
+ <div onFocusIn={props.onNavigate}>
+ <Layer depth={2}>
+ <SoupSearchbar variant="secondary" placeholder="Search calls" />
+ </Layer>
+ </div>
</ViewSidebar.Primary>
<ViewSidebar.Content>
@@ -168,7 +174,10 @@ export function CallsSidebar() {
active={activeTab() === tab.value}
icon={TAB_ICONS[tab.value] ?? PhoneIcon}
label={callViewLabel(tab)}
- onClick={() => applyTabPreset('calls', tab.value)}
+ onClick={() => {
+ props.onNavigate();
+ applyTabPreset('calls', tab.value);
+ }}
/>
)}
</For>
@@ -212,7 +221,10 @@ export function CallsSidebar() {
<SidebarTagsSection
activeIds={view.tagFilter.activeIds()}
- onActiveIdsChange={view.tagFilter.onChange}
+ onActiveIdsChange={(ids) => {
+ props.onNavigate();
+ view.tagFilter.onChange(ids);
+ }}
open={isOpen('tags')}
onOpenChange={(open) => setOpen('tags', open)}
/>
diff --git a/apps/web/src/features/calls-view/views/call-detail.tsx b/apps/web/src/features/calls-view/views/call-detail.tsx
new file mode 100644
index 0000000000..95a92af46e
--- /dev/null
+++ b/apps/web/src/features/calls-view/views/call-detail.tsx
@@ -0,0 +1,42 @@
+import { ViewBreadcrumbs } from '@app/components/view-shell';
+import { createSearchParams, useRouteParams } from '@app/lib/split-router';
+import { callsCallRoute } from '@app/routes/routes';
+import { callDetailSearch } from '@block-call/call-route';
+import { CallDetailView } from '@block-call/views/CallDetailView';
+import PhoneCallIcon from '@phosphor/phone-call.svg';
+
+export function CallsCallDetail() {
+ const params = useRouteParams(callsCallRoute);
+ const [search] = createSearchParams(callDetailSearch);
+
+ return (
+ <CallDetailView
+ callId={params.callId}
+ transcriptId={search.transcriptId}
+ messageId={search.messageId}
+ seek={search.seek}
+ header={(data) => (
+ <>
+ <ViewBreadcrumbs.Item
+ value={`call:${params.callId}`}
+ order={1}
+ metadata={{ type: 'call', id: params.callId }}
+ >
+ {(item) => (
+ <ViewBreadcrumbs.Button
+ class="gap-1.5"
+ isActive={item.isActive()}
+ onClick={item.onSelect}
+ tooltip={data()?.name ?? 'Call Recording'}
+ >
+ <PhoneCallIcon class="size-4 shrink-0" />
+ <span class="truncate">{data()?.name ?? 'Call Recording'}</span>
+ </ViewBreadcrumbs.Button>
+ )}
+ </ViewBreadcrumbs.Item>
+ <ViewBreadcrumbs.Outlet aria-label="Call location" />
+ </>
+ )}
+ />
+ );
+}
diff --git a/apps/web/src/features/calls-view/views/calls-view.tsx b/apps/web/src/features/calls-view/views/calls-view.tsx
index a855ec48fe..dc16c628b6 100644
--- a/apps/web/src/features/calls-view/views/calls-view.tsx
+++ b/apps/web/src/features/calls-view/views/calls-view.tsx
@@ -1,9 +1,16 @@
-import { ViewShell } from '@app/components/view-shell';
+import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
import { getViewPreset } from '@app/features/next-soup/sidebar/soup-filter-presets';
import { SoupRowMetadataProvider } from '@app/features/next-soup/soup-view/soup-row-metadata-provider';
import { SoupView } from '@app/features/next-soup/soup-view/soup-view';
import { callsTour } from '@app/features/next-soup/tour';
import { ViewTour } from '@app/features/tours/ViewTour';
+import {
+ SplitRouter,
+ useNavigate,
+ usePaneHistory,
+ useParams,
+} from '@app/lib/split-router';
+import { callsRoute } from '@app/routes/routes';
import { SplitPanel } from '@components/app/split-panel';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { type JSX, Show, Suspense } from 'solid-js';
@@ -16,6 +23,24 @@ import { CallsSidebar } from '../components/calls-sidebar';
*/
export function CallsView() {
const preset = getViewPreset('calls');
+ const params = useParams<{ callId?: string }>();
+ const navigate = useNavigate();
+ const history = usePaneHistory();
+ const openList = () => {
+ if (!params.callId) return;
+ const snapshot = history();
+ if (snapshot) {
+ for (let index = snapshot.index - 1; index >= 0; index--) {
+ const matches = snapshot.entries[index].location.route.matches;
+ if (!matches.some((match) => match.id === callsRoute.id)) break;
+ if (matches.at(-1)?.id === callsRoute.id) {
+ void navigate(index - snapshot.index);
+ return;
+ }
+ }
+ }
+ void navigate({ route: callsRoute, params: {} });
+ };
const list = (header?: JSX.Element) => (
<SoupView
viewName="Calls"
@@ -24,11 +49,32 @@ export function CallsView() {
initialGroupBy={preset?.groupBy}
tour={<ViewTour tour={callsTour} />}
header={header}
+ renderContent={(list) => <SplitRouter.Outlet fallback={list} />}
/>
);
return (
- <Show when={!isTouchDevice()} fallback={list()}>
+ <ViewBreadcrumbs.Root
+ value={params.callId ? `call:${params.callId}` : 'calls-view'}
+ onChange={(value) => {
+ if (value === 'calls-view') openList();
+ }}
+ >
+ <ViewBreadcrumbs.Item
+ value="calls-view"
+ order={0}
+ metadata={{ type: 'calls' }}
+ >
+ {(item) => (
+ <ViewBreadcrumbs.ReturnButton
+ isActive={item.isActive()}
+ onClick={item.onSelect}
+ tooltip="Calls"
+ >
+ Calls
+ </ViewBreadcrumbs.ReturnButton>
+ )}
+ </ViewBreadcrumbs.Item>
<SplitPanel.Root>
<SplitPanel.Body>
<ViewShell.Root
@@ -36,23 +82,27 @@ export function CallsView() {
resizable
aside={{ preserveDuringResize: false }}
>
- <ViewShell.Aside>
- <Suspense>
- <SoupRowMetadataProvider>
- <CallsSidebar />
- </SoupRowMetadataProvider>
- </Suspense>
- </ViewShell.Aside>
- <ViewShell.Main>
- {list(
+ <Show when={!isTouchDevice()}>
+ <ViewShell.Aside>
<Suspense>
- <CallsHeader />
+ <SoupRowMetadataProvider>
+ <CallsSidebar onNavigate={openList} />
+ </SoupRowMetadataProvider>
</Suspense>
+ </ViewShell.Aside>
+ </Show>
+ <ViewShell.Main>
+ {list(
+ !isTouchDevice() ? (
+ <Suspense>
+ <CallsHeader />
+ </Suspense>
+ ) : undefined
)}
</ViewShell.Main>
</ViewShell.Root>
</SplitPanel.Body>
</SplitPanel.Root>
- </Show>
+ </ViewBreadcrumbs.Root>
);
}
diff --git a/apps/web/src/features/drive-view/drive-hosted-content.ts b/apps/web/src/features/drive-view/drive-hosted-content.ts
index 612d70709a..3531bf113d 100644
--- a/apps/web/src/features/drive-view/drive-hosted-content.ts
+++ b/apps/web/src/features/drive-view/drive-hosted-content.ts
@@ -1,4 +1,4 @@
-import type { SplitLocation, SplitRouteMatch } from '@app/lib/split-router';
+import type { SplitRouteMatch } from '@app/lib/split-router';
import { paneRoute } from '@app/routes/app-route';
import type { SplitContent } from '@components/app/split-layout/layoutManager';
import type { DriveLocation } from './core/types';
@@ -43,7 +43,6 @@ export function driveHostedContent(
content: { type: string; id: string },
options: {
allowDocuments: boolean;
- search?: SplitLocation['search'];
}
): SplitContent | undefined {
const document = options.allowDocuments
@@ -51,17 +50,4 @@ export function driveHostedContent(
: undefined;
if (document)
return driveDocumentContent({ kind: 'tab', tab: 'owned' }, document);
- if (content.type !== 'call') return;
-
- return {
- type: 'component',
- id: 'documents',
- entryMetadata: {
- route: paneRoute(
- { id: 'drive', params: {} },
- { id: 'drive-call', params: { callId: content.id } }
- ),
- ...(options.search ? { search: options.search } : {}),
- },
- };
}
diff --git a/apps/web/src/features/drive-view/views/DriveCallDetail.tsx b/apps/web/src/features/drive-view/views/DriveCallDetail.tsx
index fcaae87bf7..8a32d3a5df 100644
--- a/apps/web/src/features/drive-view/views/DriveCallDetail.tsx
+++ b/apps/web/src/features/drive-view/views/DriveCallDetail.tsx
@@ -1,14 +1,6 @@
-import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
-import { useAnalytics } from '@app/lib/analytics/analytics-context';
-import {
- CallDetailActions,
- CallDetailContent,
- CallDetailRoot,
- useCallDetail,
-} from '@block-call/views/CallDetailView';
-import { SplitPanel } from '@components/app/split-panel';
+import { ViewBreadcrumbs } from '@app/components/view-shell';
+import { CallDetailView } from '@block-call/views/CallDetailView';
import PhoneCallIcon from '@phosphor/phone-call.svg';
-import { onMount, Show } from 'solid-js';
import { DriveBreadcrumbsOutlet } from '../components/DriveBreadcrumbs';
import { useDriveView } from '../context/drive-context';
import {
@@ -51,44 +43,18 @@ export function DriveCallDetail(props: {
messageId?: string;
seek?: string;
}) {
- const detail = useCallDetail(() => props.callId);
- const analytics = useAnalytics();
- onMount(() => {
- analytics.pageView('call');
- analytics.track('open_entity', {
- entityType: 'call',
- entityId: props.callId,
- });
- });
-
return (
- <CallDetailRoot callId={props.callId}>
- <div class="flex size-full min-h-0 min-w-0 flex-col overflow-hidden @container">
- <ViewShell.TopBar class="touch:flex">
- <SplitPanel.CloseButton class="hidden shrink-0 touch:flex" />
- <DriveCallBreadcrumb
- callId={props.callId}
- name={detail.data()?.name ?? 'Call Recording'}
- />
- <Show when={detail.data()}>
- {(data) => (
- <CallDetailActions
- callId={props.callId}
- record={data().record}
- name={data().name}
- />
- )}
- </Show>
- </ViewShell.TopBar>
- <CallDetailContent
+ <CallDetailView
+ callId={props.callId}
+ transcriptId={props.transcriptId}
+ messageId={props.messageId}
+ seek={props.seek}
+ header={(data) => (
+ <DriveCallBreadcrumb
callId={props.callId}
- query={detail.query}
- data={detail.data()}
- transcriptId={props.transcriptId}
- messageId={props.messageId}
- seek={props.seek}
+ name={data()?.name ?? 'Call Recording'}
/>
- </div>
- </CallDetailRoot>
+ )}
+ />
);
}
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view.tsx b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
index 6c57dee8ac..1b209b2e5c 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
@@ -237,6 +237,8 @@ interface SoupViewProps {
* views that compose their own chrome (e.g. a sidebar layout).
*/
header?: JSX.Element;
+ /** Compose a detail outlet while keeping the list's state initialized. */
+ renderContent?: (list: () => JSX.Element) => JSX.Element;
}
export const SoupView = (props: SoupViewProps) => {
@@ -566,7 +568,7 @@ export const SoupView = (props: SoupViewProps) => {
</Suspense>
</div>
);
- return content();
+ return props.renderContent ? props.renderContent(content) : content();
};
interface SoupViewListProps {
diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.ts
index 2cb7b1c962..41c910f803 100644
--- a/apps/web/src/features/next-soup/utils.test.ts
+++ b/apps/web/src/features/next-soup/utils.test.ts
@@ -2415,60 +2415,71 @@ describe('getRowClickFallbackLocation', () => {
});
describe('call navigation', () => {
- it('opens calls in Drive without mounting a call block', async () => {
- const openWithSplit = vi.fn(() => ({ status: 'unavailable' }));
- setGlobalSplitManager({
- activeSplit: () => undefined,
- getOrchestrator: () => ({}),
- openWithSplit,
- } as unknown as SplitManager);
+ it.each([false, true])(
+ 'opens calls in Calls on touch=%s without mounting a call block',
+ async (touch) => {
+ vi.mocked(isTouchDevice).mockReturnValue(touch);
+ const openWithSplit = vi.fn(() => ({ status: 'unavailable' }));
+ setGlobalSplitManager({
+ activeSplit: () => undefined,
+ getOrchestrator: () => ({}),
+ openWithSplit,
+ } as unknown as SplitManager);
- await openEntityInSplitFromUnifiedList(searchEntity('call', null), {});
- expect(openWithSplit).toHaveBeenCalledWith(
- {
+ await openEntityInSplitFromUnifiedList(searchEntity('call', null), {});
+ expect(openWithSplit).toHaveBeenCalledWith(
+ {
+ type: 'component',
+ id: 'calls',
+ entryMetadata: {
+ route: paneRoute(
+ { id: 'view-calls', params: {} },
+ { id: 'calls-call', params: { callId: 'call-1' } }
+ ),
+ },
+ },
+ expect.objectContaining({ allowDuplicate: true })
+ );
+ }
+ );
+
+ it.each([false, true])(
+ 'carries a transcript target into the Calls route with new split=%s',
+ async (openInNewSplit) => {
+ const openWithSplit = vi.fn((..._args: unknown[]) => ({
+ status: 'unavailable',
+ }));
+ setGlobalSplitManager({
+ activeSplit: () => undefined,
+ getOrchestrator: () => ({}),
+ openWithSplit,
+ } as unknown as SplitManager);
+
+ await openEntityInSplitFromUnifiedList(searchEntity('call', null), {
+ openInNewSplit,
+ location: {
+ type: 'call_record',
+ callId: 'call-1',
+ transcriptId: 'segment-1',
+ },
+ });
+ expect(openWithSplit.mock.calls[0]?.[0]).toMatchObject({
type: 'component',
- id: 'documents',
+ id: 'calls',
entryMetadata: {
route: paneRoute(
- { id: 'drive', params: {} },
- { id: 'drive-call', params: { callId: 'call-1' } }
+ { id: 'view-calls', params: {} },
+ { id: 'calls-call', params: { callId: 'call-1' } }
),
},
- },
- expect.objectContaining({ allowDuplicate: true })
- );
- });
-
- it('carries a transcript target into the Drive call route', async () => {
- const openWithSplit = vi.fn((..._args: unknown[]) => ({
- status: 'unavailable',
- }));
- setGlobalSplitManager({
- activeSplit: () => undefined,
- getOrchestrator: () => ({}),
- openWithSplit,
- } as unknown as SplitManager);
-
- await openEntityInSplitFromUnifiedList(searchEntity('call', null), {
- location: {
- type: 'call_record',
- callId: 'call-1',
- transcriptId: 'segment-1',
- },
- });
- expect(openWithSplit.mock.calls[0]?.[0]).toMatchObject({
- type: 'component',
- id: 'documents',
- entryMetadata: {
- route: paneRoute(
- { id: 'drive', params: {} },
- { id: 'drive-call', params: { callId: 'call-1' } }
- ),
- },
- });
- expect(targetSearch(openWithSplit, 'call-detail')).toMatchObject({
- transcriptId: ['segment-1'],
- seek: [expect.any(String)],
- });
- });
+ });
+ expect(openWithSplit.mock.calls[0]?.[1]).toMatchObject({
+ preferNewSplit: openInNewSplit,
+ });
+ expect(targetSearch(openWithSplit, 'call-detail')).toMatchObject({
+ transcriptId: ['segment-1'],
+ seek: [expect.any(String)],
+ });
+ }
+ );
});
diff --git a/apps/web/src/features/next-soup/utils.ts b/apps/web/src/features/next-soup/utils.ts
index 439dee540f..e62d74191e 100644
--- a/apps/web/src/features/next-soup/utils.ts
+++ b/apps/web/src/features/next-soup/utils.ts
@@ -13,6 +13,7 @@ import {
CALENDAR_VIEW_ID,
type CalendarViewTarget,
} from '@app/features/calendar-view/types';
+import { callsHostedContent } from '@app/features/calls-view/calls-hosted-content';
import { driveHostedContent } from '@app/features/drive-view/drive-hosted-content';
import { projectRouteId } from '@app/features/projects/core/route';
import { reviewsHostedContent } from '@app/features/reviews-view/reviews-hosted-content';
@@ -747,6 +748,7 @@ export const openEntityInSplitFromUnifiedList = async (
// legacy blocks. Comment targets keep their document block.
const hostedContent =
reviewsHostedContent(content) ??
+ callsHostedContent(content) ??
driveHostedContent(content, {
allowDocuments: !isTouchDevice() && !commentParams,
});
diff --git a/apps/web/src/routes/app-router-view.tsx b/apps/web/src/routes/app-router-view.tsx
index 405cbe4efd..9f47065fa5 100644
--- a/apps/web/src/routes/app-router-view.tsx
+++ b/apps/web/src/routes/app-router-view.tsx
@@ -40,6 +40,7 @@ import {
AgentsRouteView,
CalendarRouteView,
CallDetailRouteView,
+ CallsCallDetail,
CallsRouteView,
ChannelDetailRouteView,
ChannelsRouteView,
@@ -89,6 +90,7 @@ import {
bookingReceiptRoute,
calendarSplitRoute,
callDetailRoute,
+ callsCallRoute,
callsRoute,
channelDetailRoute,
channelInviteRoute,
@@ -383,7 +385,9 @@ export function AppRouterView() {
component={ChannelDetailRouteView}
/>
</Route>
- <Route definition={callsRoute} component={CallsRouteView} />
+ <Route definition={callsRoute} component={CallsRouteView}>
+ <Route definition={callsCallRoute} component={CallsCallDetail} />
+ </Route>
<Route definition={callDetailRoute} component={CallDetailRouteView} />
<Route definition={companiesRoute} component={CompaniesRouteView} />
<Route definition={foldersRoute} component={FoldersRouteView} />
diff --git a/apps/web/src/routes/lazy-route-views.ts b/apps/web/src/routes/lazy-route-views.ts
index b450ac68f6..9735c05ae2 100644
--- a/apps/web/src/routes/lazy-route-views.ts
+++ b/apps/web/src/routes/lazy-route-views.ts
@@ -18,6 +18,11 @@ export const CallDetailRouteView = lazyNamed(
() => import('@app/features/block-call/route-views'),
'CallDetailRouteView'
);
+
+export const CallsCallDetail = lazyNamed(
+ () => import('@app/features/calls-view/views/call-detail'),
+ 'CallsCallDetail'
+);
export const PrDetailRouteView = lazyNamed(
() => import('@app/features/block-pr/route-views'),
'PrDetailRouteView'
diff --git a/apps/web/src/routes/routes.ts b/apps/web/src/routes/routes.ts
index d0cae619bc..bb757ea63f 100644
--- a/apps/web/src/routes/routes.ts
+++ b/apps/web/src/routes/routes.ts
@@ -587,6 +587,17 @@ export const callsRoute = defineRoute({
claim: () => ({ namespace: 'component', id: 'calls' }),
});
+export const callsCallRoute = defineRoute({
+ id: 'calls-call',
+ path: 'call/:callId',
+ params: z.object({ callId: z.string().min(1) }),
+ search: [callDetailSearch.namespace],
+ externalSearch: [CALL_URL_PARAMS.transcriptId, CALL_URL_PARAMS.messageId],
+ remountKey: ({ callId }) => callId,
+ claim: ({ callId }) => ({ namespace: 'block', id: `call:${callId}` }),
+ toReference: ({ callId }) => uuidRouteReference(callId, 'call'),
+});
+
export const callDetailRoute = defineRoute({
id: 'call-detail',
path: 'call/:callId',
diff --git a/docs/agent-guide/calls.md b/docs/agent-guide/calls.md
index c5a3f90701..d68fd2dd4d 100644
--- a/docs/agent-guide/calls.md
+++ b/docs/agent-guide/calls.md
@@ -19,16 +19,22 @@ The channel/contact option opens the recipient picker.
Recordings, transcriptions
and summaries appear here; empty state notes "Calls are available to agents."
-Opening a recording uses `/app/drive/call/<callId>` inside the Drive shell,
-with one breadcrumbed header (`My Files > <recording name>`) and a route back to
-Drive. The Drive file list does not include calls.
-Old copied `/app/call/<callId>` links redirect to the Drive detail without losing
-the transcript target. The detail shows a loading state, recording/transcript/summary,
-Share, and a call side panel below the breadcrumb header; a failed load shows Try again.
+Opening a recording uses `/app/calls/call/<callId>` inside the Calls view,
+with one breadcrumbed header (`Calls > <recording name>`). Choose `Calls` to
+return to the list with its search, filters, focus, and scroll position preserved.
+The desktop sidebar remains available; choosing a view or filter, or focusing
+search, returns to the list. Phones show the same detail and return breadcrumb
+instead of switching to Drive. Shift+Enter and Open in new split open
+the recording in a second Calls view.
+Old copied `/app/call/<callId>` links redirect to the Calls detail without losing
+the transcript target. Existing `/app/drive/call/<callId>` links still work.
+The detail shows a loading state, recording/transcript/summary, Share, and a call
+side panel below the breadcrumb header; a failed load shows Retry.
`call_transcript_id=<segmentId>` seeks the matching video segment after loading.
-Check a direct link, an old copied link, a Calls-list click, a second split,
-the breadcrumb return, and clicking the same transcript search hit twice after
-playing elsewhere. On phones, recorded call headers omit **Call Again**.
+Check a direct link, both old link formats, a Calls-list click, a second split,
+the breadcrumb return, browser Back/Forward, and clicking the same transcript
+search hit twice after playing elsewhere. On phones, recorded call headers omit
+**Call Again**.
A channel's `Calls` tab lists that channel's recordings with the same rows, filtered
by the channel id. Its search field matches call names and transcripts in that