Files
PaperClipAI/ui
Dotta 74f26f3b49 fix(ui): mobile parity for task detail, chat, goals, cases, and coordinator inbox (#23046)
## 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 `<GoalProperties
/>` unreachable on mobile.
- `CaseDetail` renders `<h1>` 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
`<GoalProperties />` 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
`<CoordinatorReviewPanel />`.
- 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 `<Sheet>` rendering `<GoalProperties />`.
- **`ui/src/pages/CaseDetail.tsx`**: Added `min-w-0`, `break-words`, and
`wrap-anywhere` to the page container, header, and `<h1>` 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 `<Sheet>` rendering `<CoordinatorReviewPanel
/>` (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
2026-11-27 13:41:43 +00:00
..
…

@paperclipai/ui

Published static assets for the Paperclip board UI.

What gets published

The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.

Storybook

Storybook config, stories, and fixtures live under ui/storybook/.

pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook

Typical use

Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.

Editor dependency identity

Keep the root and workspace overrides for @codemirror/state, @codemirror/view, and @lezer/common aligned. CodeMirror requires shared extension identity, while Lezer parsers and syntax highlighters require shared NodeProp IDs. Multiple Lezer copies can crash code-block highlighting with tags is not iterable. src/lib/codemirror-single-instance.test.ts checks the installed dependency graph and highlights sample code through the editor's real language dependencies. GitHub Actions owns regeneration of pnpm-lock.yaml.