From 74f26f3b494c3434cbe22c15f32aa6c744bf98ef Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Fri, 27 Nov 2026 13:41:43 +0000 Subject: [PATCH] fix(ui): mobile parity for task detail, chat, goals, cases, and coordinator inbox (#23046) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Operators review tasks, agent conversations, goals, cases, and coordinator inbox decisions from both desktop and mobile viewports. > - On mobile viewports (`< 768px`), several core detail surfaces hide or disable controls that only mount in desktop sidebars: streamlined Task Detail hides both the Properties drawer trigger and the More task actions menu; Agent Chat's top-right Show properties toggle toggles a desktop-only panel; Goal Detail hides its Properties panel with no mobile drawer; Coordinator Inbox disables artifact and approval inspection; BreadcrumbBar crushes current page titles behind unshrinking ancestors; Case Detail clips long unbroken IDs; wide Markdown tables and rigid 4-column media grids overflow narrow screens. > - Mobile operators need full access to task properties, task actions, goal metadata, and decision artifacts without switching to a desktop browser or fighting horizontal page overflow. > - This pull request restores mobile sheet triggers and action menus across Task Detail, Agent Chat, Goal Detail, and Coordinator Inbox, fixes mobile breadcrumb priority and properties toggle visibility, wraps long Case Detail titles, contains wide Markdown tables inside scrollable bubble regions, updates rigid 4-column media grids to 2-to-4 responsive grids, and adds unit tests plus 390×844 Storybook mobile views. > - The benefit is complete mobile parity on Paperclip's core detail and inbox workflows with zero horizontal overflow and no regressions on desktop layouts. ## Linked Issues or Issue Description **What happened?** On viewports narrower than `768px` (such as `390×844` mobile): - Streamlined Task Detail hides both the mobile `Properties` sheet button (gated behind `!streamlinedTaskDetailEnabled`) and the `More task actions` (`...`) menu (nested inside `hidden md:flex`), making Properties, Plan, Artifacts, Subtasks, Copy, Archive, Privacy, and subtree Pause/Resume/Cancel controls unreachable. - On Agent Chat and mobile Task Detail routes, the top-right `Show properties` toggle calls `toggleTaskSidePanel`, which only toggles desktop-only `panelVisible` (`PropertiesPanel` is `hidden md:flex`) instead of opening the mobile `Sheet`. - `BreadcrumbBar` suppresses `propertiesToggle` on mobile task trails and gives ancestor segments `shrink-0`, crushing the final page label to one letter. - `GoalDetail` hides its Properties toggle (`hidden md:inline-flex`) and only writes to the desktop `PropertiesPanel`, leaving `` unreachable on mobile. - `CaseDetail` renders `

` without `break-words` / `wrap-anywhere` or `min-w-0`, causing unbroken identifiers to overflow past `390px`. - `CoordinatorNeedsYou` sets `artifact = null`, disables mentioned-link interception, and sets `onViewDetails = undefined` on mobile, blocking inspection of approval details and decision artifacts. - Wide Markdown tables inside `TaskChatBubble` lack flex `min-w-0` containment and explicit `max-w-full overflow-x-auto` utility classes on the table scroll wrapper, and media grids in `IssueOutputSection`, `IssueAttachmentsSection`, and `TaskChatBubble` use rigid `grid-cols-4` on mobile. **Expected behavior** - Mobile users can open the `TaskSidePanel` `Sheet` from both the streamlined Task Detail header and the `BreadcrumbBar` top-right toggle (on both `/issues/:id` and `/chats/:agentRef`), and can open the `More task actions` (`...`) menu. - Mobile breadcrumbs keep the current page title legible by collapsing >2 leading segments and shrinking ancestor segments before the current crumb. - Mobile `GoalDetail` provides a `Properties` button that opens `` in a bottom `Sheet`. - Mobile `CaseDetail` wraps unbroken identifiers cleanly within the viewport. - Mobile `CoordinatorNeedsYou` opens approval details, artifact rows, and mentioned documents in a responsive bottom `Sheet` backed by ``. - Wide Markdown tables scroll horizontally within their bubble container without expanding page width, and media grids adapt from 2 columns on mobile to 4 columns on `sm+`. **Steps to reproduce** 1. Open Paperclip UI at a `390×844` viewport. 2. Visit a streamlined task detail page, an agent chat page, a goal detail page, a case detail page with a long unbroken token in its title, and the Coordinator Inbox (`/decisions`). 3. Attempt to open Properties, More task actions, Goal Properties, or an approval/plan artifact review panel, and inspect breadcrumb truncation and table overflow. **Paperclip version or commit** Reproduced on `origin/master` (`85ad16b47e`). ## What Changed - **`ui/src/pages/IssueDetail.tsx`**: Wired `toggleTaskSidePanel` and `breadcrumbPanelControl.open` to `mobilePropsOpen` when `isMobile` is true (including on `/chats/:agentRef`); moved `More task actions` (`...`) out of `hidden md:flex` so it stays reachable on mobile; added a mobile-only `Properties` button to streamlined Task Detail headers. *(Note on file size rule: `IssueDetail.tsx` already exceeded 1,000 lines; this PR adds only +36 net lines directly in the existing header and panel toggle hooks to avoid unnecessary churn.)* - **`ui/src/components/BreadcrumbBar.tsx`**: Rendered `propertiesToggle` on mobile task and chat trails whenever `showPropertiesToggle` or `breadcrumbPanelControl` is present; collapsed >2-segment mobile trails to parent + current and shrunk ancestor segments (`max-w-28`, `max-w-24` for task parents) while giving the final crumb `flex-1 min-w-0`. - **`ui/src/pages/GoalDetail.tsx`**: Added a mobile-only `Properties` trigger button and bottom `` rendering ``. - **`ui/src/pages/CaseDetail.tsx`**: Added `min-w-0`, `break-words`, and `wrap-anywhere` to the page container, header, and `

` title. - **`ui/src/components/coordinator/CoordinatorNeedsYou.tsx`**: Removed mobile disables on `needsYouArtifact`, mentioned document clicks, and approval `onViewDetails`; guarded desktop `panelVisible` close sync with `!isMobile`; added a bottom `` rendering `` (with multi-tab switching when multiple artifacts are open). - **`ui/src/components/MarkdownBody.tsx` & `ui/src/components/task-chat/TaskChatBubble.tsx`**: Added `max-w-full overflow-x-auto` to the Markdown table scroll wrapper and `min-w-0 max-w-full` flex containment on chat bubbles. - **`ui/src/components/issue-output/IssueOutputSection.tsx`, `ui/src/components/IssueAttachmentsSection.tsx`, `ui/src/components/task-chat/TaskChatBubble.tsx`**: Updated rigid `grid-cols-4` media grids to `grid-cols-2 sm:grid-cols-4`. - **Storybook & Tests**: Added/updated 390×844 mobile Storybook exports (`TaskDetailMobile`, `AgentChatMobile`, `GoalDetailMobile`, `CaseDetailMobile`, `CoordinatorInboxMobile`) and 7 Vitest suites covering every changed surface. ## Verification - Targeted Vitest (8 files, 94 tests pass): `pnpm --filter @paperclipai/ui exec vitest run src/components/MarkdownBody.test.tsx src/components/BreadcrumbBar.mobile.test.tsx src/pages/GoalDetail.mobile.test.tsx src/pages/CaseDetail.mobile.test.tsx src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx src/components/task-chat/TaskChatBubble.mobile.test.tsx src/pages/IssueDetail.mobile.test.tsx` - Design token & sync gates (All 4 gates CLEAN + cliplab character in sync): `pnpm check:token-gates` - TypeScript build & typecheck (0 errors): `pnpm --filter @paperclipai/ui typecheck` - Storybook catalog & map checks (372 files, 3490 stories; 30/30 catalog & map tests pass): `node scripts/storybook-catalog.mjs --check && node --test scripts/check-maps.test.mjs scripts/storybook-catalog.test.mjs scripts/storybook-feature-index.test.mjs` - Revision verified: `20c7e91bdad95b4679cd1707e6881a3f414f71a4` on local macOS worktree. Full repo CI suite and visual browser checks will run in GitHub Actions. ## Risks - Low risk: all new drawer/sheet paths and breadcrumb collapsing are strictly gated to mobile (`isMobile` / `md:hidden`), preserving existing desktop layouts and behaviors. - Mobile `CoordinatorNeedsYou` review sheets intentionally bypass desktop `PropertiesPanel` so desktop `panelVisible === false` does not auto-dismiss the mobile sheet; desktop panel behavior is unchanged. ## Model Used - **Provider & Model**: Google Gemini — Gemini 4 Neon (High) - **Capabilities**: Extended reasoning/thinking, tool use, local code execution, and automated test verification. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --- .../components/BreadcrumbBar.mobile.test.tsx | 189 +++++++++ ui/src/components/BreadcrumbBar.tsx | 24 +- ui/src/components/IssueAttachmentsSection.tsx | 2 +- ui/src/components/MarkdownBody.test.tsx | 2 +- ui/src/components/MarkdownBody.tsx | 7 +- .../CoordinatorNeedsYou.mobile.test.tsx | 247 +++++++++++ .../coordinator/CoordinatorNeedsYou.tsx | 99 ++++- .../issue-output/IssueOutputSection.tsx | 2 +- .../task-chat/TaskChatBubble.mobile.test.tsx | 142 +++++++ .../components/task-chat/TaskChatBubble.tsx | 6 +- ui/src/pages/CaseDetail.mobile.test.tsx | 121 ++++++ ui/src/pages/CaseDetail.tsx | 8 +- ui/src/pages/GoalDetail.mobile.test.tsx | 144 +++++++ ui/src/pages/GoalDetail.tsx | 38 +- ui/src/pages/IssueDetail.mobile.test.tsx | 399 ++++++++++++++++++ ui/src/pages/IssueDetail.tsx | 53 ++- .../stories/agent-chat/agent-chat.stories.tsx | 7 + .../stories/cases/case-detail.stories.tsx | 32 ++ .../stories/goals/goal-alignment.stories.tsx | 19 + .../inbox-search/decisions-desk.stories.tsx | 59 +++ .../tasks/monitoring-status.stories.tsx | 6 +- 21 files changed, 1564 insertions(+), 42 deletions(-) create mode 100644 ui/src/components/BreadcrumbBar.mobile.test.tsx create mode 100644 ui/src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx create mode 100644 ui/src/components/task-chat/TaskChatBubble.mobile.test.tsx create mode 100644 ui/src/pages/CaseDetail.mobile.test.tsx create mode 100644 ui/src/pages/GoalDetail.mobile.test.tsx create mode 100644 ui/src/pages/IssueDetail.mobile.test.tsx diff --git a/ui/src/components/BreadcrumbBar.mobile.test.tsx b/ui/src/components/BreadcrumbBar.mobile.test.tsx new file mode 100644 index 00000000000..c656a13786b --- /dev/null +++ b/ui/src/components/BreadcrumbBar.mobile.test.tsx @@ -0,0 +1,189 @@ +// @vitest-environment jsdom +import { act, useEffect, type ReactNode } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { MemoryRouter } from "react-router-dom"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { BreadcrumbBar } from "./BreadcrumbBar"; +import { BreadcrumbProvider, useBreadcrumbs, type Breadcrumb, type BreadcrumbPanelControl } from "../context/BreadcrumbContext"; + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +const mockState = vi.hoisted(() => ({ + isMobile: true, + toggleSidebar: vi.fn(), + panelVisible: false, + togglePanelVisible: vi.fn(), +})); + +vi.mock("../context/SidebarContext", () => ({ + useSidebar: () => ({ + isMobile: mockState.isMobile, + toggleSidebar: mockState.toggleSidebar, + }), +})); + +vi.mock("../context/PanelContext", () => ({ + usePanel: () => ({ + panelVisible: mockState.panelVisible, + togglePanelVisible: mockState.togglePanelVisible, + }), +})); + +vi.mock("../context/CompanyContext", () => ({ + useCompany: () => ({ + selectedCompanyId: "company-1", + selectedCompany: { id: "company-1", issuePrefix: "PAP" }, + }), +})); + +vi.mock("@/plugins/slots", () => ({ + usePluginSlots: () => ({ slots: [] }), + PluginSlotOutlet: () => null, +})); + +vi.mock("@/plugins/launchers", () => ({ + usePluginLaunchers: () => ({ launchers: [] }), + PluginLauncherOutlet: () => null, +})); + +vi.mock("./coordinator/CoordinatorPresentation", () => ({ + useCoordinatorPresentation: () => false, +})); + +vi.mock("@/lib/router", async () => { + const actual = await vi.importActual("react-router-dom"); + return { + Link: ({ to, children, ...props }: { to: string; children: ReactNode } & React.ComponentProps<"a">) => ( + {children} + ), + useLocation: actual.useLocation, + }; +}); + +function SeedBreadcrumbs({ + crumbs, + panelControl = null, +}: { + crumbs: Breadcrumb[]; + panelControl?: BreadcrumbPanelControl | null; +}) { + const { setBreadcrumbs, setBreadcrumbPanelControl } = useBreadcrumbs(); + useEffect(() => { + setBreadcrumbs(crumbs); + setBreadcrumbPanelControl(panelControl); + }, [crumbs, panelControl, setBreadcrumbs, setBreadcrumbPanelControl]); + return null; +} + +describe("BreadcrumbBar mobile behavior", () => { + let container: HTMLDivElement; + let root: Root; + + beforeEach(() => { + mockState.isMobile = true; + mockState.panelVisible = false; + mockState.toggleSidebar.mockReset(); + mockState.togglePanelVisible.mockReset(); + container = document.createElement("div"); + document.body.appendChild(container); + root = createRoot(container); + }); + + afterEach(() => { + act(() => { + root.unmount(); + }); + container.remove(); + }); + + it("renders the properties toggle on a single-crumb mobile task trail when panel control is registered", () => { + const onToggle = vi.fn(); + act(() => { + root.render( + + + + + + , + ); + }); + + const toggle = container.querySelector('button[aria-label="Show properties"]'); + expect(toggle).not.toBeNull(); + act(() => { + toggle!.click(); + }); + expect(onToggle).toHaveBeenCalledTimes(1); + }); + + it("renders the properties toggle on a multi-crumb mobile subtask trail and shrinks ancestor before current crumb", () => { + const onToggle = vi.fn(); + act(() => { + root.render( + + + + + + , + ); + }); + + const toggle = container.querySelector('button[aria-label="Hide properties"]'); + expect(toggle).not.toBeNull(); + act(() => { + toggle!.click(); + }); + expect(onToggle).toHaveBeenCalledTimes(1); + + const items = [...container.querySelectorAll('[data-slot="breadcrumb-item"]')]; + expect(items).toHaveLength(2); + expect(items[0]!.className).toContain("max-w-24"); + expect(items[0]!.className).toContain("shrink"); + expect(items[0]!.className).not.toContain("shrink-0"); + expect(items[1]!.className).toContain("flex-1"); + expect(items[1]!.className).toContain("min-w-0"); + }); + + it("collapses leading root segments on mobile 3-segment trails so the current page label keeps width", () => { + act(() => { + root.render( + + + + + + , + ); + }); + + const items = [...container.querySelectorAll('[data-slot="breadcrumb-item"]')]; + expect(items).toHaveLength(2); + expect(items[0]!.textContent).toBe("Antigravity"); + expect(items[0]!.className).toContain("max-w-28"); + expect(items[0]!.className).not.toContain("shrink-0"); + expect(items[1]!.textContent).toBe("Identity"); + expect(items[1]!.className).toContain("flex-1"); + expect(items[1]!.className).toContain("min-w-0"); + }); +}); diff --git a/ui/src/components/BreadcrumbBar.tsx b/ui/src/components/BreadcrumbBar.tsx index dc09d363f38..c6307bd4ce3 100644 --- a/ui/src/components/BreadcrumbBar.tsx +++ b/ui/src/components/BreadcrumbBar.tsx @@ -78,11 +78,12 @@ export function BreadcrumbBar({ taskDetailLayout = false, showPropertiesToggle = const { selectedCompanyId, selectedCompany } = useCompany(); const taskPanelOpen = breadcrumbPanelControl?.open ?? panelVisible; const toggleTaskPanel = breadcrumbPanelControl?.onToggle ?? togglePanelVisible; - const propertiesToggle = showPropertiesToggle ? ( + const canToggleProperties = showPropertiesToggle || (isMobile && Boolean(breadcrumbPanelControl)); + const propertiesToggle = canToggleProperties ? (

{globalToolbarSlots} + {propertiesToggle} ); } @@ -165,8 +170,15 @@ export function BreadcrumbBar({ taskDetailLayout = false, showPropertiesToggle = const accessibleLabel = [crumb.label, crumb.identifier].filter(Boolean).join(" "); return ( - {i > 0 && } - + {i > 0 && } + {crumb.control ?? (isLast || !crumb.href ? ( crumb.leading || crumb.identifier ? ( @@ -265,7 +277,7 @@ export function BreadcrumbBar({ taskDetailLayout = false, showPropertiesToggle = {menuButton} {breadcrumbTrail} {globalToolbarSlots} - {isMobile && isTaskTrail ? null : propertiesToggle} + {propertiesToggle} ); } diff --git a/ui/src/components/IssueAttachmentsSection.tsx b/ui/src/components/IssueAttachmentsSection.tsx index 759bfa1ae1d..41aadfbdade 100644 --- a/ui/src/components/IssueAttachmentsSection.tsx +++ b/ui/src/components/IssueAttachmentsSection.tsx @@ -293,7 +293,7 @@ export function IssueAttachmentsSection({ )} {imageAttachments.length > 0 && ( -
+
{imageAttachments.map((attachment) => (
{ "| 2026-04-30T14:31:35Z | PAP-2505 | in_review_without_action_path | PAP-2779 | PAP-2910 |", ].join("\n")); - expect(html).toContain('class="paperclip-markdown-table-scroll"'); + expect(html).toContain('class="paperclip-markdown-table-scroll max-w-full overflow-x-auto"'); expect(html).toContain('aria-label="Scrollable table"'); expect(html).toContain('tabindex="0"'); expect(html).toContain(""); diff --git a/ui/src/components/MarkdownBody.tsx b/ui/src/components/MarkdownBody.tsx index ae784b31a6f..b43b248d833 100644 --- a/ui/src/components/MarkdownBody.tsx +++ b/ui/src/components/MarkdownBody.tsx @@ -860,7 +860,12 @@ function MarkdownBodyImpl({ ), table: ({ node: _node, style: tableStyle, children: tableChildren, ...tableProps }) => ( -
+
{tableChildren}
diff --git a/ui/src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx b/ui/src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx new file mode 100644 index 00000000000..577661e6ab1 --- /dev/null +++ b/ui/src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx @@ -0,0 +1,247 @@ +// @vitest-environment jsdom +import { act, type ReactNode } from "react"; +import { MemoryRouter } from "react-router-dom"; +import { createRoot, type Root } from "react-dom/client"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import type { AttentionItem } from "@paperclipai/shared"; +import { CoordinatorNeedsYou } from "./CoordinatorNeedsYou"; + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +const fixture = vi.hoisted(() => ({ + items: [] as AttentionItem[], + openPanel: vi.fn(), + closePanel: vi.fn(), + setPanelVisible: vi.fn(), + navigate: vi.fn(), +})); + +vi.mock("@/api/inboxDismissals", () => ({ + inboxDismissalsApi: { restore: vi.fn(async () => ({})), dismiss: vi.fn(async () => ({})) }, +})); +vi.mock("@/context/CompanyContext", () => ({ + useCompany: () => ({ selectedCompanyId: "company-1" }), +})); +vi.mock("@/context/BreadcrumbContext", () => ({ + useBreadcrumbs: () => ({ setBreadcrumbs: vi.fn() }), +})); +vi.mock("@/context/PanelContext", () => ({ + usePanel: () => ({ + openPanel: fixture.openPanel, + closePanel: fixture.closePanel, + setPanelVisible: fixture.setPanelVisible, + panelVisible: false, + }), +})); +vi.mock("@/context/SidebarContext", () => ({ + useSidebar: () => ({ isMobile: true }), +})); +vi.mock("@/hooks/useCoordinatorWorkspaceEnabled", () => ({ + useCoordinatorWorkspaceEnabled: () => ({ userId: "reviewer" }), +})); +vi.mock("@/lib/router", async (importOriginal) => ({ + ...(await importOriginal()), + useNavigate: () => fixture.navigate, +})); +vi.mock("@/api/agents", () => ({ + agentsApi: { list: async () => [] }, +})); +vi.mock("@/api/projects", () => ({ + projectsApi: { list: async () => [] }, +})); +vi.mock("@/api/access", () => ({ + accessApi: { + listUserDirectory: async () => ({ users: [] }), + getCurrentBoardAccess: async () => ({ + userId: "reviewer", + source: "session", + isInstanceAdmin: false, + companyIds: ["company-1"], + memberships: [{ companyId: "company-1", membershipRole: "admin", status: "active" }], + }), + }, +})); +vi.mock("@/api/attention", () => ({ + attentionApi: { + claim: vi.fn(async () => ({})), + close: vi.fn(async () => ({ until: null })), + list: async () => ({ + items: fixture.items, + viewCounts: { mine: fixture.items.length, unassigned: 0, company: 0, archived: 0, all: fixture.items.length }, + receipts: [], + }), + history: async () => ({ items: [], nextCursor: null }), + runHistory: async () => ({ items: [], nextCursor: null }), + }, +})); +vi.mock("motion/react", () => ({ + LayoutGroup: ({ children }: { children: ReactNode }) => children, + useReducedMotion: () => true, + motion: { + div: ({ children, id, tabIndex }: { children: ReactNode; id?: string; tabIndex?: number }) => ( +
{children}
+ ), + }, +})); +vi.mock("@/components/PropertiesPanel", () => ({ + PROPERTIES_PANE_HEADER_SLOT_ID: "test-sidebar", +})); +vi.mock("@/components/DecisionResolver", () => ({ + DecisionResolver: () => null, +})); +vi.mock("@/components/AttentionInteractionResolver", () => ({ + AttentionInteractionResolver: ({ artifactRow }: { artifactRow?: ReactNode }) => ( +
{artifactRow}
+ ), +})); +vi.mock("@/components/AttentionQueueRow", () => ({ + ApprovalResolver: ({ onViewDetails }: { onViewDetails?: () => void }) => ( + + ), + JoinRequestResolver: () => null, +})); +vi.mock("./CoordinatorReviewPanel", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + CoordinatorReviewPanel: ({ item, artifact }: { item: AttentionItem; artifact: { kind: string } }) => ( +
+ Reviewing {item.subject.title} ({artifact.kind}) +
+ ), + }; +}); + +describe("CoordinatorNeedsYou mobile review sheet", () => { + let container: HTMLDivElement; + let root: Root; + let client: QueryClient; + + beforeEach(() => { + fixture.items = []; + fixture.openPanel.mockReset(); + fixture.closePanel.mockReset(); + fixture.setPanelVisible.mockReset(); + fixture.navigate.mockReset(); + localStorage.clear(); + container = document.createElement("div"); + document.body.appendChild(container); + root = createRoot(container); + client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + }); + + afterEach(async () => { + await act(async () => root.unmount()); + client.clear(); + container.remove(); + }); + + async function renderInbox() { + await act(async () => { + root.render( + + + + + , + ); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 0)); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 0)); + }); + } + + it("opens approval details inside a mobile Sheet instead of disabling onViewDetails", async () => { + fixture.items = [ + { + id: "approval-1", + sourceKind: "approval", + inlineResolvable: true, + subject: { + id: "apr-1", + kind: "approval", + title: "Approve production deploy", + href: "/PAP/approvals/apr-1", + metadata: { type: "merge_pr" }, + }, + relatedIssue: { + id: "issue-1", + identifier: "PAP-101", + title: "Deploy release", + href: "/PAP/issues/PAP-101", + }, + project: null, + originAgentName: null, + activityAt: new Date("2026-08-02T14:00:00Z").toISOString(), + audience: { kind: "user", userId: "reviewer", reason: "addressee" }, + } as unknown as AttentionItem, + ]; + + await renderInbox(); + + const button = container.querySelector('[data-testid="approval-view-details"]'); + expect(button).not.toBeNull(); + expect(button!.disabled).toBe(false); + + await act(async () => { + button!.click(); + }); + + const sheet = document.querySelector('[data-testid="mobile-coordinator-review-sheet"]'); + expect(sheet).not.toBeNull(); + expect(sheet!.textContent).toContain("Reviewing Approve production deploy (approval)"); + expect(fixture.openPanel).not.toHaveBeenCalled(); + }); + + it("renders artifact rows on mobile and opens the artifact preview inside the mobile Sheet", async () => { + fixture.items = [ + { + id: "plan-1", + sourceKind: "issue_thread_interaction", + inlineResolvable: true, + subject: { + id: "intx-1", + kind: "interaction", + title: "Approve rollout plan", + href: "/PAP/issues/PAP-102#plan", + metadata: { kind: "request_confirmation", issueId: "issue-2", targetDocumentKey: "plan" }, + }, + relatedIssue: { + id: "issue-2", + identifier: "PAP-102", + title: "Rollout plan", + href: "/PAP/issues/PAP-102", + }, + project: null, + originAgentName: null, + activityAt: new Date("2026-08-02T14:30:00Z").toISOString(), + audience: { kind: "user", userId: "reviewer", reason: "addressee" }, + } as unknown as AttentionItem, + ]; + + await renderInbox(); + + const openArtifactButton = container.querySelector('button[aria-label="Open Plan"]'); + expect(openArtifactButton).not.toBeNull(); + + await act(async () => { + openArtifactButton!.click(); + }); + + const sheet = document.querySelector('[data-testid="mobile-coordinator-review-sheet"]'); + expect(sheet).not.toBeNull(); + expect(sheet!.textContent).toContain("Reviewing Approve rollout plan (document)"); + expect(fixture.openPanel).not.toHaveBeenCalled(); + }); +}); diff --git a/ui/src/components/coordinator/CoordinatorNeedsYou.tsx b/ui/src/components/coordinator/CoordinatorNeedsYou.tsx index 1590c6b9033..d95ea82fabf 100644 --- a/ui/src/components/coordinator/CoordinatorNeedsYou.tsx +++ b/ui/src/components/coordinator/CoordinatorNeedsYou.tsx @@ -3,7 +3,7 @@ import { InboxRunHistory } from "./InboxRunHistory"; import { QueryErrorState, useQueryView } from "@/components/QueryView"; import { useCallback, useEffect, useMemo, useState, type MouseEvent as ReactMouseEvent } from "react"; import { useQuery } from "@tanstack/react-query"; -import { ArrowLeft, ArrowUpRight, ChevronDown, FileText, Image as ImageIcon, Loader2 } from "lucide-react"; +import { ArrowLeft, ArrowUpRight, ChevronDown, FileText, Image as ImageIcon, Loader2, X } from "lucide-react"; import { LayoutGroup, motion, useReducedMotion } from "motion/react"; import { attentionCardType, type AttentionCloseMode, type AttentionItem, type AttentionPersonalView } from "@paperclipai/shared"; import { accessApi } from "@/api/access"; @@ -37,6 +37,7 @@ import { InboxFilter } from "@/components/InboxFilter"; import { ToolbarSearch } from "@/components/ToolbarSearch"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; +import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; import { parseCssTimeMs } from "@/components/task-chat/motion-tokens"; import { timeAgo } from "@/lib/timeAgo"; import { CoordinatorDecisionReceipt as Receipt } from "./CoordinatorDecisionReceipt"; @@ -289,15 +290,18 @@ export function CoordinatorNeedsYou() { const showReview = useCallback((item: AttentionItem, artifact?: NeedsYouArtifact | null) => { openReviewTab(needsYouReviewTab(item, artifact)); setReviewPanelOpen(true); - setPanelVisible(true); - }, [openReviewTab, setPanelVisible]); + if (!isMobile) setPanelVisible(true); + }, [isMobile, openReviewTab, setPanelVisible]); // The frame's close control hides the panel; its tabs come back with the next Review. - useEffect(() => { if (!panelVisible) setReviewPanelOpen(false); }, [panelVisible]); + useEffect(() => { if (!isMobile && !panelVisible) setReviewPanelOpen(false); }, [isMobile, panelVisible]); // A resolved or closed card's tabs close with it. useEffect(() => { const open = new Set(pendingItems.map(item => item.id)); for (const tab of reviewTabs.tabs) if (!open.has(tab.payload.itemId)) closeReviewTab(tab.id); }, [pendingItems, reviewTabs.tabs, closeReviewTab]); + useEffect(() => { + if (isMobile && reviewPanelOpen && reviewTabs.tabs.length === 0) setReviewPanelOpen(false); + }, [isMobile, reviewPanelOpen, reviewTabs.tabs.length]); useEffect(() => { setBreadcrumbs([{ label: "Inbox" }]); }, [setBreadcrumbs]); useEffect(() => { setSettling([]); setReviewPanelOpen(false); resetReviewTabs({ tabs: [], activeTabId: null }); setNow(Date.now()); closePanel(); @@ -344,9 +348,9 @@ export function CoordinatorNeedsYou() { const phase = !receipt ? "pending" : ["cancelled", "expired"].includes(receipt.outcome) ? "closed" : "resolved"; const refetchAll = () => { void feed.refetch(); void recent.refetch(); }; // Focus (PAP-770, PAP-775 IA5): a card about an artifact opens it beside the card. - const artifact = isMobile ? null : needsYouArtifact(item); + const artifact = needsYouArtifact(item); // The card stays highlighted while any of its artifacts is open beside it (UI9). - const panelOpen = !isMobile && reviewPanelOpen && panelVisible; + const panelOpen = reviewPanelOpen && (isMobile || panelVisible); const activeTab = panelOpen ? reviewTabs.tabs.find(tab => tab.id === reviewTabs.activeTabId) : undefined; const reviewing = !!activeTab && activeTab.payload.itemId === item.id; const reviewingOwn = !!artifact && panelOpen && reviewTabs.activeTabId === needsYouReviewTabId(item); @@ -354,14 +358,14 @@ export function CoordinatorNeedsYou() { const artifactRow = artifact && artifact.kind !== "approval" ? : } title={artifact.kind === "document" && !artifact.title ? (artifact.key === "plan" ? "Plan" : documentKeyLabel(artifact.key)) : needsYouArtifactLabel(artifact)} - meta={reviewingOwn ? "Open in sidebar · Showing" : "Open in sidebar"} - label={`${reviewingOwn ? "Close" : "Open"} ${needsYouArtifactLabel(artifact)} in the sidebar`} + meta={isMobile ? (reviewingOwn ? "Showing details" : "View details") : (reviewingOwn ? "Open in sidebar · Showing" : "Open in sidebar")} + label={isMobile ? `${reviewingOwn ? "Close" : "Open"} ${needsYouArtifactLabel(artifact)}` : `${reviewingOwn ? "Close" : "Open"} ${needsYouArtifactLabel(artifact)} in the sidebar`} onOpen={() => reviewingOwn ? closeReviewTab(needsYouReviewTabId(item)) : showReview(item)} /> : null; // A plan, document, approval or attachment the card links to opens as a // side-panel tab beside the card, not a page change (PAP-775, IA5). // A modified click still opens the link itself. const openMentionedDocument = (event: ReactMouseEvent) => { - if (isMobile || event.defaultPrevented || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) return; + if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) return; const link = (event.target as HTMLElement).closest("a[href]"); const mentioned = link ? needsYouMentionedArtifact(link.getAttribute("href")!, link.textContent) : null; if (!mentioned) return; @@ -410,7 +414,7 @@ export function CoordinatorNeedsYou() { : stalledReview ? <>

Choose how this task continues

This task is still in review with no active reviewer or continuation. Return it to work, request changes, or mark the task done.

: failedRun ? <>{heading} : budget ? <>{heading} - : approval ? <>{heading} showReview(item)} shareDraft onResolved={() => onResolved(item)} /> + : approval ? <>{heading} showReview(item)} shareDraft onResolved={() => onResolved(item)} /> : joinRequest ? <>{heading} onResolved(item)} /> : type === "review_task" ? <>{heading} : type === "blocked_task" ? <>{heading} @@ -452,6 +456,16 @@ export function CoordinatorNeedsYou() { const sectionHeading = (section: NeedsYouSection) =>

{NEEDS_YOU_SECTIONS[section].title}

; + const mobileActiveTab = isMobile && reviewPanelOpen + ? reviewTabs.tabs.find(tab => tab.id === reviewTabs.activeTabId) ?? reviewTabs.tabs[0] ?? null + : null; + const mobileActiveItem = mobileActiveTab + ? pendingItems.find(entry => entry.id === mobileActiveTab.payload.itemId) ?? null + : null; + const mobileActiveArtifact = mobileActiveTab && mobileActiveItem + ? needsYouTabArtifact(mobileActiveItem, mobileActiveTab.payload) + : null; + return
{archivedView ?

Archived

: null}
@@ -507,5 +521,70 @@ export function CoordinatorNeedsYou() { setSnoozedOpen(open => !open)}> + { if (!open) setReviewPanelOpen(false); }}> + + + {mobileActiveTab?.label ?? "Review"} + + {reviewTabs.tabs.length > 1 ? ( +
+ {reviewTabs.tabs.map((tab) => { + const selected = tab.id === mobileActiveTab?.id; + return ( +
+ + +
+ ); + })} +
+ ) : null} +
+ {mobileActiveTab && mobileActiveItem && mobileActiveArtifact ? ( + { + setReviewPanelOpen(false); + navigate(href); + }} + onResolved={() => { + closeReviewTab(mobileActiveTab.id); + if (reviewTabs.tabs.length <= 1) setReviewPanelOpen(false); + }} + /> + ) : ( +

This is no longer waiting on you.

+ )} +
+
+
; } diff --git a/ui/src/components/issue-output/IssueOutputSection.tsx b/ui/src/components/issue-output/IssueOutputSection.tsx index db57d791d17..496f6edb586 100644 --- a/ui/src/components/issue-output/IssueOutputSection.tsx +++ b/ui/src/components/issue-output/IssueOutputSection.tsx @@ -137,7 +137,7 @@ export function IssueOutputSection({ workProducts, resolveCreatorName, onMediaCl

Also produced

{mediaRest.length > 0 ? ( -
+
{mediaRest.map((item) => (
({ + Link: ({ to, children, ...props }: { to: string; children: React.ReactNode } & React.ComponentProps<"a">) => ( + {children} + ), + useLocation: () => ({ pathname: "/PAP/issues/PAP-1", search: "", hash: "", state: null }), +})); + +vi.mock("@/hooks/useArtifactsV1Enabled", () => ({ + useArtifactsV1Enabled: () => ({ enabled: false }), +})); + +vi.mock("@/hooks/useAgentChatRead", () => ({ + useAgentChatRead: () => () => undefined, +})); + +vi.mock("@/components/coordinator/CoordinatorPresentation", () => ({ + useCoordinatorPresentation: () => false, +})); + +vi.mock("@/components/EmailMessageCard", () => ({ + useEmailComment: () => null, +})); + +describe("Responsive media grids and chat bubble table containment", () => { + it("uses grid-cols-2 sm:grid-cols-4 in IssueOutputSection media grids", () => { + const now = new Date("2026-08-01T12:00:00Z"); + const makeImage = (id: string, attachmentId: string, filename: string): IssueWorkProduct => ({ + id, + companyId: "company-1", + projectId: null, + issueId: "issue-1", + executionWorkspaceId: null, + runtimeServiceId: null, + type: "artifact", + provider: "paperclip", + externalId: id, + title: filename, + url: `/api/attachments/${attachmentId}/content`, + status: "active", + reviewState: "none", + isPrimary: id === "wp-1", + healthStatus: "unknown", + summary: null, + metadata: { + attachmentId, + contentPath: `/api/attachments/${attachmentId}/content`, + openPath: `/api/attachments/${attachmentId}/content`, + downloadPath: `/api/attachments/${attachmentId}/content?download=1`, + contentType: "image/png", + byteSize: 1024, + originalFilename: filename, + }, + createdByRunId: null, + createdAt: now, + updatedAt: now, + }); + + const html = renderToStaticMarkup( + , + ); + + expect(html).toContain("grid grid-cols-2 gap-2 sm:grid-cols-4"); + expect(html).not.toContain('class="grid grid-cols-4 gap-2"'); + }); + + it("uses grid-cols-2 sm:grid-cols-4 in IssueAttachmentsSection image grids", () => { + const attachments: IssueAttachment[] = [ + { + id: "att-1", + companyId: "company-1", + issueId: "issue-1", + issueCommentId: null, + assetId: "asset-1", + provider: "local", + objectKey: "att-1.png", + contentType: "image/png", + byteSize: 2048, + sha256: "abc", + originalFilename: "shot-1.png", + createdByAgentId: null, + createdByUserId: null, + createdAt: new Date("2026-08-01T12:00:00Z"), + updatedAt: new Date("2026-08-01T12:00:00Z"), + contentPath: "/api/attachments/att-1/content", + }, + ]; + + const html = renderToStaticMarkup( + + undefined} /> + , + ); + + expect(html).toContain("grid grid-cols-2 gap-2 sm:grid-cols-4"); + expect(html).not.toContain('class="grid grid-cols-4 gap-2"'); + }); + + it("keeps TaskChatBubble flex containers min-w-0 max-w-full and uses responsive 2-to-4 column media grids", () => { + const html = renderToStaticMarkup( + + + + + , + ); + + expect(html).toContain("flex w-full min-w-0 flex-col gap-1"); + expect(html).toContain("min-w-0 max-w-full break-words py-2 text-sm"); + expect(html).toContain("paperclip-markdown-table-scroll max-w-full overflow-x-auto"); + expect(html).toContain("grid grid-cols-2 gap-2 sm:grid-cols-4"); + }); +}); diff --git a/ui/src/components/task-chat/TaskChatBubble.tsx b/ui/src/components/task-chat/TaskChatBubble.tsx index 780aad8f305..97b6ea1a0e8 100644 --- a/ui/src/components/task-chat/TaskChatBubble.tsx +++ b/ui/src/components/task-chat/TaskChatBubble.tsx @@ -275,7 +275,7 @@ function TaskChatBubbleContent({ data-conversation-message={isHuman ? "human" : "agent"} ref={readRef} className={cn( - "flex w-full flex-col gap-1", + "flex w-full min-w-0 flex-col gap-1", animateEntry && "tc-enter-bubble", isOwnMessage ? "items-end" : "items-start", )} @@ -306,7 +306,7 @@ function TaskChatBubbleContent({ isHuman ? "task-chat-human-bubble" : "task-chat-agent-bubble" } className={cn( - "break-words py-2 text-sm", + "min-w-0 max-w-full break-words py-2 text-sm", isOwnMessage ? "max-w-(--pct-85) rounded-2xl rounded-br-sm bg-(--liveness-blue) px-3.5 text-white" : "w-full bg-transparent px-1 text-foreground", @@ -336,7 +336,7 @@ function TaskChatBubbleContent({ Images · {imageRefs.length} -
+
{imageRefs .slice(0, imageRefs.length > 4 ? 3 : 4) .map((ref, index) => ( diff --git a/ui/src/pages/CaseDetail.mobile.test.tsx b/ui/src/pages/CaseDetail.mobile.test.tsx new file mode 100644 index 00000000000..4d7dd9dae5c --- /dev/null +++ b/ui/src/pages/CaseDetail.mobile.test.tsx @@ -0,0 +1,121 @@ +// @vitest-environment jsdom +import { act, type ReactNode } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { MemoryRouter, Route, Routes } from "react-router-dom"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { CaseDetail } from "./CaseDetail"; + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +const caseFixture = { + id: "case-1", + companyId: "company-1", + projectId: null, + caseNumber: 4, + identifier: "PAP-C4", + caseType: "support", + key: "plain-thread-1", + title: "Investigate escalation (Plain th_01M7V3SF2W8R79ABCDEF0123456789)", + summary: "Unbroken token summary_th_01M7V3SF2W8R79ABCDEF0123456789", + status: "in_review", + fields: {}, + parentCaseId: null, + parent: null, + labels: [], + documents: [], + taskDocuments: [], + attachments: [], + issueLinks: [], + workIssueId: null, + createdByAgentId: null, + createdByUserId: null, + completedAt: null, + createdAt: "2026-08-01T10:00:00Z", + updatedAt: "2026-08-01T10:00:00Z", +}; + +vi.mock("@/api/cases", () => ({ + casesApi: { + get: vi.fn(async () => caseFixture), + listChildren: vi.fn(async () => []), + }, + caseAttachmentUrl: () => "", + isImageAttachment: () => false, +})); + +vi.mock("@/api/agents", () => ({ + agentsApi: { list: vi.fn(async () => []) }, +})); + +vi.mock("@/api/projects", () => ({ + projectsApi: { get: vi.fn(async () => null) }, +})); + +vi.mock("@/context/BreadcrumbContext", () => ({ + useBreadcrumbs: () => ({ setBreadcrumbs: vi.fn() }), +})); + +vi.mock("@/components/cases/CaseWorkSummary", () => ({ + CaseWorkSummary: () => null, +})); + +vi.mock("@/components/cases/CaseHandoffHistory", () => ({ + CaseHandoffHistory: () => null, +})); + +vi.mock("@/lib/router", async () => { + const actual = await vi.importActual("react-router-dom"); + return { + ...actual, + Link: ({ to, children, ...props }: { to: string; children: ReactNode } & React.ComponentProps<"a">) => ( + {children} + ), + useCaseHref: () => (identifier?: string) => (identifier ? `/cases/${identifier}` : "/cases"), + }; +}); + +describe("CaseDetail mobile wrapping", () => { + let container: HTMLDivElement; + let root: Root; + let client: QueryClient; + + beforeEach(() => { + container = document.createElement("div"); + document.body.appendChild(container); + root = createRoot(container); + client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + }); + + afterEach(() => { + act(() => { + root.unmount(); + }); + client.clear(); + container.remove(); + }); + + it("applies break-words, wrap-anywhere, and min-w-0 to the CaseDetail heading so unbroken IDs cannot overflow 390px", async () => { + await act(async () => { + root.render( + + + + } /> + + + , + ); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 0)); + }); + + const heading = container.querySelector("h1"); + expect(heading).not.toBeNull(); + expect(heading!.textContent).toContain("th_01M7V3SF2W8R79ABCDEF0123456789"); + expect(heading!.className).toContain("min-w-0"); + expect(heading!.className).toContain("break-words"); + expect(heading!.className).toContain("wrap-anywhere"); + }); +}); diff --git a/ui/src/pages/CaseDetail.tsx b/ui/src/pages/CaseDetail.tsx index 07bb4bc3a40..131ec2c54cb 100644 --- a/ui/src/pages/CaseDetail.tsx +++ b/ui/src/pages/CaseDetail.tsx @@ -95,14 +95,14 @@ export function CaseDetail() { const files = caseData.attachments.filter(attachment => !isImageAttachment(attachment)); const children = childrenQuery.data ?? []; - return
-
+ return
+
{caseData.caseType}
-

{caseData.title}

- {caseData.summary &&

{caseData.summary}

} +

{caseData.title}

+ {caseData.summary &&

{caseData.summary}

} {caseData.labels.length > 0 &&
{caseData.labels.map(label => {label.name})}
}
diff --git a/ui/src/pages/GoalDetail.mobile.test.tsx b/ui/src/pages/GoalDetail.mobile.test.tsx new file mode 100644 index 00000000000..59d4ca2e7ad --- /dev/null +++ b/ui/src/pages/GoalDetail.mobile.test.tsx @@ -0,0 +1,144 @@ +// @vitest-environment jsdom +import { act, type ReactNode } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { MemoryRouter, Route, Routes } from "react-router-dom"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { GoalDetail } from "./GoalDetail"; + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +const goalFixture = { + id: "goal-1", + companyId: "company-1", + title: "Ship mobile parity", + description: "Make goal properties accessible on mobile.", + level: "company", + status: "active", + parentId: null, + ownerAgentId: null, + createdAt: new Date("2026-08-01T10:00:00Z"), + updatedAt: new Date("2026-08-01T10:00:00Z"), +}; + +vi.mock("../api/goals", () => ({ + goalsApi: { + get: vi.fn(async () => goalFixture), + list: vi.fn(async () => [goalFixture]), + update: vi.fn(async () => goalFixture), + }, +})); + +vi.mock("../api/projects", () => ({ + projectsApi: { + list: vi.fn(async () => []), + }, +})); + +vi.mock("../api/assets", () => ({ + assetsApi: { + uploadImage: vi.fn(), + }, +})); + +vi.mock("../context/CompanyContext", () => ({ + useCompany: () => ({ + selectedCompanyId: "company-1", + setSelectedCompanyId: vi.fn(), + }), +})); + +vi.mock("../context/DialogContext", () => ({ + useDialogActions: () => ({ + openNewGoal: vi.fn(), + }), +})); + +vi.mock("../context/PanelContext", () => ({ + usePanel: () => ({ + openPanel: vi.fn(), + closePanel: vi.fn(), + panelVisible: false, + setPanelVisible: vi.fn(), + }), +})); + +vi.mock("../context/BreadcrumbContext", () => ({ + useBreadcrumbs: () => ({ + setBreadcrumbs: vi.fn(), + }), +})); + +vi.mock("../components/GoalProperties", () => ({ + GoalProperties: ({ goal }: { goal: { title: string } }) => ( +
Goal properties for {goal.title}
+ ), +})); + +vi.mock("../components/InlineEditor", () => ({ + InlineEditor: ({ value, as: Tag = "div", className }: { value: string; as?: "h2" | "p" | "div"; className?: string }) => ( + {value} + ), +})); + +vi.mock("@/lib/router", async () => { + const actual = await vi.importActual("react-router-dom"); + return { + ...actual, + Link: ({ to, children, ...props }: { to: string; children: ReactNode } & React.ComponentProps<"a">) => ( + {children} + ), + }; +}); + +describe("GoalDetail mobile properties sheet", () => { + let container: HTMLDivElement; + let root: Root; + let client: QueryClient; + + beforeEach(() => { + container = document.createElement("div"); + document.body.appendChild(container); + root = createRoot(container); + client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + }); + + afterEach(() => { + act(() => { + root.unmount(); + }); + client.clear(); + container.remove(); + }); + + it("renders a mobile Properties trigger button and opens GoalProperties inside a mobile Sheet", async () => { + await act(async () => { + root.render( + + + + } /> + + + , + ); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 0)); + }); + + const trigger = container.querySelector('button[aria-label="Properties"]'); + expect(trigger).not.toBeNull(); + expect(trigger!.className).toContain("md:hidden"); + + expect(document.querySelector('[data-testid="mobile-goal-properties-sheet"]')).toBeNull(); + + await act(async () => { + trigger!.click(); + }); + + const sheet = document.querySelector('[data-testid="mobile-goal-properties-sheet"]'); + expect(sheet).not.toBeNull(); + expect(sheet!.textContent).toContain("Goal properties for Ship mobile parity"); + }); +}); diff --git a/ui/src/pages/GoalDetail.tsx b/ui/src/pages/GoalDetail.tsx index edfce1697e9..3f01b7098dc 100644 --- a/ui/src/pages/GoalDetail.tsx +++ b/ui/src/pages/GoalDetail.tsx @@ -1,5 +1,5 @@ import { companyProjectsQuery } from "@/lib/company-projects-query"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useParams } from "@/lib/router"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { goalsApi } from "../api/goals"; @@ -18,6 +18,8 @@ import { PageSkeleton } from "../components/PageSkeleton"; import { QueryErrorState, useQueryView } from "../components/QueryView"; import { cn, projectUrl } from "../lib/utils"; import { Button } from "@/components/ui/button"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Plus, SlidersHorizontal } from "lucide-react"; import type { Goal, Project } from "@paperclipai/shared"; @@ -40,6 +42,7 @@ export function GoalPropertiesToggleButton({ panelVisible ? "opacity-0 pointer-events-none w-0 overflow-hidden" : "opacity-100", )} onClick={onShowProperties} + aria-label="Show properties" title="Show properties" > @@ -54,6 +57,7 @@ export function GoalDetail() { const { openPanel, closePanel, panelVisible, setPanelVisible } = usePanel(); const { setBreadcrumbs } = useBreadcrumbs(); const queryClient = useQueryClient(); + const [mobilePropsOpen, setMobilePropsOpen] = useState(false); const goalQuery = useQuery({ queryKey: queryKeys.goals.detail(goalId!), @@ -147,7 +151,17 @@ export function GoalDetail() { {goal.level} -
+
+ setPanelVisible(true)} @@ -222,6 +236,26 @@ export function GoalDetail() { )} + + + + + Properties + + +
+ updateGoal.mutate(data)} + /> +
+
+
+
); } diff --git a/ui/src/pages/IssueDetail.mobile.test.tsx b/ui/src/pages/IssueDetail.mobile.test.tsx new file mode 100644 index 00000000000..08e950498f1 --- /dev/null +++ b/ui/src/pages/IssueDetail.mobile.test.tsx @@ -0,0 +1,399 @@ +// @vitest-environment jsdom +import { act, type ReactNode } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { MemoryRouter, Route, Routes } from "react-router-dom"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import type { Agent, Issue } from "@paperclipai/shared"; +import { BreadcrumbBar } from "../components/BreadcrumbBar"; +import { BreadcrumbProvider } from "../context/BreadcrumbContext"; +import { PanelProvider } from "../context/PanelContext"; +import { ThemeProvider } from "../context/ThemeContext"; +import { ToastProvider } from "../context/ToastContext"; +import { DialogProvider } from "../context/DialogContext"; +import { IssueDetail, TaskDetailSurface } from "./IssueDetail"; + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +const COMPANY_ID = "company-1"; +const AGENT: Agent = { + id: "agent-cos", + companyId: COMPANY_ID, + name: "Chief of Staff", + urlKey: "chief-of-staff", + role: "ceo", + title: "Chief of Staff", + icon: null, + status: "idle", + reportsTo: null, + capabilities: null, + adapterType: "claude_local", + adapterConfig: {}, + runtimeConfig: {}, + budgetMonthlyCents: 0, + spentMonthlyCents: 0, + pauseReason: null, + pausedAt: null, + permissions: { canCreateAgents: false }, + lastHeartbeatAt: null, + metadata: null, + createdAt: new Date("2026-08-01T10:00:00Z"), + updatedAt: new Date("2026-08-01T10:00:00Z"), +}; + +const BASE_ISSUE: Issue = { + id: "11111111-1111-4111-8111-111111111111", + companyId: COMPANY_ID, + projectId: null, + projectWorkspaceId: null, + goalId: null, + parentId: null, + title: "Streamlined mobile task detail test", + description: "Verify mobile Properties sheet and More task actions menu.", + status: "in_progress", + priority: "medium", + reviewPolicy: null, + assigneeAgentId: AGENT.id, + assigneeUserId: null, + responsibleUserId: null, + checkoutRunId: null, + executionRunId: null, + executionAgentNameKey: null, + executionLockedAt: null, + createdByAgentId: null, + createdByUserId: "user-1", + issueNumber: 6794, + identifier: "PAP-6794", + originKind: "manual", + originId: null, + originRunId: null, + requestDepth: 0, + billingCode: null, + assigneeAdapterOverrides: null, + executionPolicy: null, + executionState: null, + executionWorkspaceId: null, + executionWorkspacePreference: null, + executionWorkspaceSettings: null, + startedAt: null, + completedAt: null, + cancelledAt: null, + hiddenAt: null, + project: null, + goal: null, + currentExecutionWorkspace: null, + workProducts: [], + mentionedProjects: [], + myLastTouchAt: null, + lastExternalCommentAt: null, + lastActivityAt: null, + isUnreadForMe: false, + workMode: "standard", + createdAt: new Date("2026-08-01T10:00:00Z"), + updatedAt: new Date("2026-08-01T10:00:00Z"), +}; + +const CHAT_ISSUE: Issue = { + ...BASE_ISSUE, + id: "22222222-2222-4222-8222-222222222222", + identifier: "PAP-9001", + title: "Chat with Chief of Staff", + conversationAgentId: AGENT.id, +}; + +const testState = vi.hoisted(() => ({ + issue: null as Issue | null, +})); + +vi.mock("../context/SidebarContext", () => ({ + useSidebar: () => ({ + isMobile: true, + sidebarOpen: false, + setSidebarOpen: vi.fn(), + toggleSidebar: vi.fn(), + }), +})); + +vi.mock("../context/CompanyContext", () => ({ + useCompany: () => ({ + selectedCompanyId: COMPANY_ID, + selectedCompany: { id: COMPANY_ID, name: "Paperclip", issuePrefix: "PAP" }, + companies: [{ id: COMPANY_ID, name: "Paperclip", issuePrefix: "PAP" }], + setSelectedCompanyId: vi.fn(), + }), + useOptionalCompany: () => ({ + selectedCompanyId: COMPANY_ID, + selectedCompany: { id: COMPANY_ID, name: "Paperclip", issuePrefix: "PAP" }, + companies: [{ id: COMPANY_ID, name: "Paperclip", issuePrefix: "PAP" }], + }), +})); + +vi.mock("../context/LiveUpdatesProvider", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + useTaskRunLiveUpdates: () => ({ + subscribe: () => () => undefined, + }), + useTranscriptLiveStream: () => ({ + events: [], + connected: false, + }), + }; +}); + +vi.mock("../context/DesignSandboxContext", () => ({ + useDesignSandbox: () => false, +})); + +vi.mock("../hooks/useStreamlinedUiEnabled", () => ({ + useStreamlinedUiEnabled: () => ({ enabled: true, loaded: true }), +})); + +vi.mock("../hooks/useClassicTaskInterfaceEnabled", () => ({ + useClassicTaskInterfaceEnabled: () => ({ enabled: false, loaded: true }), +})); + +vi.mock("@/hooks/useCoordinatorWorkspaceEnabled", () => ({ + useCoordinatorWorkspaceEnabled: () => ({ enabled: false, loaded: true, userId: "user-1" }), +})); + +vi.mock("@/plugins/slots", () => ({ + usePluginSlots: () => ({ slots: [] }), + PluginSlotOutlet: () => null, + PluginSlotMount: () => null, +})); + +vi.mock("@/plugins/launchers", () => ({ + usePluginLaunchers: () => ({ launchers: [] }), + PluginLauncherOutlet: () => null, +})); + +vi.mock("../components/task-side-panel", () => ({ + TaskSidePanel: ({ issue, onRequestClose }: { issue: Issue; onRequestClose?: () => void }) => ( +
+ Side panel for {issue.identifier} + {onRequestClose ? : null} +
+ ), +})); + +vi.mock("@/lib/router", async () => { + const actual = await vi.importActual("react-router-dom"); + return { + ...actual, + Link: ({ to, children, ...props }: { to: string; children: ReactNode } & React.ComponentProps<"a">) => ( + {children} + ), + }; +}); + +function installMockFetch() { + const originalFetch = globalThis.fetch; + globalThis.fetch = vi.fn(async (input: RequestInfo | URL) => { + const rawUrl = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url; + const pathname = new URL(rawUrl, "http://localhost").pathname; + const json = (data: unknown) => + new Response(JSON.stringify(data), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + + if (pathname === "/api/auth/get-session") { + return json({ session: { userId: "user-1" }, user: { id: "user-1", name: "Riley Board" } }); + } + if (pathname === "/api/instance/settings/experimental") { + return json({ enableStreamlinedUi: true, enableAgentChat: true }); + } + if (pathname === "/api/workspace-preferences/me") { + return json({ userId: "user-1", coordinatorWorkspaceEnabled: false, updatedAt: null }); + } + if (pathname === "/api/cli-auth/me") { + return json({ source: "local_implicit", isInstanceAdmin: true, companyIds: [COMPANY_ID], memberships: [] }); + } + if (pathname === `/api/companies/${COMPANY_ID}/agents`) { + return json([AGENT]); + } + if (pathname === `/api/companies/${COMPANY_ID}/access/user-directory`) { + return json({ users: [{ principalId: "user-1", status: "active", user: { name: "Riley Board" } }] }); + } + if (/^\/api\/issues\/[^/]+$/.test(pathname)) { + return json(testState.issue ?? BASE_ISSUE); + } + if (/^\/api\/issues\/[^/]+\/recent-comments$/.test(pathname)) { + return json({ comments: [], hasMore: false, latestCommentId: null }); + } + if (/^\/api\/issues\/[^/]+\/queued-comments$/.test(pathname)) { + return json({ queues: [], items: [], revision: "rev-1" }); + } + if (/^\/api\/issues\/[^/]+\/tree-control\/state$/.test(pathname)) { + return json({ activePauseHold: null }); + } + if (/^\/api\/issues\/[^/]+\/documents\/plan$/.test(pathname)) { + return new Response(JSON.stringify({ error: "Not found" }), { + status: 404, + headers: { "Content-Type": "application/json" }, + }); + } + if (/^\/api\/issues\/[^/]+\/(active-run|runner-goal)$/.test(pathname)) { + return json(null); + } + if (/^\/api\/companies\/[^/]+\/email\/tasks\/[^/]+$/.test(pathname)) { + return json(null); + } + return json([]); + }) as typeof fetch; + + return () => { + globalThis.fetch = originalFetch; + }; +} + +describe("IssueDetail & AgentChat mobile parity", () => { + let container: HTMLDivElement; + let root: Root; + let client: QueryClient; + let restoreFetch: () => void; + + beforeEach(() => { + testState.issue = BASE_ISSUE; + restoreFetch = installMockFetch(); + if (!globalThis.ResizeObserver) { + globalThis.ResizeObserver = class ResizeObserver { + observe() {} + unobserve() {} + disconnect() {} + }; + } + Object.defineProperty(HTMLElement.prototype, "scrollIntoView", { + configurable: true, + writable: true, + value: vi.fn(), + }); + container = document.createElement("div"); + document.body.appendChild(container); + root = createRoot(container); + client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + }); + + afterEach(async () => { + await act(async () => root.unmount()); + client.clear(); + container.remove(); + restoreFetch(); + }); + + async function flush() { + for (let i = 0; i < 6; i++) { + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 10)); + }); + } + } + + function Harness({ children, initialEntry }: { children: ReactNode; initialEntry: string }) { + return ( + + + + + + + + {children} + + + + + + + + ); + } + + it("exposes mobile Properties sheet trigger, BreadcrumbBar properties toggle, and More task actions menu on Streamlined IssueDetail", async () => { + await act(async () => { + root.render( + + + + } /> + + , + ); + }); + await flush(); + + const moreButton = container.querySelector('button[aria-label="More task actions"]'); + expect(moreButton).not.toBeNull(); + expect(moreButton!.closest(".hidden")).toBeNull(); + + await act(async () => { + moreButton!.click(); + }); + await flush(); + expect(document.body.textContent).toContain("Add subtask"); + expect(document.body.textContent).toContain("Copy as markdown"); + expect(document.body.textContent).toContain("Hide this task"); + + const mobilePropsBtn = container.querySelector('button[aria-label="Properties"]'); + expect(mobilePropsBtn).not.toBeNull(); + expect(document.querySelector('[data-testid="mobile-task-side-panel"]')).toBeNull(); + + await act(async () => { + mobilePropsBtn!.click(); + }); + await flush(); + expect(document.querySelector('[data-testid="mobile-task-side-panel"]')).not.toBeNull(); + expect(document.querySelector('[data-testid="task-side-panel-sentinel"]')?.textContent).toContain("PAP-6794"); + + const hideToggle = container.querySelector('button[aria-label="Hide properties"]'); + expect(hideToggle).not.toBeNull(); + await act(async () => { + hideToggle!.click(); + }); + await flush(); + expect(document.querySelector('[data-testid="mobile-task-side-panel"]')).toBeNull(); + + const showToggle = container.querySelector('button[aria-label="Show properties"]'); + expect(showToggle).not.toBeNull(); + await act(async () => { + showToggle!.click(); + }); + await flush(); + expect(document.querySelector('[data-testid="mobile-task-side-panel"]')).not.toBeNull(); + }); + + it("opens the mobile properties Sheet when clicking Show properties on mobile AgentChat", async () => { + testState.issue = CHAT_ISSUE; + + await act(async () => { + root.render( + + + CHAT_ISSUE, + }} + /> + , + ); + }); + await flush(); + + const showToggle = container.querySelector('button[aria-label="Show properties"]'); + expect(showToggle).not.toBeNull(); + expect(document.querySelector('[data-testid="mobile-task-side-panel"]')).toBeNull(); + + await act(async () => { + showToggle!.click(); + }); + await flush(); + + expect(document.querySelector('[data-testid="mobile-task-side-panel"]')).not.toBeNull(); + expect(document.querySelector('[data-testid="task-side-panel-sentinel"]')?.textContent).toContain("PAP-9001"); + expect(container.querySelector('button[aria-label="Hide properties"]')).not.toBeNull(); + }); +}); diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx index 156e436a985..906e009df7a 100644 --- a/ui/src/pages/IssueDetail.tsx +++ b/ui/src/pages/IssueDetail.tsx @@ -4257,12 +4257,17 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS onArrival: registerArtifactTab, }); const toggleTaskSidePanel = useCallback(() => { + if (isMobile) { + setMobilePropsOpen((open) => !open); + return; + } if (!panelVisible || suppressPanelUntilPlan) { openTaskSidePanel(); return; } setPanelVisible(false); }, [ + isMobile, openTaskSidePanel, panelVisible, setPanelVisible, @@ -6164,19 +6169,22 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS ]); useEffect(() => { - if (!streamlinedTaskDetailEnabled || !taskChatShellEnabled || !issue?.id) { + if ((!streamlinedTaskDetailEnabled && !isAgentChatRoute) || !taskChatShellEnabled || !issue?.id) { setBreadcrumbPanelControl(null); return; } setBreadcrumbPanelControl({ - open: panelVisible && !suppressPanelUntilPlan, + open: isMobile ? mobilePropsOpen : panelVisible && !suppressPanelUntilPlan, onToggle: toggleTaskSidePanel, }); return () => setBreadcrumbPanelControl(null); }, [ + isAgentChatRoute, + isMobile, issue?.id, + mobilePropsOpen, panelVisible, setBreadcrumbPanelControl, streamlinedTaskDetailEnabled, @@ -7785,7 +7793,12 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS )} > {streamlinedTaskDetailEnabled ? ( -
+
{!proposedTaskHeader ? (
{issueStatusControl}
) : null} @@ -8067,14 +8080,31 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS /> ) : null} -
- +
+ {streamlinedTaskDetailEnabled && !(isMobile && isFromInbox) ? ( + + ) : null} + )} -
diff --git a/ui/storybook/stories/agent-chat/agent-chat.stories.tsx b/ui/storybook/stories/agent-chat/agent-chat.stories.tsx index 4eeeb7dab43..55ae94c8ba7 100644 --- a/ui/storybook/stories/agent-chat/agent-chat.stories.tsx +++ b/ui/storybook/stories/agent-chat/agent-chat.stories.tsx @@ -119,3 +119,10 @@ export const Coordinator: Story = { }, }, }; + +export const AgentChatMobile: Story = { + name: "19 · Mobile", + args: { scenario: "returning" }, + globals: { viewport: { value: "mobile", isRotated: false } }, + parameters: { layout: "fullscreen", waitForViewport: true }, +}; diff --git a/ui/storybook/stories/cases/case-detail.stories.tsx b/ui/storybook/stories/cases/case-detail.stories.tsx index b324e75f204..4d402768bf4 100644 --- a/ui/storybook/stories/cases/case-detail.stories.tsx +++ b/ui/storybook/stories/cases/case-detail.stories.tsx @@ -1,11 +1,14 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { Routes, Route } from "@/lib/router"; +import { Layout } from "@/components/Layout"; import { CaseDetail } from "@/pages/CaseDetail"; import { CaseFieldsPanel, CaseFieldsTable } from "@/components/CaseFieldsPanel"; import { IssueCasesPanel } from "@/components/IssueCasesPanel"; +import { PluginLauncherProvider } from "@/plugins/launchers"; import { instanceExperimentalSettingsSchema } from "@paperclipai/shared"; import { expect, within } from "storybook/test"; import { + caseDetail, caseItem, installCaseFixtures, } from "../../support/capability-gaps/cases"; @@ -129,3 +132,32 @@ export const LinkedFromTask: Story = { ).toHaveAttribute("href", "/PAP/cases/PAP-C42"); }, }; +export const CaseDetailMobile: Story = { + globals: { viewport: { value: "mobile", isRotated: false } }, + parameters: { + layout: "fullscreen", + waitForViewport: true, + initialEntries: ["/PAP/cases/PAP-C42"], + }, + beforeEach: () => { + const cleanup = prepareFixtureApi([ + { + path: /^\/api\/cases\/(PAP-C42|case-gap)$/, + read: () => ({ + ...caseDetail, + title: "Investigate support escalation (Plain th_01M7V3SF2W8R79ABCDEF0123456789)", + }), + }, + ]).cleanup; + return cleanup; + }, + render: () => ( + + + }> + } /> + + + + ), +}; diff --git a/ui/storybook/stories/goals/goal-alignment.stories.tsx b/ui/storybook/stories/goals/goal-alignment.stories.tsx index 6bb724ee37f..76163eeae5d 100644 --- a/ui/storybook/stories/goals/goal-alignment.stories.tsx +++ b/ui/storybook/stories/goals/goal-alignment.stories.tsx @@ -1,6 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { Routes, Route } from "@/lib/router"; +import { Layout } from "@/components/Layout"; import { GoalDetail } from "@/pages/GoalDetail"; +import { PluginLauncherProvider } from "@/plugins/launchers"; import { expect, userEvent, within } from "storybook/test"; import { storybookGoals, @@ -103,3 +105,20 @@ export const Failed: Story = { parameters: { fixtureState: "failure" } }; export const PermissionDenied: Story = { parameters: { fixtureState: "permission" }, }; +export const GoalDetailMobile: Story = { + globals: { viewport: { value: "mobile", isRotated: false } }, + parameters: { + layout: "fullscreen", + waitForViewport: true, + initialEntries: ["/PAP/goals/goal-gap"], + }, + render: () => ( + + + }> + } /> + + + + ), +}; diff --git a/ui/storybook/stories/inbox-search/decisions-desk.stories.tsx b/ui/storybook/stories/inbox-search/decisions-desk.stories.tsx index 60bcd8f162c..c9786ce4930 100644 --- a/ui/storybook/stories/inbox-search/decisions-desk.stories.tsx +++ b/ui/storybook/stories/inbox-search/decisions-desk.stories.tsx @@ -9,13 +9,17 @@ import type { AttentionSourceKind, } from "@paperclipai/shared"; import { Routes, Route } from "@/lib/router"; +import { Layout } from "@/components/Layout"; +import { CoordinatorNeedsYou } from "@/components/coordinator/CoordinatorNeedsYou"; import { WhatNeedsMe } from "@/pages/WhatNeedsMe"; import { DecisionQueuePage } from "@/pages/DecisionQueuePage"; import { AttentionQueueRow } from "@/components/AttentionQueueRow"; +import { PluginLauncherProvider } from "@/plugins/launchers"; import type { DecisionQueueDto } from "@/api/decisionQueues"; import { queryKeys } from "@/lib/queryKeys"; import { coordinatorAttentionQueryKey } from "@/lib/coordinator-attention"; import { storybookAuthSession } from "../../fixtures/paperclipData"; +import { installFixtureApi } from "../../support/capability-gaps/api"; const STORYBOOK_USER_ID = storybookAuthSession.user!.id; @@ -603,3 +607,58 @@ export const CardTriageStrip: Story = { ), }; + +export const CoordinatorInboxMobile: Story = { + globals: { viewport: { value: "mobile", isRotated: false } }, + parameters: { + layout: "fullscreen", + waitForViewport: true, + initialEntries: ["/PAP/decisions"], + }, + beforeEach: () => + installFixtureApi([ + { + path: "/api/workspace-preferences/me", + read: () => ({ + userId: STORYBOOK_USER_ID, + coordinatorWorkspaceEnabled: true, + updatedAt: null, + }), + }, + { + path: `/api/companies/${companyId}/access/user-directory`, + read: () => ({ + users: [ + { + principalId: STORYBOOK_USER_ID, + status: "active", + user: { name: "Riley Board" }, + }, + ], + }), + }, + { + path: `/api/companies/${companyId}/attention/history`, + read: () => ({ items: [], nextCursor: null }), + }, + { + path: `/api/companies/${companyId}/attention/run-history`, + read: () => ({ items: [], nextCursor: null }), + }, + { + path: `/api/companies/${companyId}/attention`, + read: () => feed(DESK_ITEMS), + }, + ]).cleanup, + render: () => ( + + + + }> + } /> + + + + + ), +}; diff --git a/ui/storybook/stories/tasks/monitoring-status.stories.tsx b/ui/storybook/stories/tasks/monitoring-status.stories.tsx index 17b8e25a962..9664161eec1 100644 --- a/ui/storybook/stories/tasks/monitoring-status.stories.tsx +++ b/ui/storybook/stories/tasks/monitoring-status.stories.tsx @@ -96,7 +96,11 @@ export const CompanyDashboard: Story = { render: () => }; export const ProfileRecentTasks: Story = { render: () => }; export const StatusCardWatchedTasks: Story = { render: () => undefined} initialTab="watched" /> }; -export const TaskDetailMobile: Story = { ...TaskDetail, globals: { viewport: { value: "mobile", isRotated: false } }, parameters: { waitForViewport: true } }; +export const TaskDetailMobile: Story = { + ...TaskDetail, + globals: { viewport: { value: "mobile", isRotated: false } }, + parameters: { layout: "fullscreen", waitForViewport: true }, +}; export const TaskDetailLight: Story = { ...TaskDetail, globals: { theme: "light" } }; export const TaskDetailDark: Story = { ...TaskDetail, globals: { theme: "dark" } }; export const SharedIndicators: Story = {