diff --git a/packages/junior-dashboard/e2e/conversation-details.spec.ts b/packages/junior-dashboard/e2e/conversation-details.spec.ts index 0b4845545e..8259cb8122 100644 --- a/packages/junior-dashboard/e2e/conversation-details.spec.ts +++ b/packages/junior-dashboard/e2e/conversation-details.spec.ts @@ -131,6 +131,16 @@ test("opens conversation details beside the chat", async ({ await page.keyboard.press("Escape"); await expect(details).toBeHidden(); await expect(detailsButton).toBeFocused(); + // With the `⋯` menu open, Escape closes the menu and leaves details open. + await detailsButton.click(); + await expect(details).toBeVisible(); + await page.getByRole("button", { name: "Conversation menu" }).click(); + await expect(page.getByRole("button", { name: "Event log" })).toBeVisible(); + await page.keyboard.press("Escape"); + await expect(page.getByRole("button", { name: "Event log" })).toBeHidden(); + await expect(details).toBeVisible(); + await detailsButton.click(); + await expect(details).toBeHidden(); await page.setViewportSize({ width: 390, height: 844 }); await page.getByRole("button", { name: "Conversation menu" }).click(); diff --git a/packages/junior-dashboard/e2e/conversations-attention.spec.ts b/packages/junior-dashboard/e2e/conversations-attention.spec.ts index 21e7ae12a5..3f656f1f76 100644 --- a/packages/junior-dashboard/e2e/conversations-attention.spec.ts +++ b/packages/junior-dashboard/e2e/conversations-attention.spec.ts @@ -225,6 +225,20 @@ test.describe("conversation time sections", () => { await expect(details).toHaveCount(0); await expect(page).not.toHaveURL(/review=/); + // With details already open, the chip still expands the question. + await page + .getByRole("button", { name: "Conversation details", exact: true }) + .click(); + const question = details + .getByRole("region", { name: "Needs you" }) + .getByText("Merge the checkout fix?"); + await expect(question).toBeHidden(); + await chip.click(); + await expect(question).toBeVisible(); + await details + .getByRole("button", { name: "Close conversation details" }) + .click(); + const today = sidebar.getByRole("button", { name: "Today" }); await today.click(); await expect(today).toHaveAttribute("aria-expanded", "false"); diff --git a/packages/junior-dashboard/e2e/conversations-mobile.spec.ts b/packages/junior-dashboard/e2e/conversations-mobile.spec.ts index ff9cc50224..32fd694180 100644 --- a/packages/junior-dashboard/e2e/conversations-mobile.spec.ts +++ b/packages/junior-dashboard/e2e/conversations-mobile.spec.ts @@ -264,6 +264,8 @@ test("opens and closes a conversation on mobile", async ({ // The sheet moves focus inside it. await expect(details.locator(":focus")).toHaveCount(1); await page.keyboard.press("Shift+Tab"); + // Mobile hides the title bar, so the sheet names the location. + await expect(details.getByText("Location", { exact: true })).toBeVisible(); await expect(details.locator(":focus")).toHaveCount(1); await screenshot(page, "conversation-details-sheet", { lightTheme: true, diff --git a/packages/junior-dashboard/src/client/conversations/ConversationMeta.tsx b/packages/junior-dashboard/src/client/conversations/ConversationMeta.tsx index a9b96f928e..5c10dc37ea 100644 --- a/packages/junior-dashboard/src/client/conversations/ConversationMeta.tsx +++ b/packages/junior-dashboard/src/client/conversations/ConversationMeta.tsx @@ -514,7 +514,13 @@ export function hasConversationStats(props: { return conversationStatItems(props).length > 0; } -type ConversationStatItem = { content: ReactNode; key: string; label: string }; +type ConversationStatItem = { + content: ReactNode; + key: string; + label: string; + /** Shown below `md` only, where the title bar is hidden. */ + mobileOnly?: boolean; +}; /** Render runtime, source, token, and cost metadata as a labeled list. */ export function ConversationStats(props: { @@ -527,7 +533,10 @@ export function ConversationStats(props: {