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.

feat(web): host call and PR details in Drive and Tasks (#6961)

dev-rb766ecc5dade4
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 30bc21d573..3148ae1cf5 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
@@ -59,6 +59,18 @@ function redirectLegacyRoutes(
}
}
+ if (route.matches[0].id === 'call-detail') {
+ const { callId } = routeParams(route);
+ if (typeof callId === 'string') {
+ return redirect(`/drive/call/${encodeURIComponent(callId)}`);
+ }
+ }
+ if (route.matches[0].id === 'pr-detail') {
+ const { foreignEntityId } = routeParams(route);
+ if (typeof foreignEntityId === 'string') {
+ return redirect(`/tasks/pr/${encodeURIComponent(foreignEntityId)}`);
+ }
+ }
if (route.matches[0].id !== 'legacy-content') return;
const { type, id } = routeParams(route);
@@ -171,7 +183,7 @@ function migrateLegacySearch({
namespace: CALENDAR_SEARCH_NAMESPACE,
fields: [['eventId', 'eventId']] as const,
}))
- .with('call-detail', () => ({
+ .with('call-detail', 'drive-call', () => ({
namespace: 'call-detail',
fields: [[CALL_URL_PARAMS.transcriptId, 'transcriptId']] as const,
}))
diff --git a/apps/web/src/components/app/split-layout/split-router/app-route-shell.tsx b/apps/web/src/components/app/split-layout/split-router/app-route-shell.tsx
index 1c0b5f44bf..6643de9b0b 100644
--- a/apps/web/src/components/app/split-layout/split-router/app-route-shell.tsx
+++ b/apps/web/src/components/app/split-layout/split-router/app-route-shell.tsx
@@ -50,6 +50,8 @@ export function NewAppView(props: {
detailRequested?: () => boolean;
detailFallback?: JSX.Element;
detailDesktopOnly?: boolean;
+ /** Keep routed details in their host shell when the list view flag is off. */
+ alwaysRenderDetail?: boolean;
}) {
usePageViewTracking(props.id);
const flag = useFeatureFlag(enableNewAppViews);
@@ -64,7 +66,11 @@ export function NewAppView(props: {
);
const surfaceSupported = () => !props.desktopOnly || !isTouchDevice();
const renderModern = () =>
- enabled() && surfaceSupported() && !detailUnsupported();
+ (enabled() ||
+ (ready() &&
+ Boolean(props.alwaysRenderDetail && props.detailRequested?.()))) &&
+ surfaceSupported() &&
+ !detailUnsupported();
const fallback = () => {
if (!props.detailRequested?.()) return props.fallback;
const detail = props.detailFallback;
diff --git a/apps/web/src/components/app/split-layout/split-router/legacy-route.ts b/apps/web/src/components/app/split-layout/split-router/legacy-route.ts
index 5b5141b1d8..587dff1b85 100644
--- a/apps/web/src/components/app/split-layout/split-router/legacy-route.ts
+++ b/apps/web/src/components/app/split-layout/split-router/legacy-route.ts
@@ -11,14 +11,11 @@ import {
calendarTargetSearch,
} from '@app/features/calendar-view/calendar-url';
import { CALENDAR_VIEW_ID } from '@app/features/calendar-view/types';
-import type { DriveLocation } from '@app/features/drive-view/core/types';
-import type { DriveDocumentRoute } from '@app/features/drive-view/primitives/drive-route';
import { URL_PARAMS as EMAIL_URL_PARAMS } from '@app/features/email-thread/core/location';
import {
defineRoute,
routeParams,
type SplitLocation,
- type SplitRouteMatch,
type SplitRouterEntry,
type UnmatchedSplitPathHandler,
} from '@app/lib/split-router';
@@ -34,7 +31,12 @@ import { isRecord } from '@app/lib/split-router/utils';
import { CALENDAR_BLOCK_ID } from '@block-calendar/types';
import { URL_PARAMS as CHANNEL_URL_PARAMS } from '@block-channel/constants';
import type { BlockAlias, BlockName } from '@core/block';
-import { isBlockAlias, resolveBlockAlias } from '@core/constant/allBlocks';
+import {
+ blocks,
+ fileTypeToBlockName,
+ isBlockAlias,
+ resolveBlockAlias,
+} from '@core/constant/allBlocks';
import { z } from 'zod';
import type { SplitContent } from '../layoutManager';
@@ -63,7 +65,11 @@ export function decodeLegacyPair(
};
}
- const resolvedType = resolveBlockAlias(type as BlockName | BlockAlias);
+ const resolvedType =
+ type === 'write'
+ ? resolveBlockAlias(fileTypeToBlockName(type))
+ : resolveBlockAlias(type as BlockName | BlockAlias);
+ if (!Object.hasOwn(blocks, resolvedType)) return;
if (isBlockAlias(type)) {
return {
@@ -173,39 +179,6 @@ export function encodeLegacyContent(content: SplitContent): string[] {
];
}
-export function driveSplitContent(
- location: DriveLocation,
- document?: DriveDocumentRoute
-): SplitContent {
- const matches: [SplitRouteMatch, ...SplitRouteMatch[]] = [
- { id: 'drive', params: {} },
- ];
- if (location.kind === 'folder') {
- matches.push({
- id: 'drive-folder',
- params: { view: 'folder', folderId: location.id ?? undefined },
- });
- } else if (location.tab !== 'owned') {
- matches.push({ id: 'drive-tab', params: { tab: location.tab } });
- }
- if (document) {
- matches.push({
- id:
- location.kind === 'folder'
- ? 'drive-folder-document'
- : location.tab === 'owned'
- ? 'drive-document'
- : 'drive-tab-document',
- params: { documentId: document.id, documentType: document.type },
- });
- }
- return {
- type: 'component',
- id: 'documents',
- entryMetadata: { route: { matches } },
- };
-}
-
export function splitLocationFromContent(
routes: SplitRoutesManifest,
content: SplitContent
@@ -388,7 +361,9 @@ export const legacySplitRoute = defineRoute({
id: 'legacy-content',
path: ':type/:id',
search: '*',
- params: z.object({ type: z.string().min(1), id: z.string().min(1) }),
+ params: z
+ .object({ type: z.string().min(1), id: z.string().min(1) })
+ .refine(({ type, id }) => decodeLegacyPair(type, id) !== undefined),
externalSearch: (entry) => {
const { type } = routeParams(entry.location.route);
if (type === 'email') return Object.values(EMAIL_URL_PARAMS);
diff --git a/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts b/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts
index 0c9e99737e..0bd8418a81 100644
--- a/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts
+++ b/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts
@@ -1,5 +1,6 @@
import { agentsRouteId } from '@app/features/agents-view/core/route';
import { CALENDAR_PREFERENCES_KEY } from '@app/features/calendar/calendar-preferences';
+import { driveHostedContent } from '@app/features/drive-view/drive-hosted-content';
import { driveDestination } from '@app/features/drive-view/drive-route-navigation';
import { driveSplitRoute } from '@app/features/drive-view/route';
import {
@@ -64,12 +65,6 @@ vi.mock('../componentRegistry', () => ({
})),
}));
-vi.mock('@core/constant/allBlocks', () => ({
- fileTypeToBlockName: vi.fn((type: string) => type),
- isBlockAlias: vi.fn(() => false),
- resolveBlockAlias: vi.fn((type: string) => type),
-}));
-
beforeAll(() => {
// Mock window.matchMedia for tests
Object.defineProperty(window, 'matchMedia', {
@@ -900,53 +895,178 @@ describe('layoutManager', () => {
}
);
- it('opens a PR on its standalone route and keeps the existing block content identity', async () => {
- const { manager, location, router, dispose } = ingressRouter('/pr/pr-1');
+ it('opens PR details in Tasks and redirects legacy PR links', async () => {
+ for (const path of ['/pr/pr-1', '/tasks/pr/pr-1']) {
+ const { manager, location, router, dispose } = ingressRouter(path);
+ await router.settled();
+ const split = manager.splits()[0];
+ expect(split.content).toMatchObject({
+ type: 'component',
+ id: 'tasks',
+ });
+ expect(split.mount.kind).toBe('component');
+ expect(router.route(split.id)?.matches).toEqual([
+ { id: 'view-tasks', params: {} },
+ { id: 'tasks-pr', params: { foreignEntityId: 'pr-1' } },
+ ]);
+ expect(location.read().pathname).toBe('/tasks/pr/pr-1');
+ router.dispose();
+ dispose();
+ }
+ });
+
+ it('keeps PR details in Tasks on touch', async () => {
+ const { manager, location, router, dispose } = ingressRouter('/pr/pr-1', {
+ touch: true,
+ });
await router.settled();
- const split = manager.splits()[0];
- expect(split.content).toMatchObject({ type: 'pr', id: 'pr-1' });
- expect(router.route(split.id)?.matches).toEqual([
- { id: 'pr-detail', params: { foreignEntityId: 'pr-1' } },
- ]);
- expect(location.read().pathname).toBe('/pr/pr-1');
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'tasks',
+ });
+ expect(manager.splits()[0].mount.kind).toBe('component');
+ expect(location.read().pathname).toBe('/tasks/pr/pr-1');
router.dispose();
dispose();
});
- it('uses the PR route for existing split navigation', async () => {
+ it('uses the Tasks PR route for existing split navigation', async () => {
const { manager, location, router, dispose } = ingressRouter('/inbox');
await router.settled();
manager.getSplit(manager.splits()[0].id)!.replace({
next: { type: 'pr', id: 'pr-2' },
});
await router.settled();
- expect(location.read().pathname).toBe('/pr/pr-2');
+ expect(location.read().pathname).toBe('/tasks/pr/pr-2');
+ expect(manager.splits()[0].mount.kind).toBe('component');
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'tasks',
+ });
router.dispose();
dispose();
});
- it('opens a call on its detail route with the existing block content identity', async () => {
- const { manager, location, router, dispose } =
- ingressRouter('/call/call-1');
+ it('upgrades stored PR route metadata to Tasks content', async () => {
+ const { manager, router, dispose } = ingressRouter('/inbox');
await router.settled();
- const split = manager.splits()[0];
- expect(split.content).toMatchObject({ type: 'call', id: 'call-1' });
- expect(router.route(split.id)?.matches).toEqual([
- { id: 'call-detail', params: { callId: 'call-1' } },
- ]);
- expect(location.read().pathname).toBe('/call/call-1');
+ const split = manager.getSplit(manager.splits()[0].id)!;
+ split.replace({
+ next: {
+ type: 'pr',
+ id: 'pr-1',
+ entryMetadata: {
+ route: {
+ matches: [
+ { id: 'pr-detail', params: { foreignEntityId: 'pr-1' } },
+ ],
+ },
+ },
+ },
+ });
+ await router.settled();
+ expect(split.content()).toMatchObject({
+ type: 'component',
+ id: 'tasks',
+ });
+ expect(router.route(split.id)?.matches.at(-1)?.id).toBe('tasks-pr');
+ router.dispose();
+ dispose();
+ });
+
+ it.each(['/inbox/channel', '/not-a-block/example'])(
+ 'rejects an invalid legacy pair %s without mounting a block',
+ async (path) => {
+ const { manager, location, router, dispose } = ingressRouter(path);
+ await router.settled();
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'inbox',
+ });
+ expect(location.read().pathname).toBe('/inbox');
+ router.dispose();
+ dispose();
+ }
+ );
+
+ it('opens calls as Drive components and redirects old links', async () => {
+ for (const path of ['/call/call-1', '/drive/call/call-1']) {
+ const { manager, location, router, dispose } = ingressRouter(path);
+ await router.settled();
+ const split = manager.splits()[0];
+ expect(split.content).toMatchObject({
+ type: 'component',
+ id: 'documents',
+ });
+ expect(split.mount.kind).toBe('component');
+ expect(router.route(split.id)?.matches).toEqual([
+ { id: 'drive', params: {} },
+ { id: 'drive-call', params: { callId: 'call-1' } },
+ ]);
+ expect(location.read().pathname).toBe('/drive/call/call-1');
+ router.dispose();
+ dispose();
+ }
+ });
+
+ it('keeps call details in Drive on touch', async () => {
+ const { manager, location, router, dispose } = ingressRouter(
+ '/call/call-1',
+ { touch: true }
+ );
+ await router.settled();
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'documents',
+ });
+ expect(manager.splits()[0].mount.kind).toBe('component');
+ expect(location.read().pathname).toBe('/drive/call/call-1');
router.dispose();
dispose();
});
- it('uses the call detail route for existing split navigation', async () => {
+ it('upgrades old call route metadata without losing transcript search', async () => {
+ const { manager, router, dispose } = ingressRouter('/inbox');
+ await router.settled();
+ const split = manager.getSplit(manager.splits()[0].id)!;
+ split.replace({
+ next: {
+ type: 'call',
+ id: 'call-1',
+ entryMetadata: {
+ route: {
+ matches: [{ id: 'call-detail', params: { callId: 'call-1' } }],
+ },
+ search: { 'call-detail': { transcriptId: ['segment-1'] } },
+ },
+ },
+ });
+ await router.settled();
+ expect(split.content()).toMatchObject({
+ type: 'component',
+ id: 'documents',
+ });
+ expect(router.route(split.id)?.matches.at(-1)?.id).toBe('drive-call');
+ expect(router.search(split.id, 'call-detail')).toEqual({
+ transcriptId: ['segment-1'],
+ });
+ router.dispose();
+ dispose();
+ });
+
+ it('uses the Drive call detail route for existing split navigation', async () => {
const { manager, location, router, dispose } = ingressRouter('/inbox');
await router.settled();
manager.getSplit(manager.splits()[0].id)!.replace({
next: { type: 'call', id: 'call-2' },
});
await router.settled();
- expect(location.read().pathname).toBe('/call/call-2');
+ expect(location.read().pathname).toBe('/drive/call/call-2');
+ expect(manager.splits()[0].mount.kind).toBe('component');
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'documents',
+ });
router.dispose();
dispose();
});
@@ -956,13 +1076,13 @@ describe('layoutManager', () => {
await router.settled();
const split = manager.getSplit(manager.splits()[0].id)!;
split.replace({
- next: {
- type: 'call',
- id: 'call-2',
- entryMetadata: {
+ next: driveHostedContent(
+ { type: 'call', id: 'call-2' },
+ {
+ allowDocuments: true,
search: { 'call-detail': { transcriptId: ['segment-2'] } },
- },
- },
+ }
+ )!,
});
await router.settled();
expect(router.search(split.id, 'call-detail')).toEqual({
@@ -970,15 +1090,15 @@ describe('layoutManager', () => {
});
const mount = manager.splits()[0].mount;
split.replace({
- next: {
- type: 'call',
- id: 'call-2',
- entryMetadata: {
+ next: driveHostedContent(
+ { type: 'call', id: 'call-2' },
+ {
+ allowDocuments: true,
search: {
'call-detail': { transcriptId: ['segment-2'], seek: ['again'] },
},
- },
- },
+ }
+ )!,
mergeHistory: true,
});
await router.settled();
@@ -991,22 +1111,42 @@ describe('layoutManager', () => {
dispose();
});
- it('restores a call transcript target from a copied link', async () => {
+ it('restores a call transcript target from old and Drive links', async () => {
+ for (const path of [
+ '/call/call-1?call_transcript_id=segment-1',
+ '/drive/call/call-1?call_transcript_id=segment-1',
+ ]) {
+ const { manager, location, router, dispose } = ingressRouter(path);
+ await router.settled();
+ const split = manager.splits()[0];
+ expect(router.search(split.id, 'call-detail')).toEqual({
+ transcriptId: ['segment-1'],
+ });
+ expect(location.read().pathname).toBe('/drive/call/call-1');
+ expect(
+ new URLSearchParams(location.read().search).get('call_transcript_id')
+ ).toBe('segment-1');
+ router.dispose();
+ dispose();
+ }
+ });
+
+ it('preserves canonical transcript search when upgrading an old call link', async () => {
const { manager, location, router, dispose } = ingressRouter(
- '/call/call-1?call_transcript_id=segment-1'
+ '/call/call-1?s0.call-detail.transcriptId=segment-3&referral_code=code#focus'
);
await router.settled();
- const split = manager.splits()[0];
- expect(router.search(split.id, 'call-detail')).toEqual({
- transcriptId: ['segment-1'],
+ expect(router.search(manager.splits()[0].id, 'call-detail')).toEqual({
+ transcriptId: ['segment-3'],
});
+ expect(location.read().pathname).toBe('/drive/call/call-1');
expect(
- new URLSearchParams(location.read().search).get('call_transcript_id')
- ).toBe('segment-1');
+ new URLSearchParams(location.read().search).get('referral_code')
+ ).toBe('code');
+ expect(location.read().hash).toBe('#focus');
router.dispose();
dispose();
});
-
it('keeps Drive list routes on touch', async () => {
const { location, router, dispose } = ingressRouter(
'/drive/~/drive/shared/~/drive/folder/folder',
diff --git a/apps/web/src/features/block-call/component/CallBlockAdapter.tsx b/apps/web/src/features/block-call/component/CallBlockAdapter.tsx
index b3d43f2584..acb7deaf19 100644
--- a/apps/web/src/features/block-call/component/CallBlockAdapter.tsx
+++ b/apps/web/src/features/block-call/component/CallBlockAdapter.tsx
@@ -58,16 +58,17 @@ export function CallBlockAdapter(props: CallBlockProps) {
<DocumentBlockContainer>
<div class="h-full flex flex-col @container">
<ModalsProvider>
- <Show when={callRecord.data}>
+ <Show when={callRecord.isPending ? undefined : callRecord.data}>
{(data) => (
<SidePanel.Layout>
- <CallSidePanelSections record={data} callId={callId} />
+ <CallSidePanelSections record={data()} callId={callId} />
<div class="flex size-full min-h-0 min-w-0 flex-col overflow-hidden @container">
- <CallRecordingSplitHeader record={data} />
+ <CallRecordingSplitHeader record={data()} />
<CallRecordingBody
- data={data}
+ record={data()}
callId={callId}
- transcriptTarget={transcriptTarget}
+ transcriptTarget={transcriptTarget()}
+ showOverlayHeaderGap
/>
</div>
</SidePanel.Layout>
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingBody.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingBody.tsx
index 58ec1878bf..96ac0bffd6 100644
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingBody.tsx
+++ b/apps/web/src/features/block-call/component/CallRecording/CallRecordingBody.tsx
@@ -2,10 +2,17 @@ import { AskMacroButton } from '@app/features/chat/ChatWithAgentButton';
import { SidePanel } from '@components/app/side-panel';
import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { isMobile } from '@core/mobile/isMobile';
+import SpinnerIcon from '@phosphor/spinner.svg';
import type { CallRecord } from '@service-call/client';
import { format } from 'date-fns';
-import type { Accessor } from 'solid-js';
-import { createEffect, createMemo, createSignal, on, Show } from 'solid-js';
+import {
+ createEffect,
+ createMemo,
+ createSignal,
+ on,
+ Show,
+ Suspense,
+} from 'solid-js';
import type { CallTranscriptTarget } from '../../constants';
import { formatCallDuration } from '../../utils';
import { CallTranscript } from '../CallTranscript';
@@ -23,11 +30,12 @@ import {
} from './call-recording-utils';
export function CallRecordingBody(props: {
- data: Accessor<CallRecord>;
+ record: CallRecord;
callId: string;
- transcriptTarget?: Accessor<CallTranscriptTarget | undefined>;
+ transcriptTarget?: CallTranscriptTarget;
+ showOverlayHeaderGap?: boolean;
}) {
- const record = props.data;
+ const record = () => props.record;
const hasTranscripts = createMemo(() => record().transcript.length > 0);
const [playbackSeconds, setPlaybackSeconds] = createSignal(0);
const [allowFutureLead, setAllowFutureLead] = createSignal(true);
@@ -109,7 +117,7 @@ export function CallRecordingBody(props: {
createEffect(
on(
- () => props.transcriptTarget?.(),
+ () => props.transcriptTarget,
(target) => {
if (!target) return;
goToTranscriptSegment(target.transcriptId);
@@ -159,7 +167,7 @@ export function CallRecordingBody(props: {
<div class="mx-auto max-w-3xl min-w-0 px-6 pt-12 pb-16 touch:pt-(--mobile-content-inset-top) touch:pb-(--mobile-content-inset-bottom)">
<div class="flex flex-col gap-10">
<header>
- <Show when={!isMobile()}>
+ <Show when={!isMobile() && props.showOverlayHeaderGap}>
<div class="h-8 mb-4" />
</Show>
<h1 class="text-2xl font-semibold text-ink text-balance">
@@ -183,9 +191,9 @@ export function CallRecordingBody(props: {
</div>
</header>
- <CallRecordingParticipantsSection record={record} />
+ <CallRecordingParticipantsSection record={props.record} />
- <CallRecordingSummarySection record={record} />
+ <CallRecordingSummarySection record={props.record} />
<Show when={record().recordingUrl}>
{(url) => (
@@ -207,16 +215,27 @@ export function CallRecordingBody(props: {
<section class="flex flex-col gap-3">
<h3 class="text-sm font-semibold text-ink">Transcript</h3>
<div class="flex flex-col max-h-[min(600px,60vh)] overflow-hidden rounded border border-edge-muted/50">
- <CallTranscript
- transcript={record().transcript}
- channelId={record().channelId}
- record={record()}
- timelineStartMs={timelineStartMs()}
- activeSequenceNum={activeSequenceNum()}
- videoSeekGeneration={videoSeekGeneration()}
- onSeekToSeconds={seekToSeconds}
- hideHeader
- />
+ <Suspense
+ fallback={
+ <div class="grid min-h-32 place-items-center text-ink-muted">
+ <SpinnerIcon
+ aria-label="Loading transcript"
+ class="size-5 animate-spin"
+ />
+ </div>
+ }
+ >
+ <CallTranscript
+ transcript={record().transcript}
+ channelId={record().channelId}
+ record={record()}
+ timelineStartMs={timelineStartMs()}
+ activeSequenceNum={activeSequenceNum()}
+ videoSeekGeneration={videoSeekGeneration()}
+ onSeekToSeconds={seekToSeconds}
+ hideHeader
+ />
+ </Suspense>
</div>
</section>
</Show>
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingParticipants.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingParticipants.tsx
index 2b31afabc2..d777709c3c 100644
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingParticipants.tsx
+++ b/apps/web/src/features/block-call/component/CallRecording/CallRecordingParticipants.tsx
@@ -4,22 +4,21 @@ import { idToEmail } from '@core/user';
import { useGetOrCreateDirectMessageMutation } from '@queries/channel/get-or-create-dm';
import type { CallRecord } from '@service-call/client';
-import type { Accessor } from 'solid-js';
import { createMemo, For } from 'solid-js';
import { dedupeCallRecordingParticipants } from './call-recording-utils';
export function CallRecordingParticipantsSection(props: {
- record: Accessor<CallRecord>;
+ record: CallRecord;
}) {
const { openWithSplit } = useSplitLayout();
const getOrCreateDmMutation = useGetOrCreateDirectMessageMutation();
const participants = createMemo(() =>
dedupeCallRecordingParticipants(
- props.record().participants,
- props.record().createdBy
+ props.record.participants,
+ props.record.createdBy
)
);
- const guests = () => props.record().guests;
+ const guests = () => props.record.guests;
const openDirectMessage = (participantId: string, event: MouseEvent) => {
getOrCreateDmMutation.mutate(
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx
index 2ea9edd237..e254b75c35 100644
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx
+++ b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx
@@ -27,7 +27,7 @@ import IconShared from '@icon/share.svg';
import PhoneCallIcon from '@phosphor/phone-call.svg';
import type { CallRecord } from '@service-call/client';
import { Button } from '@ui';
-import { type Accessor, Show } from 'solid-js';
+import { Show } from 'solid-js';
import { useCallAgain } from '../use-call-again';
export function CallRecordingSplitHeaderLoading() {
@@ -47,10 +47,8 @@ export function CallRecordingSplitHeaderLoading() {
);
}
-export function CallRecordingSplitHeader(props: {
- record: Accessor<CallRecord>;
-}) {
- const record = props.record;
+export function CallRecordingSplitHeader(props: { record: CallRecord }) {
+ const record = () => props.record;
const blockId = useBlockId();
const shareCtx = useShareDialogContext();
const callName = () => record().customName ?? record().channelName ?? 'Call';
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSummary.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSummary.tsx
index 8ea7842af4..7d87a49252 100644
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSummary.tsx
+++ b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSummary.tsx
@@ -4,14 +4,11 @@ import {
} from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { aiChatTheme } from '@core/component/LexicalMarkdown/theme';
import type { CallRecord } from '@service-call/client';
-import type { Accessor } from 'solid-js';
import { createMemo, Show } from 'solid-js';
-export function CallRecordingSummarySection(props: {
- record: Accessor<CallRecord>;
-}) {
+export function CallRecordingSummarySection(props: { record: CallRecord }) {
const summary = createMemo(() => {
- const value = props.record().summary;
+ const value = props.record.summary;
if (!value) return null;
const trimmed = value.trim();
return trimmed.length > 0 ? trimmed : null;
@@ -19,9 +16,7 @@ export function CallRecordingSummarySection(props: {
const isPending = createMemo(
() =>
- !summary() &&
- !props.record().isActive &&
- props.record().transcript.length > 0
+ !summary() && !props.record.isActive && props.record.transcript.length > 0
);
const shouldShow = createMemo(() => summary() || isPending());
diff --git a/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx b/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx
index fbda7cbc1a..b155b43db7 100644
--- a/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx
+++ b/apps/web/src/features/block-call/component/sidepanel/CallSidePanelSections.tsx
@@ -16,11 +16,11 @@ import {
import { useAttachmentReferencesQuery } from '@queries/storage/attachment-references';
import type { CallRecord } from '@service-call/client';
import { cn, InlineCheckbox } from '@ui';
-import { type Accessor, Show, Suspense } from 'solid-js';
+import { Show, Suspense } from 'solid-js';
import { formatCallDuration } from '../../utils';
interface CallSidePanelSectionsProps {
- record: Accessor<CallRecord>;
+ record: CallRecord;
callId: string;
}
@@ -36,15 +36,17 @@ export function CallSidePanelSections(props: CallSidePanelSectionsProps) {
defaultOpen
order={15}
>
- <PropertiesSectionContent record={props.record} />
+ <Suspense fallback={<SidePanel.Loading />}>
+ <PropertiesSectionContent record={props.record} />
+ </Suspense>
</SidePanel.Section>
- <Show when={props.record().channelId != null}>
+ <Show when={props.record.channelId != null}>
<SidePanel.Section id="sharing" title="Sharing" order={20}>
<SharingSectionContent record={props.record} />
</SidePanel.Section>
</Show>
<EntityActivitySectionConditional
- entityId={props.record().callId}
+ entityId={props.record.callId}
entityType="CALL_RECORD"
order={40}
/>
@@ -53,8 +55,8 @@ export function CallSidePanelSections(props: CallSidePanelSectionsProps) {
);
}
-function DetailsSectionContent(props: { record: Accessor<CallRecord> }) {
- const record = props.record;
+function DetailsSectionContent(props: { record: CallRecord }) {
+ const record = () => props.record;
const startedAt = (): DateValue | undefined => record().startedAt;
const endedAt = (): DateValue | undefined => record().endedAt ?? undefined;
@@ -104,17 +106,17 @@ function DetailsSectionContent(props: { record: Accessor<CallRecord> }) {
);
}
-function PropertiesSectionContent(props: { record: Accessor<CallRecord> }) {
+function PropertiesSectionContent(props: { record: CallRecord }) {
// Tag/property writes are authorized server-side via the call's owning
// channel (edit access), mirroring the sharing control above, so the editor
// is always mounted and the backend rejects unauthorized mutations.
return (
<EntityPropertiesSection
- entityId={props.record().callId}
+ entityId={props.record.callId}
entityType="CALL_RECORD"
canEdit
documentName={
- props.record().customName ?? props.record().channelName ?? undefined
+ props.record.customName ?? props.record.channelName ?? undefined
}
/>
);
@@ -145,8 +147,8 @@ function DateValueDisplay(props: { value: DateValue }) {
// Sharing Section
// ─────────────────────────────────────────────────────────────────────────────
-function SharingSectionContent(props: { record: Accessor<CallRecord> }) {
- const record = props.record;
+function SharingSectionContent(props: { record: CallRecord }) {
+ const record = () => props.record;
const callCtx = useCallContextOptional();
const userId = useUserId();
const toggleLiveShare = useToggleShareWithTeamMutation();
diff --git a/apps/web/src/features/block-call/constants.ts b/apps/web/src/features/block-call/constants.ts
index 961ed282ed..9a33b5cb1d 100644
--- a/apps/web/src/features/block-call/constants.ts
+++ b/apps/web/src/features/block-call/constants.ts
@@ -6,4 +6,9 @@ export type CallBlockProps = {
[URL_PARAMS.transcriptId]?: string;
};
-export type CallTranscriptTarget = { transcriptId: string; gen: number };
+export type CallTranscriptTarget = {
+ transcriptId: string;
+ gen: number;
+ /** Route token changes when the same transcript is selected again. */
+ seek?: string;
+};
diff --git a/apps/web/src/features/block-call/route.tsx b/apps/web/src/features/block-call/route.tsx
index 3810124335..3d33a34cea 100644
--- a/apps/web/src/features/block-call/route.tsx
+++ b/apps/web/src/features/block-call/route.tsx
@@ -1,17 +1,22 @@
import { useAnalytics } from '@app/lib/analytics/analytics-context';
-import { defineRoute, useRouteParams } from '@app/lib/split-router';
+import {
+ createSearchParams,
+ defineRoute,
+ useRouteParams,
+} from '@app/lib/split-router';
import { withAuth } from '@components/app/split-layout/split-router/app-route-shell';
import { lazy, onMount } from 'solid-js';
import { z } from 'zod';
import { callDetailSearch } from './call-route';
import { URL_PARAMS } from './constants';
-const CallDetailView = lazy(async () => ({
- default: (await import('./views/CallDetailView')).CallDetailView,
+const StandaloneCallDetail = lazy(async () => ({
+ default: (await import('./views/CallDetailView')).StandaloneCallDetail,
}));
const CallDetailRouteView = withAuth(() => {
const params = useRouteParams(callDetailRoute);
+ const [search] = createSearchParams(callDetailSearch);
const analytics = useAnalytics();
onMount(() => {
analytics.pageView('call');
@@ -20,7 +25,13 @@ const CallDetailRouteView = withAuth(() => {
entityId: params.callId,
});
});
- return <CallDetailView callId={params.callId} />;
+ return (
+ <StandaloneCallDetail
+ callId={params.callId}
+ transcriptId={search.transcriptId}
+ seek={search.seek}
+ />
+ );
});
export const callDetailRoute = defineRoute({
diff --git a/apps/web/src/features/block-call/views/CallDetailView.tsx b/apps/web/src/features/block-call/views/CallDetailView.tsx
index 6465d1715d..c1360c4a72 100644
--- a/apps/web/src/features/block-call/views/CallDetailView.tsx
+++ b/apps/web/src/features/block-call/views/CallDetailView.tsx
@@ -1,6 +1,5 @@
import { ViewShell } from '@app/components/view-shell';
import { ChatWithAgentButton } from '@app/features/chat/ChatWithAgentButton';
-import { createSearchParams } from '@app/lib/split-router';
import { SidePanel } from '@components/app/side-panel';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { SplitPanel } from '@components/app/split-panel';
@@ -23,42 +22,82 @@ import type { CallRecord } from '@service-storage/generated/schemas/callRecord';
import { Button } from '@ui';
import {
type Accessor,
- createEffect,
+ createMemo,
createSignal,
Match,
- on,
onMount,
+ type ParentProps,
Show,
Suspense,
Switch,
} from 'solid-js';
-import { callDetailSearch } from '../call-route';
import { CallRecordingBody } from '../component/CallRecording/CallRecordingBody';
import { CallSidePanelSections } from '../component/sidepanel/CallSidePanelSections';
import { useCallAgain } from '../component/use-call-again';
import type { CallTranscriptTarget } from '../constants';
-function CallDetailContent(props: {
+export type CallDetailData = { record: CallRecord; name: string };
+
+function callDetailName(record: CallRecord): string {
+ return record.customName ?? record.channelName ?? 'Call Recording';
+}
+
+/** Share the call query without owning either host's header. */
+export function useCallDetail(callId: Accessor<string>) {
+ const query = useCallRecordQuery(callId);
+
+ const data = (): CallDetailData | undefined => {
+ if (query.isPending) return undefined;
+ const record = query.data;
+ return record ? { record, name: callDetailName(record) } : undefined;
+ };
+
+ return { query, data };
+}
+
+export function CallDetailActions(props: {
callId: string;
- record: Accessor<CallRecord>;
- transcriptTarget: Accessor<CallTranscriptTarget | undefined>;
+ channelId?: string | null;
+ name: string;
+ isActive: boolean;
}) {
const panel = useSplitPanelOrThrow();
- const [shareOpen, setShareOpen] = createSignal(false);
const { canCallAgain, callAgain } = useCallAgain(
() => props.callId,
- () => props.record().channelId
+ () => props.channelId
);
- const callName = () =>
- props.record().customName ?? props.record().channelName ?? 'Call Recording';
- onMount(() => {
- optimisticUpdateSoupItemViewedAt(props.callId);
- if (!hasSoupEntity(props.callId)) {
- void refetchSoupEntity(props.callId, 'call');
- }
- });
+ return (
+ <div class="ml-auto flex shrink-0 items-center gap-2">
+ <Show when={!isMobile() && !props.isActive && canCallAgain()}>
+ <Button variant="outline" size="sm" onClick={callAgain}>
+ <PhoneCallIcon class="size-4" />
+ Call Again
+ </Button>
+ </Show>
+ <ChatWithAgentButton
+ entity={{
+ type: 'document',
+ id: props.callId,
+ name: props.name,
+ fileType: 'call',
+ }}
+ />
+ <ShareTrigger
+ id={props.callId}
+ blockType="call"
+ hotkeyScope={panel.splitHotkeyScope}
+ />
+ <SidePanel.Toggle />
+ </div>
+ );
+}
+/** Keep sharing and side-panel state alive across call-record query updates. */
+export function CallDetailRoot(
+ props: ParentProps<{ callId: string; data?: CallDetailData }>
+) {
+ const [shareOpen, setShareOpen] = createSignal(false);
return (
<ShareDialogContext.Provider
value={{
@@ -67,131 +106,158 @@ function CallDetailContent(props: {
close: () => setShareOpen(false),
}}
>
- <SidePanel.Layout
- persistKey={`call:${props.callId}`}
- headerToggle={false}
- >
- <CallSidePanelSections callId={props.callId} record={props.record} />
- <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">
- {callName()}
- </span>
- <div class="ml-auto flex shrink-0 items-center gap-2">
- <Show
- when={!isMobile() && !props.record().isActive && canCallAgain()}
- >
- <Button variant="outline" size="sm" onClick={callAgain}>
- <PhoneCallIcon class="size-4" />
- Call Again
- </Button>
- </Show>
- <ChatWithAgentButton
- entity={{
- type: 'document',
- id: props.callId,
- name: callName(),
- fileType: 'call',
- }}
- />
- <ShareTrigger
- id={props.callId}
- blockType="call"
- hotkeyScope={panel.splitHotkeyScope}
- />
- <SidePanel.Toggle />
- </div>
- </ViewShell.TopBar>
- <CallRecordingBody
- data={props.record}
- callId={props.callId}
- transcriptTarget={props.transcriptTarget}
- />
- </div>
- </SidePanel.Layout>
- <Suspense>
- <ShareModal
- isSharePermOpen={shareOpen()}
- setIsSharePermOpen={setShareOpen}
- id={props.callId}
- blockAlias="call"
- itemType="call"
- name={callName()}
- userPermissions={getPermissions(
- props.record().userAccessLevel ?? undefined
- )}
- owner={props.record().createdBy}
- />
- </Suspense>
+ <SidePanel.Root persistKey={`call:${props.callId}`}>
+ {props.children}
+ </SidePanel.Root>
+ <Show when={props.data}>
+ {(data) => (
+ <Suspense>
+ <ShareModal
+ isSharePermOpen={shareOpen()}
+ setIsSharePermOpen={setShareOpen}
+ id={props.callId}
+ blockAlias="call"
+ itemType="call"
+ name={data().name}
+ userPermissions={getPermissions(
+ data().record.userAccessLevel ?? undefined
+ )}
+ owner={data().record.createdBy}
+ />
+ </Suspense>
+ )}
+ </Show>
</ShareDialogContext.Provider>
);
}
-export function CallDetailView(props: { callId: string }) {
- const callRecord = useCallRecordQuery(() => props.callId);
- const [searchParams] = createSearchParams(callDetailSearch);
- const initialTranscriptId = searchParams.transcriptId;
- const [transcriptTarget, setTranscriptTarget] = createSignal<
- CallTranscriptTarget | undefined
- >(
- initialTranscriptId
- ? { transcriptId: initialTranscriptId, gen: 0 }
- : undefined
+function LoadedCallContent(props: {
+ callId: string;
+ record: CallRecord;
+ transcriptTarget?: CallTranscriptTarget;
+}) {
+ onMount(() => {
+ optimisticUpdateSoupItemViewedAt(props.callId);
+ if (!hasSoupEntity(props.callId)) {
+ void refetchSoupEntity(props.callId, 'call');
+ }
+ });
+ return (
+ <SidePanel.Layout headerToggle={false}>
+ <CallSidePanelSections callId={props.callId} record={props.record} />
+ <div class="flex size-full min-h-0 min-w-0 flex-col overflow-hidden">
+ <CallRecordingBody
+ record={props.record}
+ callId={props.callId}
+ transcriptTarget={props.transcriptTarget}
+ />
+ </div>
+ </SidePanel.Layout>
);
- const navigateToTranscript = (transcriptId: string) => {
- if (!transcriptId) return;
- setTranscriptTarget((previous) => ({
- transcriptId,
- gen: (previous?.gen ?? 0) + 1,
- }));
- };
+}
- // Seek again when the same transcript is selected from another list result.
- createEffect(
- on(
- () => [searchParams.transcriptId, searchParams.seek] as const,
- ([id]) => {
- if (id) navigateToTranscript(id);
- },
- { defer: true }
- )
+/** Both native hosts place their own top bar above this detail content. */
+export function CallDetailContent(props: {
+ callId: string;
+ query: ReturnType<typeof useCallRecordQuery>;
+ data?: CallDetailData;
+ transcriptId?: string;
+ seek?: string;
+}) {
+ // Include the route's seek token so selecting the same segment re-runs the seek.
+ const transcriptTarget = createMemo<CallTranscriptTarget | undefined>(() =>
+ props.transcriptId
+ ? { transcriptId: props.transcriptId, gen: 0, seek: props.seek }
+ : undefined
);
-
return (
- <Switch>
- <Match when={callRecord.isLoading}>
- <div class="grid size-full place-items-center text-ink-muted">
- <SpinnerIcon
- aria-label="Loading call recording"
- class="size-5 animate-spin"
- />
- </div>
- </Match>
- <Match when={callRecord.isError}>
- <div class="grid size-full place-items-center text-ink-muted">
- <div class="flex flex-col items-center gap-3 text-sm">
- <span>This call recording could not be displayed.</span>
- <Button
- variant="outline"
- size="sm"
- onClick={() => void callRecord.refetch()}
- >
- Retry
- </Button>
- </div>
- </div>
- </Match>
- <Match when={callRecord.isSuccess ? callRecord.data : undefined}>
- {(record) => (
- <CallDetailContent
- callId={props.callId}
- record={record}
- transcriptTarget={transcriptTarget}
- />
+ <div class="relative min-h-0 min-w-0 flex-1">
+ <Show
+ when={props.data}
+ fallback={
+ <Switch>
+ <Match when={props.query.status === 'pending'}>
+ <div class="grid size-full place-items-center text-ink-muted">
+ <SpinnerIcon
+ aria-label="Loading call recording"
+ class="size-5 animate-spin"
+ />
+ </div>
+ </Match>
+ <Match when={props.query.status === 'error'}>
+ <div class="grid size-full place-items-center text-ink-muted">
+ <div class="flex flex-col items-center gap-3 text-sm">
+ <span>This call recording could not be displayed.</span>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => void props.query.refetch()}
+ >
+ Retry
+ </Button>
+ </div>
+ </div>
+ </Match>
+ </Switch>
+ }
+ >
+ {(data) => (
+ <Suspense
+ fallback={
+ <div class="grid size-full place-items-center text-ink-muted">
+ <SpinnerIcon
+ aria-label="Loading call recording"
+ class="size-5 animate-spin"
+ />
+ </div>
+ }
+ >
+ <LoadedCallContent
+ callId={props.callId}
+ record={data().record}
+ transcriptTarget={transcriptTarget()}
+ />
+ </Suspense>
)}
- </Match>
- </Switch>
+ </Show>
+ </div>
+ );
+}
+
+export function StandaloneCallDetail(props: {
+ callId: string;
+ transcriptId?: string;
+ seek?: string;
+}) {
+ const detail = useCallDetail(() => props.callId);
+ return (
+ <CallDetailRoot callId={props.callId} data={detail.data()}>
+ <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={detail.data()}>
+ {(data) => (
+ <CallDetailActions
+ callId={props.callId}
+ channelId={data().record.channelId}
+ name={data().name}
+ isActive={data().record.isActive}
+ />
+ )}
+ </Show>
+ </ViewShell.TopBar>
+ <CallDetailContent
+ callId={props.callId}
+ query={detail.query}
+ data={detail.data()}
+ transcriptId={props.transcriptId}
+ seek={props.seek}
+ />
+ </div>
+ </CallDetailRoot>
);
}
diff --git a/apps/web/src/features/block-pr/component/Block.tsx b/apps/web/src/features/block-pr/component/Block.tsx
index 07c7ad9744..ac57b979c6 100644
--- a/apps/web/src/features/block-pr/component/Block.tsx
+++ b/apps/web/src/features/block-pr/component/Block.tsx
@@ -1,7 +1,37 @@
+import { SidePanel } from '@components/app/side-panel';
import { useBlockId } from '@core/block';
-import { PrDetail } from '../views/PrDetail';
+import { Show } from 'solid-js';
+import { PrDetailBody, usePrDetail } from '../views/PrDetail';
+import { PrSplitHeader } from './PrSplitHeader';
+import { PrSidePanelSections } from './sidepanel/PrSidePanelSections';
/** Legacy block boundary for previews until the block runtime is retired. */
export default function PrBlock() {
- return <PrDetail foreignEntityId={useBlockId()} />;
+ const foreignEntityId = useBlockId();
+ const detail = usePrDetail(() => foreignEntityId);
+ return (
+ <div class="size-full overflow-hidden flex flex-col relative">
+ <SidePanel.Layout>
+ <PrSidePanelSections enrichment={detail.data()?.pullRequest} />
+ <div class="flex flex-col size-full min-w-0">
+ <Show when={detail.data()}>
+ {(data) => (
+ <PrSplitHeader
+ foreignEntityId={foreignEntityId}
+ prRef={data().prRef}
+ enrichment={data().pullRequest}
+ />
+ )}
+ </Show>
+ <PrDetailBody
+ foreignEntityId={foreignEntityId}
+ data={detail.data()}
+ status={detail.query.status}
+ discussionSource={detail.discussionSource}
+ onRetry={() => void detail.query.refetch()}
+ />
+ </div>
+ </SidePanel.Layout>
+ </div>
+ );
}
diff --git a/apps/web/src/features/block-pr/component/PrSplitHeader.tsx b/apps/web/src/features/block-pr/component/PrSplitHeader.tsx
index 45d0cc187d..e714dc884e 100644
--- a/apps/web/src/features/block-pr/component/PrSplitHeader.tsx
+++ b/apps/web/src/features/block-pr/component/PrSplitHeader.tsx
@@ -11,70 +11,11 @@ import { Permissions } from '@core/component/SharePermissions';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { openExternalUrl } from '@core/util/url';
import GithubIcon from '@icon/mcp-github.svg';
-import GitMerge from '@phosphor/git-merge.svg';
-import GitPullRequest from '@phosphor/git-pull-request.svg';
import type { GithubPullRequest } from '@service-storage/generated/schemas';
-import { cn, Layer } from '@ui';
-import { Show } from 'solid-js';
import type { PrRef } from '../util/prKey';
import { prDisplayName, prHtmlUrl } from '../util/prKey';
-
-// Status icon colors follow the soup PR rows (entity-icon.tsx):
-// open → green pull-request icon, merged → purple merge icon, closed → red.
-const STATUS_ICON_CLASS: Record<string, string> = {
- open: 'text-success',
- merged: 'text-note',
- closed: 'text-failure',
-};
-
-const STATUS_TEXT_CLASS: Record<string, string> = {
- open: 'text-success',
- merged: 'text-note',
- closed: 'text-failure',
-};
-
-function capitalize(value: string): string {
- return value.charAt(0).toUpperCase() + value.slice(1);
-}
-
-/** Pill surface matching the task block's inline property pills. */
-export const PR_PILL_CLASS =
- 'inline-flex items-center gap-1.5 min-w-0 border border-edge-muted px-2 py-1 leading-tight text-left rounded-full bg-surface';
-
-export function PrStatusIcon(props: { status: string; class?: string }) {
- return (
- <Show
- when={props.status === 'merged'}
- fallback={
- <GitPullRequest
- class={cn('size-3.5', STATUS_ICON_CLASS[props.status], props.class)}
- />
- }
- >
- <GitMerge class={cn('size-3.5 text-note', props.class)} />
- </Show>
- );
-}
-
-/** Status pill matching the task block's inline property pills. */
-export function PrStatusChip(props: { status: string; class?: string }) {
- return (
- <Layer depth={2}>
- <span
- class={cn(
- PR_PILL_CLASS,
- 'shrink-0',
- STATUS_TEXT_CLASS[props.status],
- props.class
- )}
- >
- <PrStatusIcon status={props.status} class="size-3 shrink-0" />
- {capitalize(props.status)}
- </span>
- </Layer>
- );
-}
+import { PrStatusIcon } from './PrStatus';
/**
* PR identity in the split header chrome and file menu, independent of the
diff --git a/apps/web/src/features/block-pr/component/PrStatus.tsx b/apps/web/src/features/block-pr/component/PrStatus.tsx
new file mode 100644
index 0000000000..f95df125dd
--- /dev/null
+++ b/apps/web/src/features/block-pr/component/PrStatus.tsx
@@ -0,0 +1,56 @@
+import GitMerge from '@phosphor/git-merge.svg';
+import GitPullRequest from '@phosphor/git-pull-request.svg';
+import { cn, Layer } from '@ui';
+import { Show } from 'solid-js';
+
+const STATUS_ICON_CLASS: Record<string, string> = {
+ open: 'text-success',
+ merged: 'text-note',
+ closed: 'text-failure',
+};
+
+const STATUS_TEXT_CLASS: Record<string, string> = {
+ open: 'text-success',
+ merged: 'text-note',
+ closed: 'text-failure',
+};
+
+function capitalize(value: string): string {
+ return value.charAt(0).toUpperCase() + value.slice(1);
+}
+
+export const PR_PILL_CLASS =
+ 'inline-flex items-center gap-1.5 min-w-0 border border-edge-muted px-2 py-1 leading-tight text-left rounded-full bg-surface';
+
+export function PrStatusIcon(props: { status: string; class?: string }) {
+ return (
+ <Show
+ when={props.status === 'merged'}
+ fallback={
+ <GitPullRequest
+ class={cn('size-3.5', STATUS_ICON_CLASS[props.status], props.class)}
+ />
+ }
+ >
+ <GitMerge class={cn('size-3.5 text-note', props.class)} />
+ </Show>
+ );
+}
+
+export function PrStatusChip(props: { status: string; class?: string }) {
+ return (
+ <Layer depth={2}>
+ <span
+ class={cn(
+ PR_PILL_CLASS,
+ 'shrink-0',
+ STATUS_TEXT_CLASS[props.status],
+ props.class
+ )}
+ >
+ <PrStatusIcon status={props.status} class="size-3 shrink-0" />
+ {capitalize(props.status)}
+ </span>
+ </Layer>
+ );
+}
diff --git a/apps/web/src/features/block-pr/component/sidepanel/PrSidePanelSections.tsx b/apps/web/src/features/block-pr/component/sidepanel/PrSidePanelSections.tsx
index 67c05707fd..bef2c344d7 100644
--- a/apps/web/src/features/block-pr/component/sidepanel/PrSidePanelSections.tsx
+++ b/apps/web/src/features/block-pr/component/sidepanel/PrSidePanelSections.tsx
@@ -4,10 +4,9 @@ import {
SidePanel,
} from '@components/app/side-panel';
import type { GithubPullRequestWithDetails } from '@queries/storage/github-pull-requests';
-import type { Accessor } from 'solid-js';
export function PrSidePanelSections(props: {
- enrichment: Accessor<GithubPullRequestWithDetails | undefined>;
+ enrichment?: GithubPullRequestWithDetails;
}) {
return (
<>
diff --git a/apps/web/src/features/block-pr/route.tsx b/apps/web/src/features/block-pr/route.tsx
index fc4fa4f061..6d272e7c55 100644
--- a/apps/web/src/features/block-pr/route.tsx
+++ b/apps/web/src/features/block-pr/route.tsx
@@ -4,8 +4,8 @@ import { withAuth } from '@components/app/split-layout/split-router/app-route-sh
import { lazy, onMount } from 'solid-js';
import { z } from 'zod';
-const PrDetail = lazy(async () => ({
- default: (await import('./views/PrDetail')).PrDetail,
+const StandalonePrDetail = lazy(async () => ({
+ default: (await import('./views/PrDetail')).StandalonePrDetail,
}));
const PrDetailRouteView = withAuth(() => {
@@ -18,7 +18,7 @@ const PrDetailRouteView = withAuth(() => {
entityId: params.foreignEntityId,
});
});
- return <PrDetail foreignEntityId={params.foreignEntityId} />;
+ return <StandalonePrDetail foreignEntityId={params.foreignEntityId} />;
});
export const prDetailRoute = defineRoute({
diff --git a/apps/web/src/features/block-pr/side-panel/github-pull-request.tsx b/apps/web/src/features/block-pr/side-panel/github-pull-request.tsx
index 1c96c5223d..992451fda7 100644
--- a/apps/web/src/features/block-pr/side-panel/github-pull-request.tsx
+++ b/apps/web/src/features/block-pr/side-panel/github-pull-request.tsx
@@ -12,7 +12,7 @@ import type {
GithubPullRequestCheckRun,
} from '@service-storage/generated/schemas';
import { cn, Layer } from '@ui';
-import { type Accessor, For, Match, Show, Switch } from 'solid-js';
+import { For, Match, Show, Switch } from 'solid-js';
type GithubPullRequestWithPanelDetails = GithubPullRequest & {
authorLogin?: string | null;
@@ -133,10 +133,10 @@ export function GithubPullRequestStatusChip(props: {
}
export function GithubPullRequestDetailsContent(props: {
- enrichment: Accessor<GithubPullRequestWithPanelDetails | undefined>;
+ enrichment?: GithubPullRequestWithPanelDetails;
}) {
return (
- <Show when={props.enrichment()} fallback={<SidePanel.Loading />}>
+ <Show when={props.enrichment} fallback={<SidePanel.Loading />}>
{(enrichment) => (
<SidePanel.Grid>
<GithubPullRequestDetailsRows enrichment={enrichment()} />
@@ -218,9 +218,9 @@ export function GithubPullRequestDetailsRows(props: {
}
export function GithubPullRequestChecksContent(props: {
- enrichment: Accessor<GithubPullRequestWithPanelDetails | undefined>;
+ enrichment?: GithubPullRequestWithPanelDetails;
}) {
- const checks = () => props.enrichment()?.checks ?? [];
+ const checks = () => props.enrichment?.checks ?? [];
return (
<Show
when={checks().length > 0}
diff --git a/apps/web/src/features/block-pr/views/PrDetail.tsx b/apps/web/src/features/block-pr/views/PrDetail.tsx
index 4d272ed7ca..85dc8c15ec 100644
--- a/apps/web/src/features/block-pr/views/PrDetail.tsx
+++ b/apps/web/src/features/block-pr/views/PrDetail.tsx
@@ -1,13 +1,16 @@
+import { ViewShell } from '@app/components/view-shell';
import { useGlobalNotificationSource } from '@components/app/GlobalAppState';
import { SidePanel } from '@components/app/side-panel';
+import { SplitPanel } from '@components/app/split-panel';
import {
StaticMarkdown,
StaticMarkdownContext,
} from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
+import { openExternalUrl } from '@core/util/url';
import { DebouncedNotificationReadMarker } from '@notifications';
import type { GithubPullRequestWithDetails } from '@queries/storage/github-pull-requests';
-import { cn, Layer, Scroll } from '@ui';
-import { type Accessor, createMemo, Show } from 'solid-js';
+import { Button, cn, Layer, Scroll } from '@ui';
+import { type Accessor, createMemo, Show, Suspense } from 'solid-js';
import {
PrDescriptionSkeleton,
PrMetadataSkeleton,
@@ -16,115 +19,208 @@ import {
} from '../component/PrSkeletons';
import {
PR_PILL_CLASS,
- PrSplitHeader,
PrStatusChip,
-} from '../component/PrSplitHeader';
+ PrStatusIcon,
+} from '../component/PrStatus';
import { PrTimeline } from '../component/PrTimeline';
import { PrSidePanelSections } from '../component/sidepanel/PrSidePanelSections';
import { createPrDiscussionSource } from '../data/prDiscussionSource';
-import { usePrForeignEntityQuery } from '../data/queries';
+import {
+ type PrForeignEntityData,
+ usePrForeignEntityQuery,
+} from '../data/queries';
import {
cleanGithubMarkdown,
githubAvatarUrl,
githubDisplayLogin,
} from '../util/githubMarkdown';
import type { PrRef } from '../util/prKey';
-import { prDisplayName } from '../util/prKey';
+import { prDisplayName, prHtmlUrl } from '../util/prKey';
-export function PrDetail(props: { foreignEntityId: string }) {
- const notificationSource = useGlobalNotificationSource();
- const foreignEntityQuery = usePrForeignEntityQuery(
- () => props.foreignEntityId
- );
+/** Share PR query state without coupling the host's header to the detail body. */
+export function usePrDetail(foreignEntityId: Accessor<string>) {
+ const query = usePrForeignEntityQuery(foreignEntityId);
+ // Detail-lifetime local Macro discussion (prototype-only, lost on reload).
+ const discussionSource = createPrDiscussionSource();
+ const data = (): PrForeignEntityData | undefined =>
+ query.isPending ? undefined : query.data;
+ return { query, data, discussionSource };
+}
- const prRef = createMemo(() => foreignEntityQuery.data?.prRef);
- const pullRequest = createMemo(() => foreignEntityQuery.data?.pullRequest);
+type PrDetailBodyProps = {
+ foreignEntityId: string;
+ data?: PrForeignEntityData;
+ status: ReturnType<typeof usePrForeignEntityQuery>['status'];
+ discussionSource: ReturnType<typeof createPrDiscussionSource>;
+ onRetry: () => void;
+};
- const loadFailed = createMemo(
- () => !pullRequest() && !!foreignEntityQuery.error
+function PrDetailSkeleton() {
+ return (
+ <>
+ <PrTitleSkeleton />
+ <div class="spacer h-3" />
+ <PrMetadataSkeleton />
+ <PrDescriptionSkeleton />
+ <PrTimelineSkeleton />
+ </>
);
+}
- // Detail-lifetime local Macro discussion (prototype-only, lost on reload).
- const discussionSource = createPrDiscussionSource();
-
+export function PrDetailBody(props: PrDetailBodyProps) {
+ const notificationSource = useGlobalNotificationSource();
return (
- <div class="size-full overflow-hidden flex flex-col relative">
+ <>
<DebouncedNotificationReadMarker
notificationSource={notificationSource}
entity={{ type: 'foreign_entity', id: props.foreignEntityId }}
/>
- <SidePanel.Layout>
- <PrSidePanelSections enrichment={pullRequest} />
- <div class="flex flex-col size-full min-w-0">
- <Show when={prRef()}>
- {(ref) => (
- <PrSplitHeader
- foreignEntityId={props.foreignEntityId}
- prRef={ref()}
- enrichment={pullRequest()}
- />
+ <Scroll class="flex-1 min-h-0">
+ <div class="max-w-3xl mx-auto px-6 pt-12 pb-12 min-w-0">
+ <Show
+ when={props.data}
+ fallback={
+ <Show
+ when={props.status !== 'error'}
+ fallback={<PrLoadErrorBanner onRetry={props.onRetry} />}
+ >
+ <PrDetailSkeleton />
+ </Show>
+ }
+ >
+ {(data) => (
+ <>
+ <PrTitle
+ prRef={data().prRef}
+ pullRequest={data().pullRequest}
+ />
+ <div class="spacer h-3" />
+ <PrMetadata
+ prRef={data().prRef}
+ pullRequest={data().pullRequest}
+ />
+ <PrDescription pullRequest={data().pullRequest} />
+ <Suspense fallback={<PrTimelineSkeleton />}>
+ <PrTimeline
+ githubItems={data().pullRequest.comments ?? []}
+ source={props.discussionSource}
+ />
+ </Suspense>
+ </>
)}
</Show>
+ </div>
+ </Scroll>
+ </>
+ );
+}
- <Scroll class="flex-1 min-h-0">
+/** Native hosts own their header and place this content below it. */
+export function PrDetailContent(props: PrDetailBodyProps) {
+ return (
+ <div class="relative min-h-0 min-w-0 flex-1">
+ <Suspense
+ fallback={
+ <Scroll class="size-full min-h-0">
<div class="max-w-3xl mx-auto px-6 pt-12 pb-12 min-w-0">
- <Show
- when={prRef()}
- fallback={
- <>
- <PrTitleSkeleton />
- <div class="spacer h-3" />
- <PrMetadataSkeleton />
- <PrDescriptionSkeleton />
- <PrTimelineSkeleton />
- </>
- }
- >
- {(ref) => (
- <>
- <PrTitle prRef={ref()} pullRequest={pullRequest} />
- <div class="spacer h-3" />
- <PrMetadata prRef={ref()} pullRequest={pullRequest} />
- <PrDescription pullRequest={pullRequest} />
- <PrLoadErrorBanner loadFailed={loadFailed} />
- <PrTimeline
- githubItems={pullRequest()?.comments ?? []}
- source={discussionSource}
- />
- </>
- )}
- </Show>
+ <PrDetailSkeleton />
</div>
</Scroll>
- </div>
- </SidePanel.Layout>
+ }
+ >
+ <SidePanel.Layout headerToggle={false}>
+ <PrSidePanelSections enrichment={props.data?.pullRequest} />
+ <div class="flex size-full min-h-0 min-w-0 flex-col overflow-hidden">
+ <PrDetailBody
+ foreignEntityId={props.foreignEntityId}
+ data={props.data}
+ status={props.status}
+ onRetry={props.onRetry}
+ discussionSource={props.discussionSource}
+ />
+ </div>
+ </SidePanel.Layout>
+ </Suspense>
+ </div>
+ );
+}
+
+export function PrDetailActions(props: { url?: string }) {
+ return (
+ <div class="ml-auto flex shrink-0 items-center gap-2">
+ <Show when={props.url}>
+ {(url) => (
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => openExternalUrl(url())}
+ >
+ Open on GitHub
+ </Button>
+ )}
+ </Show>
+ <SidePanel.Toggle />
</div>
);
}
+export function StandalonePrDetail(props: { foreignEntityId: string }) {
+ const detail = usePrDetail(() => props.foreignEntityId);
+ const name = () => {
+ const data = detail.data();
+ return (
+ data?.pullRequest.name ??
+ (data ? prDisplayName(data.prRef) : 'Pull request')
+ );
+ };
+ const githubUrl = () => {
+ const data = detail.data();
+ return data ? (data.pullRequest.url ?? prHtmlUrl(data.prRef)) : undefined;
+ };
+ return (
+ <SidePanel.Root persistKey={`pr:${props.foreignEntityId}`}>
+ <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" />
+ <Show when={detail.data()?.pullRequest.status}>
+ {(status) => <PrStatusIcon status={status()} />}
+ </Show>
+ <span class="min-w-0 truncate text-sm font-semibold">{name()}</span>
+ <PrDetailActions url={githubUrl()} />
+ </ViewShell.TopBar>
+ <PrDetailContent
+ foreignEntityId={props.foreignEntityId}
+ data={detail.data()}
+ status={detail.query.status}
+ discussionSource={detail.discussionSource}
+ onRetry={() => void detail.query.refetch()}
+ />
+ </div>
+ </SidePanel.Root>
+ );
+}
+
function PrTitle(props: {
prRef: PrRef;
- pullRequest: Accessor<GithubPullRequestWithDetails | undefined>;
+ pullRequest?: GithubPullRequestWithDetails;
}) {
return (
<h1 class="ph-no-capture text-2xl font-semibold">
- {props.pullRequest()?.name ?? prDisplayName(props.prRef)}
+ {props.pullRequest?.name ?? prDisplayName(props.prRef)}
</h1>
);
}
function PrMetadata(props: {
prRef: PrRef;
- pullRequest: Accessor<GithubPullRequestWithDetails | undefined>;
+ pullRequest?: GithubPullRequestWithDetails;
}) {
- const pullRequest = () => props.pullRequest();
-
return (
<div class="mb-6 flex flex-row flex-wrap items-center gap-2 text-sm empty:hidden">
- <Show when={pullRequest()?.status}>
+ <Show when={props.pullRequest?.status}>
{(status) => <PrStatusChip status={status()} />}
</Show>
- <Show when={pullRequest()?.authorLogin}>
+ <Show when={props.pullRequest?.authorLogin}>
{(authorLogin) => (
<Layer depth={2}>
<a
@@ -146,7 +242,7 @@ function PrMetadata(props: {
</Show>
<Layer depth={2}>
<a
- href={pullRequest()?.url}
+ href={props.pullRequest?.url}
target="_blank"
rel="noreferrer"
class={cn(PR_PILL_CLASS, 'text-ink-muted hover:bg-hover')}
@@ -156,13 +252,18 @@ function PrMetadata(props: {
</Layer>
<Show
when={
- pullRequest()?.additions != null || pullRequest()?.deletions != null
+ props.pullRequest?.additions != null ||
+ props.pullRequest?.deletions != null
}
>
<Layer depth={2}>
<span class={PR_PILL_CLASS}>
- <span class="text-success">+{pullRequest()?.additions ?? 0}</span>
- <span class="text-failure">−{pullRequest()?.deletions ?? 0}</span>
+ <span class="text-success">
+ +{props.pullRequest?.additions ?? 0}
+ </span>
+ <span class="text-failure">
+ −{props.pullRequest?.deletions ?? 0}
+ </span>
</span>
</Layer>
</Show>
@@ -170,11 +271,9 @@ function PrMetadata(props: {
);
}
-function PrDescription(props: {
- pullRequest: Accessor<GithubPullRequestWithDetails | undefined>;
-}) {
+function PrDescription(props: { pullRequest?: GithubPullRequestWithDetails }) {
const description = createMemo(() => {
- const raw = props.pullRequest()?.description;
+ const raw = props.pullRequest?.description;
if (!raw) return null;
const cleaned = cleanGithubMarkdown(raw);
return cleaned || null;
@@ -193,12 +292,13 @@ function PrDescription(props: {
);
}
-function PrLoadErrorBanner(props: { loadFailed: Accessor<boolean> }) {
+function PrLoadErrorBanner(props: { onRetry: () => void }) {
return (
- <Show when={props.loadFailed()}>
- <div class="mt-6 px-3 py-2 rounded-lg border border-edge-muted text-xs text-ink-muted">
- Couldn't load this pull request from cached GitHub data.
- </div>
- </Show>
+ <div class="mt-6 flex flex-col items-start gap-3 rounded-lg border border-edge-muted px-3 py-2 text-xs text-ink-muted">
+ <span>Couldn't load this pull request from cached GitHub data.</span>
+ <Button variant="outline" size="sm" onClick={props.onRetry}>
+ Retry
+ </Button>
+ </div>
);
}
diff --git a/apps/web/src/features/drive-view/core/breadcrumbs.ts b/apps/web/src/features/drive-view/core/breadcrumbs.ts
index d56e4944fb..3486a25d4f 100644
--- a/apps/web/src/features/drive-view/core/breadcrumbs.ts
+++ b/apps/web/src/features/drive-view/core/breadcrumbs.ts
@@ -3,6 +3,9 @@ import { driveLocationLabel } from './location-label';
import type { DriveFolder, DriveLocation } from './types';
export const DRIVE_VIEW_BREADCRUMB = 'drive-view';
+export function driveCallBreadcrumbValue(callId: string) {
+ return `drive-call:${callId}`;
+}
export type DriveLocationBreadcrumb = {
type: 'drive-location';
diff --git a/apps/web/src/features/drive-view/drive-detail-navigation.tsx b/apps/web/src/features/drive-view/drive-detail-navigation.tsx
index 265b2507e8..61273c27a2 100644
--- a/apps/web/src/features/drive-view/drive-detail-navigation.tsx
+++ b/apps/web/src/features/drive-view/drive-detail-navigation.tsx
@@ -37,6 +37,7 @@ type DriveDetailRootOptions = EntityDetailNavigationOptions & {
};
type DriveDetailNavigation = {
+ activeCallId: Accessor<string | undefined>;
entries: Accessor<readonly EntityDetailNavigationEntry[]>;
active: Accessor<EntityDetailNavigationEntry | undefined>;
navigate: (
@@ -69,11 +70,12 @@ function opensInline(options?: EntityDetailNavigationOptions) {
export function DriveDetailNavigationProvider(
props: ParentProps<{ location: Accessor<DriveLocation> }>
) {
- const params = useParams<DriveRouteParams>();
+ const params = useParams<DriveRouteParams & { callId?: string }>();
const navigate = useNavigate();
const routeTrail = useRouteState(driveSplitRoute);
const selectPreview = createPreviewSelectionGuard();
const activeDocument = createMemo(() => driveDocumentFromParams(params));
+ const activeCallId = () => params.callId;
const activeTarget = createMemo(() =>
documentTargetFromRoute(activeDocument())
);
@@ -126,6 +128,7 @@ export function DriveDetailNavigationProvider(
const value: DriveDetailNavigation = {
entries,
+ activeCallId,
active,
navigate(target, options) {
@@ -195,7 +198,7 @@ export function DriveDetailNavigationProvider(
clear(options) {
// Location navigation already lands on a list route. Clearing again must
// not climb out of the folder/tab the user just selected.
- if (!activeDocument()) return;
+ if (!activeDocument() && !activeCallId()) return;
selectPreview(undefined);
navigate(driveDestination(props.location()), {
replace: options?.replace,
diff --git a/apps/web/src/features/drive-view/drive-hosted-content.ts b/apps/web/src/features/drive-view/drive-hosted-content.ts
new file mode 100644
index 0000000000..6eef92f668
--- /dev/null
+++ b/apps/web/src/features/drive-view/drive-hosted-content.ts
@@ -0,0 +1,68 @@
+import type { SplitLocation, SplitRouteMatch } from '@app/lib/split-router';
+import type { SplitContent } from '@components/app/split-layout/layoutManager';
+import type { DriveLocation } from './core/types';
+import {
+ type DriveDocumentRoute,
+ driveDocumentFromContent,
+} from './primitives/drive-route';
+
+function driveDocumentContent(
+ location: DriveLocation,
+ document: DriveDocumentRoute
+): SplitContent {
+ const matches: [SplitRouteMatch, ...SplitRouteMatch[]] = [
+ { id: 'drive', params: {} },
+ ];
+ if (location.kind === 'folder') {
+ matches.push({
+ id: 'drive-folder',
+ params: { view: 'folder', folderId: location.id ?? undefined },
+ });
+ } else if (location.tab !== 'owned') {
+ matches.push({ id: 'drive-tab', params: { tab: location.tab } });
+ }
+ matches.push({
+ id:
+ location.kind === 'folder'
+ ? 'drive-folder-document'
+ : location.tab === 'owned'
+ ? 'drive-document'
+ : 'drive-tab-document',
+ params: { documentId: document.id, documentType: document.type },
+ });
+ return {
+ type: 'component',
+ id: 'documents',
+ entryMetadata: { route: { matches } },
+ };
+}
+
+/** Construct Drive-owned split content before the layout mounts a block. */
+export function driveHostedContent(
+ content: { type: string; id: string },
+ options: {
+ allowDocuments: boolean;
+ search?: SplitLocation['search'];
+ }
+): SplitContent | undefined {
+ const document = options.allowDocuments
+ ? driveDocumentFromContent(content)
+ : undefined;
+ if (document)
+ return driveDocumentContent({ kind: 'tab', tab: 'owned' }, document);
+ if (content.type !== 'call') return;
+
+ return {
+ type: 'component',
+ id: 'documents',
+ entryMetadata: {
+ route: {
+ matches: [
+ { id: 'drive', params: {} },
+ { id: 'drive-call', params: { callId: content.id } },
+ ],
+ },
+ ...(options.search ? { search: options.search } : {}),
+ },
+ };
+}
diff --git a/apps/web/src/features/drive-view/route.tsx b/apps/web/src/features/drive-view/route.tsx
index 156998fd74..61f5ad7075 100644
--- a/apps/web/src/features/drive-view/route.tsx
+++ b/apps/web/src/features/drive-view/route.tsx
@@ -1,8 +1,13 @@
import {
+ createSearchParams,
defineRoute,
routeParams,
type SplitRouterEntry,
+ useParams,
+ useRouteParams,
} from '@app/lib/split-router';
+import { callDetailSearch } from '@block-call/call-route';
+import { URL_PARAMS as CALL_URL_PARAMS } from '@block-call/constants';
import { URL_PARAMS as MARKDOWN_URL_PARAMS } from '@block-md/constants';
import { URL_PARAMS as PDF_URL_PARAMS } from '@block-pdf/constants';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
@@ -29,6 +34,9 @@ import {
const SoupView = lazy(async () => ({
default: (await import('../next-soup/soup-view/soup-view')).SoupView,
}));
+const DriveCallDetail = lazy(async () => ({
+ default: (await import('./views/DriveCallDetail')).DriveCallDetail,
+}));
type DriveRouteViewProps = DriveViewProps & {
initialFilters?: Query;
@@ -37,6 +45,7 @@ type DriveRouteViewProps = DriveViewProps & {
export const DriveRouteView = withAuth(() => {
const panel = useSplitPanelOrThrow();
+ const params = useParams<{ callId?: string }>();
const props = (): DriveRouteViewProps => {
const content = panel.handle.content();
return content.type === 'component'
@@ -83,12 +92,35 @@ export const DriveRouteView = withAuth(() => {
initialGroupBy={preset?.groupBy}
/>
}
+ detailRequested={() => !!params.callId}
+ alwaysRenderDetail
>
<DriveView initialFacets={props().initialFacets} />
</NewAppView>
);
});
+function DriveCallRouteView() {
+ const params = useRouteParams(driveCallRoute);
+ const [search] = createSearchParams(callDetailSearch);
+ return (
+ <DriveCallDetail
+ callId={params.callId}
+ transcriptId={search.transcriptId}
+ seek={search.seek}
+ />
+ );
+}
+
+export const driveCallRoute = defineRoute({
+ id: 'drive-call',
+ path: 'call/:callId',
+ params: z.object({ callId: z.string().min(1) }),
+ search: [callDetailSearch.namespace],
+ component: DriveCallRouteView,
+ remountKey: ({ callId }) => callId,
+ claim: ({ callId }) => ({ namespace: 'block', id: `call:${callId}` }),
+});
const driveDocumentParams = z.object({
documentType: z.enum(DRIVE_DOCUMENT_TYPES),
documentId: z.string().min(1),
@@ -181,7 +213,17 @@ export const driveSplitRoute = defineRoute({
return Object.values(MARKDOWN_URL_PARAMS);
}
if (type === 'pdf') return Object.values(PDF_URL_PARAMS);
+ if (
+ typeof routeParams<{ callId?: string }>(entry.location.route).callId ===
+ 'string'
+ )
+ return [CALL_URL_PARAMS.transcriptId];
return [];
},
- children: [driveFolderRoute, driveTabRoute, driveRootDocumentRoute],
+ children: [
+ driveFolderRoute,
+ driveTabRoute,
+ driveCallRoute,
+ driveRootDocumentRoute,
+ ],
});
diff --git a/apps/web/src/features/drive-view/views/DriveCallDetail.tsx b/apps/web/src/features/drive-view/views/DriveCallDetail.tsx
new file mode 100644
index 0000000000..cce5ecbf1e
--- /dev/null
+++ b/apps/web/src/features/drive-view/views/DriveCallDetail.tsx
@@ -0,0 +1,93 @@
+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 PhoneCallIcon from '@phosphor/phone-call.svg';
+import { onMount, Show } from 'solid-js';
+import { DriveBreadcrumbsOutlet } from '../components/DriveBreadcrumbs';
+import { useDriveView } from '../context/drive-context';
+import {
+ driveCallBreadcrumbValue,
+ driveLocationBreadcrumbs,
+} from '../core/breadcrumbs';
+
+function DriveCallBreadcrumb(props: { callId: string; name: string }) {
+ const { state, sidebar } = useDriveView();
+ const order = () =>
+ driveLocationBreadcrumbs(state.value().location, sidebar.folders()).length;
+
+ return (
+ <>
+ <ViewBreadcrumbs.Item
+ value={driveCallBreadcrumbValue(props.callId)}
+ order={order()}
+ metadata={{ type: 'call', id: props.callId }}
+ >
+ {(item) => (
+ <ViewBreadcrumbs.Button
+ class="gap-1.5"
+ isActive={item.isActive()}
+ onClick={item.onSelect}
+ tooltip={props.name}
+ >
+ <PhoneCallIcon class="size-4 shrink-0" />
+ <span class="truncate">{props.name}</span>
+ </ViewBreadcrumbs.Button>
+ )}
+ </ViewBreadcrumbs.Item>
+ <DriveBreadcrumbsOutlet aria-label="Call location" />
+ </>
+ );
+}
+
+export function DriveCallDetail(props: {
+ callId: string;
+ transcriptId?: 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} data={detail.data()}>
+ <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}
+ channelId={data().record.channelId}
+ name={data().name}
+ isActive={data().record.isActive}
+ />
+ )}
+ </Show>
+ </ViewShell.TopBar>
+ <CallDetailContent
+ callId={props.callId}
+ query={detail.query}
+ data={detail.data()}
+ transcriptId={props.transcriptId}
+ seek={props.seek}
+ />
+ </div>
+ </CallDetailRoot>
+ );
+}
diff --git a/apps/web/src/features/drive-view/views/drive-breadcrumbs.tsx b/apps/web/src/features/drive-view/views/drive-breadcrumbs.tsx
index 4cbe830aee..f2de6fc401 100644
--- a/apps/web/src/features/drive-view/views/drive-breadcrumbs.tsx
+++ b/apps/web/src/features/drive-view/views/drive-breadcrumbs.tsx
@@ -2,7 +2,10 @@ import { ViewBreadcrumbs } from '@app/components/view-shell';
import type { ParentProps } from 'solid-js';
import { DriveLocationBreadcrumbItems } from '../components/DriveBreadcrumbs';
import { useDriveView } from '../context/drive-context';
-import type { DriveLocationBreadcrumb } from '../core/breadcrumbs';
+import {
+ type DriveLocationBreadcrumb,
+ driveCallBreadcrumbValue,
+} from '../core/breadcrumbs';
import { useDriveDetailNavigation } from '../drive-detail-navigation';
export function DriveBreadcrumbs(
@@ -12,9 +15,15 @@ export function DriveBreadcrumbs(
const navigation = useDriveDetailNavigation();
+ const activeValue = () => {
+ const callId = navigation.activeCallId();
+ return callId
+ ? driveCallBreadcrumbValue(callId)
+ : (navigation.active()?.value ?? props.entries.at(-1)!.value);
+ };
return (
<ViewBreadcrumbs.Root
- value={navigation.active()?.value ?? props.entries.at(-1)!.value}
+ value={activeValue()}
onChange={(value) => {
const breadcrumb = props.entries.find((entry) => entry.value === value);
diff --git a/apps/web/src/features/drive-view/views/drive-workspace.tsx b/apps/web/src/features/drive-view/views/drive-workspace.tsx
index c91be28077..3da3e5d469 100644
--- a/apps/web/src/features/drive-view/views/drive-workspace.tsx
+++ b/apps/web/src/features/drive-view/views/drive-workspace.tsx
@@ -63,7 +63,7 @@ export function DriveWorkspace() {
</ViewShell.Aside>
<ViewShell.Main>
<Show
- when={navigation.active()}
+ when={navigation.active() || navigation.activeCallId()}
fallback={
<>
<DriveHeader />
@@ -77,7 +77,9 @@ export function DriveWorkspace() {
</>
}
>
- <SplitRouter.Outlet />
+ <Suspense fallback={<DriveLoading />}>
+ <SplitRouter.Outlet />
+ </Suspense>
</Show>
</ViewShell.Main>
</ViewShell.Root>
diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.ts
index b508cc5b11..5c3ba802d0 100644
--- a/apps/web/src/features/next-soup/utils.test.ts
+++ b/apps/web/src/features/next-soup/utils.test.ts
@@ -674,7 +674,44 @@ describe('calendar view navigation', () => {
});
});
-describe('Drive document routing', () => {
+describe('Hosted details and Drive document routing', () => {
+ it('opens GitHub pull requests as Tasks-hosted content', async () => {
+ const openWithSplit = vi.fn(() => ({ status: 'unavailable' }));
+ setGlobalSplitManager({
+ activeSplit: vi.fn(),
+ openWithSplit,
+ } as unknown as SplitManager);
+
+ await openEntityInSplitFromUnifiedList(
+ {
+ type: 'foreign',
+ id: 'pr-1',
+ foreignSource: 'github_pull_request',
+ metadata: { url: 'https://github.com/example/repo/pull/1' },
+ } as EntityData,
+ { openInNewSplit: true }
+ );
+
+ expect(openWithSplit).toHaveBeenCalledWith(
+ {
+ type: 'component',
+ id: 'tasks',
+ entryMetadata: {
+ route: {
+ matches: [
+ { id: 'view-tasks', params: {} },
+ { id: 'tasks-pr', params: { foreignEntityId: 'pr-1' } },
+ ],
+ },
+ },
+ },
+ expect.objectContaining({
+ allowDuplicate: true,
+ preferNewSplit: true,
+ })
+ );
+ });
+
it('keeps task documents as legacy task blocks on touch', async () => {
vi.mocked(isTouchDevice).mockReturnValue(true);
const openWithSplit = vi.fn(() => ({ status: 'unavailable' }));
@@ -1337,3 +1374,63 @@ describe('getRowClickFallbackLocation', () => {
expect(getRowClickFallbackLocation(entity)).toBeUndefined();
});
});
+
+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);
+
+ await openEntityInSplitFromUnifiedList(searchEntity('call', null), {});
+ expect(openWithSplit).toHaveBeenCalledWith(
+ {
+ type: 'component',
+ id: 'documents',
+ entryMetadata: {
+ route: {
+ matches: [
+ { id: 'drive', params: {} },
+ { id: 'drive-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: {
+ matches: [
+ { id: 'drive', params: {} },
+ { id: 'drive-call', params: { callId: 'call-1' } },
+ ],
+ },
+ search: { 'call-detail': { transcriptId: ['segment-1'] } },
+ },
+ });
+ });
+});
diff --git a/apps/web/src/features/next-soup/utils.ts b/apps/web/src/features/next-soup/utils.ts
index cf9e7e381c..cf64b69f90 100644
--- a/apps/web/src/features/next-soup/utils.ts
+++ b/apps/web/src/features/next-soup/utils.ts
@@ -13,7 +13,7 @@ import {
CALENDAR_VIEW_ID,
type CalendarViewTarget,
} from '@app/features/calendar-view/types';
-import { driveDocumentFromContent } from '@app/features/drive-view/primitives/drive-route';
+import { driveHostedContent } from '@app/features/drive-view/drive-hosted-content';
import { URL_PARAMS as EMAIL_PARAMS } from '@app/features/email-thread/core/location';
import { withListNavigationSource } from '@app/features/soup/collection/list-navigation-source';
import {
@@ -21,6 +21,7 @@ import {
getEntityNotifications,
scopeChannelNotificationsForEntity,
} from '@app/features/soup/entity-notifications';
+import { tasksHostedContent } from '@app/features/tasks-view/tasks-hosted-content';
import { isRecord } from '@app/lib/split-router/utils';
import { globalSplitManager } from '@app/signal/splitLayout';
import { CALENDAR_BLOCK_ID } from '@block-calendar/types';
@@ -38,7 +39,6 @@ import type {
SplitContent,
SplitHandle,
} from '@components/app/split-layout/layoutManager';
-import { driveSplitContent } from '@components/app/split-layout/split-router/legacy-route';
import { toast } from '@core/component/Toast/Toast';
import {
fileTypeToBlockName,
@@ -712,14 +712,16 @@ export const openEntityInSplitFromUnifiedList = async (
if (isGithubPrEntity(entity)) {
if (USE_MACRO_PR_SUMMARY_BLOCK) {
+ const content = { type: 'pr' as const, id: entity.id };
const result = splitManager.openWithSplit(
- { type: 'pr', id: entity.id },
+ tasksHostedContent(content) ?? content,
{
referredFrom: options.referredFrom,
activate: true,
preferNewSplit: openInNewSplit,
handle: splitHandle,
mergeHistory,
+ allowDuplicate: true,
}
);
if (result.status === 'reused' && result.owner !== result.sourceOwner) {
@@ -798,18 +800,14 @@ export const openEntityInSplitFromUnifiedList = async (
: undefined;
const referredFrom = options.referredFrom ?? sourceListView;
- // Documents are hosted by Drive. Construct the canonical routed content
- // before opening the split so the layout manager does not mount a legacy
- // block and immediately replace it during router feedback.
- // A comment target opens the document block itself, exactly like a copied
- // comment link, because Drive-hosted documents cannot take a comment target.
- const driveDocument =
- !isTouchDevice() && !commentParams
- ? driveDocumentFromContent(content)
- : undefined;
- let splitContent: SplitContent = driveDocument
- ? driveSplitContent({ kind: 'tab', tab: 'owned' }, driveDocument)
- : { ...content, params };
+ // Construct hosted content before opening the split so details do not mount
+ // legacy blocks. Comment targets keep their document block.
+ const hostedContent =
+ tasksHostedContent(content) ??
+ driveHostedContent(content, {
+ allowDocuments: !isTouchDevice() && !commentParams,
+ });
+ let splitContent: SplitContent = hostedContent ?? { ...content, params };
const callTranscriptId =
entity.type === 'call' && location?.type === 'call_record'
? location.transcriptId
@@ -840,11 +838,8 @@ export const openEntityInSplitFromUnifiedList = async (
preferNewSplit: openInNewSplit,
handle: splitHandle,
mergeHistory,
- // Each routed document has a distinct Drive location even though all
- // Drive splits share the same component identity.
- allowDuplicate:
- allowDuplicate ||
- (splitContent.type === 'component' && splitContent.id === 'documents'),
+ // Hosted details have distinct routes even when they share a component identity.
+ allowDuplicate: allowDuplicate || hostedContent !== undefined,
reopen:
entity.type === 'channel' && !location && openChannelAtLatest
? 'latest'
diff --git a/apps/web/src/features/tasks-view/components/TasksPrDetail.tsx b/apps/web/src/features/tasks-view/components/TasksPrDetail.tsx
new file mode 100644
index 0000000000..149fafef80
--- /dev/null
+++ b/apps/web/src/features/tasks-view/components/TasksPrDetail.tsx
@@ -0,0 +1,109 @@
+import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
+import { useAnalytics } from '@app/lib/analytics/analytics-context';
+import { useRouteParams } from '@app/lib/split-router';
+import { PrStatusIcon } from '@block-pr/component/PrStatus';
+import { prDisplayName, prHtmlUrl } from '@block-pr/util/prKey';
+import {
+ PrDetailActions,
+ PrDetailContent,
+ usePrDetail,
+} from '@block-pr/views/PrDetail';
+import { SidePanel } from '@components/app/side-panel';
+import { SplitFileMenu } from '@components/app/split-layout/components/SplitFileMenu';
+import { SplitPanel } from '@components/app/split-panel';
+import { Permissions } from '@core/component/SharePermissions';
+import { onMount } from 'solid-js';
+import { tasksPrRoute } from '../route';
+
+function TasksPrBreadcrumb(props: {
+ foreignEntityId: string;
+ name: string;
+ status?: string;
+}) {
+ return (
+ <ViewBreadcrumbs.Item
+ value={`pr:${props.foreignEntityId}`}
+ order={1}
+ metadata={{ type: 'pr', id: props.foreignEntityId }}
+ >
+ {(item) => (
+ <div class="flex min-w-0 items-center">
+ <ViewBreadcrumbs.Button
+ class="gap-1.5"
+ isActive={item.isActive()}
+ onClick={item.onSelect}
+ tooltip={props.name}
+ >
+ <PrStatusIcon
+ status={props.status ?? 'open'}
+ class="size-4 shrink-0"
+ />
+ <span class="truncate">{props.name}</span>
+ </ViewBreadcrumbs.Button>
+ <div class="shrink-0">
+ <SplitFileMenu
+ id={props.foreignEntityId}
+ itemType="foreign"
+ name={props.name}
+ entityKind="pr"
+ permissions={Permissions.CAN_VIEW}
+ ops={[]}
+ />
+ </div>
+ </div>
+ )}
+ </ViewBreadcrumbs.Item>
+ );
+}
+
+export function TasksPrDetail(props: { foreignEntityId: string }) {
+ const analytics = useAnalytics();
+ const detail = usePrDetail(() => props.foreignEntityId);
+ const name = () => {
+ const data = detail.data();
+ return (
+ data?.pullRequest.name ??
+ (data ? prDisplayName(data.prRef) : 'Pull request')
+ );
+ };
+ const githubUrl = () => {
+ const data = detail.data();
+ return data ? (data.pullRequest.url ?? prHtmlUrl(data.prRef)) : undefined;
+ };
+ onMount(() => {
+ analytics.pageView('pr');
+ analytics.track('open_entity', {
+ entityType: 'pr',
+ entityId: props.foreignEntityId,
+ });
+ });
+
+ return (
+ <SidePanel.Root persistKey={`pr:${props.foreignEntityId}`}>
+ <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" />
+ <ViewBreadcrumbs.Outlet aria-label="Pull request location" />
+ <PrDetailActions url={githubUrl()} />
+ </ViewShell.TopBar>
+ <TasksPrBreadcrumb
+ foreignEntityId={props.foreignEntityId}
+ name={name()}
+ status={detail.data()?.pullRequest.status ?? undefined}
+ />
+ <PrDetailContent
+ foreignEntityId={props.foreignEntityId}
+ data={detail.data()}
+ status={detail.query.status}
+ discussionSource={detail.discussionSource}
+ onRetry={() => void detail.query.refetch()}
+ />
+ </div>
+ </SidePanel.Root>
+ );
+}
+
+export function TasksPrDetailRouteView() {
+ const params = useRouteParams(tasksPrRoute);
+ return <TasksPrDetail foreignEntityId={params.foreignEntityId} />;
+}
diff --git a/apps/web/src/features/tasks-view/route.tsx b/apps/web/src/features/tasks-view/route.tsx
index e17845630c..7cf75669b9 100644
--- a/apps/web/src/features/tasks-view/route.tsx
+++ b/apps/web/src/features/tasks-view/route.tsx
@@ -14,6 +14,9 @@ import { TasksView } from './tasks-view';
const SoupView = lazy(async () => ({
default: (await import('../next-soup/soup-view/soup-view')).SoupView,
}));
+const TasksPrDetailRouteView = lazy(async () => ({
+ default: (await import('./components/TasksPrDetail')).TasksPrDetailRouteView,
+}));
function LegacyTasksView() {
const user = useUserContext();
@@ -41,16 +44,19 @@ function TasksLegacyRouteView() {
}
export const TasksRouteView = withAuth(() => {
- const params = useParams<{ taskId?: string }>();
- const detailRequested = () => typeof params.taskId === 'string';
+ const params = useParams<{ taskId?: string; foreignEntityId?: string }>();
+ const detailRequested = () =>
+ typeof params.taskId === 'string' ||
+ typeof params.foreignEntityId === 'string';
return (
<NewAppView
id="tasks"
composableOnTouch
- detailDesktopOnly
+ detailDesktopOnly={!params.foreignEntityId}
detailRequested={detailRequested}
detailFallback={<TasksLegacyRouteView />}
+ alwaysRenderDetail={!!params.foreignEntityId}
fallback={<LegacyTasksView />}
>
<TasksView />
@@ -58,6 +64,18 @@ export const TasksRouteView = withAuth(() => {
);
});
+export const tasksPrRoute = defineRoute({
+ id: 'tasks-pr',
+ path: 'pr/:foreignEntityId',
+ params: z.object({ foreignEntityId: z.string().min(1) }),
+ component: TasksPrDetailRouteView,
+ remountKey: ({ foreignEntityId }) => foreignEntityId,
+ claim: ({ foreignEntityId }) => ({
+ namespace: 'block',
+ id: `pr:${foreignEntityId}`,
+ }),
+});
+
export const taskDetailRoute = defineRoute({
id: 'tasks-task',
path: ':taskId',
@@ -75,5 +93,5 @@ export const tasksSplitRoute = defineRoute({
path: 'tasks',
component: TasksRouteView,
search: '*' as const,
- children: [taskDetailRoute],
+ children: [tasksPrRoute, taskDetailRoute],
});
diff --git a/apps/web/src/features/tasks-view/tasks-hosted-content.ts b/apps/web/src/features/tasks-view/tasks-hosted-content.ts
new file mode 100644
index 0000000000..605a731300
--- /dev/null
+++ b/apps/web/src/features/tasks-view/tasks-hosted-content.ts
@@ -0,0 +1,28 @@
+import type { SplitRouteMatch } from '@app/lib/split-router';
+import type { SplitContent } from '@components/app/split-layout/layoutManager';
+
+const hostedDetailRoutes = {
+ pr: (id: string): SplitRouteMatch => ({
+ id: 'tasks-pr',
+ params: { foreignEntityId: id },
+ }),
+} satisfies Record<string, (id: string) => SplitRouteMatch>;
+
+/** Open a Tasks-hosted detail without mounting its legacy block. */
+export function tasksHostedContent(content: {
+ type: string;
+ id: string;
+}): SplitContent | undefined {
+ const detail = hostedDetailRoutes[
+ content.type as keyof typeof hostedDetailRoutes
+ ]?.(content.id);
+ if (!detail) return;
+
+ return {
+ type: 'component',
+ id: 'tasks',
+ entryMetadata: {
+ route: { matches: [{ id: 'view-tasks', params: {} }, detail] },
+ },
+ };
+}
diff --git a/apps/web/src/features/tasks-view/tasks-view.tsx b/apps/web/src/features/tasks-view/tasks-view.tsx
index ce89745683..09bf8b1651 100644
--- a/apps/web/src/features/tasks-view/tasks-view.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view.tsx
@@ -1,5 +1,5 @@
import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
-import { SplitRouter } from '@app/lib/split-router';
+import { SplitRouter, useParams } from '@app/lib/split-router';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { SplitPanel } from '@components/app/split-panel';
import { ListEntityMetadataQueryProvider } from '@entity';
@@ -30,7 +30,9 @@ function TasksListFallback() {
function TasksViewBreadcrumbs(props: ParentProps) {
const { closeTask, selectedTask } = useTasksView();
+ const params = useParams<{ foreignEntityId?: string }>();
const value = () => {
+ if (params.foreignEntityId) return `pr:${params.foreignEntityId}`;
const task = selectedTask();
return task ? `task:${task.id}` : 'tasks-view';
};
@@ -81,7 +83,9 @@ function TasksViewRoot() {
<TasksSidebar />
</ViewShell.Aside>
<ViewShell.Main>
- <SplitRouter.Outlet fallback={list} />
+ <Suspense fallback={<TasksListFallback />}>
+ <SplitRouter.Outlet fallback={list} />
+ </Suspense>
</ViewShell.Main>
</ViewShell.Root>
</SplitPanel.Body>
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index 2520a7482e..acdbf43539 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -830,6 +830,17 @@ Every calendar mention's hover card shows the schedule, location, organizer and
count, plus the first lines of the event description (its links open), and no last-updated
byline.
+## Pull requests — `/app/tasks/pr/<foreignEntityId>`
+
+Macro-linked GitHub pull requests open inside the Tasks shell, with a Tasks breadcrumb,
+PR title/status, GitHub action, discussion timeline, and Details/Checks side panel below
+the top bar. PRs are not tasks and do not appear in the Tasks list.
+Old `/app/pr/<foreignEntityId>` links redirect to the Tasks detail.
+Check an old link, a PR opened from a list or agent session,
+a second split, breadcrumb return, side-panel toggle, and phone layout. If cached
+GitHub data fails, the detail shows an error banner with a Retry button; pressing it
+refetches the PR without leaving the current detail.
+
## Calls — `/app/component/calls`
Tabs `All` / `Missed` / `Unattended`; `New call` offers `Call a channel or contact`
@@ -841,14 +852,16 @@ 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 the standalone `/app/call/<callId>` detail route, including
-old copied call links and split navigation. The detail shows a loading state,
-recording/transcript/summary, Share, and the call side panel; a failed load shows
-Try again. A link with `call_transcript_id=<segmentId>` seeks the matching video
-segment after loading. Check a direct link, a Calls-list click, a second split,
-and clicking the same transcript search hit twice after playing elsewhere.
-
-On phones, recorded call headers omit the **Call Again** action.
+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.
+`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**.
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