diff --git a/desktop/src/features/channels/lib/agentSessionPanelPresentation.test.mjs b/desktop/src/features/channels/lib/agentSessionPanelPresentation.test.mjs index 9294d134a4..114466d176 100644 --- a/desktop/src/features/channels/lib/agentSessionPanelPresentation.test.mjs +++ b/desktop/src/features/channels/lib/agentSessionPanelPresentation.test.mjs @@ -14,6 +14,7 @@ test("the cover drawer owns motion and gets standalone, opaque chrome", () => { enterMotion: false, isSinglePanelView: true, layout: "standalone", + transcriptVariant: "conversation", transparentChrome: false, }, ); @@ -30,6 +31,7 @@ test("the split pane keeps docked chrome and its own enter motion", () => { enterMotion: true, isSinglePanelView: false, layout: "split", + transcriptVariant: undefined, transparentChrome: true, }, ); @@ -47,6 +49,7 @@ test("narrow viewports keep today's overlay and single-panel presentations", () enterMotion: true, isSinglePanelView, layout: "standalone", + transcriptVariant: undefined, transparentChrome: false, }, ); diff --git a/desktop/src/features/channels/lib/agentSessionPanelPresentation.ts b/desktop/src/features/channels/lib/agentSessionPanelPresentation.ts index e7380da511..a22ad8d0c8 100644 --- a/desktop/src/features/channels/lib/agentSessionPanelPresentation.ts +++ b/desktop/src/features/channels/lib/agentSessionPanelPresentation.ts @@ -1,3 +1,5 @@ +import type { AgentSessionTranscriptVariant } from "@/features/agents/ui/agentSessionTranscriptContext"; + /** * `AnimatePresence` key shared by every agent activity presentation. * @@ -11,6 +13,7 @@ export type AgentSessionPanelPresentation = { enterMotion: boolean; isSinglePanelView: boolean; layout: "standalone" | "split"; + transcriptVariant: AgentSessionTranscriptVariant | undefined; transparentChrome: boolean; }; @@ -24,11 +27,11 @@ type AgentSessionPanelPresentationOptions = { /** * Maps channel presentation into the agent session panel's layout props. * - * TODO(#6538): once the `conversation` transcript variant lands on main, this - * should also return `transcriptVariant: "conversation"` for the cover drawer - * and `undefined` otherwise, so the reading view is pinned by presentation - * rather than inferred from panel width. The variant does not exist on main - * yet, so the prop is deliberately not set here. + * The transcript variant is pinned here rather than inferred from panel width. + * The cover drawer is the reading surface, so it gets `conversation`; every + * other host keeps the dense activity feed. Width is a proxy that breaks — the + * split pane can be dragged wide and a narrow overlay can be tall — so the + * presentation that decided to cover is what decides the reading view too. */ export function getAgentSessionPanelPresentation({ isCoverDrawer, @@ -44,6 +47,7 @@ export function getAgentSessionPanelPresentation({ // it has no resizable neighbour to draw a resize border against. isSinglePanelView: true, layout: "standalone", + transcriptVariant: "conversation", transparentChrome: false, }; } @@ -52,6 +56,10 @@ export function getAgentSessionPanelPresentation({ enterMotion: true, isSinglePanelView: useSplitAuxiliaryPane ? false : isSinglePanelView, layout: useSplitAuxiliaryPane ? "split" : "standalone", + // Undefined, not `"default"`: the panel already defaults, and naming it + // here would claim this function decides the non-cover variant when the + // profile panel's `compactPreview` is chosen at its own call site. + transcriptVariant: undefined, transparentChrome: useSplitAuxiliaryPane, }; } diff --git a/desktop/tests/e2e/agent-activity-cover-screenshots.spec.ts b/desktop/tests/e2e/agent-activity-cover-screenshots.spec.ts index 9ae78b738d..0b69fcee81 100644 --- a/desktop/tests/e2e/agent-activity-cover-screenshots.spec.ts +++ b/desktop/tests/e2e/agent-activity-cover-screenshots.spec.ts @@ -465,6 +465,18 @@ test.describe("agent activity cover drawer screenshots", () => { page.getByTestId("transcript-user-message").first(), ).toBeVisible({ timeout: 10_000 }); + // The reading view is pinned by presentation rather than inferred from panel + // width: the drawer is the reading surface, so its transcript renders the + // conversation variant. Asserted here rather than in + // `agent-activity-cover.spec.ts` because the marker only exists once the + // transcript has content, and this is the spec that seeds a turn. Asserted + // on the DOM marker rather than the prop so it proves the value survives the + // whole path from the presentation resolver through the panel. + await expect(panel.locator("[data-transcript-variant]")).toHaveAttribute( + "data-transcript-variant", + "conversation", + ); + await waitForAnimations(page); // Full window: the drawer against the sliver and the scrimmed channel, // which is the part of this presentation a panel-only shot cannot show.