The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
Draft: Build agent-ready design proposal system (#16875)
scotttong7b9334cd109d
diff --git a/DESIGN.md b/DESIGN.mdindex 376e563dc8..cce5386f62 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -117,6 +117,675 @@ reminder; dismissing one clears the composer and stays effective after reload fothat person and task. Other inputs keep a pending indicator that can reopen them;resolving or skipping the input removes that indicator.+## Proposed color foundation++Review **Design proposals → Foundations → Colors** in Storybook+(`design-foundations-colors`): Token reference, Surfaces & elevation, and+Text & interaction. The palette comes from the [Paper Dark mode frame](https://app.paper.design/file/01KZ5QQTS4TG2VADP7ZVGJNQY4/p-L-0/3LXU-2)+and the designer's usage rules. Dark mode retains these proposed values. Light mode inherits the existing+production semantic palette from `:root`, including foreground, background,+border, input, accent, status and ring colors. Proposal-only `--muted-alt`+aliases production `--secondary`; the proposed light sidebar uses `--primary-sidebar-background`, the same+border/background blend rendered by the production primary sidebar. Light+navigation uses production foreground at 80% opacity and sidebar-accent for+selected/hovered items, rather than the dark proposal’s muted mapping.+Storybook proposals follow the theme toolbar instead of locking dark mode. It remains+proposed until visual approval.++Paper's `dark-color-*` names map to theme-independent CSS tokens in+`ui/src/index.css`; do not introduce a second token file or copy colors into+components/stories. The token-reference story reads values from the active CSS.++| Paper name | Code token | Intended use |+| --- | --- | --- |+| `dark-color-foreground` | `--foreground` | Headings, header labels, emphasized text, unread task titles |+| `dark-color-background` | `--background` | Center/right panes, lowest card surface, menus and popovers |+| `dark-color-background-alt` | `--background-alt` | Text inputs and search fields |+| `dark-color-muted` | `--muted` | Left sidebar and highest card surface |+| `dark-color-muted-highlight` | `--muted-highlight` | Hover backgrounds; preserve documented selection/sort behavior |+| `dark-color-muted-alt` | `--muted-alt` | Middle card surface |+| `dark-color-muted-foreground` | `--muted-foreground` | Default text, secondary labels, metadata, read task titles |+| `dark-color-border` | `--border` | Shared dividers, input outlines and card borders |++Focus indicators use `--ring: var(--foreground)`, matching `dark-color-foreground`.+A 1px bright edge and a 3px outer halo at 20% opacity give focus two levels of+emphasis, using `--focus-ring-stroke-width`, `--focus-ring-halo-width`, and+`--focus-ring-halo`. Inputs, buttons and the proposed custom focus indicators+share this treatment. This additional reference also supplies sidebar focus. Resize controls+retain their neutral gray via `--pane-resize-highlight`, independent of focus+elsewhere. The focus colors are listed alongside the Paper palette in the token+story as derivatives of foreground. The override is scoped to the proposed dark theme.++The border is translucent: its rendered shade depends on the surface beneath it.+Keep that alpha value rather than replacing it with a different opaque gray for+each background. Card surface levels share this border and do not automatically+add shadows. Use the existing `Card` with `elevation="low"`, `"middle"`, or `"high"`;+omitting elevation keeps its default surface. These new surface mappings apply+in both proposal themes, using their respective tokens.++Most text is muted foreground. Foreground is an intentional exception for+headings, header labels and emphasis. Task-title read/unread weight and hover+rules below remain in force. Task-status colors keep their existing semantic+meaning and are outside this neutral-palette reference.++The Storybook proposal decorator adds `.design-proposal-theme`. Dark semantic+overrides are scoped to its presence on the document so portaled menus inherit+the same colors. Leaving a proposal removes that scope. Existing production+stories and the app's default theme retain their existing appearance; the+light palette is reused without redefining its production colors. Activity shimmer+and interactive metadata emphasis follow `--foreground`; human bubble text stays white on blue. The sidebar, page shell,+task list, shared inputs, card levels and refreshed flyouts consume these same+semantic tokens.++## Proposed typography foundation++Review **Design proposals → Foundations → Typography → Type specification**+(`design-foundations-typography--type-specification`). The proposal and the+opt-in design sandbox use Inter Variable for interface text and bundled Paper+Mono for all monospace text, including IDs, code and run diagnostics.++**Conversation styles** (`design-foundations-typography--conversation-styles`)+shows the same composition as the sandbox task detail page by mounting+`DesignSandboxTaskThread` directly. Its canonical 72-state fixture catalog,+grouped selector, replay, history, activity disclosures, transcript/native paths+and local composer actions are shared, rather than independently assembled+examples. It defaults to All states. Optional computed typography measurements+inspect rendered text, including expanded disclosures; refresh after changing+states or opening content. Storybook does not load saved backend conversations.+The fixtures use production renderers with synthetic data; this does not certify+a deployed production version. Refine shared tokens/renderers after review so+subsequent typography changes propagate back to the sandbox.++**Conversation type spec** (`design-foundations-typography--conversation-type-specification`)+uses the Type specification layout to dissect the shared conversation preview.+Its size inventory, family/weight specimens, searchable usage rows and shared-+metric consolidation candidates derive from browser measurements of the same+72-state composition. Source classes and example-state links connect each row+to its owning surface. Measurements are snapshots: refresh after opening+content or selecting another state. Closed disclosures, placeholders and absent+Markdown structures are excluded. Isolated text specimens copy measured styles;+the shared composition remains available in context. Consolidation requires a+subsequent change to shared tokens/renderers, which then propagates to the sandbox.++The sandbox demonstration tasks now open a **Play conversation** preview rather+than stacking all state fixtures. A local, token-timed controller progressively+feeds one cumulative synthetic transcript through the real conversation+renderers: an initial question, reasoning, commentary, file read, command and+streaming final, then a follow-up with queuing, planning, clarification and+permission receipts, a failed test and retry, file preview, usage and a second+final. Demo answers and permissions advance automatically; no approval affects+a real run. Settled turns retain inspectable Activity history. Pause freezes the preview clock; resume continues+and replay resets it. At completion the response keeps the same mounted bubble:+preceding live activity fades over 180ms, then releases its height over 480ms so+the final reply glides into place. The Activity footer appears after the fold;+reduced motion settles immediately. This handoff is shared by the Storybook and+sandbox playback. Preview prose arrives in complete words with a subtle+320ms fade from near-transparent on newly mounted word spans; existing words remain stable. Reduced+motion disables the word fade. No provider or command runs. Saved conversations on other+tasks remain available. The Typography **Conversation playback** story uses the+same controller; Conversation styles and Conversation type spec retain the+72-state catalog for detailed inspection.++Conversation typography is now consolidated inside explicit shared thread and+composer regions under the proposal theme: body text is 14px/20px and metadata+is 12px/16px. Human messages retain blue bubbles with white text. Final agent+responses use foreground; commentary, reasoning, activity labels and metadata+use muted foreground without extra opacity tiers. Interactive metadata+returns to white text with a subtle neutral background on hover or keyboard+focus; noninteractive metadata stays muted. Agent names use 14px/20px semibold+in foreground.+Only the current activity owns white shimmer: Working while awaiting activity,+then the active reasoning or tool line. Working returns to muted foreground+while another activity owns shimmer; streaming final text does not shimmer.+The sweep loops continuously without an end pause. Tool labels and Paper Mono+targets share one gradient across their containing line, rather than animating+each text segment independently; reduced motion restores solid readable text.+Completed tools return to muted metadata. Runner preparation and transcript+loading placeholders are omitted from the normal live tail; actionable queues,+recovery and failure messages remain. Explicit final-channel text is foreground while+streaming; unclassified/progress deltas stay muted. Reduced motion disables+tool shimmer and word fades. Markdown headings stay 14px+normal and retain their semantic elements and spacing; final-response headings+use foreground. Explicit strong emphasis remains semibold. Authored code follows+14px body text; diagnostic output follows 12px metadata in Paper Mono. Links+inherit color and remain underlined. Semantic status accents, action-button+variants and keyboard-focus treatments remain meaningful exceptions. Standalone+Markdown outside conversation regions retains its existing scale. Removing the+proposal theme restores ordinary conversation styling.++Only normal (400) and semibold (600) are part of this proposal. Medium recipes+resolve to normal; bold recipes resolve to semibold. The size ramp is nano+(10px), xs (12px), compact (13px), sm (14px), base (16px), lg (18px), xl (20px),+2xl (24px) and 3xl (30px). Former micro usages use xs, including message times,+account email and technical metrics. Navigation group labels and streamlined+property section labels share the same sans/nano/normal/uppercase recipe,+150% leading, 0.1em tracking and muted foreground at 60%.++These decisions live in `ui/src/index.css`, under the shared proposal marker.+Compatibility aliases carry existing shared components onto the proposed+families, weights and sizes, including portals. New proposal code uses normal,+semibold and xs directly. The ordinary app theme retains its original+typography. The Buttons playground uses the sandbox proposal theme. Do not+remove those defaults while this design is being tested.++## Task-row refresh: proposed specimen++The task-row refresh is an explicitly authorized design change following the+extraction run. Its review surface is **Design proposals → Components → Task list** in Storybook+(`tasks-row-design`), using the production `IssueRow` with+`presentation="task" appearance="refreshed"` and the shared `TaskRowGroup`.+The existing row presentation remains the default while this specimen is reviewed.++Stage this design-system refresh's new token, component, layout, and screen stories+under **Design proposals**, in `ui/storybook/stories/design-proposals/`. Organize+sidebar titles by Foundations (tokens), Components (reusable UI), Layouts+(reusable page structures), Pages (complete screens), Patterns (shared behavior),+and Guidelines (usage and contribution rules). Add groups as stories exist;+do not create empty placeholder stories. Use+`home: "design-proposals"`, `status: "proposed"`, and an explicit staging reason.+These stories are review references and do not count as current production coverage.+All Design proposals opt into `AvatarInitialProvider`: text fallback avatars use+one uppercase character, the first initial. This includes the sidebar account+control, account/profile headers, identity avatars and failed agent-image+fallbacks. Uploaded images and organization artwork keep their existing rendering.+They continue to import shared components and the existing token layer; this is+organizational separation, not a second implementation or token source. Use them+for tasks explicitly implementing the refresh. After design review and adoption+in the app, move each suite to its feature or Foundations home and update its+classification while retaining its explicit story ID and exports.++- Comfortable density is 44px; compact density is 32px. Comfortable is the default.+ Compact is a preview for a future user preference, not a new app setting yet.+- All text in proposed task rows and table headers uses the `sm` size token+ (`--text-sm`, 14px) with a 16px line height. This includes metadata, IDs and tag+ chips; keep the same type size at both row densities.+- Titles use Inter: read titles are regular (400), muted foreground; unread titles+ are semibold (600), foreground. Hover changes the row background and title to+ foreground while preserving its read/unread weight. Proposed task-row hover+ backgrounds use `--muted`; other hover highlights retain their existing tokens.+ Keyboard focus reveals the+ same title emphasis and retains a visible focus indicator.+- Refreshed task rows indicate unread state through title typography alone. Do not+ show the old blue unread dot or reserve space for it, including in inbox rows.+- Task identifiers use bundled Paper Mono. All visual values live in the+ `--task-row-*` token family in `ui/src/index.css`, mapped to the shared semantic+ color tokens (`--foreground`, `--muted-foreground`, `--border`).+- Keep an 8px gap between the status icon and title in both row specimens and+ the complete column layout. Status icons show their text label in the shared+ tooltip on hover or keyboard focus; clicking still opens the task. Use the+ shared status label, including waiting/blocked context, rather than duplicating+ status copy. Title text continues to use its marquee without a tooltip.+- Titles stay on one line with ellipsis. Every truncated column uses the same+ `CellMarquee`: hover reveals only the cell in that column, scrolling left once+ at a constant speed until the last character is visible, then holding there.+ Moving to another column or leaving the row resets immediately. Fitting cells+ stay still. Keyboard focus also reveals truncated cells; Escape stops the+ reveal. Recheck overflow when width, text, or fonts change. Reduced motion+ jumps to the end without animation. There is no title tooltip; full text+ remains accessible, and the full title stays in the row link's accessible name.+ Truncated edges use a subtle 12px alpha fade into the actual row background,+ including hover, selection and other highlights. Fitting cells have no fade.+ The marquee also fades its clipped leading edge; once it reaches the end, the+ trailing fade clears so the final character remains fully visible. Keep the+ mask inside the focusable cell so keyboard focus outlines stay intact.+- Each nesting level adds 24px inside the title area. Trailing metadata columns+ stay aligned. Thin vertical guides communicate ancestry, with room for disclosure+ controls. Disclosure controls retain independent keyboard and pointer behavior.+- A root task and its visible descendants form one `TaskRowGroup`, bounded by a+ separator above the parent and below its final visible descendant. Child rows+ have no horizontal dividers. Adjacent groups share a single separator. The outer+ nesting guide stops above the bottom separator with the same gap as between+ its top and the parent's status icon.++Review read/unread, actual hover/focus, long titles, both densities, and an expanded+two-level hierarchy before composing the full task-list screen. Story fixtures+show local UI behavior; they do not prove live persistence or task authorization.++### Task-list columns++The complete column order is **Task, Task ID, Created by, Assignee,+Project, Parent Task, Tags, Worktree, Last updated**. The reusable+`TaskListColumnHeader` and `IssueRow`'s `columnValues` share the `--task-list-*`+width tokens and configurable column order. Review the complete composition in+**Design proposals → Components → Task list → All columns**.++- Created by is the recorded creator (human or agent); Assignee is the current+ assignee. Both show names without avatars. Do not infer either from tree depth+ or task status.+- Task combines the status icon and title under one header and one Columns-menu+ choice. Sorting Task uses the title. Status sorting is unavailable for now.+- Parent Task refers to the structural parent; it can show its ID and title.+- Last updated comes from `updatedAt`. Worktree shows the linked Git worktree's+ branch name. Unassigned tasks say “Unassigned”; other missing values use “—”.+- Default visibility is Task, Task ID, and Last updated. The All columns specimen+ starts with all nine visible for review. Widths are provisional: preserve+ a readable title area and scroll horizontally on narrower screens rather than+ dropping requested fields. Nesting consumes title space; metadata stays aligned.+- Fade clipped left/right edges into the background only while more content is+ hidden on that side. Remove both fades when the table fits. Keep scrolling and+ row controls usable through the fade.+- Tag chips use muted-foreground text on a muted-highlight background+ (`--muted-foreground` and `--muted-highlight`). In dark mode, muted-highlight+ matches Paper's `--dark-color-muted-highlight` (`#333333`).+- The column header stays 44px high in both row densities. Every visible header+ is a keyboard-accessible sort button: a new column starts ascending and repeated+ clicks toggle ascending/descending. The active label and direction arrow use+ foreground on a persistent muted-highlight background; inactive labels use+ muted foreground. Expose `aria-sort`.+ All header backgrounds have 8px of padding on each side. Vertical padding stays 4px.+ Preserve label alignment and column positions across hover states.+ The Task header spans status and title and aligns its label with root-row+ titles. Headers stay left-aligned, with sort arrows to the right. Sorting must+ not move other columns or widen the gap between row status icons and task+ titles. Every column uses the same 12px arrow.+- Drag a header left or right to reorder the entire column, including Task's+ status/title pair and its nested rows. A click still sorts; dragging never+ changes the sort. Alt+Left/Right reorders a focused header. Headers and all+ rows share one grid; widths, nesting and metadata alignment survive reordering.+ Last updated is last in the default table order and flyout order.+- Sorting keeps each parent before its descendants and sorts siblings at every+ level. Task IDs and names use natural, case-insensitive ordering; timestamps use+ their raw value. Tags sort by their+ alphabetized names; missing values stay last in both directions. Equal values+ retain their order. The initial collection uses Task ID ascending as its+ default order, with no active header, direction arrow or persistent highlight.+ A header becomes active only after the user sorts by it; the first click sorts+ ascending.+- A horizontal ellipsis stays pinned to the right edge of the header, outside+ horizontal scrolling. Its “Columns” flyout lists all nine columns in their current order+ with checkmarks on the right. Toggling columns updates both header and rows+ immediately and keeps the flyout open. Keep at least one column visible; nesting+ controls remain available even when Task is hidden. Reset defaults shows only+ Task, Task ID, and Last updated and restores the default column order.+ Reset also clears the active sort, direction arrow and persistent header highlight.+ Other columns remain available in the menu; hiding and re-enabling a column+ preserves its position until reset.+ Hiding the sorted column clears the explicit sort and restores the default+ collection order without highlighting another header.+- The refresh's compact flyout uses the shared DropdownMenu primitives. The+ Paper reference defines a 200px surface with an 8px radius, 12px content+ padding, 32px items separated by 4px, regular-weight muted labels and 14px+ checks on the right. Flyout text uses `sm` (14px) with a 20px line height;+ the heading and Reset defaults use semibold foreground. Hover/focus promotes+ labels and checks to foreground on muted-highlight. The dark surface matches+ Paper's `--dark-color-background` (#1a1a1a), shared by the task list, nesting+ groups, header controls, edge fades and the entire proposal canvas (including+ its document/root background and surrounding content). The flyout has an+ explicit 1px semantic border; the reset outline also uses the semantic tokens.+ Table text retains its 16px line height.+ The existing inbox picker remains tied to its older column contract and descriptions.+ Sort, order and visibility changes in the specimen are local state; saving preferences+ across navigation/reloads belongs to app adoption.++### App-shell layout proposal++Review **Design proposals → Layouts → App shell** (`design-app-shell`):+Two Panes, Three Panes, and Independent Scrolling. These use the existing+`DesignPageShell` and `DesignSidebar`, also composed by Pages → Tasks.+Pages supply the `sidebar`, `title`, and main `children`; optional `rightSidebar`+and `rightSidebarTitle` add a contextual right pane. Do not recreate this shell+inside a page or story. The shell owns pane geometry, fixed headers, and separate+main/right scrolling; each page owns its content and actions.++For tabbed contextual panes, supply `rightSidebarHeader` and+`rightSidebarControls`; `rightSidebarMaximized` expands the right pane across+the workspace while retaining the left navigation. `headerActions` can supply+a reopen control. The Three Panes and Independent Scrolling stories reuse the+task-detail page's production `SidePanelTabs`, `SidePanelLauncher`,+`SidePanelWindowControls`, and `useSidePanelTabs`. Their Properties, Tasks, Plan,+and Artifacts tabs can be selected, added, closed, and reordered; closing the+last tab reveals the launcher. Tab contents remain neutral fixtures. Closing+the pane preserves its tabs for reopening. Both content viewports use+`useScrollbarWhileScrolling` and `scrollbar-while-scrolling`: scrollbars appear+while moving and hide after the shared `--motion-scrollbar-idle-delay`.++The left sidebar retains its shared resizing behavior. The right pane defaults+to 320px, capped at 30% of the shell width on narrower desktops. Its divider+uses the left sidebar's neutral resize highlight on hover, keyboard focus, and dragging.+Dragging left widens the pane; arrow keys resize in 16px steps, and Home/End+select the bounds. Double-click clears its saved width and restores the default.+Both sidebars animate their double-click reset with the shared 200ms+`--motion-pane-width-reset` and `--motion-ease-pane-width-reset` tokens, matching+the task-detail right pane. Dragging and keyboard resizing remain immediate;+left navigation open, close, and peek behavior stays immediate. Reduced motion+sets the reset duration to zero. The app-shell stories expose this through both+dividers, using the same SidebarShell as the sandbox's left navigation.+Resizing keeps at least 260px for the right pane and, when space permits, 320px+for the main pane. Width preferences use `rightSidebarStorageKey`, defaulting+to `${sidebarStorageKey}.right`, independently of the left width. Maximizing+hides the resize handle and restoring retains the chosen width. All dimensions+use `--design-page-aside-*` and `--design-page-main-min-width` tokens.+Main and right panes use `--background`, the left+sidebar uses `--muted`, and dividers use `--border`. Layout stories use separate+sidebar-width storage keys and neutral placeholder content so review focuses on+the structure. These are proposed dark desktop layouts; mobile navigation and+right-panel overlay behavior require separate design work.++### Task-list page proposal++Review the complete composition in **Design proposals → Pages → Tasks**+(`tasks-list-page-design--default`), alongside All Columns and No Results.+This page remains proposed until the design owner approves the surrounding+layout. The Default story shows Task, Task ID and Last updated; the row specimen+and full page consume the same `TaskList` collection.++- `DesignPageShell` composes the existing 240px `SidebarShell`, a 60px page+ header, and scrolling main content with 24px insets. The sidebar uses muted;+ the entire main pane uses Paper's background token. Desktop is the current+ review scope; mobile composition remains to be designed.+ Enable the shared shell's production resize handle, including its hover,+ dragging and keyboard states. Sidebar width persists under the proposal's own+ storage key, separate from the production sidebar preference. Double-clicking+ the resize handle restores and saves the default 240px width.+- Toolbar outlines use the opaque `--design-page-control-border` token so+ search, view, layout, expansion and filter controls have the same visible+ border despite their different fills. General surface borders continue to+ use the translucent `--border` token. Disabled controls retain their normal+ dimming, and keyboard focus retains its separate ring.+- The left sidebar clips its muted fill to the padding box so its translucent+ right divider blends over the app background, matching the main header and+ pane boundaries. The divider still uses `--border`; the resize handle keeps+ its distinct hover/focus highlight.+- `DesignSidebar` is the shared proposed navigation component used by this page+ and **Design proposals → Components → Sidebar**. Refine its Default, Narrow,+ Long Labels, Many Recent Tasks, Empty Recent Tasks, Organization Menu and+ Account Menu stories, then review the Tasks page in context. Both compositions+ use the same component and CSS tokens. The caller supplies recent tasks and+ the New Task action; recents are filtered to the selected company.+ The Recent Tasks heading stays fixed while its list scrolls independently.+ The list uses the existing `scrollbar-while-scrolling` utility and shared idle+ timer token; hovering alone does not reveal its scrollbar.+ Standalone examples use separate width preferences and share the page's owner-access+ fixture boundary, existing dialogs, marquee and Popover appearance. Navigation+ remains fixture based; mobile composition and backend behavior are not proved.+- Sidebar navigation labels use `sm` (14px). Icons match Paper and the existing+ sidebar mappings: CircleCheck, MessageCircle, FolderOpen, Repeat, Package,+ Users, Boxes, Unplug and History. The organization and account controls mount+ `SidebarCompanyMenu` and `SidebarAccountMenu` directly, preserving their+ production keyboard behavior and actions, with the shared refreshed flyout+ appearance. Switching fixture+ organizations changes the selection and never shows another company's tasks.+ The sidebar follows Paper node `32TP-0`: 12px navigation insets, 8px item+ margins and padding, 14px/150% labels, 2px row gaps and 16px section gaps.+ Work and Org captions use the sans family rather than monospace. Recent Tasks+ is a separate final section with five regular-weight, unindented links; it is+ not nested beneath Tasks. The account footer has no divider above it.+ Sidebar surface and right border alias `--muted` and `--border`, matching+ Paper's dark-color-muted and dark-color-border. The task search field uses+ `--background-alt` (Paper dark-color-background-alt: oklch(14.5% 0 0)).+ The organization switcher has no caret in this proposal. Its hit area is+ separate from an adjacent global-search button, which opens the production+ `CommandPalette`; the toolbar input remains a task-list filter.+ `TruncatedTextMarqueeProvider` opts sidebar and menu labels into the same+ `CellMarquee` animation and alpha fade as table cells. Links and buttons own+ focus; labels add no tab stops. Organization-menu state changes reset the+ trigger title; restored focus after dismissal does not restart it outside the+ hit area. Fresh pointer interaction or tabbing away and back can reveal it.+ Pointer exit resets immediately, Escape stops+ reveal, fitting labels stay still, and reduced motion follows the shared rules.+- `TaskListToolbar` composes shared buttons, input, tooltip, dropdown and filter+ primitives. Controls are 44px high. A 32px gap separates the toolbar and table.+ Page dimensions, spacing, type and surfaces live in the token layer under+ `--design-page-*` and `--design-sidebar-*`.+ The filter popover uses Paper's five peer groups in order: Status, Project,+ Creator, Assignee, Label. All but Status have an always-visible search field.+ Desktop groups are 200px wide with 16px gaps and 12px body insets; groups wrap+ on smaller viewports. Checkbox rows use the existing filter state and toggle+ helpers, with Clear resetting the active filters. This opt-in `refreshed`+ presentation omits the old quick-filter and visibility sections and inherits+ the shared Popover surface, highlight and `--shadow-flyout` token.+- Refreshed dropdowns and popovers share `FlyoutAppearanceProvider` and the+ existing Radix primitives. `Flyout` / `FlyoutContent` compose a popover;+ `FlyoutHeader` supports a simple title or profile details, and `FlyoutOptions`+ groups the actions below it. Dropdowns reuse these sections and the appearance+ provider while retaining menu keyboard behavior. Surfaces+ use background, borders use border, hover/focus uses muted-highlight and+ foreground. Unhighlighted labels and their checkmarks use+ `--flyout-item-foreground`, bound to muted-foreground. Selection uses a checkmark,+ including single-choice Views.+ The shared `--shadow-flyout` token controls the subtle drop shadow. All flyout+ visual values live under `--flyout-*`; menu-specific widths stay contextual.+ The account flyout fits its contents and retains production Invite access+ checks. The preview supplies owner access and loaded operator-policy fixtures.+ This appearance remains opt-in while the proposal is reviewed.+ Review the component separately in **Design proposals → Components → Popover**, with Columns,+ Views and Account Menu examples. Account Menu mounts the canonical+ `SidebarAccountMenu` with the same owner-access fixture boundary as the Sidebar+ story; no separate action list or simulated account handlers are maintained.+ The former Profile story keeps its stable URL and is named Account Menu.+ Its Shadow control previews a local override;+ changing the saved `--shadow-flyout` token in `ui/src/index.css` updates every+ refreshed flyout. Storybook controls do not persist token edits.+- Views appear in this order: Inbox, Unread, Needs attention, All tasks. Inbox includes+ tasks created by or assigned to the current user. Unread uses the task unread+ state; Needs attention includes both blocked and in-review statuses. New users start+ on All tasks. The last view persists in browser storage per user, across the+ proposal stories and organizations, under an isolated design-proposal key.+ Invalid or unavailable storage falls back to All tasks; changing views still+ works if storage is denied. Cross-device preference sync requires app integration.+ Search, views and filters operate on fixtures. Matching+ subtasks keep their ancestor chain for context; the result count distinguishes+ matches from contextual parents. Expand/collapse applies to every nested level.+ The grouping icon and menu are omitted from the proposed toolbar.+- List/board switching preserves the list's local column state. The board and+ New Task composer reuse existing components and are not new approved designs.+ The proposed board uses one horizontal scroll viewport. It shares the task+ table's edge detection and fade tokens, showing each fade only while content+ is clipped on that side; resize and scrolling update the indicators.+ Sidebar links exercise the memory router; destination pages, creation API+ behavior, production preferences and production routes are outside this preview.++### Reuse collection behavior as well as appearance++`useTaskListCollection` in `ui/src/hooks/` is the shared presentation controller+for the proposed task page and reproduction trial. Supply accessible `items`,+the selected `companyId`, current `userId`, an isolated `viewStorageKey`, and+optionally `initialQuery`. Feed its query/view/layout/filter handlers to+`TaskListToolbar`, its `creators` directly to the Creator filter, and its+`visibleItems`, `companyItems` and expansion state to `TaskList`. Boards consume+`matchingItems`: contextual parents belong in the hierarchical list only.+The caller owns data loading and mutations; this hook does not authorize data+access, define server permissions, or integrate production persistence.++Creator IDs are namespaced (`user:<id>` / `agent:<id>`), including when human+and agent IDs coincide. Search includes task IDs, titles, creator, assignee,+project and tags. Changing query, view or filters expands matching families so+results cannot remain hidden behind collapsed ancestors. Clear resets search,+filters and view, while keeping the chosen layout. View storage remains isolated+by the caller's scope/user key. Company changes scope tasks and creator options+and start with expanded families.++The reproduction story now uses this controller too. It is a repaired regression+reference, not an untouched fresh-agent result. Preserve the first submission's+source, frozen PNGs and capture metadata separately when evaluating improvements;+do not replace its evidence with repaired output or silently accept new images.+The opt-in `task-list-reproduction-trial.config.ts` suite requires+`TRIAL_REFERENCE_PNG` pointing to the original frozen reference (and a matching+Chromium executable via `TRIAL_CHROMIUM_EXECUTABLE`). Missing visual evidence is+an error rather than an omitted comparison. Its browser cases exercise creator+filters, collapsed search/view/filter transitions, metadata search and board+matching on both the reference and trial. These checks establish fixture behavior+and reproduction of that frozen desktop state, not production acceptance.++The next milestone is the agent reference contract and another fresh-agent test+using the shared components, tokens and collection controller. A corrected trial+does not establish that a new agent will discover and reuse this system without+coaching. Visual approval and production integration remain separate milestones.++### Activity lists++**Design proposals → Components → Activity list** demonstrates the shared+`ActivityList` and the refreshed appearance of `ActivityRow`, including mixed+task, agent, project, approval, run and unlinked system events. Its Playground+exposes comfortable/compact density and standard/narrow/smallest container width.+It reuses task-row height, spacing, typography, ID/time widths and responsive+metadata rules, plus the same `CellMarquee` and `useCellMarqueeHover` behavior.+Activity is its own composition; events are not converted into synthetic tasks.++The caller supplies events in display order, entity/actor directories and any+entry animation. Only task events show a task ID and task hover card; other+events retain their entity or run destination. Unlinked events remain readable.+The main row stays 44px (comfortable) or 32px (compact), with 14px/16px text.+Added/removed issue references remain in a detail block below that row rather+than being dropped or clipped to fit. Narrow containers hide task ID first,+then timestamp in the smallest layout, matching task summaries.++Dashboard's Recent Activity opts in only while the design sandbox is on. The+sandbox also provides the same single-initial avatar policy as Design proposals+in Storybook, including account menus and other shared fallback avatars.+Turning proposals off restores the original rows and avatar policy.++### Task hover cards++**Design proposals → Components → Task hover card** documents the contextual+preview shared by task links and recent activity. The code names are+`IssueLinkQuicklook` (trigger/behavior) and `IssueQuicklookCard` (content).+Use the existing `Link` from `@/lib/router` for task links; set+`disableIssueQuicklook` when a surface should omit the preview. This choice+belongs to the caller, not a user preference. `IssueRow` and `TaskSummaryList`+remain opted out and reveal truncated text locally instead.++The refreshed card follows the Paper task-card reference: 280px width, 16px+padding, status/ID/timestamp metadata, a 14px semibold title clamped to two+lines, and a 12px description clamped to three lines. Project metadata is+omitted in this proposed appearance. The card uses background, border,+foreground and muted-foreground semantics plus the existing `--shadow-flyout`;+its geometry and typography live in the `--task-preview-*` token family.+It retains production hover intent, single-open behavior, focus, dismissal,+prefetch and access boundaries. The default appearance remains unchanged.+Story fixtures demonstrate the component and opt-out contract, not live access+checks; verify the sandbox's recent-activity links for integration review.++### Narrow task summaries++`TaskSummaryList` is the flat summary composition of the same refreshed+`IssueRow`, reviewed under **Design proposals → Components → Task list → Narrow**.+The **Playground** (stable story ID `tasks-row-design--specimen`) exposes row+density and container width both above the preview and in Storybook Controls.+It retains nesting and read/unread samples while varying these independently;+the fixed density and width stories remain review references.+The caller supplies ordered issues and an accessible list+label; `showIdentifier` and `showUpdated` can omit optional metadata. The list+uses regular muted read-style titles regardless of the source unread flag and+never marks a task read. It retains the 44px comfortable height, sm/16px type,+status tooltips, normal task navigation, hover, keyboard focus and cell-local+fade/marquee. It omits disclosure spacing, avatars, assignee, table headers,+column settings and collection state. Container queries hide Task ID below+28rem and Last updated below 20rem while keeping status/title readable without+horizontal scrolling. Existing row, spacing, type and divider tokens are reused.++Dashboard's Recent Tasks opts into this composition only while the design+sandbox is on. Data, ordering, limit and empty-state behavior stay with Dashboard;+the ordinary presentation remains available with the toggle off.+Agent overview's Recent Tasks uses the same summary in the sandbox, retaining+its participant-scoped query, updated ordering, six-task limit, more-task count+and See All link. The toggle restores its original rows as well.++### Sandbox button playground++**Design proposals / Components / Buttons / Playground** is a styling+workbench for the local design sandbox. All specimens use the shared proposal+theme. The live specimen, variant/state matrix and size matrix use the shared+Button API; contextual examples mount the sandbox's task toolbar, task list,+sidebar, pane controls, agent actions, conversation feedback, favorites, file+controls, status picker, attachment actions and relation expansion.++Label, variant, size, icon, interaction state and semantic surface controls+stay synchronized with Storybook args. Specimens measure actual dimensions,+padding, typography, radius, icon size and resolved colors. Hover, keyboard+focus and pressed previews derive from compiled component CSS under a+Storybook-only attribute; the app's Button gains no forced-state API. Disabled+and loading remain real props. Context actions use local fixtures.++The workbench has one full-width sandbox inventory. It does not show a+production iframe, comparison-layout controls, legacy-only components,+feature-gated priority controls or repository-wide source usage counts.+Playground is the single story in this grouping. These examples do not run+agents, persist uploads or establish backend behavior.++### Local integration sandbox++The development app can opt into **Design proposals only** with+`VITE_PAPERCLIP_DESIGN_SANDBOX=true`. The bottom-right **Design proposals: On/Off**+control persists a local comparison preference. Production builds and development+instances without this environment switch cannot activate it through browser+storage. This experiment does not enable other Storybook explorations.++When on, the app uses the same `.design-proposal-theme` marker and+`FlyoutAppearanceProvider` as the proposal stories. Document-wide token and portal+propagation is intentional: inspect ordinary pages for missing foundation mappings+and component variants. The desktop primary sidebar mounts `DesignSidebar` with+real recent-task data; existing layouts retain their route handling, contextual+sidebars, panels and dialogs. Mobile retains its existing drawer. No new global+component defaults are introduced. Toggle off removes the marker and restores+the existing sidebar, Tasks surface and menu appearance.++The resizable contextual pane uses `--design-page-aside-width` for its default+and double-click reset while the proposal is on (currently 320px). Sandbox+widths use separate `paperclip.design-proposal.properties-pane-width.*` storage+keys, so toggling off retains the ordinary 434px task-detail default and its+saved widths. This adapts the existing task-detail pane; it does not replace its+production content or maximize behavior with the layout-story fixtures.++`DesignSandboxTasks` adapts real company-scoped APIs to `TaskListToolbar`,+`TaskList`, `KanbanBoard` and `useTaskListCollection`. It imports no Storybook+fixtures. Creator names, projects, labels and viewer unread state come from APIs;+the ordinary organization list does not supply unread context, so a separate+server-filtered unread query supplies that set. Load-more explicitly limits+client search/filter/sort coverage to loaded tasks. Preferences use sandbox keys.+Task links, creation dialogs and board updates retain the existing app services.+This is an integration experiment, not permission, scale or release acceptance.++Dashboard metrics use `MetricCard appearance="card"` while the proposal is on.+This mounts the shared low-elevation `Card` with semantic background, border,+radius and padding, keeping the existing metric links and responsive grid.+The plain metric presentation remains the default outside the experiment.++The streamlined task-detail header follows the Paper title-block proposal while+the sandbox is on: a regular 24px title, followed by a metadata row grouping the+status picker with its monospaced task ID, project and people. The title remains+editable and the existing task-actions menu stays at the upper right. Typography+and spacing use the shared tokens; toggling off restores the ordinary header.++The local task detail also offers a **Thread preview** selector. DES-1 opens a+complete synthetic conversation matching the staging transcript layout; other+tasks start with their saved thread. Synthetic runner events pass through+`nativeRunEventsToTranscript` and `transcriptToTaskChatItems`. The preview uses+the shipped message bubbles, attached **Activity** history, working/elapsed/tool+status, chronological activity groups and composer takeovers. It does not import+the older chat-lab scenario inventory. The presentation flag follows the instance.++The selector also exposes native-runner turns, streaming commentary/final replies,+reasoning, tools, startup, queued messages, pause, failure, cancellation, timeout,+permissions/questions, result dispositions, provider activity, workspace changes+and usage. Native-runner and transcript layouts are named separately: runner+version alone does not determine which presentation a run uses. Individual+snapshots replay streaming text; **All states** is a labeled comparison gallery.+Stop, approval, question, feedback, resume and composer actions change local+presentation state only. **Show saved thread** restores the real task thread.+`threadPreview` preserves selection in the URL, including aliases for older links.+The fixture module is lazy-loaded only in the enabled development sandbox.+These styling snapshots do not run agents or prove provider/backend behavior.++Use the worktree-local isolated config and database. For a desktop visual review+without building the agent runner, the documented direct API/UI dev path is:++```sh+PAPERCLIP_CONFIG="$PWD/.paperclip/config.json" \+PAPERCLIP_HOME="$PWD/.paperclip-local" \+PAPERCLIP_INSTANCE_ID=design-system-sandbox \+PAPERCLIP_UI_DEV_MIDDLEWARE=true \+VITE_PAPERCLIP_DESIGN_SANDBOX=true \+HEARTBEAT_SCHEDULER_ENABLED=false \+PAPERCLIP_TELEMETRY_DISABLED=1 \+pnpm dev:server+```++The dark foundation is the review target; select dark mode in the account menu.+Local sample records are persisted through product APIs in the sandbox database,+not supplied by fetch mocks or copied from a live instance. Sample agents remain+paused. Agent execution is outside this visual sandbox.+## Enforcement (what "compliant" means for the extraction run)- **Zero visual change is proven, not promised:** Storybook visual snapshots are baselined before any refactor, and all snapshots match baseline after it. A change that alters rendered output must be intentional and human-approved.@@ -169,6 +838,111 @@ tokenize motion. Principles — reasoning only; values live in `ui/src/index.cssAgent Chat and regular task chats keep pending questions as compact “Unanswered question” entries at their original position in history. Dismissing the form or sending a newer user message clears it from the composer without resolving it. Questions never contribute to composer pending counts or navigation. Opening the history entry restores the original form and its draft; submitting later uses the same durable question response path. Actual permission reviews retain their permission checks.+## Canonical proposal toolbars++`Design proposals / Components / Toolbars` is the canonical toolbar review and+reuse home. Playground shows all demonstrated families; Tasks and Decisions+isolate their controls, and Narrow exercises wrapping. Reuse `TaskListToolbar` with+`useTaskListCollection` for proposed Tasks controls, `CollectionToolbar` for+collection context/search/controls/actions/feedback slots, and `DecisionsToolbar`+for decision filtering, grouping and sorting. These are distinct jobs; do not+copy their markup into new page-specific toolbars. Shared buttons, semantic+foundations, focus treatment and refreshed flyouts remain their dependencies.++The Decisions specimen mounts the production component used by+WhatNeedsMe and DecisionQueuePage. Preview creation callbacks only report+intent; menu and control state is local. Canonical proposal status establishes+the reference for continued styling and reuse, rather than certifying deployed+production behavior or migrating every existing page.++Skills and Artifacts are additional canonical toolbar references. Their shared+`SkillsToolbar` and `ArtifactsToolbar` presentations are consumed by both the+shipped pages and proposal stories; query, URL, permission and mutation state+stay in the pages. The Skills story simulates scanning and creation locally.++`Design proposals / Components / Tabs` defines two canonical filled sizes:+Compact uses `--text-xs` (12px) and a 24px item height; Standard uses+`--text-sm` (14px) and a 32px item height. Both use normal 400 weight,+muted inactive text, foreground selected text, rounded filled selection and+shared focus treatment. Standard follows the Paper tab bar: 10px horizontal+padding, 8px gaps and 4px list padding. Compact retains the artifact filter's+6px gaps. Sizes, colors, spacing and motion live in the token layer.++`TabBar` composes within Radix `Tabs` with matching content panels.+`TabFilters` uses an exclusive Radix ToggleGroup with radio semantics for+collection filters; it never clears the current choice. Both support roving+keyboard focus and disabled choices. `PageTabBar` adopts Standard and retains+its mobile select; connector source filters and the Artifacts toolbar use+Standard. Artifact type filters also support Compact for dense standalone uses. Segmented controllers and closable document tabs are separate+patterns. Tabs contains only Playground, Standard and Compact. Playground+compares the two sizes with local fixture state; narrow width remains a control.++Accepted toolbar foundation for Design Proposals and the opt-in sandbox:++- Use the shared `ToolbarSearch` and 44px control height, with one token-driven+ border, radius and horizontal padding across Tasks, Decisions, Skills and+ Artifacts. Adjacent toolbar controls and action groups use an 8px gap+ (`--collection-toolbar-gap`); separate rows retain the 16px layout gap. Embedded search clear buttons and the inner halves of a segmented+ layout switch retain their smaller geometry within a full-height control.+- Order controls as search, filter/sort/group/view, optional secondary actions,+ then the primary action. Tasks is the exception: its view dropdown precedes+ search because it also serves as a heading.+- Decisions includes a controlled search field on the desk and queue pages.+ Search intersects active filters before grouping; it matches all entered words+ across titles, task identifiers, summaries, agent, project and workspace names.+ It searches the current decision list, not collapsed terminal-history curtains.++Further consolidation proposals, pending visual review:++- Move infrequent secondary creation actions into the primary creation menu+ when that keeps the toolbar readable.+- Reuse CollectionToolbar slots while keeping domain-specific controls and+ controllers separate. Preserve search and the primary action in narrow+ layouts, with predictable wrapping or overflow for secondary controls.+- Use canonical Standard or Compact filled tabs for the compared label strips.+ Keep panel-switching tab semantics separate from exclusive collection+ filters. Closable document tabs retain their additional behavior.++### Segmented controller comparison++`Design proposals / Components / Segmented controllers` owns the segmented+comparison Playground, with Disabled and Narrow stories. It includes audit+scope, proposal and production task layouts, agent layouts, instruction and file+preview modes, secret ownership/value source, goal panels and model lanes.+FilePreviewModeToggle mounts directly; inline page controls use explicitly+labelled primitive compositions with local state. Page navigation and+collection filters remain in Tabs. This comparison does not migrate app styles+or certify backend behavior or keyboard accessibility.++Agents and Connectors compose the same `ToolbarSearch` with canonical Standard filled tabs. `AgentsToolbar` is shared by the roster page and+toolbar references; `ConnectorsToolbar` is shared by Browse and toolbar references. Keep search+first, status/source selection next, and view/actions last where present.+Connector source choices use radio semantics and preserve Browse's existing+automatic search expansion; they do not switch separate content panels.+Agents status navigation retains route-backed Tabs with its associated roster+panel. Agent search intersects the chosen status/built-in filter, matches name,+role and title words, and retains ancestor context for matching org-chart nodes.++Projects uses `ProjectsToolbar` for shared search, the existing name/updated/+created/target-date sort choices and direction toggling, and Add Project. Project+search matches all words across name and description before sorting and grouping.+Connector source tabs sit on a second row below search. Tasks keeps its view+dropdown before search; task view state and persistence are unchanged.++In the streamlined Skills area, `SkillsNavigationTabs` replaces the contextual+sidebar with Installed, Discover and My Skills links styled as canonical Standard+tabs beneath the toolbar. Studio and Sources keep these links beneath their own+header controls. Sources is a separate destination available through the Skills+New menu's Manage sources action; it is not a tab. The main company navigation+stays visible. Legacy Skills navigation retains its existing sidebar.++The streamlined My Skills landing (`/skills/studio`) mounts the same CompanySkills+collection, SkillsToolbar and DiscoveryGrid/SkillCard as Installed and Discover.+It keeps the existing installed-skill collection, defaults to Recently updated,+and opens cards directly in Studio. Search, source filtering, scanning, import,+folder creation and skill creation use the existing collection controllers.+Studio editor routes and the legacy recency landing keep their own layouts.+## Offline recoveryThe service worker recovery page uses a centered character, a dark surface, anddiff --git a/doc/design/CHANGING-THE-UI.md b/doc/design/CHANGING-THE-UI.mdindex 77602f0ae1..9a727fb9e1 100644--- a/doc/design/CHANGING-THE-UI.md+++ b/doc/design/CHANGING-THE-UI.md@@ -50,6 +50,18 @@ Then **review the git diff and keep only the CSS-variable value changes** — th- **Give it a story.** New visual surface = new Storybook story = automatic screenshot coverage forever.- `pnpm check:token-gates` before you push. If a value genuinely can't be a token (third-party config, canvas fills, intentional one-off decoration on demo pages), it goes on the allowlist **with an inline comment saying why**.+## Proposed task collections++For work explicitly implementing the staged design refresh, review **Design+proposals → Pages → Tasks** and the component stories. Compose shared UI with+`useTaskListCollection` (`ui/src/hooks/useTaskListCollection.ts`) rather than+reimplementing search, creator identity mapping, views, filter transitions or+hierarchy expansion. Its `visibleItems` include parent context for the list;+boards use `matchingItems`. Pass its namespaced `creators` into the filter menu.+The caller supplies accessible data and handles API mutations. See `DESIGN.md`+for the contract and trial acceptance cases; the proposed controller is not yet+wired into production routes.+## Recipe 4 — you changed something and snapshots failedThat's the system working. Two cases:diff --git a/maps/feature-map/skills.md b/maps/feature-map/skills.mdindex 532f101202..7b9c2a169b 100644--- a/maps/feature-map/skills.md+++ b/maps/feature-map/skills.md@@ -22,11 +22,11 @@ Agent access: [companion](../agent-access-map/skills.md).### `library-sources`-Open `/skills`, Discover, or `/skills/sources`; project import is available through the library’s import flow.+Open `/skills`, Discover, or `/skills/sources`; project import is available through the library’s import flow. In Streamlined UI, Installed, Discover and My Skills are route links styled as tabs beneath the toolbar, with no secondary navigation rail. Sources stays separate under New → Manage sources. Legacy UI retains the Skills sidebar.### `studio`-Use New skill or `/skills/studio/:skillId`; writable copies and source-backed originals differ.+Use New skill or `/skills/studio/:skillId`; writable copies and source-backed originals differ. In Streamlined UI, `/skills/studio` uses the shared Skills toolbar and card collection with My Skills active and Recently updated sorting; opening a card enters Studio.Direct authoring starts at `/skills/studio/new`: fill **Name** and **Slug**, then**Create skill**. Authoring/save/reload requires no model credential; running aStudio test is separate.diff --git a/maps/storybook-map/README.md b/maps/storybook-map/README.mdindex 40d10b6221..92d934175b 100644--- a/maps/storybook-map/README.md+++ b/maps/storybook-map/README.md@@ -31,6 +31,8 @@ const meta = {primary home; others cross-list the same suite. An empty array requires an`exception` explaining the intentional scope. Shared foundations may use`home: "foundations"` with an exception to keep their existing location and links.+Staged design work may use `home: "design-proposals"`, with `status: "proposed"`+and an exception explaining why it is staged separately from production references.The metadata must be literal; place it after any other parameter spreads.| Field | Values and purpose |@@ -55,6 +57,23 @@ the recipe's section and H1 title, followed by the suite name. `/` in featurelabels becomes `, ` in the sidebar. Preserve explicit CSF IDs across title/folderchanges. Compare the built `index.json` when changing navigation.+**Design proposals** is a separate top-level review section. Its stories live in+`ui/storybook/stories/design-proposals/`, with titles beginning `Design proposals/`.+Group these titles by **Foundations** (tokens), **Components** (reusable UI),+**Layouts** (page structures), **Pages** (complete screens), **Patterns** (shared+behavior) and **Guidelines** (usage and contribution rules), in that order.+Create a group when there are stories for it; do not add empty placeholders.+For example, color tokens belong in `Design proposals/Foundations/Colors (dark mode)`,+the task table in `Design proposals/Components/Task list`, and its complete page+in `Design proposals/Pages/Tasks`. Preserve explicit story IDs and exports when+reorganizing so links and browser tests remain valid.+Retain capability references so proposals remain discoverable from the feature+guide, but never count them as current production examples. Keep using shared+components and tokens rather than creating a parallel design implementation.+When a proposal is reviewed and adopted in the app, move its story into the usual+feature or Foundations home, update its classification and staging metadata, and+preserve the explicit CSF ID and exports so review links remain valid.+The generator discovers feature recipes and story annotations. It assembles:- `ui/storybook/generated/catalog.json` and `feature-index.json`.diff --git a/scripts/storybook-button-usage.mjs b/scripts/storybook-button-usage.mjsnew file mode 100644index 0000000000..63234927a0--- /dev/null+++ b/scripts/storybook-button-usage.mjs@@ -0,0 +1,80 @@+import { readFileSync, readdirSync } from "node:fs";+import { createRequire } from "node:module";+import path from "node:path";+import { fileURLToPath } from "node:url";++const root = fileURLToPath(new URL("..", import.meta.url));+const require = createRequire(path.join(root, "ui/package.json"));+const storybookRequire = createRequire(require.resolve("storybook/internal/csf-tools"));+const { parse } = storybookRequire("@babel/parser");+const traverse = storybookRequire("@babel/traverse").default;++function canonicalImport(source, file) {+ if (source === "@/components/ui/button") return true;+ return source.startsWith(".") && path.posix.normalize(path.posix.join(path.posix.dirname(file), source))+ .replace(/\.[jt]sx?$/, "") === "ui/src/components/ui/button";+}++function propValue(attributes, name, fallback) {+ const explicit = attributes.find(attribute => attribute.type === "JSXAttribute" && attribute.name.name === name);+ if (!explicit) return attributes.some(attribute => attribute.type === "JSXSpreadAttribute") ? "dynamic / spread" : fallback;+ // A subsequent spread may override even an explicit literal.+ if (attributes.slice(attributes.indexOf(explicit) + 1).some(attribute => attribute.type === "JSXSpreadAttribute")) return "dynamic / spread";+ const value = explicit.value?.type === "JSXExpressionContainer" ? explicit.value.expression : explicit.value;+ return value?.type === "StringLiteral" ? value.value : "dynamic";+}++/** Count source call sites, never rendered instances or user activity. */+export function buttonReferences(source, file, scope) {+ const ast = parse(source, { sourceType: "module", plugins: ["typescript", "jsx"] });+ const entries = [];+ traverse(ast, {+ JSXOpeningElement(element) {+ const name = element.node.name;+ const local = name.type === "JSXIdentifier" ? name.name : name.type === "JSXMemberExpression" && name.object.type === "JSXIdentifier" ? name.object.name : null;+ if (!local) return;+ const binding = element.scope.getBinding(local);+ if (!binding || !canonicalImport(binding.path.parent.source?.value ?? "", file)) return;+ const importedButton = binding.path.isImportSpecifier() && (binding.path.node.imported.name ?? binding.path.node.imported.value) === "Button" && name.type === "JSXIdentifier";+ const namespaceButton = binding.path.isImportNamespaceSpecifier() && name.type === "JSXMemberExpression" && name.property.name === "Button";+ if (!importedButton && !namespaceButton) return;+ entries.push({ file, line: element.node.loc.start.line, scope,+ variant: propValue(element.node.attributes, "variant", "default"),+ size: propValue(element.node.attributes, "size", "default"),+ });+ },+ });+ return entries;+}++function walk(directory) {+ return readdirSync(path.join(root, directory), { withFileTypes: true }).flatMap(entry => {+ const file = `${directory}/${entry.name}`;+ return entry.isDirectory() ? walk(file) : /\.tsx$/.test(file) && !/\.(test|spec|stories)\.tsx$/.test(file) ? [file] : [];+ });+}++function inventory() {+ const roots = [["ui/src", "app"]];+ const entries = roots.flatMap(([directory, scope]) => walk(directory).flatMap(file => {+ const source = readFileSync(path.join(root, file), "utf8");+ // Parsing is unnecessary for modules that cannot import the subject.+ return /\bButton\b/.test(source) ? buttonReferences(source, file, scope) : [];+ }));+ return { entries: entries.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line) };+}++/** Storybook-only module: publish counts and locations, without bundling app source text. */+export function storybookButtonUsage() {+ const id = "virtual:paperclip-button-usage";+ return {+ name: "paperclip-button-usage",+ resolveId(value) { if (value === id) return `\0${id}`; },+ load(value) { if (value === `\0${id}`) return `export default ${JSON.stringify(inventory())};`; },+ handleHotUpdate(context) {+ if (!/\/ui\/src\/.*\.tsx$/.test(context.file)) return;+ const module = context.server.moduleGraph.getModuleById(`\0${id}`);+ if (module) { context.server.moduleGraph.invalidateModule(module); return [...context.modules, module]; }+ },+ };+}diff --git a/scripts/storybook-button-usage.test.mjs b/scripts/storybook-button-usage.test.mjsnew file mode 100644index 0000000000..d63699351b--- /dev/null+++ b/scripts/storybook-button-usage.test.mjs@@ -0,0 +1,25 @@+import assert from "node:assert/strict";+import test from "node:test";+import { buttonReferences } from "./storybook-button-usage.mjs";++test("button usage follows canonical imports and aliases, excluding native and unrelated buttons", () => {+ const entries = buttonReferences(`+ import { Button as Action } from '@/components/ui/button';+ import * as UI from './ui/button';+ import { Button } from './OtherButton';+ export const View = () => <><Action variant="outline" size="sm" /><UI.Button /><Button /><button /></>;+ `, "ui/src/components/Example.tsx", "app");+ assert.equal(entries.length, 2);+ assert.deepEqual(entries.map(({ variant, size, scope }) => ({ variant, size, scope })), [+ { variant: "outline", size: "sm", scope: "app" }, { variant: "default", size: "default", scope: "app" },+ ]);+});++test("dynamic props and spread precedence are not reported as known defaults", () => {+ const entries = buttonReferences(`+ import { Button } from '@/components/ui/button';+ export const View = () => <><Button {...props} /><Button variant={style} /><Button variant="cta" {...props} /><Button {...props} variant="ghost" /></>;+ `, "ui/src/pages/Example.tsx", "app");+ assert.deepEqual(entries.map(entry => entry.variant), ["dynamic / spread", "dynamic", "dynamic / spread", "ghost"]);+ assert.deepEqual(entries.map(entry => entry.size), ["dynamic / spread", "default", "dynamic / spread", "dynamic / spread"]);+});diff --git a/scripts/storybook-catalog.mjs b/scripts/storybook-catalog.mjsindex 618fb89389..b1ef8b0c5f 100644--- a/scripts/storybook-catalog.mjs+++ b/scripts/storybook-catalog.mjs@@ -14,6 +14,7 @@ const statuses = ["current", "proposed", "historical", "mixed", "unreviewed"];const implementations = ["production", "prototype", "mixed", "guide", "unreviewed"];const boundaries = ["fixtures", "fixture-server", "static", "unreviewed"];const annotationFields = new Set(["capabilities", "status", "implementation", "boundary", "notes", "home", "exception", "replacement"]);+const specialHomes = { overview: "Overview", "design-proposals": "Design proposals", foundations: "Foundations" };function files(root, dir) {return readdirSync(path.join(root, dir), { withFileTypes: true }).flatMap(entry => {@@ -74,7 +75,7 @@ export function catalogFromStories(stories, index) {const navigation = new Map(index.sections.flatMap(section => section.features.map(feature => [feature.id, `${sidebarLabel(section.title)}/${sidebarLabel(feature.title)}`])));return { version: 2, entries: stories.map(story => {const entry = { status: "unreviewed", implementation: "unreviewed", boundary: "unreviewed", notes: "", ...story.annotation, file: story.file, stableId: story.metaId, sidebarTitle: story.title };- const prefix = navigation.get(storyHome(entry)) ?? ({ overview: "Overview", foundations: "Foundations" })[storyHome(entry)];+ const prefix = navigation.get(storyHome(entry)) ?? specialHomes[storyHome(entry)];return { ...entry, purpose: story.title?.startsWith(`${prefix}/`) ? story.title.slice(prefix.length + 1) : story.title };}) };}@@ -91,14 +92,18 @@ export function validateCatalog(catalog, stories, index) {if (!boundaries.includes(entry.boundary)) errors.push(`${label}: invalid data boundary`);if (typeof entry.notes !== "string") errors.push(`${label}: notes must be text`);if (!Array.isArray(entry.capabilities) || entry.capabilities.some(ref => typeof ref !== "string")) { errors.push(`${label}: capabilities must be an array of IDs`); continue; }- if (entry.home !== undefined && entry.home !== "foundations") errors.push(`${label}: only shared foundations may override the capability home`);+ if (entry.home !== undefined && !["foundations", "design-proposals"].includes(entry.home)) errors.push(`${label}: only shared foundations and design proposals may override the capability home`);if (entry.exception !== undefined && (typeof entry.exception !== "string" || !entry.exception.trim())) errors.push(`${label}: exception must be nonempty text`);if (entry.home === "foundations" && !entry.exception) errors.push(`${label}: foundation home needs an explicit reason`);+ if (entry.home === "design-proposals") {+ if (entry.status !== "proposed") errors.push(`${label}: design proposal home requires proposed status`);+ if (!entry.exception) errors.push(`${label}: design proposal home needs an explicit staging reason`);+ }for (const ref of entry.capabilities) if (!refs.has(ref)) errors.push(`${label}: unknown feature capability ${ref}`);if (!entry.capabilities.length && !entry.exception) errors.push(`${label}: unmapped story needs an explicit reason`);if (entry.capabilities.length !== new Set(entry.capabilities).size) errors.push(`${label}: duplicate capability references`);const area = storyHome(entry);- const prefix = navigation.get(area) ?? ({ overview: "Overview", foundations: "Foundations" })[area];+ const prefix = navigation.get(area) ?? specialHomes[area];if (!label.startsWith(`${storyRoot}/${area}/`)) errors.push(`${label}: story must live in its primary feature folder ${area}`);if (!prefix || typeof entry.sidebarTitle !== "string" || !entry.sidebarTitle.startsWith(`${prefix}/`)) errors.push(`${label}: sidebar title must match its feature-map home`);if (typeof entry.stableId !== "string" || !entry.stableId.trim()) errors.push(`${label}: explicit meta ID is required`);@@ -124,7 +129,10 @@ export function renderIndex(catalog, stories, index) {"[Contract and maintenance](../storybook-map/README.md) · [Verification routes](verification.md)", "",`${stories.length} story files; ${stories.reduce((n, story) => n + story.ids.length, 0)} indexed stories. Counts describe inventory, not passed tests or complete feature coverage.`, "","Status describes product alignment; implementation describes the rendered subject; boundary describes simulated data. Limitations are authored alongside each story. Classification is not executed evidence. Related capabilities cross-list one canonical story file.", ""];- const homes = index.sections.flatMap(section => section.features.map(feature => ({ ...feature, section: section.title })));+ const homes = [+ { id: "design-proposals", title: "Proposed design system", section: "Design proposals", description: "Staged design work for review. These examples retain capability references but do not count as current product coverage." },+ ...index.sections.flatMap(section => section.features.map(feature => ({ ...feature, section: section.title }))),+ ];homes.push({ id: "foundations-and-guides", title: "Shared foundations and guides", section: "Foundations", description: "Shared components and contributor guidance outside the product feature index." });let currentSection;for (const feature of homes) {@@ -134,7 +142,7 @@ export function renderIndex(catalog, stories, index) {lines.push(`## ${feature.section}`, "");currentSection = feature.section;}- lines.push(`### ${feature.title}`, "", feature.description, "", ...(area !== "foundations-and-guides" ? [`[Feature recipe](../feature-map/${area}.md)`, ""] : []));+ lines.push(`### ${feature.title}`, "", feature.description, "", ...(!["foundations-and-guides", "design-proposals"].includes(area) ? [`[Feature recipe](../feature-map/${area}.md)`, ""] : []));if (!entries.length) lines.push("No primary story suite. Check capability lookup below for related examples; this does not imply a missing product feature.", "");else lines.push("| Story suite | Capabilities | Product / implementation / data | Stories / play functions | Review note |",diff --git a/scripts/storybook-catalog.test.mjs b/scripts/storybook-catalog.test.mjsindex c638759745..cdbe2445b8 100644--- a/scripts/storybook-catalog.test.mjs+++ b/scripts/storybook-catalog.test.mjs@@ -3,7 +3,7 @@ import { execFileSync } from "node:child_process";import { existsSync, readFileSync, rmSync } from "node:fs";import path from "node:path";import { test } from "node:test";-import { catalogFromStories, generateStorybook, renderVerification, scanStories, validateCatalog } from "./storybook-catalog.mjs";+import { catalogFromStories, generateStorybook, renderIndex, renderVerification, scanStories, validateCatalog } from "./storybook-catalog.mjs";import { featureIndex } from "./feature-map.mjs";import { mapFixture } from "./map-test-fixture.mjs";@@ -72,6 +72,48 @@ test("foundations preserve home and cross-capability references", t => {assert.match(inspect(f).errors.join("\n"), /foundation home needs an explicit reason/);});+test("design proposals keep stable IDs and capability links in a separate catalog section without filling coverage gaps", t => {+ const f = mapFixture(t);+ const originalIds = scanStories(f.root)[0].ids;+ rmSync(path.join(f.root, f.file));+ f.story("task", {+ home: "design-proposals",+ status: "proposed",+ capabilities: ["tasks/create", "tasks/discussion"],+ implementation: "production",+ boundary: "fixtures",+ exception: "Opt-in task row refresh awaiting design review and application rollout.",+ }, { area: "design-proposals", title: "Design proposals/Tasks/Task row" });+ const { catalog, stories, index, errors } = inspect(f);+ assert.deepEqual(errors, []);+ assert.deepEqual(stories[0].ids, originalIds);+ assert.equal(catalog.entries[0].home, "design-proposals");+ assert.equal(catalog.entries[0].purpose, "Tasks/Task row");+ const report = renderIndex(catalog, stories, index);+ const proposalSection = report.split("## Design proposals\n")[1].split("## Work\n")[0];+ assert.match(proposalSection, /Design proposals\/Tasks\/Task row/);+ assert.doesNotMatch(report, /feature-map\/design-proposals\.md/);+ assert.match(report, /- `tasks\/create`: .*\(proposed\)/);+ assert.match(report, /- `tasks\/discussion`: .*\(proposed\)/);+ assert.match(renderVerification(catalog, index), /2 without a current, mixed or unreviewed example/);+});++test("design proposal homes require proposed status, a staging reason and their own navigation", t => {+ const f = mapFixture(t);+ const metadata = { home: "design-proposals", status: "proposed", capabilities: ["tasks/create"], exception: "Staged refresh for review." };+ const options = { area: "design-proposals", title: "Design proposals/Tasks/Task row" };+ for (const status of ["current", "mixed", "unreviewed", "historical"]) {+ f.story("proposal", { ...metadata, status }, options);+ assert.match(inspect(f).errors.join("\n"), /design proposal home requires proposed status/);+ }+ f.story("proposal", { ...metadata, exception: undefined }, options);+ assert.match(inspect(f).errors.join("\n"), /design proposal home needs an explicit staging reason/);+ f.story("proposal", metadata, { ...options, title: "Work/Tasks/Task row" });+ assert.match(inspect(f).errors.join("\n"), /sidebar title/);+ f.story("misplaced", metadata, { title: options.title });+ assert.match(inspect(f).errors.join("\n"), /primary feature folder design-proposals/);+});+test("duplicate IDs, missing replacement references and collisions with generated guides fail", t => {const f = mapFixture(t);f.story("other", { capabilities: ["tasks/create"] }, { id: "stable-task" });diff --git a/scripts/storybook-feature-index.mjs b/scripts/storybook-feature-index.mjsindex d13df347b3..f0fa91b2d9 100644--- a/scripts/storybook-feature-index.mjs+++ b/scripts/storybook-feature-index.mjs@@ -8,7 +8,7 @@ export const generatedRoot = "ui/storybook/generated";export const generatedPreview = "ui/storybook/.storybook/preview.tsx";export function featureOrder(index) {- return ["Overview", ...index.sections.flatMap(section => [sidebarLabel(section.title),+ return ["Overview", "Design proposals", ["Foundations", "Components", "Layouts", "Pages", "AI Generated Test Pages", "Patterns", "Guidelines"], ...index.sections.flatMap(section => [sidebarLabel(section.title),section.features.flatMap(feature => [sidebarLabel(feature.title), ["Overview", "*"]]),]), "Foundations"];}diff --git a/scripts/storybook-feature-index.test.mjs b/scripts/storybook-feature-index.test.mjsindex 6797dd4125..cca941f314 100644--- a/scripts/storybook-feature-index.test.mjs+++ b/scripts/storybook-feature-index.test.mjs@@ -16,7 +16,7 @@ test("recipes own discovery, names, section order and multiline capability descrassert.deepEqual(index.sections.map(section => section.title), ["Work", "Connections"]);assert.deepEqual(index.sections.flatMap(section => section.features.map(feature => feature.id)), ["tasks", "goals", "apps"]);assert.equal(index.sections[0].features[0].capabilities[0].description, "Create work; retain its description.");- assert.deepEqual(featureOrder(index), ["Overview", "Work", ["Tasks", ["Overview", "*"], "Goals", ["Overview", "*"]], "Connections", ["Apps", ["Overview", "*"]], "Foundations"]);+ assert.deepEqual(featureOrder(index), ["Overview", "Design proposals", ["Foundations", "Components", "Layouts", "Pages", "AI Generated Test Pages", "Patterns", "Guidelines"], "Work", ["Tasks", ["Overview", "*"], "Goals", ["Overview", "*"]], "Connections", ["Apps", ["Overview", "*"]], "Foundations"]);});test("equal local orders preserve independently added features using their stable filename", t => {diff --git a/tests/storybook-visual/activity-list-design.spec.ts b/tests/storybook-visual/activity-list-design.spec.tsnew file mode 100644index 0000000000..cf043cbd88--- /dev/null+++ b/tests/storybook-visual/activity-list-design.spec.ts@@ -0,0 +1,71 @@+import { expect, test } from "@playwright/test";++test.use({ viewport: { width: 1200, height: 900 } });+async function openActivity(page: import("@playwright/test").Page, story = "playground") {+ await page.goto(`/iframe.html?id=design-activity-list--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByRole("list", { name: "Recent activity", exact: true })).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+}++test("activity shares task densities and responsive metadata without inventing task IDs", async ({ page }, testInfo) => {+ await openActivity(page);+ const list = page.getByRole("list", { name: "Recent activity", exact: true });+ const rows = list.locator('[data-slot="activity-row"]');+ await expect(rows).toHaveCount(6);+ await expect(list.locator('[data-slot="avatar-fallback"]')).toHaveText(["R", "R", "R", "R", "S"]);+ await expect(rows.nth(1)).toHaveAttribute("href", "/PAP/agents/agent-codex");+ await expect(rows.nth(2)).toHaveAttribute("href", /\/PAP\/projects\//);+ await expect(rows.nth(3)).toHaveAttribute("href", "/PAP/approvals/approval-budget");+ await expect(rows.nth(4)).toHaveAttribute("href", "/PAP/agents/agent-codex/runs/run-storybook");+ await expect(rows.nth(5)).not.toHaveAttribute("href");+ await expect(list.locator('[data-slot="task-row-identifier"]')).toHaveCount(1);+ for (const density of ["Comfortable (44px)", "Compact (32px)"]) {+ await page.getByRole("group", { name: "Row density", exact: true }).getByRole("button", { name: density, exact: true }).click();+ for (const width of ["Standard", "Narrow", "Smallest"]) {+ await page.getByRole("group", { name: "Container width", exact: true }).getByRole("button", { name: width, exact: true }).click();+ for (const row of await rows.all()) {+ await expect(row).toHaveCSS("height", density.startsWith("Compact") ? "32px" : "44px");+ await expect(row.locator('[data-slot="task-row-title"]')).toHaveCSS("font-size", "14px");+ await expect(row.locator('[data-slot="task-row-title"]')).toHaveCSS("line-height", "16px");+ await expect(row.locator('[data-slot="task-row-timestamp"]')).toBeVisible({ visible: width !== "Smallest" });+ }+ await expect(rows.first().locator('[data-slot="task-row-identifier"]')).toBeVisible({ visible: width === "Standard" });+ expect(await list.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true);+ }+ }+ await page.getByRole("button", { name: "Narrow", exact: true }).click();+ await page.screenshot({ path: testInfo.outputPath("activity-list-narrow.png"), fullPage: true });+});++test("activity keeps task hover cards and cell-local fade/marquee while non-task links stay independent", async ({ page }) => {+ await openActivity(page, "narrow");+ const rows = page.locator('[data-slot="activity-row"]');+ const row = rows.first();+ const title = row.locator('[data-slot="task-row-title"]');+ await expect(title).toHaveAttribute("data-truncated", "true");+ expect(await title.locator(".cell-marquee-viewport").evaluate(element => getComputedStyle(element).maskImage)).toContain("linear-gradient");+ const color = await title.evaluate(element => getComputedStyle(element).color);+ await title.hover();+ await expect(title).toHaveAttribute("data-revealing", "true");+ expect(await title.evaluate(element => getComputedStyle(element).color)).not.toBe(color);+ const popup = page.locator('[data-quicklook][data-slot="popover-content"]');+ await expect(popup).toBeVisible();+ await expect(popup.locator('[data-slot="task-preview-id"]')).toHaveText("PAP-431");+ await row.locator('[data-slot="task-row-timestamp"]').hover();+ await expect(title).not.toHaveAttribute("data-revealing");+ await rows.nth(1).hover();+ await expect(popup).toBeHidden();+ await expect(title).not.toHaveAttribute("data-revealing");+ await row.focus();+ await expect(popup).toBeVisible();+ await page.keyboard.press("Escape");+ await expect(popup).toBeHidden();+});++test("reference changes remain available below the fixed-height activity row", async ({ page }) => {+ await openActivity(page, "reference-changes");+ await expect(page.getByLabel("Added references", { exact: true })).toBeVisible();+ await expect(page.getByLabel("Removed references", { exact: true })).toBeVisible();+ await expect(page.getByRole("link", { name: "Task PAP-400: Superseded connector plan", exact: true })).toBeVisible();+ await expect(page.locator('[data-slot="activity-row"]').first()).toHaveCSS("height", "44px");+});diff --git a/tests/storybook-visual/app-shell-design.spec.ts b/tests/storybook-visual/app-shell-design.spec.tsnew file mode 100644index 0000000000..1f55ff87cf--- /dev/null+++ b/tests/storybook-visual/app-shell-design.spec.ts@@ -0,0 +1,244 @@+import { expect, test, type Page } from "@playwright/test";++test.use({ viewport: { width: 1200, height: 800 } });++async function openShell(page: Page, story: string) {+ await page.goto(`/iframe.html?id=design-app-shell--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("design-page-shell")).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+}++test("two and three panes share the sidebar, maintain boundaries, and fit narrower desktops", async ({ page }, testInfo) => {+ await openShell(page, "two-panes");+ const main = page.getByRole("main");+ const sidebar = page.locator(".design-sidebar");+ const resize = page.getByRole("separator", { name: "Resize sidebar", exact: true });+ await expect(page.getByRole("complementary")).toHaveCount(0);+ await expect(sidebar).toHaveCSS("width", "240px");+ expect((await main.boundingBox())!.width).toBe(960);+ await resize.press("ArrowRight");+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ expect((await main.boundingBox())!.width).toBe(944);+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ await page.screenshot({ path: testInfo.outputPath("app-shell-two-panes.png") });++ await openShell(page, "three-panes");+ const right = page.getByRole("complementary", { name: "Right sidebar", exact: true });+ await expect(resize).toHaveAttribute("aria-valuenow", "240");+ await expect(right).toHaveCSS("width", "320px");+ await expect(right).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await expect(right).toHaveCSS("border-left-width", "1px");+ await expect(right).toHaveCSS("border-left-color", "oklch(1 0 0 / 0.1)");+ await expect(page.locator(".design-page-main")).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await expect(sidebar).toHaveCSS("background-color", "oklch(0.269 0 0)");+ const mainBox = (await main.boundingBox())!;+ const rightBox = (await right.boundingBox())!;+ expect(mainBox.x + mainBox.width).toBe(rightBox.x);+ expect(rightBox.x + rightBox.width).toBe(1200);+ await page.screenshot({ path: testInfo.outputPath("app-shell-three-panes.png") });++ await page.setViewportSize({ width: 960, height: 800 });+ await expect(right).toHaveCSS("width", "288px");+ expect((await main.boundingBox())!.width).toBe(432);+ expect(await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth)).toBe(false);+ await page.screenshot({ path: testInfo.outputPath("app-shell-three-panes-narrow.png") });+ const skip = page.getByRole("link", { name: "Skip to main content" });+ await skip.focus();+ await skip.press("Enter");+ await expect(main).toBeFocused();+});++test("main and right content scroll independently while headers and sidebar stay in place", async ({ page }) => {+ await openShell(page, "independent-scrolling");+ const main = page.getByRole("main");+ const right = page.getByRole("region", { name: "Right sidebar content", exact: true });+ const sidebar = page.locator(".design-sidebar");+ const header = page.getByRole("heading", { name: "App shell", exact: true });+ const rightHeader = page.getByRole("complementary", { name: "Right sidebar", exact: true }).locator("header");+ const originalHeaderY = (await header.boundingBox())!.y;+ const originalRightHeaderY = (await rightHeader.boundingBox())!.y;+ const originalSidebarY = (await sidebar.boundingBox())!.y;+ for (const pane of [main, right]) {+ await expect(pane).toHaveCSS("scrollbar-color", "rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)");+ }+ await main.hover();+ await page.mouse.wheel(0, 600);+ await expect.poll(() => main.evaluate(element => element.scrollTop)).toBeGreaterThan(0);+ await expect(main).toHaveAttribute("data-scroll-active", "true");+ expect(await right.evaluate(element => element.scrollTop)).toBe(0);+ // Focus a pane with overflow and scroll it using the keyboard.+ await right.focus();+ await right.press("PageDown");+ await expect.poll(() => right.evaluate(element => element.scrollTop)).toBeGreaterThan(0);+ await expect(right).toHaveAttribute("data-scroll-active", "true");+ const mainScroll = await main.evaluate(element => element.scrollTop);+ await right.hover();+ await page.mouse.wheel(0, 400);+ expect(await main.evaluate(element => element.scrollTop)).toBe(mainScroll);+ expect((await header.boundingBox())!.y).toBe(originalHeaderY);+ expect((await rightHeader.boundingBox())!.y).toBe(originalRightHeaderY);+ expect((await sidebar.boundingBox())!.y).toBe(originalSidebarY);+ expect(await page.evaluate(() => window.scrollY)).toBe(0);+ for (const pane of [main, right]) {+ await expect(pane).not.toHaveAttribute("data-scroll-active", "true");+ await expect(pane).toHaveCSS("scrollbar-color", "rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)");+ }+});++test("right divider matches the left highlight, resizes in both directions, persists and resets", async ({ page }, testInfo) => {+ await openShell(page, "three-panes");+ const pane = page.getByRole("complementary", { name: "Right sidebar", exact: true });+ const resize = page.getByRole("separator", { name: "Resize right sidebar", exact: true });+ const left = page.getByRole("separator", { name: "Resize sidebar", exact: true });+ await expect(resize).toHaveAttribute("aria-valuenow", "320");+ await expect(resize).toHaveCSS("width", "8px");+ const highlight = await left.evaluate(element => getComputedStyle(element).getPropertyValue("--ring").trim());+ expect(highlight).toBe("oklch(0.556 0 0)");+ expect(await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--ring").trim())).toBe("oklch(0.985 0 0)");+ await left.hover();+ await expect(left.locator("div")).toHaveCSS("background-color", highlight);+ await resize.hover();+ await expect(resize.locator("div")).toHaveCSS("background-color", highlight);++ const box = (await resize.boundingBox())!;+ await page.mouse.move(box.x + box.width / 2, box.y + 160);+ await page.mouse.down();+ await page.mouse.move(box.x + box.width / 2 - 120, box.y + 160, { steps: 8 });+ await expect(pane).toHaveCSS("width", "440px");+ await expect(resize).toHaveAttribute("data-dragging", "");+ await page.mouse.up();+ await expect(resize).not.toHaveAttribute("data-dragging", "");+ await page.reload();+ await expect(pane).toHaveCSS("width", "440px");+ await resize.press("ArrowRight");+ await expect(pane).toHaveCSS("width", "424px");+ await resize.press("ArrowLeft");+ await expect(pane).toHaveCSS("width", "440px");+ await page.getByRole("button", { name: "Maximize side panel", exact: true }).click();+ await expect(resize).toHaveCount(0);+ await page.getByRole("button", { name: "Restore side panel", exact: true }).click();+ await expect(pane).toHaveCSS("width", "440px");+ await page.setViewportSize({ width: 960, height: 800 });+ await expect(pane).toHaveCSS("width", "400px");+ expect((await page.getByRole("main").boundingBox())!.width).toBe(320);+ await resize.dblclick();+ await expect(pane).toHaveCSS("width", "288px");+ await page.setViewportSize({ width: 1200, height: 800 });+ await expect(pane).toHaveCSS("width", "320px");+ await page.reload();+ await expect(pane).toHaveCSS("width", "320px");+ await resize.press("Home");+ await expect(pane).toHaveCSS("width", "260px");+ await resize.press("End");+ await expect(pane).toHaveCSS("width", "640px");+ await resize.dblclick();+ await expect(pane).toHaveCSS("width", "320px");+ await expect(left).toHaveAttribute("aria-valuenow", "240");+ await resize.hover();+ await page.screenshot({ path: testInfo.outputPath("app-shell-right-resize-highlight.png") });+});++test("both pane dividers animate a double-click reset while manual sizing stays immediate", async ({ page }) => {+ await openShell(page, "three-panes");+ const left = page.getByRole("separator", { name: "Resize sidebar", exact: true });+ const leftShell = page.locator(".design-page-navigation");+ const leftPanel = leftShell.locator(".sidebar-shell-panel");+ const right = page.getByRole("separator", { name: "Resize right sidebar", exact: true });+ const rightPane = page.getByRole("complementary", { name: "Right sidebar", exact: true });+ // Observe real CSS transitions, so this proves motion rather than only its end state.+ for (const [pane, property] of [[leftShell, "width"], [leftPanel, "width"], [rightPane, "flex-basis"]] as const) {+ await pane.evaluate((element, propertyName) => {+ element.addEventListener("transitionrun", event => {+ const transition = event as TransitionEvent;+ if (event.target !== element || transition.propertyName !== propertyName) return;+ element.setAttribute("data-observed-reset-transition", propertyName);+ element.setAttribute("data-observed-reset-duration", getComputedStyle(element).transitionDuration);+ });+ }, property);+ }+ await left.press("End");+ await expect(leftShell).toHaveCSS("width", "420px");+ await expect(leftShell).toHaveCSS("transition-duration", "0s");+ await left.dblclick();+ for (const pane of [leftShell, leftPanel]) {+ await expect(pane).toHaveAttribute("data-observed-reset-transition", "width");+ await expect(pane).toHaveAttribute("data-observed-reset-duration", "0.2s");+ await expect(pane).toHaveCSS("width", "240px");+ }+ await expect(leftShell).not.toHaveAttribute("data-width-resetting", "true");+ await right.press("End");+ await expect(rightPane).toHaveCSS("width", "640px");+ await expect(rightPane).toHaveCSS("transition-duration", "0s");+ await right.dblclick();+ await expect(rightPane).toHaveAttribute("data-observed-reset-transition", "flex-basis");+ await expect(rightPane).toHaveAttribute("data-observed-reset-duration", "0.2s");+ await expect(rightPane).toHaveCSS("width", "320px");+ await expect(rightPane).not.toHaveAttribute("data-width-resetting", "true");+});++test("reduced motion resets both panes instantly", async ({ page }) => {+ await page.emulateMedia({ reducedMotion: "reduce" });+ await openShell(page, "three-panes");+ for (const [name, selector, width] of [+ ["Resize sidebar", ".design-page-navigation", "240px"],+ ["Resize right sidebar", ".design-page-aside", "320px"],+ ]) {+ const resize = page.getByRole("separator", { name, exact: true });+ const pane = page.locator(selector);+ await resize.press("End");+ await resize.dblclick();+ await expect(pane).toHaveCSS("width", width);+ await expect(pane).toHaveCSS("transition-duration", "0s");+ expect(await pane.evaluate(element => element.getAnimations().length)).toBe(0);+ }+});++test("production pane controls add and close tabs, maximize, restore, and reopen the pane", async ({ page }, testInfo) => {+ await openShell(page, "three-panes");+ const right = page.getByRole("complementary", { name: "Right sidebar", exact: true });+ await expect(right.getByRole("tab")).toHaveCount(4);+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Properties");+ await page.getByRole("button", { name: "Maximize side panel", exact: true }).click();+ await expect(right).toHaveCSS("width", "960px");+ await expect(page.getByRole("main")).toHaveCount(0);+ await expect(page.locator(".design-sidebar")).toBeVisible();++ await right.getByRole("tab", { name: "Tasks", exact: true }).click();+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Tasks");+ await right.getByRole("tab", { name: "Tasks", exact: true }).press("ArrowRight");+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Plan");+ await right.getByRole("tab", { name: "Tasks", exact: true }).click();+ await right.getByRole("button", { name: "Close Tasks", exact: true }).click();+ await expect(right.getByRole("tab", { name: "Tasks", exact: true })).toHaveCount(0);+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Plan");+ await right.getByRole("button", { name: "Open a new tab", exact: true }).click();+ await page.getByRole("option", { name: "Tasks", exact: true }).click();+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Tasks");+ await expect(right.getByRole("tab")).toHaveCount(4);+ await right.getByRole("tab", { name: "Tasks", exact: true }).hover();+ await right.getByRole("button", { name: "Close Tasks", exact: true }).click();+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Artifacts");++ await page.getByRole("button", { name: "Restore side panel", exact: true }).click();+ await expect(right).toHaveCSS("width", "320px");+ await expect(page.getByRole("main")).toBeVisible();+ await page.getByRole("button", { name: "Close side panel", exact: true }).click();+ await expect(right).toHaveCount(0);+ const toggle = page.getByRole("button", { name: "Toggle side panel", exact: true });+ await expect(toggle).toBeFocused();+ await toggle.click();+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Artifacts");+ await expect(right.getByRole("tab")).toHaveCount(3);++ // Closing the final tab leaves the production launcher available for recovery.+ for (const label of ["Artifacts", "Plan", "Properties"]) {+ const tab = right.getByRole("tab", { name: label, exact: true });+ await tab.click();+ await right.getByRole("button", { name: `Close ${label}`, exact: true }).click();+ }+ await expect(right.getByRole("tabpanel")).toHaveCount(0);+ await right.getByRole("option", { name: "Properties", exact: true }).click();+ await expect(right.getByRole("tabpanel")).toHaveAccessibleName("Properties");+ await page.screenshot({ path: testInfo.outputPath("app-shell-production-pane-controls.png") });+});diff --git a/tests/storybook-visual/buttons-design.spec.ts b/tests/storybook-visual/buttons-design.spec.tsnew file mode 100644index 0000000000..5bc8a16f8e--- /dev/null+++ b/tests/storybook-visual/buttons-design.spec.ts@@ -0,0 +1,80 @@+import { expect, test, type Page } from "@playwright/test";++test.use({ viewport: { width: 1600, height: 1000 } });+async function openButtons(page: Page, story = "playground") {+ await page.goto(`/iframe.html?id=design-buttons--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("buttons-playground")).toBeVisible();+ return page.getByTestId("proposal-button-samples");+}++test("the playground uses a single sandbox inventory and proposal theme", async ({ page }) => {+ const samples = await openButtons(page);+ await expect(samples.locator("[data-button-variant]")).toHaveCount(7);+ await expect(samples.locator("[data-button-size]")).toHaveCount(8);+ await expect(page.locator(".design-proposal-theme")).toBeVisible();+ await expect(page.locator("iframe")).toHaveCount(0);+ await expect(page.getByRole("region", { name: "Button usage inventory", exact: true })).toHaveCount(0);+ await expect(page.getByLabel("Comparison layout", { exact: true })).toHaveCount(0);+ await expect(page.getByRole("group", { name: "Button playground controls", exact: true })).toHaveCount(1);+ await expect(samples.getByRole("region", { name: "All button variants", exact: true }).locator('[aria-busy="true"]')).toHaveCount(7);+});++test("on-canvas controls update the live sandbox specimen and reset it", async ({ page }) => {+ const samples = await openButtons(page);+ await page.getByLabel("Button label", { exact: true }).fill("Review changes");+ await page.getByLabel("Button variant", { exact: true }).selectOption("cta");+ await page.getByLabel("Button size", { exact: true }).selectOption("sm");+ await page.getByLabel("Button icon", { exact: true }).selectOption("trailing");+ await page.getByLabel("Button state", { exact: true }).selectOption("loading");+ const specimen = samples.getByRole("region", { name: "Live specimen", exact: true });+ const button = specimen.getByRole("button", { name: "Review changes", exact: true });+ await expect(button).toBeDisabled();+ await expect(button).toHaveAttribute("aria-busy", "true");+ await expect(button).toHaveAttribute("data-variant", "cta");+ await expect(button).toHaveAttribute("data-size", "sm");+ await page.getByRole("button", { name: "Reset controls", exact: true }).click();+ await expect(page.getByLabel("Button label", { exact: true })).toHaveValue("Create task");+ await expect(specimen.getByRole("button", { name: "Create task", exact: true })).toBeEnabled();+});++test("sandbox context actions use local state and menus inherit the same theme", async ({ page }) => {+ await openButtons(page);+ const toolbar = page.getByRole("toolbar", { name: "Task list controls" });+ await toolbar.getByRole("button", { name: "Board view", exact: true }).click();+ await expect(toolbar.getByRole("button", { name: "Board view", exact: true })).toHaveAttribute("aria-pressed", "true");+ await toolbar.getByRole("button", { name: "Task view: All tasks", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "Needs attention", exact: true }).click();+ await expect(toolbar.getByRole("button", { name: "Task view: Needs attention", exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Star preview", exact: true }).click();+ await expect(page.getByRole("button", { name: "Unstar preview", exact: true })).toHaveAttribute("aria-pressed", "true");+ await toolbar.getByRole("button", { name: "Filter", exact: true }).click();+ const filters = page.getByRole("dialog", { name: "Filters", exact: true });+ await expect(filters).toHaveCSS("background-color", "rgb(26, 26, 26)");+ const pageBackground = await page.getByTestId("buttons-playground").evaluate(element => getComputedStyle(element).backgroundColor);+ await expect(filters).toHaveCSS("background-color", pageBackground);+});++test("specimens retain real dimensions, state previews and surface controls", async ({ page }, testInfo) => {+ const errors: string[] = [];+ page.on("pageerror", error => errors.push(error.message));+ const samples = await openButtons(page);+ const specimen = samples.getByRole("region", { name: "Live specimen", exact: true });+ await expect(page.getByLabel("Button size", { exact: true }).locator('option[value="sm"]')).toHaveText("Small · 36px high");+ await page.getByLabel("Button variant", { exact: true }).selectOption("cta");+ const button = specimen.getByRole("button", { name: "Create task", exact: true });+ await button.hover();+ await button.evaluate(async element => { await Promise.all(element.getAnimations().map(animation => animation.finished)); });+ const hoveredBackground = await button.evaluate(element => getComputedStyle(element).backgroundColor);+ await page.getByLabel("Button state", { exact: true }).selectOption("hover");+ await expect(button).toHaveCSS("background-color", hoveredBackground);+ await page.getByLabel("Button state", { exact: true }).selectOption("focus-visible");+ await expect(button).not.toHaveCSS("box-shadow", "none");+ await page.getByLabel("Button size", { exact: true }).selectOption("icon-xs");+ await expect(specimen.getByTestId("button-pixel-size")).toHaveText("24 × 24px");+ await expect(button).toHaveAttribute("aria-label", "Create task");+ await page.getByLabel("Button surface", { exact: true }).selectOption("muted");+ await expect(specimen.locator(".bg-muted").first()).toHaveCSS("background-color", "oklch(0.269 0 0)");+ await page.evaluate(() => window.scrollTo(0, 0));+ await page.screenshot({ path: testInfo.outputPath("sandbox-button-workbench.png") });+ expect(errors).toEqual([]);+});diff --git a/tests/storybook-visual/color-foundations.spec.ts b/tests/storybook-visual/color-foundations.spec.tsnew file mode 100644index 0000000000..dde285e71d--- /dev/null+++ b/tests/storybook-visual/color-foundations.spec.ts@@ -0,0 +1,107 @@+import { expect, test, type Page } from "@playwright/test";++test.use({ viewport: { width: 1440, height: 1000 } });++async function openColors(page: Page, story: string) {+ await page.goto(`/iframe.html?id=design-foundations-colors--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("color-foundations-preview")).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+ await page.mouse.move(0, 0);+}++test("color reference reads the Paper palette and foreground focus color from the active CSS theme", async ({ page }, testInfo) => {+ await openColors(page, "token-reference");+ const expected = {+ foreground: "oklch(0.985 0 0)",+ background: "#1a1a1a",+ "background-alt": "oklch(0.145 0 0)",+ muted: "oklch(0.269 0 0)",+ "muted-highlight": "#333333",+ "muted-alt": "#202020",+ "muted-foreground": "oklch(0.708 0 0)",+ border: "oklch(1 0 0 / 10%)",+ ring: "oklch(0.985 0 0)",+ "focus-ring-halo": "color-mix(in srgb, oklch(0.985 0 0) 20%, transparent)",+ };+ await expect(page.locator("tr[data-token]")).toHaveCount(Object.keys(expected).length);+ for (const [name, value] of Object.entries(expected)) {+ await expect(page.locator(`tr[data-token="${name}"] [data-token-value]`)).toHaveText(value);+ }+ await expect(page.getByTestId("color-foundations-preview")).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await page.screenshot({ path: testInfo.outputPath("color-token-reference.png"), fullPage: true });+});++test("shared cards use three surfaces and one border; inputs use background-alt", async ({ page }, testInfo) => {+ await openColors(page, "surfaces-and-elevation");+ for (const [level, color] of [["low", "rgb(26, 26, 26)"], ["middle", "rgb(32, 32, 32)"], ["high", "oklch(0.269 0 0)"]]) {+ const card = page.locator(`[data-slot="card"][data-elevation="${level}"]`);+ await expect(card).toHaveCSS("background-color", color);+ await expect(card).toHaveCSS("border-color", "oklch(1 0 0 / 0.1)");+ }+ await expect(page.locator('[data-pane="Left sidebar"]')).toHaveCSS("background-color", "oklch(0.269 0 0)");+ for (const field of [page.getByLabel("Task name"), page.getByLabel("Search tasks", { exact: true })]) {+ await expect(field).toHaveCSS("background-color", "oklch(0.145 0 0)");+ await expect(field).toHaveCSS("border-color", "oklch(1 0 0 / 0.1)");+ }+ await page.getByLabel("Task name").focus();+ await expect(page.getByLabel("Task name")).toHaveCSS("border-color", "oklch(0.985 0 0)");+ await expect.poll(() => page.getByLabel("Task name").evaluate(element => getComputedStyle(element).boxShadow)).toContain("/ 0.2)");+ expect(await page.getByLabel("Task name").evaluate(element => getComputedStyle(element).boxShadow)).toContain("3px");+ await page.screenshot({ path: testInfo.outputPath("color-surfaces-and-elevation.png"), fullPage: true });+});++test("task hover and portaled menus share the palette; production stories restore their theme", async ({ page }, testInfo) => {+ await openColors(page, "text-and-interaction");+ const row = page.locator('[data-slot="task-row"]').first();+ const title = row.locator('[data-slot="task-row-title"]');+ await expect(title).toHaveCSS("color", "oklch(0.708 0 0)");+ await expect(title).toHaveCSS("font-weight", "400");+ await row.hover();+ await expect(row).toHaveCSS("background-color", "oklch(0.269 0 0)");+ await expect(title).toHaveCSS("color", "oklch(0.985 0 0)");+ await expect(title).toHaveCSS("font-weight", "400");+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ const menu = page.getByRole("menu", { name: "Columns", exact: true });+ await expect(menu).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await expect(menu).toHaveCSS("border-color", "oklch(1 0 0 / 0.1)");+ const option = menu.getByRole("menuitemcheckbox", { name: "Task ID", exact: true });+ await option.hover();+ await expect(option).toHaveCSS("background-color", "rgb(51, 51, 51)");+ await expect(option).toHaveCSS("color", "oklch(0.985 0 0)");+ await page.screenshot({ path: testInfo.outputPath("color-interaction-and-portal.png"), fullPage: true });+ await page.keyboard.press("Escape");++ // The CSS scope must disappear with its marker, even within the same document.+ await page.locator(".design-proposal-theme").evaluate(element => element.classList.remove("design-proposal-theme"));+ await expect.poll(() => page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--background").trim())).toBe("oklch(0.205 0 0)");+ await expect.poll(() => page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--muted-alt").trim())).toBe("");+ await expect.poll(() => page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--ring").trim())).toBe("oklch(0.556 0 0)");+ await page.goto("/iframe.html?id=foundations-primitive-matrix--all-primitives&viewMode=story&globals=theme:dark");+ await expect(page.getByRole("heading", { name: "Primitives and interaction states", exact: true })).toBeVisible();+ await expect(page.locator(".design-proposal-theme")).toHaveCount(0);+ await expect.poll(() => page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--background").trim())).toBe("oklch(0.205 0 0)");+});++test("light proposals inherit the production palette, including portaled menus", async ({ page }) => {+ const palette = () => page.evaluate(() => {+ const style = getComputedStyle(document.documentElement);+ return Object.fromEntries(["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "muted", "muted-foreground", "accent", "border", "input", "ring", "sidebar"].map(name => [name, style.getPropertyValue(`--${name}`).trim()]));+ });+ await page.goto("/iframe.html?id=foundations-primitive-matrix--all-primitives&viewMode=story&globals=theme:light");+ await expect(page.getByRole("heading", { name: "Primitives and interaction states", exact: true })).toBeVisible();+ const production = await palette();+ await page.goto("/iframe.html?id=design-foundations-colors--token-reference&viewMode=story&globals=theme:light");+ await expect(page.getByTestId("color-foundations-preview")).toBeVisible();+ await expect(page.locator("html")).not.toHaveClass(/dark/);+ expect(await palette()).toEqual(production);+ await expect(page.locator('tr[data-token="background"] [data-token-value]')).toHaveText(production.background);+ await page.goto("/iframe.html?id=design-foundations-colors--surfaces-and-elevation&viewMode=story&globals=theme:light");+ await expect(page.getByLabel("Task name")).toBeVisible();+ await expect(page.locator('[data-slot="card"][data-elevation="middle"]')).toHaveCSS("background-color", "oklch(0.97 0 0)");+ await page.getByLabel("Task name").focus();+ await expect(page.getByLabel("Task name")).toHaveCSS("outline-style", "solid");+ await page.goto("/iframe.html?id=design-foundations-colors--text-and-interaction&viewMode=story&globals=theme:light");+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await expect(page.getByRole("menu", { name: "Columns", exact: true })).toHaveCSS("background-color", "oklch(1 0 0)");+ expect(await palette()).toEqual(production);+});diff --git a/tests/storybook-visual/flyout-design.spec.ts b/tests/storybook-visual/flyout-design.spec.tsnew file mode 100644index 0000000000..2a7451039a--- /dev/null+++ b/tests/storybook-visual/flyout-design.spec.ts@@ -0,0 +1,88 @@+import { expect, test } from "@playwright/test";++test.use({ viewport: { width: 1512, height: 1050 } });++test("standalone Popover sections support toggles, radio checks and the canonical account menu", async ({ page }, testInfo) => {+ await page.goto("/iframe.html?id=design-flyout--columns&viewMode=story&globals=theme:dark");+ const columns = page.getByRole("dialog", { name: "Columns", exact: true });+ await expect(columns).toBeVisible();+ const taskId = columns.getByRole("button", { name: "Task ID", exact: true });+ await page.mouse.move(0, 0);+ await expect(taskId).toHaveCSS("color", "oklch(0.708 0 0)");+ await expect(taskId.locator("svg.lucide-check")).toHaveCSS("color", "oklch(0.708 0 0)");+ await taskId.hover();+ await expect(taskId).toHaveCSS("color", "oklch(0.985 0 0)");+ await expect(taskId.locator("svg.lucide-check")).toHaveCSS("color", "oklch(0.985 0 0)");+ await taskId.click();+ await expect(taskId).toHaveAttribute("aria-pressed", "false");+ await expect(taskId.locator("svg")).toHaveCount(0);+ await columns.getByRole("button", { name: "Reset defaults", exact: true }).click();+ await expect(taskId).toHaveAttribute("aria-pressed", "true");+ await page.mouse.move(0, 0);+ await page.screenshot({ path: testInfo.outputPath("flyout-component.png") });+ await columns.screenshot({ path: testInfo.outputPath("flyout-component-panel.png") });+ await page.keyboard.press("Escape");+ await expect(columns).toBeHidden();+ await expect(page.getByRole("button", { name: "Columns", exact: true })).toBeFocused();++ await page.goto("/iframe.html?id=design-flyout--views&viewMode=story&globals=theme:dark");+ await expect(page.getByRole("menuitemradio")).toHaveText(["Inbox", "Unread", "Needs attention", "All tasks"]);+ await expect(page.getByRole("menuitemradio", { name: "All tasks", exact: true })).toBeChecked();+ await page.getByRole("menuitemradio", { name: "Unread", exact: true }).click();+ await page.getByRole("button", { name: "Views", exact: true }).click();+ const unread = page.getByRole("menuitemradio", { name: "Unread", exact: true });+ await expect(unread).toBeChecked();+ await expect(unread.locator("svg.lucide-check")).toBeVisible();++ await page.goto("/iframe.html?id=design-flyout--profile&viewMode=story&globals=theme:dark");+ await expect(page.getByRole("link", { name: "View profile", exact: true })).toBeVisible();+ await expect(page.getByRole("dialog", { name: "Account", exact: true }).locator('[data-slot="avatar-fallback"]')).toHaveText("R");+ const invite = page.getByRole("link", { name: "Invite", exact: true });+ await expect(invite).toHaveAttribute("href", /\/company\/settings\/members\?tab=invites$/);+ await invite.click();+ await expect(page.getByRole("dialog", { name: "Account", exact: true })).toBeHidden();+});++test("Popover Account Menu matches the canonical Sidebar Account Menu", async ({ page }, testInfo) => {+ const snapshots = [];+ for (const story of ["design-sidebar--account-menu", "design-flyout--profile"]) {+ await page.goto(`/iframe.html?id=${story}&viewMode=story&globals=theme:dark`);+ const menu = page.getByRole("dialog", { name: "Account", exact: true });+ await expect(menu.getByRole("link", { name: "Invite", exact: true })).toBeVisible();+ await page.mouse.move(0, 0);+ snapshots.push(await menu.evaluate(element => ({+ actions: [...element.querySelectorAll("a,button")].map(action => ({ label: action.textContent?.trim(), href: action.getAttribute("href"), target: action.getAttribute("target") })),+ width: element.getBoundingClientRect().width,+ height: element.getBoundingClientRect().height,+ shadow: getComputedStyle(element).boxShadow,+ background: getComputedStyle(element).backgroundColor,+ })));+ await page.keyboard.press("Escape");+ await expect(menu).toBeHidden();+ const trigger = page.getByRole("button", { name: "Open account menu", exact: true });+ await expect(trigger).toBeFocused();+ await trigger.click();+ await expect(menu).toBeVisible();+ if (story === "design-flyout--profile") await menu.screenshot({ path: testInfo.outputPath("canonical-account-menu.png") });+ await menu.getByRole("link", { name: "Settings", exact: true }).click();+ await expect(menu).toBeHidden();+ }+ expect(snapshots[1]).toEqual(snapshots[0]);+});++test("Shadow control previews an override and clearing it restores the shared token", async ({ page }, testInfo) => {+ await page.goto("/?path=/story/design-flyout--columns");+ const preview = page.frameLocator("#storybook-preview-iframe");+ const panel = preview.getByRole("dialog", { name: "Columns", exact: true });+ await expect(panel).toBeVisible();+ const defaultShadow = await panel.evaluate(element => getComputedStyle(element).boxShadow);+ const showAddons = page.getByRole("button", { name: "Show addon panel", exact: true });+ if (await showAddons.isVisible()) await showAddons.click();+ await page.getByRole("tab", { name: /^Controls/ }).click();+ const shadow = page.locator("#control-shadow");+ await shadow.fill("0 8px 24px rgb(0 0 0 / 35%)");+ await expect(panel).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.35) 0px 8px 24px 0px");+ await shadow.fill("");+ await expect(panel).toHaveCSS("box-shadow", defaultShadow);+ await page.screenshot({ path: testInfo.outputPath("flyout-shadow-controls.png") });+});diff --git a/tests/storybook-visual/playwright.config.ts b/tests/storybook-visual/playwright.config.tsindex 49ee969a17..0e7608f185 100644--- a/tests/storybook-visual/playwright.config.ts+++ b/tests/storybook-visual/playwright.config.ts@@ -16,7 +16,9 @@ const snapshotDir = process.env.STORYBOOK_VISUAL_SNAPSHOT_DIRexport default defineConfig({testDir: ".",projects: [- { name: "stories", testIgnore: "agent-personas.spec.ts" },+ // The reproduction trial has a dedicated fixed-clock/browser contract and+ // requires its frozen first-submission PNG via TRIAL_REFERENCE_PNG.+ { name: "stories", testIgnore: ["agent-personas.spec.ts", "task-list-reproduction-trial.spec.ts"] },{name: "agent-personas", testMatch: "agent-personas.spec.ts", fullyParallel: false,snapshotPathTemplate: `${snapshotDir}/agent-personas/{arg}{ext}`,diff --git a/tests/storybook-visual/sidebar-design.spec.ts b/tests/storybook-visual/sidebar-design.spec.tsnew file mode 100644index 0000000000..225fcad069--- /dev/null+++ b/tests/storybook-visual/sidebar-design.spec.ts@@ -0,0 +1,122 @@+import { expect, test } from "@playwright/test";++test.use({ viewport: { width: 1100, height: 862 } });++async function openSidebar(page: import("@playwright/test").Page, story = "default") {+ await page.goto(`/iframe.html?id=design-sidebar--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.locator(".design-sidebar")).toBeVisible();+}++test("standalone sidebar supports resize, navigation states, search and production menus", async ({ page }, testInfo) => {+ await openSidebar(page);+ const sidebar = page.locator(".design-sidebar");+ await expect(sidebar).toHaveCSS("background-color", "oklch(0.269 0 0)");+ await expect(sidebar).toHaveCSS("background-clip", "padding-box");+ const headerBorder = await page.locator(".design-page-header").evaluate(element => getComputedStyle(element).borderBottomColor);+ await expect(sidebar).toHaveCSS("border-right-color", headerBorder);+ await expect(sidebar.getByRole("link", { name: "Tasks", exact: true })).toHaveAttribute("aria-current", "page");+ const dashboard = sidebar.getByRole("link", { name: "Dashboard", exact: true });+ await dashboard.hover();+ await expect(dashboard).toHaveCSS("background-color", "rgb(51, 51, 51)");+ await dashboard.focus();+ await expect(dashboard).toBeFocused();+ const resize = page.getByRole("separator", { name: "Resize sidebar" });+ await resize.press("ArrowRight");+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ await resize.dblclick();+ await expect(resize).toHaveAttribute("aria-valuenow", "240");+ await expect(sidebar).toHaveCSS("width", "240px");+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "240");+ await sidebar.getByRole("button", { name: "Global search" }).click();+ await expect(page.getByRole("dialog")).toBeVisible();+ await page.keyboard.press("Escape");+ await page.screenshot({ path: testInfo.outputPath("sidebar-component.png") });++ await openSidebar(page, "organization-menu");+ const research = page.getByRole("menuitem", { name: /Research Bureau/ });+ await expect(research).toBeVisible();+ await research.click();+ await expect(sidebar.locator(".design-sidebar-recents a")).toHaveCount(0);++ await openSidebar(page, "account-menu");+ await expect(page.getByRole("link", { name: "Invite", exact: true })).toBeVisible();+});++test("sidebar specimens cover narrow, overflowing and empty recents", async ({ page }) => {+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openSidebar(page, "narrow");+ await expect(page.getByRole("separator", { name: "Resize sidebar" })).toHaveAttribute("aria-valuenow", "208");+ await openSidebar(page, "long-labels");+ const label = page.locator(".design-sidebar-recents a").first().locator("[data-cell-marquee]");+ await expect(label).toHaveAttribute("data-truncated", "true");+ await label.hover();+ await expect.poll(() => label.locator(".cell-marquee-content").evaluate(element => getComputedStyle(element).transform)).not.toBe("matrix(1, 0, 0, 1, 0, 0)");+ await openSidebar(page, "many-recent-tasks");+ await expect(page.locator(".design-sidebar-recents a")).toHaveCount(30);+ const recents = page.getByRole("region", { name: "Recent tasks", exact: true });+ expect(await recents.evaluate(element => element.scrollHeight > element.clientHeight)).toBe(true);+ const navigation = page.locator(".design-sidebar-navigation");+ const header = page.getByText("Recent Tasks", { exact: true });+ const headerY = (await header.boundingBox())!.y;+ const navScroll = await navigation.evaluate(element => element.scrollTop);+ await expect(recents).toHaveCSS("scrollbar-color", "rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)");+ await recents.hover();+ await expect(recents).not.toHaveAttribute("data-scroll-active");+ await page.mouse.wheel(0, 300);+ await expect(recents).toHaveAttribute("data-scroll-active", "true");+ await expect(recents).toHaveCSS("scrollbar-color", "oklch(0.4 0 0) rgba(0, 0, 0, 0)");+ expect(await recents.evaluate(element => element.scrollTop)).toBeGreaterThan(0);+ expect(await navigation.evaluate(element => element.scrollTop)).toBe(navScroll);+ expect((await header.boundingBox())!.y).toBe(headerY);+ await expect(recents).not.toHaveAttribute("data-scroll-active");+ await expect(recents).toHaveCSS("scrollbar-color", "rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)");+ await expect(page.getByRole("button", { name: "Open account menu", exact: true })).toBeInViewport();+ await openSidebar(page, "empty-recent-tasks");+ await expect(page.locator(".design-sidebar-recents")).toHaveCount(0);+ await expect(page.getByRole("link", { name: "Tasks", exact: true })).toBeVisible();+});++test("organization title resets after menu dismissal outside its hit area", async ({ page }) => {+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openSidebar(page);+ const trigger = page.getByRole("button", { name: /organization switcher/ });+ const label = trigger.locator("[data-cell-marquee]");+ for (const dismissal of ["escape", "outside"]) {+ await trigger.hover();+ await expect(label).toHaveAttribute("data-revealing", "true");+ await expect.poll(() => label.locator(".cell-marquee-content").evaluate(element => getComputedStyle(element).transform)).not.toBe("matrix(1, 0, 0, 1, 0, 0)");+ await trigger.click();+ await expect(page.getByRole("menuitem", { name: /Research Bureau/ })).toBeVisible();+ await page.mouse.move(800, 200);+ if (dismissal === "escape") await page.keyboard.press("Escape");+ else await page.mouse.click(800, 200);+ await expect(page.getByRole("menuitem", { name: /Research Bureau/ })).toBeHidden();+ await expect(trigger).toBeFocused();+ await expect(label).not.toHaveAttribute("data-revealing");+ await expect(label.locator(".cell-marquee-content")).toHaveCSS("transform", "matrix(1, 0, 0, 1, 0, 0)");+ }+ // Restored focus remains usable; tabbing away and back is a new interaction.+ await trigger.press("Tab");+ await page.keyboard.press("Shift+Tab");+ await expect(trigger).toBeFocused();+ await expect(label).toHaveAttribute("data-revealing", "true");+});++test("light sidebar uses production surface, navigation contrast and selected colors", async ({ page }) => {+ await page.goto('/iframe.html?id=design-sidebar--default&viewMode=story&globals=theme:light');+ const sidebar = page.locator('.design-sidebar');+ await expect(sidebar).toBeVisible();+ // The production primary sidebar renders a border/background blend, not --sidebar.+ await expect(sidebar).toHaveCSS('background-color', 'color(srgb 0.948957 0.949131 0.949147)');+ const tasks = sidebar.getByRole('link', { name: 'Tasks', exact: true });+ await expect(tasks).toHaveCSS('background-color', 'oklch(0.88 0 0)');+ await expect(tasks).toHaveCSS('color', 'oklch(0.205 0 0)');+ const projects = sidebar.getByRole('link', { name: 'Projects', exact: true });+ await expect(projects).toHaveCSS('color', 'oklab(0.145 0 0 / 0.8)');+ await projects.hover();+ await expect(projects).toHaveCSS('background-color', 'oklch(0.88 0 0)');+ await expect(projects).toHaveCSS('color', 'oklch(0.205 0 0)');+});diff --git a/tests/storybook-visual/tabs-design.spec.ts b/tests/storybook-visual/tabs-design.spec.tsnew file mode 100644index 0000000000..59492b2d07--- /dev/null+++ b/tests/storybook-visual/tabs-design.spec.ts@@ -0,0 +1,44 @@+import { expect, test } from "@playwright/test";++test.use({ viewport: { width: 1440, height: 1100 } });+test("canonical tabs share filled selection with compact and standard type sizes", async ({ page }) => {+ const errors: string[] = [];+ page.on("pageerror", error => errors.push(error.message));+ await page.goto("/iframe.html?id=design-tabs--playground&viewMode=story&globals=theme:dark");+ const preview = page.getByTestId("tabs-preview");+ await expect(preview.getByRole("region")).toHaveCount(2);+ for (const [name, size, height] of [["Standard", "14px", 32], ["Compact", "12px", 24]] as const) {+ const section = preview.getByRole("region", { name, exact: true });+ const paperclip = section.getByRole("tab", { name: "Paperclip", exact: true });+ await paperclip.focus();+ await page.keyboard.press("ArrowRight");+ const selected = section.getByRole("tab", { name: "Composio", exact: true });+ await expect(selected).toBeFocused();+ await expect(selected).toHaveAttribute("aria-selected", "true");+ await expect(section.getByRole("tabpanel", { name: "Composio", exact: true })).toBeVisible();+ await expect(selected).toHaveCSS("font-size", size);+ await expect(selected).toHaveCSS("font-weight", "400");+ expect(await selected.evaluate(element => element.getBoundingClientRect().height)).toBe(height);+ expect(await selected.evaluate(element => getComputedStyle(element).backgroundColor)).not.toBe("rgba(0, 0, 0, 0)");+ expect(await selected.evaluate(element => getComputedStyle(element, "::after").display)).toBe("none");+ }+ const compact = preview.getByRole("region", { name: "Compact", exact: true });+ await compact.getByRole("radio", { name: "Videos", exact: true }).click();+ await expect(compact.getByRole("radio", { name: "Videos", exact: true })).toHaveAttribute("aria-checked", "true");+ await compact.getByRole("radio", { name: "Videos", exact: true }).click();+ await expect(compact.getByRole("radio", { name: "Videos", exact: true })).toHaveAttribute("aria-checked", "true");+ await expect(compact.getByText("Artifact type: video", { exact: true })).toBeVisible();+ await preview.getByRole("combobox", { name: "Tabs container width", exact: true }).selectOption("narrow");+ expect(await preview.getByTestId("tabs-specimens").evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true);+ expect(errors).toEqual([]);+});++test("disabled choices are unavailable in canonical tabs and segmented controls", async ({ page }) => {+ await page.goto("/iframe.html?id=design-tabs--playground&viewMode=story&globals=theme:dark");+ await expect(page.getByRole("radio", { name: "Restricted", exact: true })).toBeDisabled();+ await page.goto("/iframe.html?id=design-segmented-controllers--disabled&viewMode=story&globals=theme:dark");+ await expect(page.getByRole("tab", { name: "Agent Actions", exact: true })).toBeDisabled();+ await page.getByRole("tab", { name: "Activity", exact: true }).focus();+ await page.keyboard.press("ArrowRight");+ await expect(page.getByRole("tab", { name: "Activity", exact: true })).toBeFocused();+});diff --git a/tests/storybook-visual/task-hover-card-design.spec.ts b/tests/storybook-visual/task-hover-card-design.spec.tsnew file mode 100644index 0000000000..09df42a218--- /dev/null+++ b/tests/storybook-visual/task-hover-card-design.spec.ts@@ -0,0 +1,72 @@+import { expect, test } from "@playwright/test";++test.use({ viewport: { width: 1100, height: 900 } });++async function openPreview(page: import("@playwright/test").Page, story = "playground") {+ await page.goto(`/iframe.html?id=design-task-hover-card--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("task-hover-card-reference")).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+}++test("task hover card follows the padded Paper layout and shared popover shadow", async ({ page }, testInfo) => {+ await openPreview(page);+ const card = page.getByTestId("task-hover-card-reference");+ await expect(card).toHaveCSS("width", "280px");+ await expect(card).toHaveCSS("padding", "16px");+ await expect(card).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await expect(card).toHaveCSS("border-top-width", "1px");+ const shadow = await card.evaluate(element => getComputedStyle(element).getPropertyValue("--shadow-flyout").trim());+ expect(shadow).not.toBe("");+ await expect(card).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.2) 0px 4px 16px 0px");+ const title = card.locator('[data-slot="task-preview-title"]');+ await expect(title).toHaveCSS("font-size", "14px");+ await expect(title).toHaveCSS("font-weight", "600");+ await expect(title).toHaveCSS("line-height", "18px");+ await expect(title).toHaveCSS("-webkit-line-clamp", "2");+ await expect(title).toHaveCSS("color", "oklch(0.985 0 0)");+ await expect(card.locator('[data-slot="task-preview-id"]')).toHaveCSS("font-size", "12px");+ const description = card.locator('[data-slot="task-preview-description"]');+ await expect(description).toHaveCSS("font-size", "12px");+ await expect(description).toHaveCSS("line-height", "18px");+ await expect(description).toHaveCSS("-webkit-line-clamp", "3");+ await expect(card.getByTestId("quicklook-project")).toHaveCount(0);+ await page.screenshot({ path: testInfo.outputPath("task-hover-card.png"), fullPage: true });+});++test("text links can disable previews while activity keeps them and summary rows stay opted out", async ({ page }) => {+ await openPreview(page);+ const popup = page.locator('[data-slot="popover-content"][data-quicklook]');+ const link = page.getByRole("link", { name: "Preview linked task PAP-173", exact: true });+ await link.hover();+ await expect(popup).toBeVisible();+ await expect(popup).toHaveCSS("padding", "16px");+ await expect(popup).toHaveCSS("width", "280px");+ await expect(popup.locator('[data-slot="task-preview-title"]')).toHaveText("Artifact Review: Finish the remaining approved wireframe gaps");+ await page.mouse.move(1000, 850);+ await expect(popup).toBeHidden();+ await link.focus();+ await expect(popup).toBeVisible();+ await page.keyboard.press("Escape");+ await expect(popup).toBeHidden();+ await page.getByRole("button", { name: "Hover preview: On", exact: true }).click();+ await link.hover();+ await expect(page.getByRole("button", { name: "Hover preview: Off", exact: true })).toBeVisible();+ // Give the production hover-intent timer a chance to fire, then verify no card.+ await page.waitForTimeout(200);+ await expect(popup).toHaveCount(0);+ const activity = page.getByRole("region", { name: "Activity preview example", exact: true });+ await activity.getByRole("link").hover();+ await expect(popup).toBeVisible();+ const summary = page.getByRole("region", { name: "Summary without hover preview", exact: true });+ await summary.getByRole("link", { name: /^Open PAP-173:/ }).hover();+ await expect(popup).toBeHidden();+ await expect(summary.locator('[data-slot="task-row"]')).toHaveCSS("height", "44px");+});++test("missing descriptions collapse naturally without leaving an empty block", async ({ page }) => {+ await openPreview(page, "no-description");+ const card = page.getByTestId("task-hover-card-reference");+ await expect(card.locator('[data-slot="task-preview-description"]')).toHaveCount(0);+ await expect(card.locator('[data-slot="task-preview-title"]')).toBeVisible();+ await expect(card).toHaveCSS("padding", "16px");+});diff --git a/tests/storybook-visual/task-list-page-design.spec.ts b/tests/storybook-visual/task-list-page-design.spec.tsnew file mode 100644index 0000000000..25de4ad6d8--- /dev/null+++ b/tests/storybook-visual/task-list-page-design.spec.ts@@ -0,0 +1,478 @@+import { expect, test, type Page } from "@playwright/test";++test.use({ viewport: { width: 1512, height: 862 } });++async function openPage(page: Page, story = "default") {+ await page.goto(`/iframe.html?id=tasks-list-page-design--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("design-page-shell")).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+ await page.mouse.move(0, 0);+}+const rows = (page: Page) => page.locator('.design-task-list-panel [data-slot="task-row"]');++test("toolbar outlines remain opaque and consistent across control fills without changing popover borders", async ({ page }, testInfo) => {+ await openPage(page);+ const controls = [+ page.locator(".design-task-search"),+ page.locator(".design-view-trigger"),+ page.locator(".design-view-toggle"),+ page.getByRole("button", { name: "Collapse all tasks", exact: true }),+ page.locator(".design-toolbar-filter > button"),+ ];+ const border = await controls[0].evaluate(element => getComputedStyle(element).borderTopColor);+ expect(border).not.toContain("/"); // An opaque color has no fractional alpha.+ expect(border).not.toBe("transparent");+ const fill = await controls[0].evaluate(element => getComputedStyle(element).backgroundColor);+ expect(await controls[1].evaluate(element => getComputedStyle(element).backgroundColor)).not.toBe(fill);+ for (const control of controls) {+ await expect(control).toHaveCSS("border-top-color", border);+ await expect(control).toHaveCSS("border-top-width", "1px");+ }+ await controls[1].hover();+ await expect(controls[1]).toHaveCSS("border-top-color", border);+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ await expect(page.getByRole("button", { name: "Board view", exact: true })).toHaveAttribute("aria-pressed", "true");+ await expect(controls[2]).toHaveCSS("border-top-color", border);+ await page.getByRole("textbox", { name: "Search tasks", exact: true }).focus();+ await expect(controls[0]).toHaveCSS("border-top-color", "oklch(0.985 0 0)");+ await expect(controls[0]).toHaveCSS("outline-style", "none");+ await expect.poll(() => controls[0].evaluate(element => getComputedStyle(element).boxShadow)).toContain("/ 0.2)");+ expect(await controls[0].evaluate(element => getComputedStyle(element).boxShadow)).toContain("3px");+ await controls[4].click();+ const popover = page.getByRole("dialog", { name: "Filters", exact: true });+ await expect(popover).toBeVisible();+ const popoverBorder = await popover.evaluate(element => getComputedStyle(element).borderTopColor);+ expect(popoverBorder).toContain("/ 0.1"); // Surface borders keep the translucent foundation token.+ await page.keyboard.press("Escape");+ await page.mouse.move(0, 0);+ await page.screenshot({ path: testInfo.outputPath("toolbar-consistent-borders.png"), fullPage: true });+});++test("tabbing through the toolbar shows the shared foreground edge and halo on every control", async ({ page }, testInfo) => {+ await openPage(page);+ const toolbar = page.getByRole("toolbar", { name: "Task list controls", exact: true });+ const search = toolbar.getByRole("textbox", { name: "Search tasks", exact: true });+ await search.focus();+ for (const control of [+ toolbar.getByRole("button", { name: "List view", exact: true }),+ toolbar.getByRole("button", { name: "Board view", exact: true }),+ toolbar.getByRole("button", { name: "Collapse all tasks", exact: true }),+ toolbar.locator(".design-toolbar-filter > button"),+ toolbar.getByRole("button", { name: "New Task", exact: true }),+ ]) {+ await page.keyboard.press("Tab");+ await expect(control).toBeFocused();+ await expect(control).toHaveCSS("outline-style", "solid");+ await expect(control).toHaveCSS("outline-color", "oklch(0.985 0 0)");+ await expect.poll(() => control.evaluate(element => getComputedStyle(element).boxShadow)).toContain("/ 0.2)");+ expect(await control.evaluate(element => getComputedStyle(element).boxShadow)).toContain("3px");+ }+ // The view menu precedes search and uses a different trigger wrapper.+ await search.focus();+ await page.keyboard.press("Shift+Tab");+ const view = toolbar.getByRole("button", { name: "Task view: All tasks", exact: true });+ await expect(view).toBeFocused();+ await expect(view).toHaveCSS("outline-color", "oklch(0.985 0 0)");+ await expect.poll(() => view.evaluate(element => getComputedStyle(element).boxShadow)).toContain("/ 0.2)");+ await page.screenshot({ path: testInfo.outputPath("toolbar-keyboard-focus.png"), fullPage: true });+});++test("full page uses the reviewed row contract and three default columns", async ({ page }, testInfo) => {+ await openPage(page);+ await expect(page.getByRole("navigation", { name: "Main navigation" })).toBeVisible();+ await expect(page.getByRole("heading", { name: "Tasks", exact: true })).toBeVisible();+ await expect(page.getByRole("toolbar", { name: "Task list controls" })).toBeVisible();+ await expect(rows(page)).toHaveCount(10);+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(page.getByRole("button", { name: "Group tasks", exact: true })).toHaveCount(0);+ for (const link of await page.locator(".design-sidebar-navigation a").all()) await expect(link).toHaveCSS("font-size", "14px");+ await expect(page.locator(".design-sidebar-new-task")).toHaveCSS("font-size", "14px");+ await expect(page.getByRole("button", { name: "Open account menu", exact: true })).toHaveCSS("font-size", "14px");+ await expect(page.getByRole("button", { name: "Open account menu", exact: true }).locator('[data-slot="avatar-fallback"]')).toHaveText("R");+ const recentLinks = page.locator(".design-sidebar-recents a");+ await expect(recentLinks).toHaveCount(5);+ await expect(page.locator(".design-sidebar-recents").getByText("Recent Tasks", { exact: true })).toBeVisible();+ for (const link of await recentLinks.all()) await expect(link).toHaveCSS("font-weight", "400");+ const dashboard = page.getByRole("navigation", { name: "Main navigation" }).getByRole("link", { name: "Dashboard", exact: true });+ await expect(dashboard).toHaveCSS("line-height", "21px");+ expect((await dashboard.locator("svg").boundingBox())!.x).toBe(28);+ expect((await dashboard.boundingBox())!.height).toBe(33);+ expect((await recentLinks.first().boundingBox())!.y).toBeGreaterThan((await page.getByRole("link", { name: "Audit", exact: true }).boundingBox())!.y);+ await expect(page.locator(".design-sidebar-account")).toHaveCSS("border-top-width", "0px");+ await expect(page.locator(".design-sidebar")).toHaveCSS("background-color", "oklch(0.269 0 0)");+ await expect(page.locator(".design-sidebar")).toHaveCSS("border-right-color", "oklch(1 0 0 / 0.1)");+ await expect(page.locator(".design-task-search")).toHaveCSS("background-color", "oklch(0.145 0 0)");+ const geometry = await page.getByTestId("design-page-shell").evaluate(shell => {+ const main = shell.querySelector<HTMLElement>(".design-page-main")!;+ const toolbar = shell.querySelector<HTMLElement>(".design-page-toolbar")!;+ const row = shell.querySelector<HTMLElement>('[data-slot="task-row"]')!;+ const title = row.querySelector<HTMLElement>('[data-slot="task-row-title"]')!;+ return {+ mainX: main.getBoundingClientRect().x,+ headerHeight: shell.querySelector(".design-page-header")!.getBoundingClientRect().height,+ toolbarHeight: toolbar.getBoundingClientRect().height,+ background: getComputedStyle(main).backgroundColor,+ rowHeight: row.getBoundingClientRect().height,+ titleSize: getComputedStyle(title).fontSize,+ titleLeading: getComputedStyle(title).lineHeight,+ pageOverflow: document.documentElement.scrollWidth > window.innerWidth,+ };+ });+ expect(geometry).toEqual({ mainX: 240, headerHeight: 60, toolbarHeight: 44, background: "rgb(26, 26, 26)", rowHeight: 44, titleSize: "14px", titleLeading: "16px", pageOverflow: false });+ await page.screenshot({ path: testInfo.outputPath("task-list-page.png"), fullPage: true });+ await page.locator(".design-sidebar").screenshot({ path: testInfo.outputPath("task-list-sidebar-paper.png") });+ const resize = page.getByRole("separator", { name: "Resize sidebar", exact: true });+ await resize.press("ArrowRight");+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ expect((await page.locator(".design-page-main").boundingBox())!.x).toBe(256);+ await resize.hover();+ await expect(resize).toHaveCSS("cursor", "col-resize");+ await expect(resize.locator(":scope > div")).toHaveCSS("background-color", "oklch(0.556 0 0)");+ await page.screenshot({ path: testInfo.outputPath("task-list-sidebar-resize.png"), fullPage: true });+});++test("search preserves ancestor context, recovers from no results, and expansion works", async ({ page }) => {+ await openPage(page);+ await page.getByRole("button", { name: "Collapse all tasks" }).click();+ await expect(rows(page)).toHaveCount(6);+ await page.getByRole("button", { name: "Expand all tasks" }).click();+ await expect(rows(page)).toHaveCount(10);+ await page.getByRole("textbox", { name: "Search tasks", exact: true }).fill("expired credential");+ await expect(rows(page)).toHaveCount(3);+ await expect(page.locator(".design-task-results")).toHaveText("1 matching task · Parent tasks included for context");+ await expect(rows(page).locator('[data-slot="task-row-title"]')).toHaveText(["Improve connector reliability", "Design reconnect and recovery flows", /Document connector recovery behavior/]);+ await page.getByRole("textbox", { name: "Search tasks", exact: true }).fill("no matching task exists");+ await expect(rows(page)).toHaveCount(0);+ await expect(page.getByText("No tasks match this view", { exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Clear filters", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ await expect(page.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");+});++test("views change the collection while keeping task families together", async ({ page }) => {+ await openPage(page);+ await page.getByRole("button", { name: "Task view: All tasks" }).click();+ await expect(page.getByRole("menuitemradio")).toHaveText(["Inbox", "Unread", "Needs attention", "All tasks"]);+ await page.getByRole("menuitemradio", { name: "Unread", exact: true }).click();+ await expect(rows(page)).toHaveCount(3);+ await expect(page.locator(".design-task-results")).toHaveText("3 matching tasks");+ await page.reload();+ await expect(page.getByRole("button", { name: "Task view: Unread" })).toBeVisible();+ await expect(rows(page)).toHaveCount(3);+ await page.getByRole("button", { name: "Task view: Unread" }).click();+ await page.getByRole("menuitemradio", { name: "Needs attention", exact: true }).click();+ await expect(page.locator(".design-task-results")).toHaveText("2 matching tasks · Parent tasks included for context");+ await expect(rows(page)).toHaveCount(3);+ await expect(rows(page).locator('[data-slot="task-row-title"]')).toHaveText(["Improve connector reliability", "Define connector health states", "Review budget notifications"]);+ await page.getByRole("button", { name: "Task view: Needs attention" }).click();+ await page.getByRole("menuitemradio", { name: "Inbox", exact: true }).click();+ await expect(page.locator(".design-task-results")).toHaveText("6 matching tasks");+ await expect(rows(page)).toHaveCount(6);+ await page.reload();+ await page.getByRole("button", { name: "Task view: Inbox" }).click();+ await expect(page.getByRole("menuitemradio", { name: "Inbox", exact: true })).toBeChecked();+ await page.getByRole("menuitemradio", { name: "All tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ await expect(page.getByRole("rowgroup", { name: "Improve connector reliability task group", exact: true }).locator('[data-slot="task-row"]')).toHaveCount(5);+ await page.reload();+ await expect(page.getByRole("button", { name: "Task view: All tasks" })).toBeVisible();+ await expect(rows(page)).toHaveCount(10);+});++test("production filters operate on fixtures and list preferences survive board switching", async ({ page }) => {+ await openPage(page);+ await page.locator(".design-toolbar-filter > button").click();+ await page.getByRole("checkbox", { name: "Done", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(page.locator(".design-task-results")).toHaveText("2 matching tasks · Parent tasks included for context");+ await expect(rows(page)).toHaveCount(3);+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ await expect(page.locator(".design-task-board")).toBeVisible();+ await expect(page.locator(".design-task-list-panel")).toBeHidden();+ await expect(page.getByRole("button", { name: "Collapse all tasks", exact: true })).toBeDisabled();+ await page.getByRole("button", { name: "List view", exact: true }).click();+ await expect(rows(page)).toHaveCount(3);+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+});++test("refreshed filters use five searchable peer groups and the shared popover shadow", async ({ page }, testInfo) => {+ await openPage(page);+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ const shadow = await page.getByRole("menu", { name: "Columns", exact: true }).evaluate(element => getComputedStyle(element).boxShadow);+ await page.keyboard.press("Escape");+ await page.locator(".design-toolbar-filter > button").click();+ const filters = page.getByRole("dialog", { name: "Filters", exact: true });+ await expect(filters).toHaveCSS("box-shadow", shadow);+ await expect(filters).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await expect(filters.getByRole("heading", { level: 3 })).toHaveText(["Status", "Project", "Creator", "Assignee", "Label"]);+ const geometry = await filters.locator(".task-filter-group").evaluateAll(groups => groups.map(group => {+ const bounds = group.getBoundingClientRect();+ return { x: bounds.x, y: bounds.y, width: bounds.width };+ }));+ expect(new Set(geometry.map(group => group.y)).size).toBe(1);+ for (const [index, group] of geometry.entries()) {+ expect(group.width).toBe(200);+ if (index) expect(group.x - geometry[index - 1].x).toBe(216);+ }+ for (const name of ["projects", "creators", "assignees", "labels"]) await expect(filters.getByRole("textbox", { name: `Search ${name}`, exact: true })).toBeVisible();+ await expect(filters.getByText("Quick filters", { exact: true })).toHaveCount(0);+ for (const dot of await filters.locator(".task-filter-label-dot").all()) await expect(dot).toHaveCSS("border-radius", "5px");+ await page.screenshot({ path: testInfo.outputPath("task-filters-five-groups.png") });+ await filters.screenshot({ path: testInfo.outputPath("task-filters-panel.png") });++ const projectSearch = filters.getByRole("textbox", { name: "Search projects", exact: true });+ await projectSearch.fill("no such project");+ await expect(filters.getByText("No projects match.", { exact: true })).toBeVisible();+ await projectSearch.fill("Board");+ await filters.getByRole("checkbox", { name: "Board UI", exact: true }).click();+ await filters.getByRole("textbox", { name: "Search creators", exact: true }).fill("Scott");+ await filters.getByRole("checkbox", { name: "Scott", exact: true }).click();+ await filters.getByRole("textbox", { name: "Search assignees", exact: true }).fill("Codex");+ await filters.getByRole("checkbox", { name: "CodexCoder", exact: true }).click();+ await filters.getByRole("textbox", { name: "Search labels", exact: true }).fill("Design");+ await filters.getByRole("checkbox", { name: "Design system", exact: true }).click();+ await expect(rows(page).locator('[data-slot="task-row-title"]')).toHaveText(["Review budget notifications"]);+ await filters.getByRole("button", { name: "Clear", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ for (const input of await filters.getByRole("textbox").all()) await expect(input).toHaveValue("");+ await expect(filters.getByRole("checkbox", { checked: true })).toHaveCount(0);++ await page.setViewportSize({ width: 900, height: 862 });+ const bounds = (await filters.boundingBox())!;+ expect(bounds.x).toBeGreaterThanOrEqual(0);+ expect(bounds.x + bounds.width).toBeLessThanOrEqual(900);+ expect(await filters.locator(".task-filter-group").evaluateAll(groups => new Set(groups.map(group => group.getBoundingClientRect().y)).size)).toBeGreaterThan(1);+ expect(await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth)).toBe(false);+ await page.keyboard.press("Escape");+ await expect(filters).toBeHidden();+ await expect(page.locator(".design-toolbar-filter > button")).toBeFocused();+});++test("New Task opens the shared task composer", async ({ page }) => {+ await openPage(page);+ await page.getByRole("toolbar", { name: "Task list controls" }).getByRole("button", { name: "New Task", exact: true }).click();+ await expect(page.getByRole("dialog", { name: "New task", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "Create task", exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("dialog", { name: "New task", exact: true })).toBeHidden();+});++test("board has one horizontal scroll owner and fades only its clipped edges", async ({ page }, testInfo) => {+ await openPage(page);+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ const board = page.locator(".design-task-board");+ const viewport = board.locator(".horizontal-scroll-viewport");+ const scroll = board.getByRole("region", { name: "Task board columns", exact: true });+ const scrollOwners = () => board.evaluate(element => [element, ...element.querySelectorAll("*"), element.closest("main")!].filter(node => {+ const style = getComputedStyle(node);+ return ["auto", "scroll"].includes(style.overflowX) && node.scrollWidth > node.clientWidth + 1;+ }).length);+ expect(await scrollOwners()).toBe(1);+ await expect(viewport).toHaveAttribute("data-overflow-left", "false");+ await expect(viewport).toHaveAttribute("data-overflow-right", "true");+ expect(await viewport.evaluate(element => getComputedStyle(element, "::before").opacity)).toBe("0");+ expect(await viewport.evaluate(element => getComputedStyle(element, "::after").opacity)).toBe("1");+ expect(await viewport.evaluate(element => getComputedStyle(element, "::after").pointerEvents)).toBe("none");++ await scroll.evaluate(element => element.scrollTo({ left: element.scrollWidth / 4 }));+ await expect(viewport).toHaveAttribute("data-overflow-left", "true");+ await expect(viewport).toHaveAttribute("data-overflow-right", "true");+ await page.screenshot({ path: testInfo.outputPath("task-board-scroll-fades.png") });+ await scroll.evaluate(element => element.scrollTo({ left: element.scrollWidth }));+ await expect(viewport).toHaveAttribute("data-overflow-left", "true");+ await expect(viewport).toHaveAttribute("data-overflow-right", "false");+ await scroll.hover();+ await page.mouse.wheel(-300, 0);+ await expect(viewport).toHaveAttribute("data-overflow-right", "true");++ await page.setViewportSize({ width: 2400, height: 862 });+ await expect(viewport).toHaveAttribute("data-overflow-left", "false");+ await expect(viewport).toHaveAttribute("data-overflow-right", "false");+ expect(await scrollOwners()).toBe(0);+ await page.setViewportSize({ width: 1000, height: 862 });+ await expect(viewport).toHaveAttribute("data-overflow-right", "true");+ expect(await scrollOwners()).toBe(1);+ expect(await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth)).toBe(false);+});++test("production organization switcher changes selection without leaking task fixtures", async ({ page }, testInfo) => {+ await openPage(page);+ await page.getByRole("button", { name: "Open Paperclip Storybook organization switcher", exact: true }).click();+ await expect(page.getByText("Organizations", { exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "Edit", exact: true })).toBeVisible();+ await page.screenshot({ path: testInfo.outputPath("task-list-organization-menu.png"), fullPage: true });+ await page.getByRole("menuitem", { name: /Research Bureau/ }).click();+ await expect(page.getByRole("button", { name: "Open Research Bureau organization switcher", exact: true })).toBeVisible();+ await expect(rows(page)).toHaveCount(0);+ await expect(page.getByText("No tasks in this organization", { exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Open Research Bureau organization switcher", exact: true }).click();+ await page.getByRole("menuitem", { name: /Paperclip Storybook/ }).click();+ await expect(rows(page)).toHaveCount(10);+});++test("production account menu fits profile, settings, Invite and theme actions", async ({ page }, testInfo) => {+ await openPage(page);+ const trigger = page.getByRole("button", { name: "Open account menu", exact: true });+ await trigger.click();+ await expect(page.getByRole("link", { name: "View profile", exact: true })).toBeVisible();+ await expect(page.getByRole("link", { name: "Settings", exact: true })).toBeVisible();+ const invite = page.getByRole("link", { name: "Invite", exact: true });+ await expect(invite).toBeVisible();+ await expect(invite).toHaveAttribute("href", /\/company\/settings\/members\?tab=invites$/);+ await expect(page.getByRole("link", { name: "Documentation", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "Switch to light mode", exact: true })).toBeVisible();+ const account = page.getByRole("dialog", { name: "Account", exact: true });+ await expect(account.locator('[data-slot="avatar-fallback"]')).toHaveText("R");+ const content = await account.evaluate(menu => {+ const last = menu.querySelector('[data-flyout-options] > button:last-of-type')!;+ return { bottomGap: menu.getBoundingClientRect().bottom - last.getBoundingClientRect().bottom, minimumHeight: getComputedStyle(menu).minHeight };+ });+ expect(content.minimumHeight).toBe("0px");+ expect(content.bottomGap).toBe(13);+ await page.screenshot({ path: testInfo.outputPath("task-list-account-menu.png"), fullPage: true });+ await page.keyboard.press("Escape");+ await expect(page.getByRole("link", { name: "View profile", exact: true })).toBeHidden();+ await expect(trigger).toBeFocused();+ await trigger.click();+ await invite.click();+ await expect(account).toBeHidden();+});++test("organization, account, Views and Columns share the refreshed flyout appearance", async ({ page }, testInfo) => {+ await openPage(page);+ const scenarios = [+ { trigger: "Open Paperclip Storybook organization switcher", role: "menu", name: /organization switcher/, option: /Research Bureau/, optionRole: "menuitem", screenshot: "flyout-organizations" },+ { trigger: "Open account menu", role: "dialog", name: "Account", option: "Settings", optionRole: "link", screenshot: "flyout-account" },+ // Radix names this menu from its trigger, so the accessible name changes with the selected view.+ { trigger: "Task view: All tasks", role: "menu", name: undefined, option: "Unread", optionRole: "menuitemradio", screenshot: "flyout-views" },+ { trigger: "Columns", role: "menu", name: "Columns", option: "Created by", optionRole: "menuitemcheckbox", screenshot: "flyout-columns" },+ ] as const;+ let sharedShadow: string | undefined;+ for (const scenario of scenarios) {+ await page.getByRole("button", { name: scenario.trigger, exact: true }).click();+ const menu = page.getByRole(scenario.role, { name: scenario.name, exact: true });+ await expect(menu).toHaveCSS("background-color", "rgb(26, 26, 26)");+ await expect(menu).toHaveCSS("border-width", "1px");+ await expect(menu).toHaveCSS("border-radius", "8px");+ const shadow = await menu.evaluate(element => getComputedStyle(element).boxShadow);+ expect(shadow).not.toBe("none");+ if (sharedShadow) expect(shadow).toBe(sharedShadow);+ sharedShadow = shadow;+ const option = menu.getByRole(scenario.optionRole, { name: scenario.option, exact: true });+ await expect(option).toHaveCSS("color", "oklch(0.708 0 0)");+ const selected = menu.locator('[data-selected="true"], [aria-checked="true"]').first();+ if (await selected.count()) {+ await expect(selected).toHaveCSS("color", "oklch(0.708 0 0)");+ await expect(selected.locator("svg.lucide-check")).toHaveCSS("color", "oklch(0.708 0 0)");+ }+ await option.hover();+ await expect(option).toHaveCSS("background-color", "rgb(51, 51, 51)");+ await expect(option).toHaveCSS("color", await menu.locator("[data-flyout-header]").evaluate(element => getComputedStyle(element).color));+ if (scenario.trigger === "Task view: All tasks") {+ const selected = menu.getByRole("menuitemradio", { name: "All tasks", exact: true });+ await expect(selected).toBeChecked();+ await expect(selected.locator("svg.lucide-check")).toBeVisible();+ await expect(selected.locator("svg.lucide-circle")).toHaveCount(0);+ }+ await page.screenshot({ path: testInfo.outputPath(`${scenario.screenshot}.png`) });+ await page.keyboard.press("Escape");+ await expect(menu).toBeHidden();+ }+});++test("separate sidebar search target opens the production global palette", async ({ page }) => {+ await openPage(page);+ const organization = page.getByRole("button", { name: "Open Paperclip Storybook organization switcher", exact: true });+ const search = page.getByRole("button", { name: "Global search", exact: true });+ await expect(organization.locator("svg.lucide-chevrons-up-down")).toHaveCount(0);+ const organizationBounds = (await organization.boundingBox())!;+ expect((await search.boundingBox())!.x).toBeGreaterThanOrEqual(organizationBounds.x + organizationBounds.width);+ await search.click();+ const input = page.getByPlaceholder("Search tasks, agents, projects...", { exact: true });+ await expect(input).toBeVisible();+ await expect(page.getByText("Organizations", { exact: true })).toBeHidden();+ await input.fill("Codex");+ await expect(page.getByRole("option", { name: /CodexCoder/ })).toBeVisible();+ await page.keyboard.press("Escape");+ await expect(input).toBeHidden();+ await expect(page.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");+});++test("sidebar truncated labels share the table marquee and fade without extra tab stops", async ({ page }) => {+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openPage(page);+ const organization = page.getByRole("button", { name: "Open Paperclip Storybook organization switcher", exact: true });+ const label = organization.locator("[data-cell-marquee]");+ const recent = page.locator(".design-sidebar-recents a").first().locator("[data-cell-marquee]");+ for (const text of [label, recent]) {+ await expect(text).toHaveAttribute("data-truncated", "true");+ await expect(text).not.toHaveAttribute("tabindex");+ expect(await text.locator(".cell-marquee-viewport").evaluate(element => getComputedStyle(element).maskImage)).toContain("linear-gradient");+ await text.hover();+ await expect(text).toHaveAttribute("data-revealing", "true");+ await expect.poll(() => text.locator(".cell-marquee-content").evaluate(element => getComputedStyle(element).transform)).not.toBe("matrix(1, 0, 0, 1, 0, 0)");+ await page.mouse.move(0, 0);+ await expect(text).not.toHaveAttribute("data-revealing");+ await expect(text.locator(".cell-marquee-content")).toHaveCSS("transform", "matrix(1, 0, 0, 1, 0, 0)");+ }+ const fitting = page.getByRole("link", { name: "Dashboard", exact: true }).locator("[data-cell-marquee]");+ await fitting.hover();+ await expect(fitting).not.toHaveAttribute("data-truncated");+ await expect(fitting).not.toHaveAttribute("data-revealing");+ await page.mouse.move(0, 0);+ await organization.focus();+ await expect(label).toHaveAttribute("data-revealing", "true");+ await page.keyboard.press("Escape");+ await expect(label).not.toHaveAttribute("data-revealing");+});++test("fractionally clipped recent titles reveal even when scrollWidth equals clientWidth", async ({ page }, testInfo) => {+ await openPage(page);+ const task = page.locator(".design-sidebar-recents").getByRole("link", { name: "Review budget notifications", exact: true });+ const label = task.locator("[data-cell-marquee]");+ const dimensions = await label.evaluate(element => {+ const content = element.querySelector(".cell-marquee-content")!;+ const range = document.createRange();+ range.selectNodeContents(content);+ return { client: element.clientWidth, scroll: content.scrollWidth, viewport: element.getBoundingClientRect().width, text: range.getBoundingClientRect().width };+ });+ expect(dimensions.scroll).toBe(dimensions.client);+ expect(dimensions.text).toBeGreaterThan(dimensions.viewport);+ expect(dimensions.text - dimensions.viewport).toBeLessThan(1);+ await expect(label).toHaveAttribute("data-truncated", "true");+ const bounds = (await task.boundingBox())!;+ // Hover the link padding, outside the text rectangle, just like the row's+ // visible hover state. Small overflow must still reveal the full final glyph.+ await page.mouse.move(bounds.x + 3, bounds.y + 3);+ await expect(label).toHaveAttribute("data-revealing", "true");+ await expect(label.locator(".cell-marquee-content")).toHaveCSS("overflow", "visible");+ await expect.poll(() => label.locator(".cell-marquee-content").evaluate(element => getComputedStyle(element).transform)).not.toBe("matrix(1, 0, 0, 1, 0, 0)");+ await page.locator(".design-sidebar").screenshot({ path: testInfo.outputPath("recent-task-marquee.png") });+ await page.mouse.move(0, 0);+ await expect(label).not.toHaveAttribute("data-revealing");+ await expect(label.locator(".cell-marquee-content")).toHaveCSS("transform", "matrix(1, 0, 0, 1, 0, 0)");+});++test("all-columns layout clips inside the table at a narrower desktop width", async ({ page }, testInfo) => {+ await page.setViewportSize({ width: 1100, height: 862 });+ await openPage(page, "all-columns");+ await expect(page.getByRole("columnheader")).toHaveCount(9);+ const overflow = await page.locator(".task-list-columns-scroll").evaluate(element => ({ table: element.scrollWidth > element.clientWidth, page: document.documentElement.scrollWidth > window.innerWidth }));+ expect(overflow).toEqual({ table: true, page: false });+ await expect(page.locator(".design-toolbar-actions")).toBeInViewport();+ await page.getByRole("button", { name: "Task ID: sort ascending", exact: true }).click();+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(1);+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await page.getByRole("menuitem", { name: "Reset defaults", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(page.locator('[data-slot="task-list-sort-direction"]')).toHaveCount(0);+ await expect(page.locator('[role="columnheader"][aria-sort="none"]')).toHaveCount(3);+ await page.mouse.move(0, 0);+ for (const button of await page.locator(".task-list-sort-button").all()) await expect(button).toHaveCSS("background-color", "rgba(0, 0, 0, 0)");+ await page.locator(".design-task-list-panel").screenshot({ path: testInfo.outputPath("task-list-reset-defaults.png") });+});diff --git a/tests/storybook-visual/task-list-reproduction-trial.config.ts b/tests/storybook-visual/task-list-reproduction-trial.config.tsnew file mode 100644index 0000000000..e130e5f2ae--- /dev/null+++ b/tests/storybook-visual/task-list-reproduction-trial.config.ts@@ -0,0 +1,20 @@+import { defineConfig } from "@playwright/test";++export default defineConfig({+ testDir: ".",+ testMatch: "task-list-reproduction-trial.spec.ts",+ outputDir: "./test-results/task-list-reproduction-trial",+ workers: 1,+ retries: 0,+ timeout: 30_000,+ use: {+ baseURL: process.env.STORYBOOK_TEST_BASE_URL ?? "http://127.0.0.1:6007",+ viewport: { width: 1440, height: 900 },+ deviceScaleFactor: 1,+ colorScheme: "dark",+ reducedMotion: "reduce",+ locale: "en-US",+ timezoneId: "America/Los_Angeles",+ launchOptions: { executablePath: process.env.TRIAL_CHROMIUM_EXECUTABLE },+ },+});diff --git a/tests/storybook-visual/task-list-reproduction-trial.spec.ts b/tests/storybook-visual/task-list-reproduction-trial.spec.tsnew file mode 100644index 0000000000..451fe62bb6--- /dev/null+++ b/tests/storybook-visual/task-list-reproduction-trial.spec.ts@@ -0,0 +1,225 @@+import { readFileSync } from "node:fs";+import { expect, test, type Page } from "@playwright/test";++const storyId = "design-agent-task-list-trial";+const referencePng = process.env.TRIAL_REFERENCE_PNG;+if (!referencePng) throw new Error("TRIAL_REFERENCE_PNG is required: supply the screenshot frozen before implementation; visual verification cannot be omitted.");+const rows = (page: Page) => page.locator('.design-task-list-panel [data-slot="task-row"]');+const titles = (page: Page) => rows(page).locator('[data-slot="task-row-title"]');++test.beforeEach(async ({ page }) => {+ await page.clock.setFixedTime(new Date("2026-10-15T00:00:00.000Z"));+ await page.goto(`/iframe.html?id=${storyId}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("design-page-shell")).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+ await page.mouse.move(1439, 899);+});++test("matches the pre-implementation frozen reference and mounts canonical components", async ({ page }, testInfo) => {+ const errors: string[] = [];+ page.on("pageerror", error => errors.push(error.message));+ await expect(rows(page)).toHaveCount(10);+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(page.getByRole("separator", { name: "Resize sidebar" })).toHaveAttribute("aria-valuenow", "240");+ const screenshot = await page.screenshot({ path: testInfo.outputPath("reproduction.png"), animations: "disabled" });+ expect(screenshot.equals(readFileSync(referencePng))).toBe(true);+ const components = await page.getByTestId("design-page-shell").evaluate(element => {+ const key = Object.keys(element).find(key => key.startsWith("__reactFiber$"))!;+ type Fiber = { type?: { name?: string; displayName?: string }; return?: Fiber; child?: Fiber; sibling?: Fiber };+ let root = (element as unknown as Record<string, Fiber>)[key]!;+ while (root.return) root = root.return;+ const names = new Set<string>();+ const visit = (fiber?: Fiber) => {+ if (!fiber) return;+ const name = fiber.type?.displayName ?? fiber.type?.name;+ if (name) names.add(name);+ visit(fiber.child);+ visit(fiber.sibling);+ };+ visit(root);+ return [...names];+ });+ for (const component of ["DesignPageShell", "SidebarShell", "DesignSidebar", "SidebarCompanyMenu", "SidebarAccountMenu", "TaskListToolbar", "TaskList", "TaskListViewport", "TaskListColumnHeader", "TaskListColumnSettings", "TaskRowGroup", "IssueRow", "CellMarquee"]) {+ expect(components).toContain(component);+ }+ const controller = readFileSync("ui/storybook/support/design-proposals/TasksReproductionTrial.tsx", "utf8");+ expect(controller).not.toMatch(/TaskListPagePreview|style=|<button|<input|<table|<svg|#[0-9a-f]{6}|\[\d+px\]/i);+ expect(errors).toEqual([]);+ const index = await (await page.request.get("/index.json")).json();+ expect(index.entries[storyId].title).toBe("Design proposals/AI Generated Test Pages/Tasks reproduction test");+});++for (const target of [storyId, "tasks-list-page-design--default"]) {+ test(`${target}: creator filters match their identity and collapsed matches become visible`, async ({ page }) => {+ await page.goto(`/iframe.html?id=${target}&viewMode=story&globals=theme:dark`);+ await expect(rows(page)).toHaveCount(10);+ await page.getByRole("button", { name: "Filter", exact: true }).click();+ await page.getByRole("region", { name: "Creator", exact: true }).getByRole("checkbox", { name: "Scott", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(6);+ await page.getByRole("button", { name: "1", exact: true }).click();+ const creator = page.getByRole("region", { name: "Creator", exact: true });+ await creator.getByRole("checkbox", { name: "Scott", exact: true }).click();+ await creator.getByRole("checkbox", { name: "CodexCoder", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(5);+ await page.getByRole("button", { name: "1", exact: true }).click();+ await page.getByRole("region", { name: "Creator", exact: true }).getByRole("checkbox", { name: "CodexCoder", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(10);+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await page.getByRole("textbox", { name: "Search tasks", exact: true }).fill("expired credential");+ await expect(rows(page)).toHaveCount(3);+ await expect(titles(page)).toHaveText(["Improve connector reliability", "Design reconnect and recovery flows", /Document connector recovery/]);+ });++ test(`${target}: metadata search, view/filter expansion and board matching share the collection contract`, async ({ page }) => {+ await page.goto(`/iframe.html?id=${target}&viewMode=story&globals=theme:dark`);+ await expect(rows(page)).toHaveCount(10);+ const search = page.getByRole("textbox", { name: "Search tasks", exact: true });+ await search.fill("CodexCoder");+ await expect(rows(page)).toHaveCount(8);+ await search.fill("");+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await page.getByRole("button", { name: "Task view: All tasks", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "Unread", exact: true }).click();+ await expect(rows(page)).toHaveCount(3);+ await expect(page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true })).toHaveAttribute("aria-expanded", "true");+ await page.getByRole("button", { name: "Task view: Unread", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "All tasks", exact: true }).click();+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await page.getByRole("button", { name: "Filter", exact: true }).click();+ await page.getByRole("checkbox", { name: "In Review", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(3);+ await expect(page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true })).toHaveAttribute("aria-expanded", "true");+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ const board = page.locator(".design-task-board");+ await expect(board.getByText("Define connector health states", { exact: true })).toBeVisible();+ await expect(board.getByText("Review budget notifications", { exact: true })).toBeVisible();+ await expect(board.getByText("Improve connector reliability", { exact: true })).toHaveCount(0);+ });+}++test("read/unread hover and nested guides retain canonical behavior", async ({ page }, testInfo) => {+ const unread = titles(page).filter({ hasText: /^Improve connector reliability$/ });+ const read = titles(page).filter({ hasText: /^Design reconnect and recovery flows$/ });+ await expect(unread).toHaveCSS("font-weight", "600");+ await expect(read).toHaveCSS("font-weight", "400");+ const foreground = await unread.evaluate(element => getComputedStyle(element).color);+ expect(await read.evaluate(element => getComputedStyle(element).color)).not.toBe(foreground);+ for (const [title, weight] of [[read, "400"], [unread, "600"]] as const) {+ const background = () => title.evaluate(element => getComputedStyle(element.closest('[data-slot="task-row"]')!).backgroundColor);+ const originalBackground = await background();+ const bounds = (await title.boundingBox())!;+ await page.mouse.move(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);+ await expect(title).toHaveCSS("color", foreground);+ await expect(title).toHaveCSS("font-weight", weight);+ expect(await background()).not.toBe(originalBackground);+ }+ await page.screenshot({ path: testInfo.outputPath("unread-hover.png"), animations: "disabled" });+ const guides = page.locator('[data-slot="task-row-tree-guide"]');+ await expect(guides).toHaveCount(5);+ const positions = await titles(page).evaluateAll(elements => elements.map(element => element.getBoundingClientRect().x));+ expect(positions[1] - positions[0]).toBe(24);+ expect(positions[3] - positions[1]).toBe(24);+ const nested = page.getByRole("button", { name: "Collapse Design reconnect and recovery flows", exact: true });+ await expect(nested).toHaveAttribute("aria-expanded", "true");+ await nested.click();+ await expect(rows(page)).toHaveCount(9);+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await expect(rows(page)).toHaveCount(6);+ await page.getByRole("button", { name: "Expand all tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ await expect(nested).toHaveAttribute("aria-expanded", "true");+ await page.getByRole("button", { name: "Collapse all tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(6);+ await page.getByRole("button", { name: "Expand all tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+});++test("sorting, column toggles, reorder/reset and list/board state", async ({ page }) => {+ await page.getByRole("button", { name: "Task ID: sort ascending", exact: true }).click();+ await page.getByRole("button", { name: "Task ID: sort descending", exact: true }).click();+ await expect(titles(page).first()).toHaveText("Collect feedback on the refreshed task list");+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await page.getByRole("menuitemcheckbox", { name: "Created by", exact: true }).click();+ await expect(page.getByRole("menuitemcheckbox", { name: "Created by", exact: true })).toBeChecked();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("columnheader")).toHaveCount(4);+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ await expect(page.getByRole("region", { name: "Task board", exact: true })).toBeVisible();+ await page.getByRole("button", { name: "List view", exact: true }).click();+ await expect(page.getByRole("columnheader")).toHaveCount(4);+ await expect(titles(page).first()).toHaveText("Collect feedback on the refreshed task list");+ await page.getByRole("button", { name: "Created by: sort ascending", exact: true }).press("Alt+ArrowLeft");+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Created by", "Task ID", "Last updated"]);+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await page.getByRole("menuitem", { name: "Reset defaults", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(titles(page).first()).toHaveText("Improve connector reliability");+});++test("views, searches and canonical filters preserve ancestors", async ({ page }) => {+ await page.getByRole("button", { name: "Task view: All tasks", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "Unread", exact: true }).click();+ await expect(rows(page)).toHaveCount(3);+ await page.reload();+ await expect(page.getByRole("button", { name: "Task view: Unread", exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Task view: Unread", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "All tasks", exact: true }).click();+ for (const [label, count] of [["Inbox", 6], ["Needs attention", 3]] as const) {+ await page.getByRole("button", { name: "Task view: All tasks", exact: true }).click();+ await page.getByRole("menuitemradio", { name: label, exact: true }).click();+ await expect(rows(page)).toHaveCount(count);+ await page.getByRole("button", { name: `Task view: ${label}`, exact: true }).click();+ await page.getByRole("menuitemradio", { name: "All tasks", exact: true }).click();+ }+ const search = page.getByRole("textbox", { name: "Search tasks", exact: true });+ await search.fill("expired credential");+ await expect(rows(page)).toHaveCount(3);+ await expect(page.locator(".design-task-results")).toHaveText("1 matching task · Parent tasks included for context");+ await search.fill("no such task");+ await expect(page.getByText("No tasks match this view", { exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Clear filters", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ await page.getByRole("button", { name: "Filter", exact: true }).click();+ await expect(page.getByRole("textbox", { name: "Search projects", exact: true })).toBeVisible();+ await page.getByRole("checkbox", { name: "In Review", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(3);+});++test("canonical organization/account menus and sidebar resizing", async ({ page }) => {+ await page.getByRole("button", { name: "Global search", exact: true }).click();+ await expect(page.getByPlaceholder("Search tasks, agents, projects...", { exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await page.getByRole("toolbar", { name: "Task list controls" }).getByRole("button", { name: "New Task", exact: true }).click();+ await expect(page.getByRole("dialog", { name: "New task", exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await page.getByRole("button", { name: "Open account menu", exact: true }).click();+ await expect(page.getByRole("dialog", { name: "Account", exact: true })).toBeVisible();+ await expect(page.getByRole("link", { name: "Invite", exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await page.getByRole("button", { name: "Open Paperclip Storybook organization switcher", exact: true }).click();+ await expect(page.getByRole("menuitem", { name: /Research Bureau/ })).toBeVisible();+ await page.getByRole("menuitem", { name: /Research Bureau/ }).click();+ await expect(rows(page)).toHaveCount(0);+ await expect(page.getByText("No tasks in this organization", { exact: true })).toBeVisible();+ await expect(page.locator(".design-sidebar-recents a")).toHaveCount(0);+ const resize = page.getByRole("separator", { name: "Resize sidebar", exact: true });+ await resize.press("ArrowRight");+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ const bounds = (await resize.boundingBox())!;+ await page.mouse.move(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);+ await page.mouse.down();+ await page.mouse.move(bounds.x + bounds.width / 2 + 32, bounds.y + bounds.height / 2);+ await page.mouse.up();+ await expect(resize).toHaveAttribute("aria-valuenow", "288");+});diff --git a/tests/storybook-visual/task-row-design.spec.ts b/tests/storybook-visual/task-row-design.spec.tsnew file mode 100644index 0000000000..a11b381208--- /dev/null+++ b/tests/storybook-visual/task-row-design.spec.ts@@ -0,0 +1,701 @@+import { expect, test, type Locator, type Page } from "@playwright/test";++const longTitle = "Document connector recovery behavior when an expired credential interrupts an active task and requires a human to reconnect the account";++test.use({ viewport: { width: 1512, height: 862 } });++function rowFor(page: Page, number: number): Locator {+ return page.locator('[data-slot="task-row"]').filter({+ has: page.getByRole("link", { name: new RegExp(`^Open PAP-${number}:`) }),+ });+}++async function openStory(page: Page, name = "specimen") {+ await page.goto(`/iframe.html?id=tasks-row-design--${name}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("task-row-design-preview")).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+ await page.mouse.move(0, 0);+}++async function titleOverflows(title: Locator) {+ return title.evaluate(element => element.querySelector('[data-slot="task-row-title-text"]')!.scrollWidth > element.clientWidth);+}++test("playground changes density and width independently without losing hierarchy or title states", async ({ page }, testInfo) => {+ await openStory(page);+ const preview = page.getByTestId("task-row-playground-container");+ const row = preview.locator('[data-slot="task-row"]').first();+ const widths = page.getByRole("group", { name: "Container width", exact: true });+ const densities = page.getByRole("group", { name: "Row density", exact: true });+ for (const { label, height } of [{ label: "Comfortable (44px)", height: "44px" }, { label: "Compact (32px)", height: "32px" }]) {+ await densities.getByRole("button", { name: label, exact: true }).click();+ await expect(densities.getByRole("button", { name: label, exact: true })).toHaveAttribute("aria-pressed", "true");+ for (const width of ["Standard", "Narrow", "Smallest"]) {+ await widths.getByRole("button", { name: width, exact: true }).click();+ await expect(widths.getByRole("button", { name: width, exact: true })).toHaveAttribute("aria-pressed", "true");+ await expect(preview.locator('[data-slot="task-row"]')).toHaveCount(9);+ await expect(row).toHaveCSS("height", height);+ await expect(row.locator('[data-slot="task-row-identifier"]')).toBeVisible({ visible: width === "Standard" });+ await expect(row.locator('[data-slot="task-row-metadata"]')).toBeVisible({ visible: width === "Standard" });+ await expect(row.locator('[data-slot="task-row-timestamp"]')).toBeVisible({ visible: width !== "Smallest" });+ await expect(rowFor(page, 431).locator('[data-slot="task-row-tree-guide"]')).toHaveCount(2);+ for (const { number, weight } of [{ number: 456, weight: "400" }, { number: 457, weight: "600" }]) {+ const title = rowFor(page, number).locator('[data-slot="task-row-title"]');+ await expect(title).toHaveCSS("font-size", "14px");+ await expect(title).toHaveCSS("line-height", "16px");+ await expect(title).toHaveCSS("font-weight", weight);+ }+ const fit = await preview.evaluate(element => element.scrollWidth <= element.clientWidth);+ expect(fit).toBe(true);+ }+ }+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await widths.getByRole("button", { name: "Narrow", exact: true }).click();+ await expect(preview.locator('[data-slot="task-row"]')).toHaveCount(5);+ await page.getByRole("button", { name: "Expand Improve connector reliability", exact: true }).click();+ await expect(preview.locator('[data-slot="task-row"]')).toHaveCount(9);+ await page.mouse.move(0, 0);+ await page.screenshot({ path: testInfo.outputPath("task-row-playground.png"), fullPage: true });+});++test("summary rows fit narrow containers without changing density or read typography", async ({ page }, testInfo) => {+ await openStory(page, "summary");+ for (const { label, identifier, timestamp } of [+ { label: "Standard task summary", identifier: true, timestamp: true },+ { label: "Narrow task summary", identifier: false, timestamp: true },+ { label: "Smallest task summary", identifier: false, timestamp: false },+ ]) {+ const list = page.getByRole("list", { name: label, exact: true });+ const rows = list.locator('[data-slot="task-row"]');+ await expect(rows).toHaveCount(3);+ const row = rows.first();+ await expect(row).toHaveCSS("height", "44px");+ await expect(row.locator('[data-slot="task-row-title"]')).toHaveCSS("font-size", "14px");+ await expect(row.locator('[data-slot="task-row-title"]')).toHaveCSS("line-height", "16px");+ await expect(row.locator('[data-slot="task-row-title"]')).toHaveCSS("font-weight", "400");+ await expect(row.locator('[data-slot="task-row-identifier"]')).toBeVisible({ visible: identifier });+ await expect(row.locator('[data-slot="task-row-timestamp"]')).toBeVisible({ visible: timestamp });+ const fit = await list.evaluate(element => ({ content: element.scrollWidth, available: element.clientWidth }));+ expect(fit.content).toBeLessThanOrEqual(fit.available);+ await expect(list.locator('[data-testid="issue-row-unread-slot"], [data-slot="avatar"], [role="columnheader"]')).toHaveCount(0);+ }+ const list = page.getByRole("list", { name: "Narrow task summary", exact: true });+ const row = list.locator('[data-slot="task-row"]').first();+ const title = row.locator('[data-slot="task-row-title"]');+ expect(await titleOverflows(title)).toBe(true);+ const originalColor = await title.evaluate(element => getComputedStyle(element).color);+ const rect = (await title.boundingBox())!;+ await page.mouse.move(rect.x + rect.width / 2, rect.y + rect.height / 2);+ await expect(title).toHaveAttribute("data-revealing", "true");+ await expect(title).toHaveCSS("font-weight", "400");+ expect(await title.evaluate(element => getComputedStyle(element).color)).not.toBe(originalColor);+ await page.mouse.move(0, 0);+ await expect(title).not.toHaveAttribute("data-revealing");+ const link = list.getByRole("link", { name: `Open PAP-431: ${longTitle}`, exact: true });+ await link.focus();+ await expect(title).toHaveAttribute("data-revealing", "true");+ await link.press("Escape");+ await expect(title).not.toHaveAttribute("data-revealing");+ await page.getByRole("heading", { name: "Task summaries", exact: true }).click();+ await page.screenshot({ path: testInfo.outputPath("task-summary-containers.png"), fullPage: true });+ // Container queries also apply below the app's global sm breakpoint.+ await page.setViewportSize({ width: 390, height: 844 });+ await expect(list.locator('[data-slot="task-row-identifier"]').first()).toBeHidden();+ await expect(list.locator('[data-slot="task-row-timestamp"]').first()).toBeVisible();+ await expect(row).toHaveCSS("height", "44px");+ await expect(row.locator('[data-slot="task-row-status"]')).toBeVisible();+});++for (const { story, density, height } of [+ { story: "specimen", density: "comfortable", height: 44 },+ { story: "compact", density: "compact", height: 32 },+]) {+ test(`${density} rows retain nesting, aligned metadata, and one group boundary`, async ({ page }, testInfo) => {+ await openStory(page, story);+ const list = page.locator(`[aria-label="${density} task list"]`);+ const rows = list.locator('[data-slot="task-row"]');+ await expect(rows).toHaveCount(7);+ const geometry = await rows.evaluateAll((elements) => elements.map((element) => {+ const rect = element.getBoundingClientRect();+ const style = getComputedStyle(element);+ const left = (slot: string) => element.querySelector(`[data-slot="${slot}"]`)!.getBoundingClientRect().left;+ return {+ height: rect.height,+ paddingLeft: style.paddingLeft,+ paddingRight: style.paddingRight,+ titleLeft: left("task-row-title"),+ metadataLeft: left("task-row-metadata"),+ identifierLeft: left("task-row-identifier"),+ timestampLeft: left("task-row-timestamp"),+ borderTop: style.borderTopWidth,+ borderBottom: style.borderBottomWidth,+ };+ }));+ for (const row of geometry) {+ expect(row.height).toBe(height);+ expect(row.paddingLeft).toBe("16px");+ expect(row.paddingRight).toBe("16px");+ expect(row.borderTop).toBe("0px");+ expect(row.borderBottom).toBe("0px");+ expect(row.metadataLeft).toBe(geometry[0].metadataLeft);+ expect(row.identifierLeft).toBe(geometry[0].identifierLeft);+ expect(row.timestampLeft).toBe(geometry[0].timestampLeft);+ }+ expect(geometry[1].titleLeft - geometry[0].titleLeft).toBe(24);+ expect(geometry[2].titleLeft).toBe(geometry[1].titleLeft);+ expect(geometry[3].titleLeft - geometry[2].titleLeft).toBe(24);+ expect(geometry[4].titleLeft).toBe(geometry[1].titleLeft);++ const groups = list.locator('[data-slot="task-row-group"]');+ await expect(groups).toHaveCount(3);+ await expect(groups.first()).toHaveCSS("border-top-width", "1px");+ await expect(groups.first()).toHaveCSS("border-bottom-width", "1px");+ await expect(groups.nth(1)).toHaveCSS("border-top-width", "0px");+ expect((await groups.first().boundingBox())!.height).toBe(height * 5 + 2);++ // The outer guide stays continuous through child and grandchild rows.+ const guides = await Promise.all([429, 430, 431, 432].map(async (number) =>+ rowFor(page, number).locator('[data-slot="task-row-tree-connector"]').first().boundingBox(),+ ));+ for (let index = 0; index < guides.length; index += 1) {+ expect(guides[index]!.x).toBe(guides[0]!.x);+ expect(guides[index]!.height).toBe(height);+ if (index > 0) expect(guides[index - 1]!.y + guides[index - 1]!.height).toBe(guides[index]!.y);+ }+ const depthTwoGuides = await rowFor(page, 431).locator('[data-slot="task-row-tree-connector"]').evaluateAll((elements) => elements.map((element) => element.getBoundingClientRect().left));+ expect(depthTwoGuides[1] - depthTwoGuides[0]).toBe(24);+ await expect(rowFor(page, 430).locator('[data-chevron-gap="true"]')).toHaveCount(1);+ if (density === "comfortable") {+ const path = testInfo.outputPath("task-row-specimen.png");+ await page.screenshot({ path, fullPage: true });+ await testInfo.attach("Task row specimen", { path, contentType: "image/png" });+ }+ });+}++test("read and unread preserve their weights through real pointer hover", async ({ page }) => {+ await openStory(page);+ const foreground = await page.getByRole("heading", { name: "Task rows", exact: true }).evaluate((element) => getComputedStyle(element).color);+ const muted = await page.getByText("Read · Regular", { exact: true }).evaluate((element) => getComputedStyle(element).color);+ expect(foreground).not.toBe(muted);+ for (const { number, weight, color } of [+ { number: 456, weight: "400", color: muted },+ { number: 457, weight: "600", color: foreground },+ ]) {+ const row = rowFor(page, number);+ const title = row.locator('[data-slot="task-row-title"]');+ await page.mouse.move(0, 0);+ await expect(title).toHaveCSS("font-weight", weight);+ await expect(title).toHaveCSS("color", color);+ const background = await row.evaluate((element) => getComputedStyle(element).backgroundColor);+ await row.hover();+ await expect(title).toHaveCSS("font-weight", weight);+ await expect(title).toHaveCSS("color", foreground);+ expect(await row.evaluate((element) => getComputedStyle(element).backgroundColor)).not.toBe(background);+ await page.mouse.move(0, 0);+ await expect(title).toHaveCSS("color", color);+ }+ const identifier = rowFor(page, 428).locator('[data-slot="task-row-identifier"]');+ expect(await identifier.evaluate((element) => getComputedStyle(element).fontFamily)).toContain("Paper Mono");+ expect(await page.evaluate(() => document.fonts.check('12px "Paper Mono"'))).toBe(true);+});++test("title reveal follows truncation on resize and respects reduced motion", async ({ page }) => {+ await page.emulateMedia({ reducedMotion: "reduce" });+ await openStory(page);+ const row = rowFor(page, 430);+ const title = row.locator('[data-slot="task-row-title"]');+ const link = row.locator('[data-inbox-issue-link]');+ const text = title.locator('[data-slot="task-row-title-text"]');+ expect(await titleOverflows(title)).toBe(false);+ await link.hover();+ await expect(title).not.toHaveAttribute("data-revealing");+ await expect(page.getByRole("tooltip")).toHaveCount(0);+ await page.mouse.move(0, 0);+ await link.focus();+ await expect(link).toBeFocused();+ await expect(title).not.toHaveAttribute("data-revealing");+ await expect(page.getByRole("tooltip")).toHaveCount(0);++ await page.setViewportSize({ width: 660, height: 862 });+ await expect.poll(() => titleOverflows(title)).toBe(true);+ await expect(title).toHaveAttribute("data-revealing", "true");+ await expect(text).toHaveCSS("transition-duration", "0s");+ await expect.poll(async () => Math.abs((await text.boundingBox())!.x + (await text.boundingBox())!.width - (await title.boundingBox())!.x - (await title.boundingBox())!.width)).toBeLessThan(1);+ await expect(page.getByRole("tooltip")).toHaveCount(0);+ await page.setViewportSize({ width: 1512, height: 862 });+ await expect.poll(() => titleOverflows(title)).toBe(false);+ await expect(title).not.toHaveAttribute("data-revealing");+ await expect(text).toHaveCSS("transform", "matrix(1, 0, 0, 1, 0, 0)");+ await expect(link).toBeFocused();+});++test("all nine columns use sm text and align through nesting and horizontal scrolling", async ({ page }, testInfo) => {+ await page.setViewportSize({ width: 1200, height: 862 });+ await openStory(page, "all-columns");+ const header = page.locator('[data-slot="task-list-column-header"]');+ await expect(header.locator('[data-column]')).toHaveText([+ "Task", "Task ID", "Created by", "Assignee", "Project", "Parent Task", "Tags", "Worktree", "Last updated",+ ]);+ await expect(header).toHaveCSS("height", "44px");+ const columns = ["taskId", "createdBy", "assignee", "project", "parentTask", "tags", "lastUpdated", "worktree"];+ const rows = page.locator('[data-slot="task-row"]');+ await expect(rows).toHaveCount(7);+ await expect(header.getByRole("button", { name: /^Status:/ })).toHaveCount(0);+ await expect(header.locator('[data-column="task"]')).toHaveAttribute("aria-colspan", "2");+ const typeSizes = await page.locator('[data-slot="task-row-title"], [data-slot="task-row-columns"] [data-column], [data-slot="task-row-columns"] [data-slot="badge"], .task-list-sort-button > span').evaluateAll(elements => elements.map(element => ({ size: getComputedStyle(element).fontSize, leading: getComputedStyle(element).lineHeight })));+ for (const type of typeSizes) expect(type).toEqual({ size: "14px", leading: "16px" });+ for (const column of columns) {+ const heading = await header.locator(`[data-column="${column}"]`).boundingBox();+ const cells = await rows.locator(`[data-column="${column}"]`).evaluateAll(elements => elements.map(element => element.getBoundingClientRect().toJSON()));+ expect(cells).toHaveLength(7);+ for (const cell of cells) {+ expect(cell.x).toBe(heading!.x);+ expect(cell.width).toBe(heading!.width);+ }+ }+ const rootTitle = await rowFor(page, 428).locator('[data-slot="task-row-title"]').boundingBox();+ expect(rootTitle!.x).toBe((await header.locator('[data-column="task"]').getByRole("button").locator("span").boundingBox())!.x);+ for (const number of [428, 429, 431]) {+ const row = rowFor(page, number);+ const status = await row.locator('[data-slot="task-row-status"]').boundingBox();+ const title = await row.locator('[data-slot="task-row-title"]').boundingBox();+ expect(title!.x - status!.x - status!.width).toBe(8);+ }+ expect((await rowFor(page, 431).locator('[data-slot="task-row-title"]').boundingBox())!.x - rootTitle!.x).toBe(48);+ await expect(rowFor(page, 455).locator('[data-column="assignee"]')).toHaveText("Unassigned");+ await expect(rowFor(page, 455).locator('[data-column="worktree"]')).toHaveText("—");+ await expect(rowFor(page, 431).locator('[data-column="parentTask"]')).toContainText("PAP-430");+ await expect(rowFor(page, 428).locator('[data-column="worktree"]')).toHaveText("codex/pap-428");++ const scroller = page.getByRole("region", { name: "Task list columns" });+ const viewport = page.locator('[data-slot="task-list-viewport"]');+ expect(await scroller.evaluate(element => element.scrollWidth > element.clientWidth)).toBe(true);+ await expect(viewport).toHaveAttribute("data-overflow-left", "false");+ await expect(viewport).toHaveAttribute("data-overflow-right", "true");+ await scroller.focus();+ await expect(scroller).toBeFocused();+ await scroller.evaluate(element => element.scrollTo({ left: (element.scrollWidth - element.clientWidth) / 2 }));+ await expect(viewport).toHaveAttribute("data-overflow-left", "true");+ await expect(viewport).toHaveAttribute("data-overflow-right", "true");+ await header.locator('[data-column="worktree"]').scrollIntoViewIfNeeded();+ expect(await scroller.evaluate(element => element.scrollLeft)).toBeGreaterThan(0);+ await scroller.evaluate(element => element.scrollTo({ left: element.scrollWidth }));+ await expect(viewport).toHaveAttribute("data-overflow-left", "true");+ await expect(viewport).toHaveAttribute("data-overflow-right", "false");+ await expect(header.locator('[data-column]')).toHaveCount(9);+ await page.setViewportSize({ width: 1700, height: 862 });+ await expect.poll(() => scroller.evaluate(element => element.scrollWidth > element.clientWidth)).toBe(false);+ await expect(viewport).toHaveAttribute("data-overflow-left", "false");+ await expect(viewport).toHaveAttribute("data-overflow-right", "false");+ await page.getByRole("heading", { name: "Task-list columns", exact: true }).click();+ const path = testInfo.outputPath("task-list-all-columns.png");+ await page.locator('.task-list-columns-content').screenshot({ path });+ await testInfo.attach("Complete column specimen", { path, contentType: "image/png" });+});++test("headers sort both ways without separating subtasks from their parents", async ({ page }, testInfo) => {+ await openStory(page, "all-columns");+ const header = page.locator('[data-slot="task-list-column-header"]');+ await expect(header.getByRole("button", { name: /^Status:/ })).toHaveCount(0);+ const ids = page.locator('[data-slot="task-row"] [data-column="taskId"]');+ const taskId = header.locator('[data-column="taskId"]');+ await expect(taskId).toHaveAttribute("aria-sort", "none");+ await expect(header.locator('[data-active="true"]')).toHaveCount(0);+ await expect(header.locator('[data-slot="task-list-sort-direction"]')).toHaveCount(0);+ await taskId.getByRole("button").click();+ await expect(taskId).toHaveAttribute("aria-sort", "ascending");+ for (const button of await header.getByRole("button").all()) {+ await expect(button).toHaveCSS("padding-left", "8px");+ await expect(button).toHaveCSS("padding-right", "8px");+ }+ await expect(taskId.locator('[data-slot="task-list-sort-direction"]')).toHaveCSS("width", "12px");+ await expect(taskId.locator('[data-slot="task-list-sort-direction"]')).toHaveCSS("height", "12px");+ await taskId.getByRole("button").click();+ await expect(taskId).toHaveAttribute("aria-sort", "descending");+ await expect(ids).toHaveText(["PAP-455", "PAP-454", "PAP-428", "PAP-432", "PAP-430", "PAP-431", "PAP-429"]);+ await expect(rowFor(page, 431).locator('[data-slot="task-row-tree-guide"]')).toHaveCount(2);+ const collapse = page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true });+ await collapse.click();+ await expect(ids).toHaveText(["PAP-455", "PAP-454", "PAP-428"]);+ await page.getByRole("button", { name: "Expand Improve connector reliability", exact: true }).click();+ await expect(ids).toHaveText(["PAP-455", "PAP-454", "PAP-428", "PAP-432", "PAP-430", "PAP-431", "PAP-429"]);+ await taskId.getByRole("button").focus();+ await page.keyboard.press("Enter");+ await expect(taskId).toHaveAttribute("aria-sort", "ascending");+ await expect(ids).toHaveText(["PAP-428", "PAP-429", "PAP-430", "PAP-431", "PAP-432", "PAP-454", "PAP-455"]);++ const title = header.locator('[data-column="task"]');+ const titleLabel = title.getByRole("button").locator("span");+ const labelBefore = await titleLabel.boundingBox();+ await title.getByRole("button").hover();+ await expect(title.getByRole("button")).toHaveCSS("padding-left", "8px");+ await expect(title.getByRole("button")).toHaveCSS("padding-right", "8px");+ expect(await titleLabel.boundingBox()).toEqual(labelBefore);+ await title.getByRole("button").click();+ await expect(title).toHaveAttribute("aria-sort", "ascending");+ await expect(taskId).toHaveAttribute("aria-sort", "none");+ await expect(ids).toHaveText(["PAP-454", "PAP-428", "PAP-429", "PAP-430", "PAP-431", "PAP-432", "PAP-455"]);+ await title.getByRole("button").click();+ await expect(title).toHaveAttribute("aria-sort", "descending");+ await expect(ids).toHaveText(["PAP-455", "PAP-428", "PAP-432", "PAP-430", "PAP-431", "PAP-429", "PAP-454"]);+ await page.mouse.move(0, 0);+ await expect(title.getByRole("button")).toHaveCSS("background-color", "rgb(51, 51, 51)");+ const path = testInfo.outputPath("task-list-task-header.png");+ await page.locator('[data-slot="task-list-viewport"]').screenshot({ path });+ await testInfo.attach("Combined Task header and sm table typography", { path, contentType: "image/png" });++ for (const column of ["createdBy", "assignee", "project", "parentTask", "tags", "lastUpdated", "worktree"]) {+ const cell = header.locator(`[data-column="${column}"]`);+ await cell.getByRole("button").click();+ await expect(cell).toHaveAttribute("aria-sort", "ascending");+ await expect(cell.locator('[data-slot="task-list-sort-direction"]')).toHaveCSS("width", "12px");+ await expect(cell.locator('[data-slot="task-list-sort-direction"]')).toHaveCSS("height", "12px");+ await cell.getByRole("button").click();+ await expect(cell).toHaveAttribute("aria-sort", "descending");+ await expect(cell.locator('[data-slot="task-list-sort-direction"]')).toHaveCSS("width", "12px");+ await expect(cell.locator('[data-slot="task-list-sort-direction"]')).toHaveCSS("height", "12px");+ await expect(header.locator('[aria-sort="descending"]')).toHaveCount(1);+ }+ // A missing worktree stays last even when sorting descending.+ await expect(ids).toHaveText(["PAP-454", "PAP-428", "PAP-432", "PAP-430", "PAP-431", "PAP-429", "PAP-455"]);+});++test("truncated cells reveal independently and preserve row navigation", async ({ page }, testInfo) => {+ await page.setViewportSize({ width: 1800, height: 900 });+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openStory(page, "all-columns");+ const row = rowFor(page, 431);+ const title = row.locator('[data-slot="task-row-title"]');+ const parent = row.locator('[data-column="parentTask"] [data-cell-marquee]');+ const tags = rowFor(page, 429).locator('[data-column="tags"] [data-cell-marquee]');+ const parentText = parent.locator('.cell-marquee-content');+ const revealing = page.locator('[data-cell-marquee][data-revealing="true"]');+ const moveToCell = async (cell: Locator) => {+ const rect = (await cell.boundingBox())!;+ await page.mouse.move(rect.x + rect.width / 2, rect.y + rect.height / 2);+ };+ const overflows = (cell: Locator) => cell.evaluate(element => element.querySelector('.cell-marquee-content')!.scrollWidth > element.clientWidth);+ expect(await overflows(title)).toBe(true);+ expect(await overflows(parent)).toBe(true);+ expect(await overflows(tags)).toBe(true);+ for (const cell of [title, parent, tags]) {+ await expect(cell).toHaveAttribute("data-truncated", "true");+ await expect(cell.locator('.cell-marquee-viewport')).not.toHaveCSS("mask-image", "none");+ }+ const fitting = row.locator('[data-column="taskId"] [data-cell-marquee]');+ await expect(fitting).not.toHaveAttribute("data-truncated");+ await expect(fitting.locator('.cell-marquee-viewport')).toHaveCSS("mask-image", "none");+ const mask = await parent.locator('.cell-marquee-viewport').evaluate(element => getComputedStyle(element).maskImage);+ const background = await row.evaluate(element => getComputedStyle(element).backgroundColor);+ await moveToCell(fitting);+ expect(await row.evaluate(element => getComputedStyle(element).backgroundColor)).not.toBe(background);+ await expect(parent.locator('.cell-marquee-viewport')).toHaveCSS("mask-image", mask);+ await expect(parent).not.toHaveAttribute("data-revealing");+ await page.locator('[data-slot="task-list-viewport"]').screenshot({ path: testInfo.outputPath("task-list-truncation-fade-hover.png") });+ await page.mouse.move(0, 0);+ await row.locator('[data-inbox-issue-link]').focus();+ await expect(title).toHaveAttribute("data-revealing", "true");+ await moveToCell(parent);+ await expect(parent).toHaveAttribute("data-revealing", "true");+ await expect(title).not.toHaveAttribute("data-revealing");+ await expect(revealing).toHaveCount(1);+ await expect.poll(() => parentText.evaluate(element => new DOMMatrixReadOnly(getComputedStyle(element).transform).m41)).toBeLessThan(-1);+ await parentText.evaluate(element => element.getAnimations().forEach(animation => animation.finish()));+ await expect(parent).toHaveAttribute("data-reveal-complete", "true");+ const endMask = await parent.locator('.cell-marquee-viewport').evaluate(element => getComputedStyle(element).maskImage);+ expect(endMask).not.toBe(mask);+ expect(endMask).not.toMatch(/transparent\)$|rgba\(0, 0, 0, 0\)\)$/);+ const parentEnd = await parentText.boundingBox();+ const parentViewport = await parent.boundingBox();+ expect(Math.abs(parentEnd!.x + parentEnd!.width - parentViewport!.x - parentViewport!.width)).toBeLessThan(1);+ await moveToCell(tags);+ await expect(tags).toHaveAttribute("data-revealing", "true");+ await expect(parent).not.toHaveAttribute("data-revealing");+ await expect(parentText).toHaveCSS("transform", "matrix(1, 0, 0, 1, 0, 0)");+ await expect(parentText).toHaveCSS("transition-duration", "0s");+ await expect(revealing).toHaveCount(1);+ await expect(page.getByRole("tooltip")).toHaveCount(0);+ await moveToCell(rowFor(page, 429).locator('[data-column="taskId"]'));+ await expect(revealing).toHaveCount(0);+ await parent.focus();+ await expect(parent).toHaveAttribute("data-revealing", "true");+ await page.keyboard.press("Escape");+ await expect(parent).not.toHaveAttribute("data-revealing");+ await page.emulateMedia({ reducedMotion: "reduce" });+ await moveToCell(parent);+ await expect(parent).toHaveAttribute("data-revealing", "true");+ await expect(parentText).toHaveCSS("transition-duration", "0s");+ const cell = (await row.locator('[data-column="parentTask"]').boundingBox())!;+ await page.mouse.click(cell.x + cell.width / 2, cell.y + cell.height / 2);+ await expect(page.getByTestId("task-row-design-route")).toHaveText("/PAP/issues/PAP-431");+ await page.mouse.move(0, 0);+ await page.screenshot({ path: testInfo.outputPath("task-list-cell-marquees.png") });+});++test("column headers drag in either direction, preserve sorting and nesting, and reset their order", async ({ page }, testInfo) => {+ await page.setViewportSize({ width: 1800, height: 900 });+ await openStory(page, "all-columns");+ const header = page.locator('[data-slot="task-list-column-header"]');+ const initialOrder = ["Task", "Task ID", "Created by", "Assignee", "Project", "Parent Task", "Tags", "Worktree", "Last updated"];+ await expect(header.locator('[data-column]')).toHaveText(initialOrder);+ const dragHeader = async (from: string, to: string) => {+ const button = (await header.locator(`[data-column="${from}"] button`).boundingBox())!;+ const target = (await header.locator(`[data-column="${to}"]`).boundingBox())!;+ await page.mouse.move(button.x + button.width / 2, button.y + button.height / 2);+ await page.mouse.down();+ await page.mouse.move(button.x + button.width / 2 + 8, button.y + button.height / 2);+ await page.mouse.move(target.x + target.width / 2, target.y + target.height / 2, { steps: 12 });+ await page.mouse.up();+ };+ await dragHeader("taskId", "assignee");+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Created by", "Assignee", "Task ID", "Project", "Parent Task", "Tags", "Worktree", "Last updated"]);+ await expect(header.locator('[data-column="taskId"]')).toHaveAttribute("aria-sort", "none");+ await dragHeader("task", "project");+ await expect(header.locator('[data-column]')).toHaveText(["Created by", "Assignee", "Task ID", "Project", "Task", "Parent Task", "Tags", "Worktree", "Last updated"]);+ const task = header.locator('[data-column="task"] button');+ await task.focus();+ await page.keyboard.press("Alt+ArrowLeft");+ const movedOrder = ["Created by", "Assignee", "Task ID", "Task", "Project", "Parent Task", "Tags", "Worktree", "Last updated"];+ await expect(header.locator('[data-column]')).toHaveText(movedOrder);+ await expect(task).toBeFocused();+ for (const id of ["createdBy", "assignee", "taskId", "project", "parentTask", "tags", "worktree", "lastUpdated"]) {+ const rect = (await header.locator(`[data-column="${id}"]`).boundingBox())!;+ for (const cell of await page.locator(`[data-slot="task-row"] [data-column="${id}"]`).all()) {+ expect((await cell.boundingBox())!.x).toBe(rect.x);+ }+ }+ const root = rowFor(page, 428);+ const child = rowFor(page, 431);+ expect((await child.locator('[data-slot="task-row-title"]').boundingBox())!.x - (await root.locator('[data-slot="task-row-title"]').boundingBox())!.x).toBe(48);+ for (const row of [root, child]) {+ const status = (await row.locator('[data-slot="task-row-status"]').boundingBox())!;+ expect((await row.locator('[data-slot="task-row-title"]').boundingBox())!.x - status.x - status.width).toBe(8);+ }+ await page.keyboard.press("Enter");+ await expect(header.locator('[data-column="task"]')).toHaveAttribute("aria-sort", "ascending");+ await page.mouse.move(0, 0);+ await expect(task).toHaveCSS("background-color", "rgb(51, 51, 51)");+ await page.locator('[data-slot="task-list-viewport"]').screenshot({ path: testInfo.outputPath("task-list-reordered-columns.png") });+ const settings = page.getByRole("button", { name: "Columns", exact: true });+ await settings.click();+ const menu = page.getByRole("menu", { name: "Columns", exact: true });+ await expect(menu.getByRole("menuitemcheckbox")).toHaveText(movedOrder);+ await menu.getByRole("menuitemcheckbox", { name: "Created by", exact: true }).click();+ await menu.getByRole("menuitemcheckbox", { name: "Created by", exact: true }).click();+ await expect(header.locator('[data-column]')).toHaveText(movedOrder);+ await menu.getByRole("menuitem", { name: "Reset defaults", exact: true }).click();+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(menu.getByRole("menuitemcheckbox")).toHaveText(initialOrder);+ await expect(header.locator('[data-active="true"]')).toHaveCount(0);+ await expect(header.locator('[data-slot="task-list-sort-direction"]')).toHaveCount(0);+ await menu.getByRole("menuitemcheckbox", { name: "Worktree", exact: true }).click();+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Task ID", "Worktree", "Last updated"]);+ await page.keyboard.press("Escape");+ // Drag cancellation must not change the order or toggle sorting.+ const button = (await task.boundingBox())!;+ await page.mouse.move(button.x + button.width / 2, button.y + button.height / 2);+ await page.mouse.down();+ await page.mouse.move(button.x + button.width / 2 + 100, button.y + button.height / 2);+ await page.keyboard.press("Escape");+ await page.mouse.up();+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Task ID", "Worktree", "Last updated"]);+ await expect(header.locator('[data-column="task"]')).toHaveAttribute("aria-sort", "none");+});++test("status labels appear on hover and focus while the icon still opens the task", async ({ page }, testInfo) => {+ await openStory(page, "all-columns");+ const status = rowFor(page, 428).locator('[data-slot="task-row-status"]');+ const tooltip = page.getByRole("tooltip");+ await status.hover();+ await expect(tooltip).toHaveText("In Progress");+ await page.mouse.move(0, 0, { steps: 3 });+ await expect(tooltip).toHaveCount(0);+ await status.focus();+ await expect(tooltip).toHaveText("In Progress");+ await page.keyboard.press("Escape");+ await expect(tooltip).toHaveCount(0);+ await expect(status).toBeFocused();+ await rowFor(page, 429).locator('[data-slot="task-row-status"]').hover();+ await expect(tooltip).toHaveText("In Review");+ const path = testInfo.outputPath("task-status-tooltip.png");+ await page.screenshot({ path });+ await testInfo.attach("Task status label", { path, contentType: "image/png" });+ await status.click();+ await expect(page.getByTestId("task-row-design-route")).toHaveText("/PAP/issues/PAP-428");+});++test("pinned Columns menu hides columns, retains alignment, and resets defaults", async ({ page }, testInfo) => {+ await page.setViewportSize({ width: 1200, height: 862 });+ await openStory(page, "all-columns");+ const header = page.locator('[data-slot="task-list-column-header"]');+ const settings = page.getByRole("button", { name: "Columns", exact: true });+ const settingsBefore = await settings.boundingBox();+ await page.getByRole("region", { name: "Task list columns" }).evaluate(element => element.scrollTo({ left: element.scrollWidth }));+ expect(await settings.boundingBox()).toEqual(settingsBefore);+ await settings.click();+ const menu = page.getByRole("menu", { name: "Columns", exact: true });+ await expect(menu).toBeVisible();+ // Match the Paper flyout while retaining the current combined Task contract.+ await expect(menu).toHaveCSS("width", "200px");+ await expect(menu).toHaveCSS("border-radius", "8px");+ await expect(menu).toHaveCSS("border-width", "1px");+ await expect(menu).toHaveCSS("border-style", "solid");+ await expect(menu).toHaveCSS("background-color", "rgb(26, 26, 26)");+ const borderColor = await menu.evaluate(element => getComputedStyle(element.querySelector(".task-list-options-heading")!).borderBottomColor);+ await expect(menu).toHaveCSS("border-color", borderColor);+ for (const surface of [page.locator("html"), page.locator("body"), page.locator("#storybook-root"), page.getByTestId("task-row-design-preview"), page.locator('[data-slot="task-list-viewport"]'), page.locator(".task-list-header-controls"), page.locator('[data-slot="task-row-group"]').first()]) {+ await expect(surface).toHaveCSS("background-color", "rgb(26, 26, 26)");+ }+ const heading = menu.locator(".task-list-options-heading");+ await expect(heading).toHaveCSS("padding", "12px 24px");+ await expect(heading).toHaveCSS("font-weight", "600");+ const options = menu.getByRole("menuitemcheckbox");+ const menuGeometry = await options.evaluateAll(elements => elements.map(element => {+ const style = getComputedStyle(element);+ const rect = element.getBoundingClientRect();+ const check = element.querySelector("svg")!.getBoundingClientRect();+ return { x: rect.x, y: rect.y, width: rect.width, height: rect.height, size: style.fontSize, leading: style.lineHeight, weight: style.fontWeight, radius: style.borderRadius, checkRight: rect.right - check.right, checkWidth: check.width };+ }));+ for (const [index, item] of menuGeometry.entries()) {+ expect(item).toMatchObject({ width: 174, height: 32, size: "14px", leading: "20px", weight: "400", radius: "4px", checkRight: 12, checkWidth: 14 });+ if (index > 0) expect(item.y - menuGeometry[index - 1].y).toBe(36);+ }+ const reset = menu.getByRole("menuitem", { name: "Reset defaults", exact: true });+ await expect(reset).toHaveCSS("height", "32px");+ await expect(reset).toHaveCSS("font-weight", "600");+ const taskIdOption = menu.getByRole("menuitemcheckbox", { name: "Task ID", exact: true });+ await taskIdOption.hover();+ await expect(taskIdOption).toHaveCSS("background-color", "rgb(51, 51, 51)");+ await expect(taskIdOption).toHaveCSS("color", await heading.evaluate(element => getComputedStyle(element).color));+ await expect(menu.getByRole("menuitemcheckbox")).toHaveCount(9);+ await expect(menu.getByRole("menuitemcheckbox", { name: "Status", exact: true })).toHaveCount(0);+ await expect(menu.getByRole("menuitemcheckbox", { name: "Task", exact: true })).toBeChecked();+ for (const name of ["Created by", "Tags", "Task ID"]) {+ const item = menu.getByRole("menuitemcheckbox", { name, exact: true });+ await expect(item).toBeChecked();+ await item.click();+ await expect(item).not.toBeChecked();+ await expect(menu).toBeVisible();+ }+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Assignee", "Project", "Parent Task", "Worktree", "Last updated"]);+ await expect(page.locator('[data-slot="task-row"] [data-column="tags"]')).toHaveCount(0);+ await expect(header.locator('[data-column="task"]')).toHaveAttribute("aria-sort", "none");+ for (const column of ["assignee", "project", "parentTask", "lastUpdated", "worktree"]) {+ const x = (await header.locator(`[data-column="${column}"]`).boundingBox())!.x;+ const positions = await page.locator(`[data-slot="task-row"] [data-column="${column}"]`).evaluateAll(elements => elements.map(element => element.getBoundingClientRect().x));+ expect(positions).toEqual(Array(7).fill(x));+ }+ // Hiding Task hides both status and title; hierarchy controls and links remain.+ await menu.getByRole("menuitemcheckbox", { name: "Task", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(menu).toBeHidden();+ await expect(rowFor(page, 428).locator('[data-slot="task-row-content"]')).toBeHidden();+ await expect(rowFor(page, 428).getByRole("img", { name: "In Progress", exact: true })).toHaveCount(0);+ await expect(page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await expect(rowFor(page, 431)).toHaveCount(0);+ await page.getByRole("button", { name: "Expand Improve connector reliability", exact: true }).click();+ await expect(rowFor(page, 431)).toHaveCount(1);++ await settings.click();+ await menu.getByRole("menuitem", { name: "Reset defaults", exact: true }).click();+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(header.locator('[data-column="taskId"]')).toHaveAttribute("aria-sort", "none");+ await expect(menu.getByRole("menuitemcheckbox", { checked: true })).toHaveText(["Task", "Task ID", "Last updated"]);+ for (const row of await page.locator('[data-slot="task-row"]').all()) {+ expect(await row.locator('[data-column]').evaluateAll(elements => elements.map(element => element.getAttribute("data-column")))).toEqual(["taskId", "lastUpdated"]);+ }+ // Optional columns remain available after resetting to the smaller default.+ const tags = menu.getByRole("menuitemcheckbox", { name: "Tags", exact: true });+ await expect(tags).not.toBeChecked();+ await tags.click();+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Task ID", "Tags", "Last updated"]);+ await expect(page.locator('[data-slot="task-row"] [data-column="tags"] [data-slot="badge"]').first()).toHaveCSS("background-color", "rgb(51, 51, 51)");+ await tags.click();++ // Leave only one column: the final choice is disabled until another is enabled.+ await menu.getByRole("menuitemcheckbox", { name: "Worktree", exact: true }).click();+ for (const name of ["Task", "Task ID", "Last updated"]) {+ await menu.getByRole("menuitemcheckbox", { name, exact: true }).click();+ }+ await expect(menu.getByRole("menuitemcheckbox", { name: "Worktree", exact: true })).toBeDisabled();+ await menu.getByRole("menuitem", { name: "Reset defaults", exact: true }).click();+ await taskIdOption.hover();+ const path = testInfo.outputPath("task-list-options.png");+ await page.screenshot({ path });+ await testInfo.attach("Columns flyout", { path, contentType: "image/png" });+ await menu.screenshot({ path: testInfo.outputPath("task-list-columns-flyout.png") });+ await page.keyboard.press("Escape");+ await expect(menu).toBeHidden();+ await expect(settings).toBeFocused();+ await expect(rowFor(page, 428).locator('[data-slot="task-row-content"]')).toBeVisible();+ await expect(header.locator('[data-column]')).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(rowFor(page, 428).locator('[data-column="tags"]')).toHaveCount(0);+ await page.locator('[data-slot="task-list-viewport"]').screenshot({ path: testInfo.outputPath("task-list-default-columns.png") });+});++test("truncated titles scroll once, hold their end, and reset immediately; row actions stay independent", async ({ page }) => {+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openStory(page);+ const route = page.getByTestId("task-row-design-route");+ await expect(route).toHaveText("/PAP/storybook");+ const longRow = rowFor(page, 431);+ const title = longRow.locator('[data-slot="task-row-title"]');+ await expect(title).toHaveCSS("text-overflow", "ellipsis");+ await expect(title).toHaveCSS("white-space", "nowrap");+ const text = title.locator('[data-slot="task-row-title-text"]');+ expect(await titleOverflows(title)).toBe(true);+ const start = (await text.boundingBox())!.x;+ const identifierBefore = await longRow.locator('[data-slot="task-row-identifier"]').boundingBox();+ const link = longRow.locator('[data-inbox-issue-link]');+ await link.hover();+ await expect(title).toHaveAttribute("data-revealing", "true");+ await expect(page.getByRole("tooltip")).toHaveCount(0);+ await expect.poll(async () => (await text.boundingBox())!.x).toBeLessThan(start - 1);+ expect(await longRow.locator('[data-slot="task-row-identifier"]').boundingBox()).toEqual(identifierBefore);+ await text.evaluate(element => element.getAnimations().forEach(animation => animation.finish()));+ const viewport = await title.boundingBox();+ const end = await text.boundingBox();+ expect(Math.abs(end!.x + end!.width - viewport!.x - viewport!.width)).toBeLessThan(1);+ await page.evaluate(() => new Promise<void>(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))));+ expect(await text.boundingBox()).toEqual(end);+ await page.mouse.move(0, 0);+ await expect(title).not.toHaveAttribute("data-revealing");+ await expect(text).toHaveCSS("transition-duration", "0s");+ expect((await text.boundingBox())!.x).toBe(start);+ await expect(title).toHaveCSS("text-overflow", "ellipsis");++ // Reach the long-title link using the keyboard from the preceding disclosure.+ const childDisclosure = page.getByRole("button", { name: "Collapse Design reconnect and recovery flows" });+ await childDisclosure.focus();+ await page.keyboard.press("Tab");+ await expect(rowFor(page, 430).locator('[data-slot="task-row-status"]')).toBeFocused();+ await expect(page.getByRole("tooltip")).toHaveText("Todo");+ await page.keyboard.press("Tab");+ await expect(link).toBeFocused();+ await expect(title).toHaveAttribute("data-revealing", "true");+ await expect(link).toHaveCSS("outline-style", "solid");+ await expect(link).toHaveCSS("outline-width", "1px");+ await page.keyboard.press("Escape");+ await expect(title).not.toHaveAttribute("data-revealing");++ await childDisclosure.click();+ await expect(rowFor(page, 431)).toHaveCount(0);+ await expect(rowFor(page, 432)).toBeVisible();+ await expect(route).toHaveText("/PAP/storybook");+ await page.getByRole("button", { name: "Expand Design reconnect and recovery flows" }).click();+ await expect(rowFor(page, 431)).toBeVisible();+ await page.getByRole("button", { name: "Collapse Improve connector reliability" }).click();+ await expect(rowFor(page, 429)).toHaveCount(0);+ await expect(rowFor(page, 431)).toHaveCount(0);+ await expect(route).toHaveText("/PAP/storybook");+ const rootDisclosure = page.getByRole("button", { name: "Expand Improve connector reliability" });+ await rootDisclosure.focus();+ await page.keyboard.press("Space");+ await expect(rowFor(page, 431)).toBeVisible();+ await expect(route).toHaveText("/PAP/storybook");+ await rowFor(page, 428).locator('[data-inbox-issue-link]').focus();+ await page.keyboard.press("Enter");+ await expect(route).toHaveText("/PAP/issues/PAP-428");+});diff --git a/tests/storybook-visual/toolbars-design.spec.ts b/tests/storybook-visual/toolbars-design.spec.tsnew file mode 100644index 0000000000..a59bf4278f--- /dev/null+++ b/tests/storybook-visual/toolbars-design.spec.ts@@ -0,0 +1,171 @@+import { expect, test, type Page } from "@playwright/test";++test.use({ viewport: { width: 1440, height: 1100 } });+async function openToolbars(page: Page, story = "playground") {+ await page.goto(`/iframe.html?id=design-toolbars--${story}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("toolbars-preview")).toBeVisible();+ return page.getByTestId("toolbars-preview");+}++test("canonical toolbar stories mount the shared components under the proposal theme", async ({ page }) => {+ const errors: string[] = [];+ page.on("pageerror", error => errors.push(error.message));+ for (const [story, count] of [["playground", 6], ["tasks", 1], ["decisions", 1], ["skills", 1], ["artifacts", 1], ["projects", 1], ["routines", 1], ["narrow", 6]] as const) {+ const preview = await openToolbars(page, story);+ await expect(page.locator(".design-proposal-theme")).toBeVisible();+ await expect(preview.getByRole("toolbar")).toHaveCount(count);+ }+ expect(errors).toEqual([]);+});++test("task toolbar retains real view, search, layout, expansion and filter controls", async ({ page }) => {+ const preview = await openToolbars(page, "tasks");+ const toolbar = preview.getByRole("toolbar", { name: "Task list controls" });++ await toolbar.getByRole("button", { name: "Task view: All tasks", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "Unread", exact: true }).click();+ await expect(toolbar.getByRole("button", { name: "Task view: Unread", exact: true })).toBeVisible();+ await toolbar.getByRole("textbox", { name: "Search tasks", exact: true }).fill("connector");+ await toolbar.getByRole("button", { name: "Clear search", exact: true }).click();+ await expect(toolbar.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");+ await toolbar.getByRole("button", { name: "Board view", exact: true }).click();+ await expect(toolbar.getByRole("button", { name: "Board view", exact: true })).toHaveAttribute("aria-pressed", "true");+ await expect(toolbar.getByRole("button", { name: /all tasks/ })).toBeDisabled();+ await toolbar.getByRole("button", { name: "List view", exact: true }).click();+ await toolbar.getByRole("button", { name: "Collapse all tasks", exact: true }).click();+ await expect(toolbar.getByRole("button", { name: "Expand all tasks", exact: true })).toBeEnabled();+ await toolbar.getByRole("button", { name: "Filter", exact: true }).click();+ await expect(page.getByRole("dialog", { name: "Filters", exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await toolbar.getByRole("button", { name: "New Task", exact: true }).click();+ await expect(preview.getByRole("status")).toContainText("New Task requested · local preview only");+});++test("decision menus update local state", async ({ page }) => {+ const writes: string[] = [];+ page.on("request", request => { if (["POST", "PATCH", "PUT", "DELETE"].includes(request.method()) && request.url().includes("/api/")) writes.push(request.url()); });+ const preview = await openToolbars(page);+ const decisions = preview.getByRole("region", { name: "Decisions toolbar", exact: true });+ await decisions.getByRole("button", { name: "Group", exact: true }).click();+ await page.getByRole("button", { name: "Severity", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(decisions.getByRole("status")).toContainText("Group: severity");+ await decisions.getByRole("button", { name: "Sort", exact: true }).click();+ await page.getByRole("button", { name: "Oldest first", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(decisions.getByRole("status")).toContainText("Sort: oldest");+ await decisions.getByRole("button", { name: "Filter", exact: true }).click();+ await page.getByRole("button", { name: "Critical", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(decisions.getByRole("status")).toContainText("1 active filters");+ expect(writes).toEqual([]);+});++test("width controls expose narrow wrapping and keyboard focus", async ({ page }) => {+ const preview = await openToolbars(page);+ await preview.getByRole("combobox", { name: "Toolbar container width", exact: true }).selectOption("narrow");+ const specimens = preview.getByTestId("toolbar-specimens");+ await expect(specimens).toHaveAttribute("data-container-width", "narrow");+ expect(await specimens.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true);+ const search = preview.getByRole("textbox", { name: "Search tasks", exact: true });+ await search.focus();+ await page.keyboard.press("Tab");+ const list = preview.getByRole("button", { name: "List view", exact: true });+ await expect(list).toBeFocused();+ await expect(list).not.toHaveCSS("box-shadow", "none");+});++test("Skills and Artifacts use their shared production controls with local preview state", async ({ page }) => {+ let preview = await openToolbars(page, "skills");+ await preview.getByRole("textbox", { name: "Search installed skills", exact: true }).fill("review");+ await preview.getByRole("button", { name: "Sort Most agents", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "Alphabetical", exact: true }).click();+ await expect(preview.getByRole("status")).toContainText("Search: review · Sort: alphabetical");+ await preview.getByRole("button", { name: "Source All", exact: true }).click();+ await page.getByRole("menuitemradio", { name: "GitHub", exact: true }).click();+ await expect(preview.getByRole("status")).toContainText("Source: github");+ const scan = preview.getByRole("button", { name: "Scan project workspaces for skills", exact: true });+ await scan.click();+ await expect(scan).toBeDisabled();+ await preview.getByRole("button", { name: "Complete simulated scan", exact: true }).click();+ await expect(scan).toBeEnabled();+ await preview.getByRole("button", { name: "New", exact: true }).click();+ await page.getByRole("menuitem", { name: "Create new skill", exact: true }).click();+ await expect(preview.getByRole("status")).toContainText("Create skill requested");+ await preview.getByRole("button", { name: "New folder", exact: true }).click();+ await expect(preview.getByRole("status")).toContainText("New folder requested");+ preview = await openToolbars(page, "artifacts");+ await preview.getByRole("textbox", { name: "Search artifacts", exact: true }).fill("mockup");+ await preview.getByRole("radio", { name: "Images", exact: true }).click();+ await expect(preview.getByRole("radio", { name: "Images", exact: true })).toHaveCSS("font-size", "14px");+ await expect(preview.getByRole("radio", { name: "Images", exact: true })).toHaveCSS("height", "32px");+ await preview.getByTestId("artifact-group-control").click();+ await page.getByTestId("artifact-group-option-parent_task").click();+ await expect(preview.getByRole("status")).toHaveText("Search: mockup · Group: parent_task · Type: image");+ await preview.getByRole("button", { name: "Clear artifact search", exact: true }).click();+ await expect(preview.getByRole("textbox", { name: "Search artifacts", exact: true })).toHaveValue("");+});++test("canonical toolbars share control geometry and keep the requested keyboard order", async ({ page }) => {+ const preview = await openToolbars(page);+ const geometry = await preview.locator("[data-canonical-toolbar]").evaluateAll(toolbars => toolbars.map(toolbar => {+ const search = toolbar.querySelector<HTMLElement>("[data-toolbar-search]")!;+ const first = toolbar.querySelector("input, button")!;+ const controls = [...toolbar.querySelectorAll<HTMLElement>("button:not([data-toolbar-clear], .canonical-tab), [data-toolbar-control]")].filter(button => !button.closest(".design-view-toggle"));+ const style = getComputedStyle(search);+ return { name: toolbar.getAttribute("data-canonical-toolbar"), searchHeight: search.getBoundingClientRect().height, gap: getComputedStyle(toolbar).columnGap,+ border: style.borderColor, radius: style.borderRadius, first: first.getAttribute("aria-label"),+ controls: controls.map(button => ({ height: button.getBoundingClientRect().height, border: getComputedStyle(button).borderColor, radius: getComputedStyle(button).borderRadius })) };+ }));+ expect(geometry).toHaveLength(6);+ for (const toolbar of geometry) {+ expect(toolbar.searchHeight).toBe(44);+ expect(toolbar.gap).toBe("8px");+ expect(toolbar.first).toBe(toolbar.name === "tasks" ? "Task view: All tasks" : toolbar.name === "skills" ? "Search installed skills" : `Search ${toolbar.name}`);+ for (const control of toolbar.controls) {+ expect(control.height).toBe(toolbar.searchHeight);+ expect(control.border).toBe(toolbar.border);+ expect(control.radius).toBe(toolbar.radius);+ }+ }+ const skills = preview.getByRole("toolbar", { name: "Skills controls", exact: true });+ const skillViews = skills.getByRole("navigation", { name: "Skills views" });+ await expect(skillViews.getByRole("link")).toHaveText(["Installed", "Discover", "My Skills"]);+ await expect(skillViews.getByRole("link", { name: "Installed", exact: true })).toHaveAttribute("aria-current", "page");+ await expect(skillViews.getByRole("link", { name: "My Skills", exact: true })).toHaveAttribute("href", /\/skills\/studio$/);+ await expect(skillViews.getByRole("link", { name: "Sources", exact: true })).toHaveCount(0);++ await expect(skills.getByRole("button").last()).toHaveAccessibleName("New");+ const decisions = preview.getByRole("region", { name: "Decisions toolbar", exact: true });+ await decisions.getByRole("textbox", { name: "Search decisions", exact: true }).fill("des-3");+ await expect(decisions.locator("[data-toolbar-count]")).toHaveText("1 decision");+ await decisions.getByRole("button", { name: "Clear search", exact: true }).click();+ await expect(decisions.locator("[data-toolbar-count]")).toHaveText("2 decisions");+});++test("Projects toolbar searches, sorts and reports creation locally", async ({ page }) => {+ const preview = await openToolbars(page, "projects");+ await preview.getByRole("textbox", { name: "Search projects", exact: true }).fill("design");+ await preview.getByRole("button", { name: "Sort: Name", exact: true }).click();+ await page.getByRole("button", { name: "Updated", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(preview.getByRole("status")).toContainText("Search: design · Sort: updated · Direction: desc");+ await preview.getByRole("button", { name: "Add Project", exact: true }).click();+ await expect(preview.getByRole("status")).toContainText("Add Project requested · local preview only");+});+++test("routines toolbar updates search, sort, group and creation intent", async ({ page }) => {+ const preview = await openToolbars(page, "routines");+ await preview.getByRole("textbox", { name: "Search routines", exact: true }).fill("review");+ await expect(preview.locator("output")).toContainText("Search: review");+ await preview.getByRole("button", { name: "Sort", exact: true }).click();+ await page.getByRole("button", { name: "Title", exact: true }).click();+ await expect(preview.locator("output")).toContainText("Sort: title · Direction: asc");+ await preview.getByRole("button", { name: "Group", exact: true }).click();+ await page.getByRole("button", { name: "Agent", exact: true }).click();+ await expect(preview.locator("output")).toContainText("Group: assignee");+ await expect(preview.getByRole("button", { name: "New folder" })).toHaveCount(0);+ await preview.getByRole("button", { name: "Create routine" }).click();+ await expect(preview.locator("output")).toContainText("Create routine requested");+});diff --git a/tests/storybook-visual/trial-2/task-list-reproduction-trial.spec.ts b/tests/storybook-visual/trial-2/task-list-reproduction-trial.spec.tsnew file mode 100644index 0000000000..395d3ba7c5--- /dev/null+++ b/tests/storybook-visual/trial-2/task-list-reproduction-trial.spec.ts@@ -0,0 +1,357 @@+import { createHash } from "node:crypto";+import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";+import { join } from "node:path";+import { expect, test, type Page } from "@playwright/test";++const evidence = process.env.TRIAL_2_EVIDENCE_DIR;+if (!evidence) throw new Error("TRIAL_2_EVIDENCE_DIR is required; visual evidence may not be omitted.");+const reference = join(evidence, "reference.png");+const clock = "2026-10-15T00:00:00.000Z";++test.use({+ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1,+ colorScheme: "dark", reducedMotion: "reduce", locale: "en-US",+ timezoneId: "America/Los_Angeles",+ launchOptions: { executablePath: process.env.TRIAL_CHROMIUM_EXECUTABLE },+});++const storyId = "design-agent-task-list-trial-2--default";+const rows = (page: Page) => page.locator('.design-task-list-panel [data-slot="task-row"]');+const titles = (page: Page) => rows(page).locator('[data-slot="task-row-title"]');++async function selectView(page: Page, label: string) {+ await page.getByRole("button", { name: /^Task view:/ }).click();+ await page.getByRole("menuitemradio", { name: label, exact: true }).click();+}++async function componentNames(page: Page) {+ return page.getByTestId("design-page-shell").evaluate(element => {+ const key = Object.keys(element).find(key => key.startsWith("__reactFiber$"))!;+ type Fiber = { type?: { name?: string; displayName?: string }; return?: Fiber; child?: Fiber; sibling?: Fiber };+ let root = (element as unknown as Record<string, Fiber>)[key]!;+ while (root.return) root = root.return;+ const names = new Set<string>();+ const visit = (fiber?: Fiber) => {+ if (!fiber) return;+ const name = fiber.type?.displayName ?? fiber.type?.name;+ if (name) names.add(name);+ visit(fiber.child);+ visit(fiber.sibling);+ };+ visit(root);+ return [...names];+ });+}++test.describe("independent second trial", () => {+ test.skip(process.env.TRIAL_2_FREEZE === "1", "Freeze runs before implementation exists.");+ test.beforeEach(async ({ page }) => {+ await openStory(page, storyId);+ });++ test("pixel comparison executes against the immutable frozen reference", async ({ page, browser }, testInfo) => {+ expect(existsSync(reference), "Frozen reference must exist; do not substitute a new baseline").toBe(true);+ const frozen = readFileSync(reference);+ const conditions = JSON.parse(readFileSync(join(evidence!, "capture-conditions.json"), "utf8"));+ expect(createHash("sha256").update(frozen).digest("hex")).toBe(conditions.sha256);+ expect(browser.version()).toBe(conditions.browser);+ expect(conditions.clock).toBe(clock);+ await expect(rows(page)).toHaveCount(10);+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.getByRole("button", { name: "Task view: All tasks", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "Collapse all tasks", exact: true })).toBeVisible();+ await expect(page.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");+ await expect(page.getByRole("button", { name: "Filter", exact: true })).toBeVisible();+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(page.getByRole("separator", { name: "Resize sidebar" })).toHaveAttribute("aria-valuenow", "240");+ await expect(page.getByRole("menu")).toHaveCount(0);+ await expect(page.getByRole("dialog")).toHaveCount(0);+ const actual = await page.screenshot({ path: join(evidence!, "reproduction.png"), animations: "disabled", caret: "hide", scale: "css" });+ // Decode both PNGs in the same browser. Compare every RGBA channel exactly,+ // rather than allowing PNG metadata or compression to determine equality.+ const comparison = await page.evaluate(async ({ expected, received }) => {+ const decode = async (base64: string) => {+ const image = new Image();+ image.src = `data:image/png;base64,${base64}`;+ await image.decode();+ const canvas = document.createElement("canvas");+ canvas.width = image.width; canvas.height = image.height;+ const context = canvas.getContext("2d")!;+ context.drawImage(image, 0, 0);+ return { width: image.width, height: image.height, data: context.getImageData(0, 0, image.width, image.height) };+ };+ const left = await decode(expected), right = await decode(received);+ if (left.width !== right.width || left.height !== right.height) throw new Error("Screenshot dimensions differ");+ const canvas = document.createElement("canvas");+ canvas.width = left.width; canvas.height = left.height;+ const context = canvas.getContext("2d")!, diff = context.createImageData(left.width, left.height);+ let changedPixels = 0, maxChannelDelta = 0;+ for (let offset = 0; offset < left.data.data.length; offset += 4) {+ let changed = false;+ for (let channel = 0; channel < 4; channel++) {+ const delta = Math.abs(left.data.data[offset + channel] - right.data.data[offset + channel]);+ changed ||= delta !== 0;+ maxChannelDelta = Math.max(maxChannelDelta, delta);+ }+ if (changed) changedPixels++;+ const gray = Math.round((left.data.data[offset] + left.data.data[offset + 1] + left.data.data[offset + 2]) / 3);+ diff.data[offset] = changed ? 255 : gray;+ diff.data[offset + 1] = changed ? 0 : gray;+ diff.data[offset + 2] = changed ? 0 : gray;+ diff.data[offset + 3] = 255;+ }+ context.putImageData(diff, 0, 0);+ return { width: left.width, height: left.height, changedPixels, totalPixels: left.width * left.height, maxChannelDelta, diffBase64: canvas.toDataURL("image/png").split(",")[1] };+ }, { expected: frozen.toString("base64"), received: actual.toString("base64") });+ const { diffBase64, ...metrics } = comparison;+ writeFileSync(join(evidence!, "difference.png"), Buffer.from(diffBase64, "base64"));+ writeFileSync(join(evidence!, "visual-comparison.json"), JSON.stringify({+ ...metrics, changedPixelRatio: metrics.changedPixels / metrics.totalPixels,+ tolerancePixels: 0, referenceSha256: conditions.sha256,+ reproductionSha256: createHash("sha256").update(actual).digest("hex"),+ referenceConditions: "capture-conditions.json", reproductionUrl: page.url(),+ conditions: { ...conditions, referenceUrl: undefined, frozenAt: undefined, sha256: undefined },+ }, null, 2));+ await testInfo.attach("reproduction", { path: join(evidence!, "reproduction.png"), contentType: "image/png" });+ await testInfo.attach("difference", { path: join(evidence!, "difference.png"), contentType: "image/png" });+ expect(metrics.changedPixels, `Exact pixel comparison: ${JSON.stringify(metrics)}`).toBe(0);+ });++ test("rendered component and source imports audit proves reuse", async ({ page }) => {+ const errors: string[] = [];+ page.on("pageerror", error => errors.push(error.message));+ await page.reload();+ await expect(rows(page)).toHaveCount(10);+ const names = await componentNames(page);+ for (const name of ["DesignPageShell", "SidebarShell", "DesignSidebar", "SidebarCompanyMenu", "SidebarAccountMenu", "TaskListToolbar", "IssueFiltersPopover", "TaskList", "TaskListViewport", "TaskListColumnHeader", "TaskListColumnSettings", "TaskRowGroup", "IssueRow", "CellMarquee", "NewIssueDialog", "CommandPalette"]) expect(names).toContain(name);+ expect(names).not.toContain("TaskListPagePreview");+ expect(names).not.toContain("TasksReproductionTrial");+ const controller = readFileSync("ui/storybook/support/design-proposals/TasksReproductionTrial2.tsx", "utf8");+ expect(controller).toMatch(/import\s*\{\s*useTaskListCollection\s*\}\s*from\s*"@\/hooks\/useTaskListCollection"/);+ expect(controller).toMatch(/creators:\s*collection\.creators/);+ expect(controller).toMatch(/issues=\{collection\.matchingItems\.map/);+ expect(controller).not.toMatch(/TaskListPagePreview|TasksReproductionTrial["']|applyIssueFilters|includeTaskListAncestors|matchesTaskListView|createdByAgentId|createdByUserId|toLocaleLowerCase|\.filter\(|style=|<button|<input|<table|<svg|#[0-9a-f]{6}|\[\d+px\]/i);+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ expect(await componentNames(page)).toContain("KanbanBoard");+ const index = await (await page.request.get("/index.json")).json();+ expect(index.entries[storyId].title).toBe("Design proposals/AI Generated Test Pages/Tasks reproduction test 2");+ expect(errors).toEqual([]);+ writeFileSync(join(evidence!, "reuse-audit.json"), JSON.stringify({ storyId, renderedComponents: names, boardComponent: "KanbanBoard", controllerImportsSharedCollection: true, duplicatedCollectionLogicDetected: false, forbiddenCompositionDetected: false, browserErrors: errors }, null, 2));+ });++ test("read/unread hover, nested guides and all expansion levels", async ({ page }, testInfo) => {+ const unread = titles(page).filter({ hasText: /^Improve connector reliability$/ });+ const read = titles(page).filter({ hasText: /^Design reconnect and recovery flows$/ });+ await expect(unread).toHaveCSS("font-weight", "600");+ await expect(read).toHaveCSS("font-weight", "400");+ const foreground = await unread.evaluate(element => getComputedStyle(element).color);+ expect(await read.evaluate(element => getComputedStyle(element).color)).not.toBe(foreground);+ for (const [title, weight] of [[read, "400"], [unread, "600"]] as const) {+ const background = () => title.evaluate(element => getComputedStyle(element.closest('[data-slot="task-row"]')!).backgroundColor);+ const previous = await background();+ const bounds = (await title.boundingBox())!;+ await page.mouse.move(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);+ await expect(title).toHaveCSS("color", foreground);+ await expect(title).toHaveCSS("font-weight", weight);+ expect(await background()).not.toBe(previous);+ }+ await page.screenshot({ path: testInfo.outputPath("unread-hover.png"), animations: "disabled" });+ await expect(page.locator('[data-slot="task-row-tree-guide"]')).toHaveCount(5);+ const x = await titles(page).evaluateAll(elements => elements.map(element => element.getBoundingClientRect().x));+ expect(x[1] - x[0]).toBe(24);+ expect(x[3] - x[1]).toBe(24);+ const nested = page.getByRole("button", { name: "Collapse Design reconnect and recovery flows", exact: true });+ await expect(nested).toHaveAttribute("aria-expanded", "true");+ await nested.click();+ await expect(rows(page)).toHaveCount(9);+ await page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true }).click();+ await expect(rows(page)).toHaveCount(6);+ await page.getByRole("button", { name: "Expand all tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ await expect(nested).toHaveAttribute("aria-expanded", "true");+ await page.getByRole("button", { name: "Collapse all tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(6);+ await page.getByRole("button", { name: "Expand all tasks", exact: true }).click();+ await expect(rows(page)).toHaveCount(10);+ });++ test("sorting, column visibility, order, reset and list/board retention", async ({ page }) => {+ await page.getByRole("button", { name: "Task ID: sort ascending", exact: true }).click();+ await expect(page.getByRole("columnheader", { name: "Task ID" })).toHaveAttribute("aria-sort", "ascending");+ await page.getByRole("button", { name: "Task ID: sort descending", exact: true }).click();+ await expect(titles(page).first()).toHaveText("Collect feedback on the refreshed task list");+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await page.getByRole("menuitemcheckbox", { name: "Created by", exact: true }).click();+ await expect(page.getByRole("menuitemcheckbox", { name: "Created by", exact: true })).toBeChecked();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("columnheader")).toHaveCount(4);+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ await expect(page.getByRole("region", { name: "Task board columns", exact: true })).toBeVisible();+ await page.getByRole("button", { name: "List view", exact: true }).click();+ await expect(page.getByRole("columnheader")).toHaveCount(4);+ await expect(titles(page).first()).toHaveText("Collect feedback on the refreshed task list");+ await page.getByRole("button", { name: "Created by: sort ascending", exact: true }).press("Alt+ArrowLeft");+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Created by", "Task ID", "Last updated"]);+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await page.getByRole("menuitemcheckbox", { name: "Task ID", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Created by", "Last updated"]);+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await page.getByRole("button", { name: "Created by: sort ascending", exact: true }).click();+ await page.getByRole("button", { name: "Columns", exact: true }).click();+ await page.getByRole("menuitem", { name: "Reset defaults", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(titles(page).first()).toHaveText("Improve connector reliability");+ });++ test("all canonical views and saved view selection survive reload", async ({ page }) => {+ await page.getByRole("button", { name: "Task view: All tasks", exact: true }).click();+ await expect(page.getByRole("menuitemradio")).toHaveText(["Inbox", "Unread", "Needs attention", "All tasks"]);+ await page.keyboard.press("Escape");+ for (const [label, count] of [["Inbox", 6], ["Unread", 3], ["Needs attention", 3], ["All tasks", 10]] as const) {+ await selectView(page, label);+ await expect(rows(page)).toHaveCount(count);+ await page.reload();+ await expect(page.getByRole("button", { name: `Task view: ${label}`, exact: true })).toBeVisible();+ await expect(rows(page)).toHaveCount(count);+ }+ });++ test("human and agent creator filtering preserves identity", async ({ page }) => {+ await page.getByRole("button", { name: "Filter", exact: true }).click();+ await expect(page.getByRole("textbox", { name: "Search projects", exact: true })).toBeVisible();+ const creator = page.getByRole("region", { name: "Creator", exact: true });+ await creator.getByRole("checkbox", { name: "Scott", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(6);+ await expect(titles(page)).toHaveText(["Improve connector reliability", "Chat style tasks v2", "Refine the empty task-list state", "Simplify the first company setup", "Review budget notifications", "Collect feedback on the refreshed task list"]);+ await page.getByRole("button", { name: "1", exact: true }).click();+ await creator.getByRole("checkbox", { name: "Scott", exact: true }).click();+ await creator.getByRole("checkbox", { name: "CodexCoder", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(5);+ await expect(page.locator(".design-task-results")).toHaveText("4 matching tasks · Parent tasks included for context");+ await expect(titles(page)).toHaveText(["Improve connector reliability", "Define connector health states", "Design reconnect and recovery flows", /Document connector recovery/, "Review failure messages with the team"]);+ });++ test("collapsed parents reveal children after search, view and filter transitions", async ({ page }) => {+ const collapse = () => page.getByRole("button", { name: "Collapse Improve connector reliability", exact: true });+ const search = page.getByRole("textbox", { name: "Search tasks", exact: true });+ await collapse().click();+ await search.fill("expired credential");+ await expect(rows(page)).toHaveCount(3);+ await expect(titles(page)).toHaveText(["Improve connector reliability", "Design reconnect and recovery flows", /Document connector recovery/]);+ await expect(collapse()).toHaveAttribute("aria-expanded", "true");+ await expect(page.locator(".design-task-results")).toHaveText("1 matching task · Parent tasks included for context");+ await search.fill("");+ await collapse().click();+ await selectView(page, "Unread");+ await expect(rows(page)).toHaveCount(3);+ await expect(collapse()).toHaveAttribute("aria-expanded", "true");+ await selectView(page, "All tasks");+ await collapse().click();+ await page.getByRole("button", { name: "Filter", exact: true }).click();+ await page.getByRole("checkbox", { name: "In Review", exact: true }).click();+ await page.keyboard.press("Escape");+ await expect(rows(page)).toHaveCount(3);+ await expect(collapse()).toHaveAttribute("aria-expanded", "true");+ await expect(page.locator(".design-task-results")).toHaveText("2 matching tasks · Parent tasks included for context");+ await page.getByRole("button", { name: "Board view", exact: true }).click();+ const board = page.locator(".design-task-board");+ await expect(board.getByRole("button")).toHaveCount(2);+ await expect(board.getByText("Define connector health states", { exact: true })).toBeVisible();+ await expect(board.getByText("Review budget notifications", { exact: true })).toBeVisible();+ await expect(board.getByText("Improve connector reliability", { exact: true })).toHaveCount(0);+ await expect(page.locator(".design-task-results")).toHaveText("2 matching tasks");+ });++ test("metadata search covers creator, assignee, project and tags; empty state resets", async ({ page }) => {+ const search = page.getByRole("textbox", { name: "Search tasks", exact: true });+ for (const [query, count, matching] of [["Scott", 6, 6], ["CodexCoder", 8, 8], ["Design", 6, 5], ["Board UI", 9, 9], ["Design system", 3, 2]] as const) {+ await search.fill(query);+ await expect(rows(page), `Metadata query ${query}`).toHaveCount(count);+ await expect(page.locator(".design-task-results")).toContainText(`${matching} matching tasks`);+ }+ await expect(titles(page)).toHaveText(["Improve connector reliability", "Define connector health states", "Review budget notifications"]);+ await search.fill("no such task");+ await expect(page.getByText("No tasks match this view", { exact: true })).toBeVisible();+ await page.getByRole("button", { name: "Clear filters", exact: true }).click();+ await expect(search).toHaveValue("");+ await expect(rows(page)).toHaveCount(10);+ });++ test("canonical menus, company boundary and sidebar resize persistence", async ({ page }) => {+ await page.getByRole("button", { name: "Global search", exact: true }).click();+ await expect(page.getByPlaceholder("Search tasks, agents, projects...", { exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await page.getByRole("toolbar", { name: "Task list controls" }).getByRole("button", { name: "New Task", exact: true }).click();+ await expect(page.getByRole("dialog", { name: "New task", exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await page.getByRole("button", { name: "Open account menu", exact: true }).click();+ await expect(page.getByRole("dialog", { name: "Account", exact: true })).toBeVisible();+ await expect(page.getByRole("link", { name: "Invite", exact: true })).toBeVisible();+ await page.keyboard.press("Escape");+ await page.getByRole("button", { name: "Open Paperclip Storybook organization switcher", exact: true }).click();+ await expect(page.getByRole("menuitem", { name: /Research Bureau/ })).toBeVisible();+ await page.getByRole("menuitem", { name: /Research Bureau/ }).click();+ await expect(rows(page)).toHaveCount(0);+ await expect(page.getByText("No tasks in this organization", { exact: true })).toBeVisible();+ await expect(page.locator(".design-sidebar-recents a")).toHaveCount(0);+ const resize = page.getByRole("separator", { name: "Resize sidebar", exact: true });+ await resize.press("ArrowRight");+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "256");+ const bounds = (await resize.boundingBox())!;+ await page.mouse.move(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);+ await page.mouse.down();+ await page.mouse.move(bounds.x + bounds.width / 2 + 32, bounds.y + bounds.height / 2);+ await page.mouse.up();+ await expect(resize).toHaveAttribute("aria-valuenow", "288");+ await page.reload();+ await expect(resize).toHaveAttribute("aria-valuenow", "288");+ });+});++async function openStory(page: Page, id: string) {+ await page.clock.setFixedTime(new Date(clock));+ await page.goto(`/iframe.html?id=${id}&viewMode=story&globals=theme:dark`);+ await expect(page.getByTestId("design-page-shell")).toBeVisible();+ await page.evaluate(async () => {+ await Promise.all([document.fonts.load('400 14px InterVariable'), document.fonts.load('600 14px InterVariable'), document.fonts.load('400 14px "Paper Mono"')]);+ await document.fonts.ready;+ });+ await page.mouse.move(1439, 899);+}++test("freeze reference before implementation", async ({ page, browser }) => {+ test.skip(process.env.TRIAL_2_FREEZE !== "1", "Reference is frozen once, before implementation.");+ expect(existsSync(reference), "Never overwrite the frozen reference").toBe(false);+ await openStory(page, "tasks-list-page-design--default");+ await expect(page.locator('.design-task-list-panel [data-slot="task-row"]')).toHaveCount(10);+ await expect(page.getByRole("columnheader")).toHaveText(["Task", "Task ID", "Last updated"]);+ await expect(page.getByRole("button", { name: "Task view: All tasks", exact: true })).toBeVisible();+ await expect(page.getByRole("button", { name: "Collapse all tasks", exact: true })).toBeVisible();+ await expect(page.getByRole("textbox", { name: "Search tasks", exact: true })).toHaveValue("");+ await expect(page.getByRole("button", { name: "Filter", exact: true })).toBeVisible();+ await expect(page.getByRole("separator", { name: "Resize sidebar" })).toHaveAttribute("aria-valuenow", "240");+ await expect(page.locator('.task-list-sort-button[data-active="true"]')).toHaveCount(0);+ await expect(page.getByRole("menu")).toHaveCount(0);+ await expect(page.getByRole("dialog")).toHaveCount(0);+ mkdirSync(evidence!, { recursive: true });+ const png = await page.screenshot({ animations: "disabled", caret: "hide", scale: "css" });+ writeFileSync(reference, png, { flag: "wx" });+ const fonts = await page.evaluate(() => Array.from(document.fonts).filter(font => font.status === "loaded").map(font => ({ family: font.family, weight: font.weight, status: font.status })));+ writeFileSync(join(evidence!, "capture-conditions.json"), JSON.stringify({+ referenceUrl: page.url(), frozenAt: new Date().toISOString(), clock,+ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1,+ browser: browser.version(), platform: process.platform, colorScheme: "dark",+ reducedMotion: "reduce", locale: "en-US", timezoneId: "America/Los_Angeles",+ fonts, freshIsolatedContext: true, pointer: { x: 1439, y: 899 },+ view: "All tasks", layout: "list", sidebarWidth: 240,+ columns: ["Task", "Task ID", "Last updated"], sort: null, query: "", filters: [],+ hierarchy: "expanded", menus: "closed", sha256: createHash("sha256").update(png).digest("hex"),+ }, null, 2), { flag: "wx" });+});diff --git a/tests/storybook-visual/typography-foundations.spec.ts b/tests/storybook-visual/typography-foundations.spec.tsnew file mode 100644index 0000000000..6ebbadad34--- /dev/null+++ b/tests/storybook-visual/typography-foundations.spec.ts@@ -0,0 +1,412 @@+import { expect, test, type Locator, type Page } from "@playwright/test";+import { THREAD_PREVIEW_CASES } from "../../ui/src/components/design-sandbox/task-thread-fixtures";++async function openStory(page: Page, id: string) {+ await page.goto(`/iframe.html?id=${id}&viewMode=story&globals=theme:dark`);+}++async function resolvedColor(locator: Locator, token: string): Promise<string> {+ return locator.evaluate((element, tokenName) => {+ const probe = document.createElement("span");+ probe.style.color = `var(${tokenName})`;+ element.append(probe);+ const color = getComputedStyle(probe).color;+ probe.remove();+ return color;+ }, token);+}++test("proposal typography reaches shared buttons, prose and identifiers", async ({ page }) => {+ await openStory(page, "design-foundations-typography--type-specification");+ const guide = page.getByTestId("typography-foundations-preview");+ await expect(guide).toBeVisible();+ await page.evaluate(() => document.fonts.ready);+ await expect(guide.locator("[data-ramp]")).toHaveCount(9);+ await expect(guide.locator('[data-type-sample^="weight-"]')).toHaveCount(2);+ await expect(guide.getByRole("button", { name: "Continue", exact: true })).toHaveCSS("font-weight", "400");+ for (const selector of ['[data-type-sample="detail-id"]', ".paperclip-markdown code", '.task-row-columns [data-column="taskId"]']) {+ const element = guide.locator(selector).first();+ await expect(element).toHaveCSS("font-family", /"Paper Mono"/);+ }+ await expect(guide.locator(".paperclip-markdown a")).toHaveCSS("font-weight", "400");+ await expect(guide.locator(".paperclip-markdown strong")).toHaveCSS("font-weight", "600");+ await expect(guide.locator('[data-type-sample="message-time"]')).toHaveCSS("font-size", "12px");+ await expect(guide.locator('[data-type-sample="message-time"]')).toHaveCSS("line-height", "16px");+ const label = (id: string) => guide.locator(`[data-type-sample="${id}"]`).evaluate(element => {+ const style = getComputedStyle(element);+ return [style.fontFamily, style.fontSize, style.fontWeight, style.lineHeight, style.letterSpacing, style.color, style.textTransform];+ });+ expect(await label("property-eyebrow")).toEqual(await label("nav-eyebrow"));+});++test("shared sidebar and portaled account menu use the simplified weights and xs metadata", async ({ page }) => {+ await openStory(page, "design-sidebar--default");+ const organization = page.getByRole("button", { name: /organization switcher/ }).locator("[data-cell-marquee]");+ await expect(organization).toHaveCSS("font-weight", "600");+ await expect(page.getByRole("button", { name: "New Task", exact: true })).toHaveCSS("font-weight", "400");+ await page.getByRole("button", { name: "Open account menu", exact: true }).click();+ const header = page.locator("[data-flyout-profile]");+ await expect(header).toBeVisible();+ await expect(header.locator("p")).toHaveCSS("font-size", "12px");+ await expect(header.locator("p")).toHaveCSS("line-height", "16px");+ await expect(page.getByRole("link", { name: "Settings", exact: true })).toHaveCSS("font-weight", "400");+});++test("leaving a proposal restores the ordinary foundation typography", async ({ page }) => {+ await openStory(page, "design-foundations-typography--type-specification");+ await expect(page.getByRole("button", { name: "Continue", exact: true })).toHaveCSS("font-weight", "400");+ await openStory(page, "foundations-primitive-matrix--all-primitives");+ await expect(page.getByRole("heading", { name: "Primitives and interaction states", exact: true })).toBeVisible();+ await expect(page.locator(".design-proposal-theme")).toHaveCount(0);+ await expect(page.getByRole("button", { name: "default", exact: true }).first()).toHaveCSS("font-weight", "500");+ await expect(page.locator(".font-mono").first()).not.toHaveCSS("font-family", /"Paper Mono"/);+ expect(await page.locator("html").evaluate(element => {+ const style = getComputedStyle(element);+ return [style.getPropertyValue("--font-weight-medium").trim(), style.getPropertyValue("--font-weight-bold").trim(), style.getPropertyValue("--text-micro").trim()];+ })).toEqual(["500", "700", "11px"]);+});+++test("conversation typography uses the sandbox's complete state catalog and grouped composition", async ({ page }) => {+ await openStory(page, "design-foundations-typography--conversation-styles");+ const preview = page.getByTestId("sandbox-task-thread");+ await expect(preview).toHaveAttribute("data-preview-state", "all");+ expect(THREAD_PREVIEW_CASES).toHaveLength(72);+ await expect(preview.locator("[data-preview-case]")).toHaveCount(THREAD_PREVIEW_CASES.length);+ const selector = preview.getByRole("combobox", { name: "Thread preview state" });+ expect(await selector.locator("optgroup option").evaluateAll(options => options.map(option => ({+ id: (option as HTMLOptionElement).value, label: option.textContent,+ group: option.parentElement?.getAttribute("label"),+ }))).then(options => options.sort((a, b) => a.id.localeCompare(b.id)))).toEqual(THREAD_PREVIEW_CASES.map(({ id, label, group }) => ({ id, label, group })).sort((a, b) => a.id.localeCompare(b.id)));+ expect(await preview.locator("[data-preview-case]").evaluateAll(elements => elements.map(element => element.getAttribute("data-preview-case"))))+ .toEqual(THREAD_PREVIEW_CASES.map(example => example.id));++ await selector.selectOption("staging-conversation");+ await expect(preview.locator("[data-preview-case]")).toHaveCount(1);+ await expect(preview.getByTestId("task-chat-live-run-pill")).toBeVisible();+ await expect(preview.getByTestId("task-chat-runner-turn")).toHaveCount(0);+ await expect(preview.getByText("Thought through the task", { exact: true })).toBeVisible();+ await expect(preview.getByText("Read files", { exact: true })).toBeVisible();+ await expect(preview.getByTestId("task-chat-bubble-attached-turn")).toHaveCount(1);+ await page.getByText("Typography measurements", { exact: true }).click();+ await expect(page.getByTestId("conversation-style-inventory").locator("tbody tr")).not.toHaveCount(0);++ await selector.selectOption("runner-running");+ await expect(preview.getByTestId("task-chat-runner-turn")).toBeVisible();+ await expect(preview.getByTestId("task-chat-live-run-pill")).toHaveCount(0);+});++test("conversation typography keeps permission decisions and replay in the shared preview", async ({ page }) => {+ await openStory(page, "design-foundations-typography--conversation-styles");+ const preview = page.getByTestId("sandbox-task-thread");+ await preview.getByRole("combobox", { name: "Thread preview state" }).selectOption("permission-pending");+ const allow = preview.getByRole("button", { name: "Allow once", exact: true });+ await allow.click();+ await expect(allow).toHaveCount(0);+ await preview.getByRole("button", { name: "Reset / replay", exact: true }).click();+ await expect(allow).toBeVisible();+ await preview.getByRole("button", { name: "Show saved thread", exact: true }).click();+ await expect(preview).toHaveAttribute("data-preview-state", "saved");+ await expect(preview.locator("[data-preview-case]")).toHaveCount(0);+ await expect(preview.getByText(/Saved task data is available in the sandbox/)).toBeVisible();+});++test("conversation type spec measures the shared states and preserves actual sample typography", async ({ page }) => {+ await openStory(page, "design-foundations-typography--conversation-type-specification");+ const guide = page.getByTestId("conversation-type-spec");+ await expect(guide.getByTestId("conversation-type-census")).toContainText("72 states measured");+ const preview = guide.getByTestId("conversation-spec-shared-preview");+ await expect(preview.locator("[data-preview-case]")).toHaveCount(THREAD_PREVIEW_CASES.length);+ await expect(guide.locator("[data-conversation-weight]")).toHaveCount(2);+ await expect(guide.locator("[data-conversation-candidate]").first()).toBeVisible();+ await guide.getByRole("combobox", { name: "Surface", exact: true }).selectOption("Human message");+ const row = guide.locator("[data-conversation-type-role]").first();+ const properties = (element: Element) => {+ const style = getComputedStyle(element);+ return [style.fontFamily, style.fontSize, style.lineHeight, style.fontWeight, style.color, style.letterSpacing];+ };+ expect(await row.locator("[data-conversation-type-sample]").evaluate(properties))+ .toEqual(await preview.getByTestId("task-chat-human-bubble").first().locator("p").first().evaluate(properties));+ await row.getByText("Source & recipe", { exact: true }).click();+ await expect(row.getByText("ui/src/components/task-chat/TaskChatBubble.tsx", { exact: true })).toBeVisible();+ await guide.getByRole("searchbox", { name: "Find a conversation text role" }).fill("no-such-type-recipe");+ await expect(guide.locator("[data-conversation-type-role]")).toHaveCount(0);+ await expect(guide.getByText("No roles match these filters.", { exact: true })).toBeVisible();+});++test("conversation type spec can measure expanded shared content without deciding requests", async ({ page }) => {+ await openStory(page, "design-foundations-typography--conversation-type-specification");+ const guide = page.getByTestId("conversation-type-spec");+ await expect(guide.getByTestId("conversation-type-census")).toContainText("72 states measured");+ const preview = guide.getByTestId("conversation-spec-shared-preview");+ await preview.getByRole("combobox", { name: "Thread preview state" }).selectOption("working");+ await guide.getByRole("button", { name: "Expand details & measure", exact: true }).click();+ await expect(guide.getByTestId("conversation-type-census")).toContainText("1 states measured");+ await expect(preview.getByTestId("task-chat-runner-activity-detail").first()).toBeVisible();+ await expect(guide.locator('[data-conversation-type-role="Activity detail · code / command"]').first()).toBeVisible();+ await preview.getByRole("combobox", { name: "Thread preview state" }).selectOption("permission-pending");+ await guide.getByRole("button", { name: "Expand details & measure", exact: true }).click();+ await expect(preview.getByRole("button", { name: "Allow once", exact: true })).toBeVisible();+ await guide.getByRole("button", { name: "Show all states", exact: true }).click();+ await expect(preview.locator("[data-preview-case]")).toHaveCount(THREAD_PREVIEW_CASES.length);+ await guide.getByRole("button", { name: "Refresh type inventory", exact: true }).click();+ await expect(guide.getByTestId("conversation-type-census")).toContainText("72 states measured");+});++test("proposal conversation uses two sizes with muted progress, contrasting bubbles and preserved shimmer", async ({ page }) => {+ await openStory(page, "design-foundations-typography--conversation-type-specification");+ const guide = page.getByTestId("conversation-type-spec");+ await expect(guide.getByTestId("conversation-type-census")).toContainText("72 states measured");+ const preview = guide.getByTestId("conversation-spec-shared-preview");+ expect(await guide.locator("[data-conversation-size]").evaluateAll(elements => elements.map(element => element.getAttribute("data-conversation-size")).sort())).toEqual(["12px", "14px"]);+ const human = preview.locator('[data-conversation-text="human"] p').first();+ const final = preview.locator('[data-conversation-text="final"] p').first();+ const progress = preview.locator('[data-conversation-text="progress"] p').first();+ for (const element of [human, final, progress]) {+ await expect(element).toHaveCSS("font-size", "14px");+ await expect(element).toHaveCSS("line-height", "20px");+ }+ await expect(human).toHaveCSS("color", "rgb(255, 255, 255)");+ const foregroundToken = await preview.evaluate(element => getComputedStyle(element).getPropertyValue("--foreground").trim());+ await expect(final).toHaveCSS("color", await resolvedColor(preview, "--foreground"));+ await expect(progress).toHaveCSS("color", await resolvedColor(preview, "--muted-foreground"));+ const pill = preview.locator('[data-preview-case="session-start"]').getByTestId("task-chat-live-run-pill");+ await expect(pill.locator(".shimmer-text")).toHaveCSS("font-size", "14px");+ await expect(pill.locator(".shimmer-text")).toHaveCSS("--shimmer-base", foregroundToken);+ await expect(pill.locator("span").filter({ hasText: /^for / }).last()).toHaveCSS("font-size", "12px");+ await guide.getByRole("button", { name: "Expand details & measure", exact: true }).click();+ expect(await guide.locator("[data-conversation-size]").evaluateAll(elements => elements.map(element => element.getAttribute("data-conversation-size")).sort())).toEqual(["12px", "14px"]);+ await expect(preview.locator('[data-testid="task-chat-runner-activity-detail"] .paperclip-markdown p').first()).toHaveCSS("font-size", "14px");+ const streamingFinal = preview.locator('[data-preview-case="streaming-final"] [data-conversation-text="final"] p').last();+ await expect(streamingFinal).toHaveCSS("color", await resolvedColor(preview, "--foreground"));+ await expect(preview.locator('[data-testid="task-chat-turn-status-header"] [data-conversation-meta]').last()).toHaveCSS("font-size", "12px");+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await expect(pill.locator(".shimmer-text")).toHaveCSS("animation-name", "shimmer-text-slide");+});++test("conversation playback progresses through one thread and supports pause and replay", async ({ page }) => {+ await page.clock.install();+ await openStory(page, "design-foundations-typography--conversation-playback");+ const playback = page.getByTestId("conversation-playback");+ await expect(playback).toHaveAttribute("data-playback-state", "idle");+ await expect(page.getByRole("combobox", { name: "Thread preview state" })).toHaveCount(0);+ await playback.getByRole("button", { name: "Play conversation", exact: true }).click();+ await expect(playback.getByTestId("task-chat-human-bubble")).toHaveCount(1);+ await page.clock.runFor(2500);+ await expect(playback).toHaveAttribute("data-playback-stage", "1");+ await expect(playback.getByTestId("task-chat-live-run-pill")).toBeVisible();+ await playback.getByRole("button", { name: "Pause", exact: true }).click();+ const paused = await playback.innerText();+ await page.clock.runFor(5000);+ expect(await playback.innerText()).toBe(paused);+ await expect(playback).toHaveAttribute("data-playback-state", "paused");+ await playback.getByRole("button", { name: "Resume conversation", exact: true }).click();+ await page.clock.runFor(3000);+ await expect(playback).toHaveAttribute("data-playback-stage", "3");+ await expect(playback.getByTestId("task-chat-human-bubble")).toHaveCount(1);+ await expect(playback.getByText(/inspect the component alias/)).toBeVisible();+ const runningLabel = playback.locator('[data-conversation-tool-running="true"]').first();+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await expect(runningLabel).toHaveCSS("animation-name", "shimmer-text-slide");+ const foreground = await resolvedColor(playback, "--foreground");+ await expect(runningLabel).toHaveCSS("color", foreground);+ await page.clock.runFor(7500);+ await expect(playback).toHaveAttribute("data-playback-stage", "6");+ await expect(playback.locator('[data-conversation-text="final"] .paperclip-markdown').last()).toHaveCSS("color", foreground);+ await page.clock.runFor(7500);+ await expect(playback).toHaveAttribute("data-playback-stage", "9");+ await expect(playback.getByText("Which reconnect policy should I test?", { exact: true })).toBeVisible();+ await expect(playback.getByTestId("task-chat-human-bubble")).toHaveCount(2);+ await page.clock.runFor(11_000);+ await expect(playback).toHaveAttribute("data-playback-stage", "13");+ await expect(playback.locator('[data-conversation-tool-running="true"]')).toHaveCount(0);+ await page.clock.runFor(5000);+ await expect(playback).toHaveAttribute("data-playback-stage", "15");+ await expect(playback.locator('[data-conversation-tool-running="true"]').first()).toHaveCSS("animation-name", "shimmer-text-slide");+ await page.clock.runFor(10_000);+ await expect(playback).toHaveAttribute("data-playback-state", "complete");+ await expect(playback.getByTestId("task-chat-agent-bubble")).toHaveCount(2);+ await expect(playback.getByText("26 component source files", { exact: true })).toBeVisible();+ await playback.getByTestId("task-chat-turn-summary").last().click();+ await expect(playback.getByTestId("task-chat-activity-phase-toggle").first()).toBeVisible();+ await playback.getByRole("button", { name: "Replay conversation", exact: true }).click();+ await expect(playback).toHaveAttribute("data-playback-stage", "0");+ await expect(playback.getByTestId("task-chat-agent-bubble")).toHaveCount(0);+});+++test("conversation metadata has hover and focus feedback and agent names stay body-sized", async ({ page }) => {+ await openStory(page, "design-foundations-typography--conversation-styles");+ const preview = page.getByTestId("sandbox-task-thread");+ const name = preview.getByTestId("task-chat-agent-identity").first().locator(":scope > span:last-child");+ await expect(name).toHaveCSS("font-size", "14px");+ await expect(name).toHaveCSS("line-height", "20px");+ await expect(name).toHaveCSS("font-weight", "600");+ const foreground = await resolvedColor(preview, "--foreground");+ await expect(name).toHaveCSS("color", foreground);+ const heading = preview.locator('[data-conversation-text="final"] h2').first();+ await expect(heading).toHaveCSS("font-size", "14px");+ await expect(heading).toHaveCSS("font-weight", "400");+ await expect(heading).toHaveCSS("color", foreground);+ const activity = preview.getByTestId("task-chat-turn-summary").first();+ const label = activity.locator("span").filter({ hasText: /^Activity$/ });+ const base = await label.evaluate(element => getComputedStyle(element).color);+ await activity.hover();+ await expect(label).toHaveCSS("color", foreground);+ await expect(activity).not.toHaveCSS("background-color", "rgba(0, 0, 0, 0)");+ await page.mouse.move(0, 0);+ await expect(label).toHaveCSS("color", base);+ await activity.focus();+ await expect(label).toHaveCSS("color", foreground);+ await expect(activity).toHaveCSS("font-size", "12px");+});++test("playback appends complete words with a fade while retaining previous word nodes", async ({ page }) => {+ await page.clock.install();+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openStory(page, "design-foundations-typography--conversation-playback");+ const playback = page.getByTestId("conversation-playback");+ await playback.getByRole("button", { name: "Play conversation", exact: true }).click();+ await page.clock.runFor(3500);+ const prose = playback.locator('[data-conversation-text="progress"] .paperclip-markdown').last();+ const words = prose.locator(".conversation-stream-word");+ await expect(words.first()).toHaveText("I’ll");+ await expect(words.first()).toHaveCSS("animation-name", "conversation-word-in");+ await expect(words.first()).toHaveCSS("animation-duration", "0.32s");+ const initialCount = await words.count();+ const oldWord = await words.first().elementHandle();+ await page.clock.runFor(200);+ expect(await words.count()).toBeGreaterThan(initialCount);+ expect(await oldWord!.evaluate(element => element.isConnected)).toBe(true);+ const text = await prose.textContent();+ expect("I’ll inspect the component alias first, then check the file list. No code changes are needed.".startsWith(text!)).toBe(true);+ await page.emulateMedia({ reducedMotion: "reduce" });+ await expect(words.first()).toHaveCSS("animation-name", "none");+});++test("completion fades activity before folding its space and preserves the mounted answer", async ({ page }) => {+ await page.clock.install();+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openStory(page, "design-foundations-typography--conversation-playback");+ const playback = page.getByTestId("conversation-playback");+ await playback.getByRole("button", { name: "Play conversation", exact: true }).click();+ await page.clock.runFor(15_800);+ const turn = playback.getByTestId("task-chat-turn-handoff").first();+ const activity = turn.getByTestId("task-chat-handoff-activity");+ const answer = turn.getByTestId("task-chat-agent-bubble");+ const node = await answer.elementHandle();+ const prose = await answer.locator("p").first().elementHandle();+ const before = await answer.boundingBox();+ const expandedHeight = (await activity.boundingBox())!.height;+ await page.clock.runFor(240);+ await expect(turn).toHaveAttribute("data-handoff-state", "settling");+ await expect(activity).toHaveAttribute("aria-hidden", "true");+ await expect(activity).toHaveAttribute("inert", "");+ await expect(activity).toHaveCSS("transition-delay", "0s, 0.18s");+ await expect(activity).toHaveCSS("transition-duration", "0.18s, 0.48s");+ expect(await node!.evaluate(element => element.isConnected)).toBe(true);+ expect(await prose!.evaluate(element => element.isConnected)).toBe(true);+ // Observe intermediate rendered geometry, not just a class name or endpoint.+ await expect.poll(async () => Number(await activity.evaluate(element => getComputedStyle(element).opacity))).toBeLessThan(1);+ await expect.poll(async () => (await activity.boundingBox())!.height).toBeLessThan(expandedHeight);+ await expect(turn).toHaveAttribute("data-handoff-state", "settled");+ expect((await activity.boundingBox())!.height).toBe(0);+ expect((await answer.boundingBox())!.y).toBeLessThan(before!.y);+ expect(await node!.evaluate(element => element.isConnected)).toBe(true);+ expect(await prose!.evaluate(element => element.isConnected)).toBe(true);+ await expect(turn.getByTestId("task-chat-turn-summary")).toBeVisible();+ await turn.getByTestId("task-chat-turn-summary").click();+ await expect(turn.getByTestId("task-chat-activity-phase-toggle").first()).toBeVisible();++ // Replay during an exit must discard its retained activity and old timers.+ await playback.getByRole("button", { name: "Replay", exact: true }).click();+ await page.clock.runFor(15_800);+ await page.clock.runFor(240);+ await expect(playback.getByTestId("task-chat-turn-handoff").first()).toHaveAttribute("data-handoff-state", "settling");+ await playback.getByRole("button", { name: "Replay", exact: true }).click();+ await expect(playback.getByTestId("task-chat-turn-handoff")).toHaveCount(1);+ await expect(playback.getByTestId("task-chat-agent-bubble")).toHaveCount(0);+});++test("reduced motion settles the final response without an activity exit", async ({ page }) => {+ await page.clock.install();+ await page.emulateMedia({ reducedMotion: "reduce" });+ await openStory(page, "design-foundations-typography--conversation-playback");+ const playback = page.getByTestId("conversation-playback");+ await playback.getByRole("button", { name: "Play conversation", exact: true }).click();+ await page.clock.runFor(16_040);+ const turn = playback.getByTestId("task-chat-turn-handoff").first();+ await expect(turn).toHaveAttribute("data-handoff-state", "settled");+ await expect(turn.getByTestId("task-chat-handoff-activity")).toHaveCSS("transition-property", "none");+ await expect(turn.getByTestId("task-chat-turn-summary")).toBeVisible();+ await expect(turn.getByTestId("task-chat-live-run-pill")).toHaveCount(0);+});++test("one current item owns shimmer and startup plumbing stays out of the conversation", async ({ page }) => {+ await page.clock.install();+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openStory(page, "design-foundations-typography--conversation-playback");+ const playback = page.getByTestId("conversation-playback");+ const owners = playback.locator('.shimmer-text, [data-conversation-tool-running="true"]');+ await playback.getByRole("button", { name: "Play conversation", exact: true }).click();+ await expect(owners).toHaveCount(1);+ await expect(owners).toHaveText("Working");+ await expect(playback).not.toContainText(/Preparing the turn|Preparing the transcript|Waiting for transcript|run phase:/i);+ await page.clock.runFor(1600);+ await expect(owners).toHaveCount(1);+ await expect(owners).toHaveText("Thinking");+ const working = playback.getByTestId("task-chat-live-run-pill").getByText("Working", { exact: true });+ const muted = await resolvedColor(playback, "--muted-foreground");+ await expect(working).toHaveCSS("color", muted);+ await expect(working).toHaveCSS("animation-name", "none");+ await page.clock.runFor(3800);+ await expect(owners).toHaveCount(1);+ await expect(owners).toHaveAttribute("data-conversation-tool-running", "true");+ await expect(owners).toHaveCSS("animation-name", "shimmer-text-slide");+ await expect(working).toHaveCSS("color", muted);+ await page.clock.runFor(7400);+ await expect(playback).toHaveAttribute("data-playback-stage", "6");+ await expect(owners).toHaveCount(0);+});++test("mixed-font tool text shares one uninterrupted shimmer loop", async ({ page }) => {+ await page.clock.install();+ await page.emulateMedia({ reducedMotion: "no-preference" });+ await openStory(page, "design-foundations-typography--conversation-playback");+ const playback = page.getByTestId("conversation-playback");+ await playback.getByRole("button", { name: "Play conversation", exact: true }).click();+ await page.clock.runFor(9600);+ const line = playback.locator('[data-conversation-tool-running="true"]');+ await expect(line).toHaveCount(1);+ await expect(line).toContainText("Running a command");+ await expect(line.locator("span").first()).toHaveCSS("font-family", /Inter/);+ await expect(line.locator("span").last()).toHaveCSS("font-family", /Paper Mono/);+ for (const child of await line.locator(":scope > span").all()) {+ await expect(child).toHaveCSS("animation-name", "none");+ await expect(child).toHaveCSS("background-image", "none");+ await expect(child).toHaveCSS("-webkit-text-fill-color", "rgba(0, 0, 0, 0)");+ }+ const sweep = await line.evaluate(element => {+ const animations = element.getAnimations({ subtree: true });+ const animation = animations.find(candidate => (candidate as CSSAnimation).animationName === "shimmer-text-slide")!;+ const timing = animation.effect!.getTiming();+ const keyframes = animation.effect!.getKeyframes();+ // Sample the old dead zone: the background must keep moving after 60%.+ animation.pause();+ animation.currentTime = Number(timing.duration) * 0.65;+ const first = getComputedStyle(element).backgroundPosition;+ animation.currentTime = Number(timing.duration) * 0.95;+ const second = getComputedStyle(element).backgroundPosition;+ animation.play();+ return { count: animations.length, easing: timing.easing, forever: timing.iterations === Infinity, offsets: keyframes.map(frame => frame.offset), first, second };+ });+ expect(sweep.count).toBe(1);+ expect(sweep.easing).toBe("linear");+ expect(sweep.forever).toBe(true);+ expect(sweep.offsets).toEqual([0, 1]);+ expect(sweep.first).not.toBe(sweep.second);+ await page.emulateMedia({ reducedMotion: "reduce" });+ await expect(line).toHaveCSS("animation-name", "none");+ await expect(line).toHaveCSS("background-image", "none");+ await expect(line.locator("span").last()).toHaveCSS("-webkit-text-fill-color", await resolvedColor(playback, "--foreground"));+});diff --git a/ui/public/fonts/NOTICE.md b/ui/public/fonts/NOTICE.mdindex 699d3d0e35..5eb40e75fd 100644--- a/ui/public/fonts/NOTICE.md+++ b/ui/public/fonts/NOTICE.md@@ -15,3 +15,16 @@ the same sans-serif text stack without relying on host font packages.Redistribution note: Inter is redistributed under the SIL Open Font License 1.1.The bundled WOFF2 files are included unmodified from the upstream v4.1 release.++## Paper Mono++- Upstream project: https://github.com/paper-design/paper-mono+- Version: v1.000+- Release archive: https://github.com/paper-design/paper-mono/releases/download/v1.000/paper-mono-v1.000.zip+- Archive SHA-256: `8642652985dc87bf4cfd07c89942899e611c3c774fc25284c0dd4fe86a993a13`+- Source file: `fonts/webfonts/PaperMono[wght].woff2`, bundled without modification as `PaperMono-Variable.woff2`+- License: SIL Open Font License 1.1; included in `PaperMono-OFL.txt`++The refreshed task-row specimen uses this variable webfont for task identifiers.+It supports upright weights 100–800. Existing uses of the system monospace stack+remain unchanged until their design is reviewed.diff --git a/ui/public/fonts/PaperMono-OFL.txt b/ui/public/fonts/PaperMono-OFL.txtnew file mode 100644index 0000000000..00aff8566d--- /dev/null+++ b/ui/public/fonts/PaperMono-OFL.txt@@ -0,0 +1,93 @@+Copyright 2025 The Paper-Mono.Git Project Authors (https://github.com/paper-design/paper-mono.git)++This Font Software is licensed under the SIL Open Font License, Version 1.1.+This license is copied below, and is also available with a FAQ at:+https://openfontlicense.org+++-----------------------------------------------------------+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007+-----------------------------------------------------------++PREAMBLE+The goals of the Open Font License (OFL) are to stimulate worldwide+development of collaborative font projects, to support the font creation+efforts of academic and linguistic communities, and to provide a free and+open framework in which fonts may be shared and improved in partnership+with others.++The OFL allows the licensed fonts to be used, studied, modified and+redistributed freely as long as they are not sold by themselves. The+fonts, including any derivative works, can be bundled, embedded,+redistributed and/or sold with any software provided that any reserved+names are not used by derivative works. The fonts and derivatives,+however, cannot be released under any other type of license. The+requirement for fonts to remain under this license does not apply+to any document created using the fonts or their derivatives.++DEFINITIONS+"Font Software" refers to the set of files released by the Copyright+Holder(s) under this license and clearly marked as such. This may+include source files, build scripts and documentation.++"Reserved Font Name" refers to any names specified as such after the+copyright statement(s).++"Original Version" refers to the collection of Font Software components as+distributed by the Copyright Holder(s).++"Modified Version" refers to any derivative made by adding to, deleting,+or substituting -- in part or in whole -- any of the components of the+Original Version, by changing formats or by porting the Font Software to a+new environment.++"Author" refers to any designer, engineer, programmer, technical+writer or other person who contributed to the Font Software.++PERMISSION & CONDITIONS+Permission is hereby granted, free of charge, to any person obtaining+a copy of the Font Software, to use, study, copy, merge, embed, modify,+redistribute, and sell modified and unmodified copies of the Font+Software, subject to the following conditions:++1) Neither the Font Software nor any of its individual components,+in Original or Modified Versions, may be sold by itself.++2) Original or Modified Versions of the Font Software may be bundled,+redistributed and/or sold with any software, provided that each copy+contains the above copyright notice and this license. These can be+included either as stand-alone text files, human-readable headers or+in the appropriate machine-readable metadata fields within text or+binary files as long as those fields can be easily viewed by the user.++3) No Modified Version of the Font Software may use the Reserved Font+Name(s) unless explicit written permission is granted by the corresponding+Copyright Holder. This restriction only applies to the primary font name as+presented to the users.++4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font+Software shall not be used to promote, endorse or advertise any+Modified Version, except to acknowledge the contribution(s) of the+Copyright Holder(s) and the Author(s) or with their explicit written+permission.++5) The Font Software, modified or unmodified, in part or in whole,+must be distributed entirely under this license, and must not be+distributed under any other license. The requirement for fonts to+remain under this license does not apply to any document created+using the Font Software.++TERMINATION+This license becomes null and void if any of the above conditions are+not met.++DISCLAIMER+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM+OTHER DEALINGS IN THE FONT SOFTWARE.\ No newline at end of filediff --git a/ui/public/fonts/PaperMono-Variable.woff2 b/ui/public/fonts/PaperMono-Variable.woff2new file mode 100644index 0000000000..80e9f10157Binary files /dev/null and b/ui/public/fonts/PaperMono-Variable.woff2 differdiff --git a/ui/src/App.tsx b/ui/src/App.tsxindex 351bc10e27..daee663274 100644--- a/ui/src/App.tsx+++ b/ui/src/App.tsx@@ -260,7 +260,7 @@ function boardRoutes(streamlinedUiEnabled: boolean, combinedInboxTasksEnabled: b<Route path="company/settings/:settingsRoutePath/*" element={<CompanySettingsPluginPage />} /><Route path="skills/sources" element={<SkillSources />} /><Route path="skills/sources/:sourceId" element={<SkillSources />} />- <Route path="skills/studio" element={<SkillStudio />} />+ <Route path="skills/studio" element={streamlinedUiEnabled ? <CompanySkills collectionView="authored" /> : <SkillStudio />} /><Route path="skills/studio/new" element={<SkillStudio />} /><Route path="skills/studio/:skillId" element={<SkillStudio />} /><Route path="skills/:skillId/studio" element={<LegacySkillStudioRedirect />} />diff --git a/ui/src/components/ActivityList.tsx b/ui/src/components/ActivityList.tsxnew file mode 100644index 0000000000..c42962b686--- /dev/null+++ b/ui/src/components/ActivityList.tsx@@ -0,0 +1,16 @@+import type { ActivityEvent } from "@paperclipai/shared";+import { ActivityRow, type ActivityRowProps } from "./ActivityRow";++/** Caller-ordered events, with the same row tokens and responsive metadata+ * priorities as task summaries. Event destinations and task hover cards remain+ * owned by ActivityRow and the shared Link; non-task events never get task IDs. */+export function ActivityList({ events, label = "Recent activity", density = "comfortable", rowClassName, ...directories }: {+ events: readonly ActivityEvent[];+ label?: string;+ density?: "comfortable" | "compact";+ rowClassName?: (event: ActivityEvent) => string | undefined;+} & Pick<ActivityRowProps, "agentMap" | "userProfileMap" | "entityNameMap" | "entityTitleMap">) {+ return <ul className="task-summary-list activity-list" aria-label={label}>+ {events.map(event => <li key={event.id}><ActivityRow {...directories} event={event} appearance="refreshed" density={density} className={rowClassName?.(event)} /></li>)}+ </ul>;+}diff --git a/ui/src/components/ActivityRow.tsx b/ui/src/components/ActivityRow.tsxindex 4cc0526c9c..f3d6ba55eb 100644--- a/ui/src/components/ActivityRow.tsx+++ b/ui/src/components/ActivityRow.tsx@@ -8,6 +8,8 @@ import { cn } from "../lib/utils";import { formatActivityVerb } from "../lib/activity-format";import { deriveProjectUrlKey, type ActivityEvent, type Agent } from "@paperclipai/shared";import type { CompanyUserProfile } from "../lib/company-members";+import { useState, type ReactNode } from "react";+import { CellMarquee, HoveredCellContext, useCellMarqueeHover } from "./CellMarquee";function entityLink(entityType: string, entityId: string, name?: string | null): string | null {switch (entityType) {@@ -20,16 +22,18 @@ function entityLink(entityType: string, entityId: string, name?: string | null):}}-interface ActivityRowProps {+export interface ActivityRowProps {event: ActivityEvent;agentMap: Map<string, Agent>;userProfileMap?: Map<string, CompanyUserProfile>;entityNameMap: Map<string, string>;entityTitleMap?: Map<string, string>;className?: string;+ appearance?: "default" | "refreshed";+ density?: "comfortable" | "compact";}-export function ActivityRow({ event, agentMap, userProfileMap, entityNameMap, entityTitleMap, className }: ActivityRowProps) {+export function ActivityRow({ event, agentMap, userProfileMap, entityNameMap, entityTitleMap, className, appearance = "default", density = "comfortable" }: ActivityRowProps) {const verb = formatActivityVerb(event.action, event.details, { agentMap, userProfileMap });const isHeartbeatEvent = event.entityType === "heartbeat_run";@@ -52,18 +56,24 @@ export function ActivityRow({ event, agentMap, userProfileMap, entityNameMap, enconst userProfile = event.actorType === "user" ? userProfileMap?.get(event.actorId) : null;const actorName = actor?.name ?? (event.actorType === "system" ? "System" : userProfile?.label ?? (event.actorType === "user" ? "Board" : event.actorId || "Unknown"));const actorAvatarUrl = userProfile?.image ?? null;+ const avatar = event.actorType === "agent" ? (+ <AgentAvatar agent={actor} name={actorName} size={24} className="@xl:self-center" />+ ) : (+ <Avatar size="sm" aria-hidden="true" className="@xl:self-center">+ {actorAvatarUrl && <AvatarImage src={actorAvatarUrl} alt="" />}+ <AvatarFallback>{deriveInitials(actorName)}</AvatarFallback>+ </Avatar>+ );++ if (appearance === "refreshed") {+ const subject = event.entityType === "issue" ? entityTitle || name || "Task" : [name, entityTitle].filter(Boolean).join(" — ");+ return <RefreshedActivityRow event={event} avatar={avatar} actorName={actorName} verb={verb} subject={subject} identifier={event.entityType === "issue" ? name ?? undefined : undefined} link={link} density={density} className={className} />;+ }const inner = (<div className="space-y-2"><div className="flex items-start gap-2 @xl:grid @xl:grid-cols-(--dashboard-activity-list-columns) @xl:items-baseline">- {event.actorType === "agent" ? (- <AgentAvatar agent={actor} name={actorName} size={24} className="@xl:self-center" />- ) : (- <Avatar size="sm" aria-hidden="true" className="@xl:self-center">- {actorAvatarUrl && <AvatarImage src={actorAvatarUrl} alt="" />}- <AvatarFallback>{deriveInitials(actorName)}</AvatarFallback>- </Avatar>- )}+ {avatar}<div className="flex min-w-0 flex-1 flex-col gap-1 @xl:contents"><div className="flex min-w-0 items-baseline gap-2 @xl:contents"><p className="flex h-6 min-w-0 flex-1 items-center gap-1.5">@@ -115,3 +125,36 @@ export function ActivityRow({ event, agentMap, userProfileMap, entityNameMap, en</div>);}++function RefreshedActivityRow({ event, avatar, actorName, verb, subject, identifier, link, density, className }: {+ event: ActivityEvent; avatar: ReactNode; actorName: string; verb: string; subject: string;+ identifier?: string; link: string | null; density: "comfortable" | "compact"; className?: string;+}) {+ const { hoveredCell, onMouseMove, clearHoveredCell } = useCellMarqueeHover();+ const [focused, setFocused] = useState(false);+ const rowProps = {+ "data-slot": "activity-row",+ "data-density": density,+ className: cn("task-row-refreshed task-summary-row activity-row-refreshed", className),+ onMouseMove,+ onMouseLeave: () => { clearHoveredCell(); setFocused(false); },+ onFocus: () => setFocused(true),+ onBlur: () => setFocused(false),+ };+ const content = <>+ {avatar}+ <span data-marquee-cell="activity" className="min-w-0 flex-1">+ <CellMarquee cell="activity" active={focused} slot="task-row-title" tabbable={!link}>+ {actorName} {verb}{subject ? ` ${subject}` : ""}+ </CellMarquee>+ </span>+ <span data-slot="task-row-trailing" className="ml-auto flex shrink-0 items-center">+ {identifier ? <span data-slot="task-row-identifier" data-marquee-cell="identifier" className="shrink-0 text-right text-muted-foreground"><CellMarquee cell="identifier">{identifier}</CellMarquee></span> : null}+ <span data-slot="task-row-timestamp" data-marquee-cell="timestamp" className="shrink-0 text-right text-muted-foreground"><CellMarquee cell="timestamp">{timeAgo(event.createdAt)}</CellMarquee></span>+ </span>+ </>;+ return <HoveredCellContext.Provider value={hoveredCell}>+ {link ? <Link to={link} {...rowProps}>{content}</Link> : <div {...rowProps}>{content}</div>}+ <div className="activity-row-details"><IssueReferenceActivitySummary event={event} /></div>+ </HoveredCellContext.Provider>;+}diff --git a/ui/src/components/AgentAvatar.tsx b/ui/src/components/AgentAvatar.tsxindex 0866c2bf49..e4ef127835 100644--- a/ui/src/components/AgentAvatar.tsx+++ b/ui/src/components/AgentAvatar.tsx@@ -3,6 +3,7 @@ import { useState } from "react";import { resolveAgentAppearance, type AgentAppearance, type AgentAvatarSize, type CharacterState } from "@paperclipai/shared";import { cn } from "@/lib/utils";import { deriveInitials } from "./Identity";+import { useAvatarInitials } from "./ui/avatar-initials";export type AvatarAgent = { id?: string; name?: string; appearance?: AgentAppearance | null; avatarUrl?: string | null };export const avatarSizeClasses: Record<AgentAvatarSize, string> = {@@ -23,10 +24,11 @@ export function AgentAvatar({ agent, appearance, size = 24, name, label, pose =const identity = resolveAgentAppearance(appearance ?? agent?.appearance, agent?.id);const src = agentAvatarUrl(identity, size, 1, pose, muted);const [failedUrl, setFailedUrl] = useState<string | null>(null);+ const initials = useAvatarInitials(deriveInitials(name ?? agent?.name ?? "Agent"));return (<span data-slot="agent-avatar" className={cn("relative inline-flex shrink-0 items-center justify-center align-middle", avatarSizeClasses[size], className)}role={label ? "img" : undefined} aria-label={label} aria-hidden={label ? undefined : true}>- {failedUrl === src ? <span className="text-xs text-muted-foreground">{deriveInitials(name ?? agent?.name ?? "Agent")}</span> :+ {failedUrl === src ? <span className="text-xs text-muted-foreground">{initials}</span> :<img src={src} srcSet={identity.customAvatarAssetId ? undefined : `${agentAvatarUrl(identity, size, 2, pose, muted)} 2x`} alt="" width={size} height={size}decoding="async" loading="lazy" className="size-full object-contain" onError={() => setFailedUrl(src)} />}</span>diff --git a/ui/src/components/AgentsToolbar.tsx b/ui/src/components/AgentsToolbar.tsxnew file mode 100644index 0000000000..adf09e3a2c--- /dev/null+++ b/ui/src/components/AgentsToolbar.tsx@@ -0,0 +1,35 @@+import { List, Network, Plus } from "lucide-react";+import { ToolbarSearch } from "./ToolbarSearch";+import { PageTabBar, type PageTabItem } from "./PageTabBar";+import { Button } from "./ui/button";++export interface AgentsToolbarProps {+ query: string;+ onQueryChange: (value: string) => void;+ tab: string;+ items: readonly PageTabItem[];+ onTabChange: (value: string) => void;+ view: "list" | "org";+ onViewChange: (value: "list" | "org") => void;+ hideViewToggle?: boolean;+ onNewAgent: () => void;+}++/** Shared roster search, status navigation and actions for the page and stories. */+export function AgentsToolbar({ query, onQueryChange, tab, items, onTabChange, view, onViewChange, hideViewToggle, onNewAgent }: AgentsToolbarProps) {+ return <div data-canonical-toolbar="agents" role="toolbar" aria-label="Agents controls" className="flex flex-wrap items-center gap-3">+ <div className="design-toolbar-controls flex w-full flex-wrap items-center gap-4">+ <ToolbarSearch query={query} onQueryChange={onQueryChange} label="Search agents" placeholder="Search agents…" />+ {!hideViewToggle && <div className="design-view-toggle" role="group" aria-label="Agent view">+ <Button type="button" size="icon-sm" variant={view === "list" ? "secondary" : "ghost"} className="design-toolbar-icon" onClick={() => onViewChange("list")} title="List view" aria-label="List view" aria-pressed={view === "list"}><List aria-hidden /></Button>+ <Button type="button" size="icon-sm" variant={view === "org" ? "secondary" : "ghost"} className="design-toolbar-icon" onClick={() => onViewChange("org")} title="Org chart view" aria-label="Org chart view" aria-pressed={view === "org"}><Network aria-hidden /></Button>+ </div>}+ <div className="design-toolbar-actions">+ <Button size="sm" variant="outline" data-toolbar-primary onClick={onNewAgent}><Plus aria-hidden />New Agent</Button>+ </div>+ </div>+ <div className="collection-toolbar-tabs">+ <PageTabBar items={items} value={tab} onValueChange={onTabChange} align="start" />+ </div>+ </div>;+}diff --git a/ui/src/components/CellMarquee.tsx b/ui/src/components/CellMarquee.tsxnew file mode 100644index 0000000000..8ab3b7084c--- /dev/null+++ b/ui/src/components/CellMarquee.tsx@@ -0,0 +1,149 @@+import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ReactNode, type MouseEvent as ReactMouseEvent } from "react";+import { cn } from "../lib/utils";++/** Row overlays keep navigation intact; the row reports the cell under the pointer. */+export const HoveredCellContext = createContext<string | null>(null);++/** Shared hit testing for row overlays and ordinary links. Only the cell under+ * the pointer reveals, even when its navigation target covers the whole row. */+export function useCellMarqueeHover() {+ const [hoveredCell, setHoveredCell] = useState<string | null>(null);+ const onMouseMove = (event: ReactMouseEvent<HTMLElement>) => {+ const cell = Array.from(event.currentTarget.querySelectorAll<HTMLElement>("[data-marquee-cell]")).find(element => {+ const rect = element.getBoundingClientRect();+ return rect.width > 0 && event.clientX >= rect.left && event.clientX < rect.right;+ });+ setHoveredCell(cell?.dataset.marqueeCell ?? null);+ };+ return { hoveredCell, onMouseMove, clearHoveredCell: () => setHoveredCell(null) };+}++export function CellMarquee({ children, cell, active = false, className, slot = "cell-marquee", contentSlot = "cell-marquee-content", tabbable = true, interactWithParent = false, resetKey }: {+ children: ReactNode;+ cell: string;+ active?: boolean;+ className?: string;+ slot?: string;+ contentSlot?: string;+ tabbable?: boolean;+ /** Labels inside links/buttons reuse that control's pointer and keyboard target. */+ interactWithParent?: boolean;+ /** Reset when a parent menu changes state, without replaying on restored focus. */+ resetKey?: string | number | boolean;+}) {+ const hoveredCell = useContext(HoveredCellContext);+ const viewportRef = useRef<HTMLSpanElement>(null);+ const contentRef = useRef<HTMLSpanElement>(null);+ const previousResetKey = useRef(resetKey);+ const ignoreRestoredFocus = useRef(false);+ const [overflow, setOverflow] = useState(0);+ const [focused, setFocused] = useState(false);+ const [dismissed, setDismissed] = useState(false);+ const [revealComplete, setRevealComplete] = useState(false);+ const [parentHovered, setParentHovered] = useState(false);+ const [parentFocused, setParentFocused] = useState(false);+ const hovered = hoveredCell === cell || parentHovered;+ const activated = hovered || ((active || focused || parentFocused) && (hoveredCell === null || hovered));+ const revealing = overflow > 0 && activated && !dismissed;++ useLayoutEffect(() => {+ if (previousResetKey.current === resetKey) return;+ previousResetKey.current = resetKey;+ const owner = viewportRef.current?.closest<HTMLElement>('a, button, [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]');+ // Menus restore focus to their trigger on dismissal. That is not a new+ // request to reveal its label; resume on pointer interaction or a new focus.+ ignoreRestoredFocus.current = true;+ setParentHovered(owner?.matches(":hover") ?? false);+ setFocused(false);+ setParentFocused(false);+ }, [resetKey]);++ useLayoutEffect(() => {+ const viewport = viewportRef.current;+ const content = contentRef.current;+ if (!viewport || !content) return;+ const measure = () => {+ const width = viewport.getBoundingClientRect().width;+ // scrollWidth/clientWidth round to whole pixels even when text-overflow+ // has already clipped a fractional glyph. Measure the contents precisely.+ const range = content.ownerDocument.createRange();+ range.selectNodeContents(content);+ setOverflow(width > 0 ? Math.max(0, range.getBoundingClientRect().width - width) : 0);+ };+ measure();+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);+ observer?.observe(viewport);+ observer?.observe(content);+ document.fonts?.addEventListener("loadingdone", measure);+ return () => {+ observer?.disconnect();+ document.fonts?.removeEventListener("loadingdone", measure);+ };+ }, [children, className]);++ useEffect(() => {+ const viewport = viewportRef.current;+ if (!interactWithParent || !viewport) return;+ const control = viewport.closest<HTMLElement>('a, button, [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]');+ const owner = control ?? viewport.closest<HTMLElement>("[data-marquee-surface]") ?? viewport;+ const move = (event: MouseEvent) => {+ ignoreRestoredFocus.current = false;+ if (control) { setParentHovered(true); return; }+ const rect = viewport.getBoundingClientRect();+ setParentHovered(event.clientX >= rect.left && event.clientX < rect.right && event.clientY >= rect.top && event.clientY < rect.bottom);+ };+ const leave = () => setParentHovered(false);+ const focus = () => { if (!ignoreRestoredFocus.current) setParentFocused(true); };+ const blur = (event: FocusEvent) => {+ if (!(event.relatedTarget instanceof Node && owner.contains(event.relatedTarget))) {+ ignoreRestoredFocus.current = false;+ setParentFocused(false);+ }+ };+ const key = (event: KeyboardEvent) => { if (event.key === "Escape") setDismissed(true); };+ owner.addEventListener("mouseenter", move);+ owner.addEventListener("mousemove", move);+ owner.addEventListener("mouseleave", leave);+ owner.addEventListener("focus", focus, true);+ owner.addEventListener("blur", blur, true);+ owner.addEventListener("keydown", key);+ return () => {+ owner.removeEventListener("mouseenter", move);+ owner.removeEventListener("mousemove", move);+ owner.removeEventListener("mouseleave", leave);+ owner.removeEventListener("focus", focus, true);+ owner.removeEventListener("blur", blur, true);+ owner.removeEventListener("keydown", key);+ };+ }, [interactWithParent]);+ useEffect(() => setDismissed(false), [hovered, active, focused, parentFocused]);+ useEffect(() => setRevealComplete(false), [revealing, overflow]);++ return (+ <span+ ref={viewportRef}+ data-slot={slot}+ data-cell-marquee+ data-truncated={overflow > 0 ? "true" : undefined}+ data-revealing={revealing ? "true" : undefined}+ data-reveal-complete={revealing && revealComplete ? "true" : undefined}+ className={cn("cell-marquee", className)}+ style={{ "--cell-marquee-overflow": overflow } as CSSProperties}+ tabIndex={tabbable && overflow > 0 ? 0 : undefined}+ onFocus={() => setFocused(true)}+ onBlur={() => setFocused(false)}+ onKeyDown={event => { if (event.key === "Escape") setDismissed(true); }}+ >+ <span className="cell-marquee-viewport">+ <span+ ref={contentRef}+ data-slot={contentSlot}+ className="cell-marquee-content"+ onTransitionRun={() => setRevealComplete(false)}+ onTransitionEnd={event => { if (event.propertyName === "transform") setRevealComplete(true); }}+ onTransitionCancel={() => setRevealComplete(false)}+ >{children}</span>+ </span>+ </span>+ );+}diff --git a/ui/src/components/CollectionToolbar.tsx b/ui/src/components/CollectionToolbar.tsxindex d38369dd05..e1cf96ce7f 100644--- a/ui/src/components/CollectionToolbar.tsx+++ b/ui/src/components/CollectionToolbar.tsx@@ -22,6 +22,7 @@ export interface CollectionToolbarProps {* State, queries, and control behavior stay with the consuming surface. Keeping* this component slot-based lets Inbox, Tasks, routine runs, and scoped task* lists share geometry without coupling their data models.+ * Canonical proposal composition reference: Components / Toolbars / Collection.*/export function CollectionToolbar({context,diff --git a/ui/src/components/DecisionsToolbar.tsx b/ui/src/components/DecisionsToolbar.tsxindex 1390468d56..9a38191d50 100644--- a/ui/src/components/DecisionsToolbar.tsx+++ b/ui/src/components/DecisionsToolbar.tsx@@ -13,6 +13,7 @@ import {type AttentionSortOrder,} from "../lib/attention";import { cn } from "../lib/utils";+import { ToolbarSearch } from "./ToolbarSearch";import { Button } from "./ui/button";import { Checkbox } from "./ui/checkbox";import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";@@ -25,6 +26,8 @@ const SEVERITY_LABELS: Record<string, string> = {};interface DecisionsToolbarProps {+ query: string;+ onQueryChange: (query: string) => void;/** Number of decisions currently shown, for the count pill. */visibleCount: number;filterOptions: ReturnType<typeof buildAttentionFilterOptions>;@@ -41,8 +44,11 @@ interface DecisionsToolbarProps {* desk (WhatNeedsMe) and the per-queue page so both surfaces expose an identical* control set. All state lives in the parent; this is presentation* plus the filter popover only.+ * Canonical proposal reference: Components / Toolbars / Decisions.*/export function DecisionsToolbar({+ query,+ onQueryChange,visibleCount,filterOptions,filters,@@ -54,12 +60,8 @@ export function DecisionsToolbar({}: DecisionsToolbarProps) {const activeFilterCount = countActiveAttentionFilters(filters);return (- <div className="flex items-center gap-2">- {visibleCount > 0 && (- <span className="text-sm text-muted-foreground">- {visibleCount} {visibleCount === 1 ? "decision" : "decisions"}- </span>- )}+ <div data-canonical-toolbar="decisions" role="toolbar" aria-label="Decisions controls" className="flex flex-wrap items-center gap-2">+ <ToolbarSearch query={query} onQueryChange={onQueryChange} label="Search decisions" placeholder="Search decisions…" />{/* Filter */}<Popover><PopoverTrigger asChild>@@ -69,6 +71,7 @@ export function DecisionsToolbar({size="icon"className={cn("h-8 w-8 shrink-0", activeFilterCount > 0 && "bg-accent")}title="Filter"+ data-active={activeFilterCount > 0}aria-label="Filter"><ListFilter className="h-3.5 w-3.5" />@@ -87,6 +90,7 @@ export function DecisionsToolbar({size="icon"className={cn("h-8 w-8 shrink-0", groupBy !== "none" && "bg-accent")}title="Group"+ data-active={groupBy !== "none"}aria-label="Group"><Layers className="h-3.5 w-3.5" />@@ -144,6 +148,7 @@ export function DecisionsToolbar({</div></PopoverContent></Popover>+ <span data-toolbar-count className="w-full text-xs text-muted-foreground" aria-live="polite">{visibleCount} {visibleCount === 1 ? "decision" : "decisions"}</span></div>);}diff --git a/ui/src/components/DesignPageAside.tsx b/ui/src/components/DesignPageAside.tsxnew file mode 100644index 0000000000..a7aeb965fc--- /dev/null+++ b/ui/src/components/DesignPageAside.tsx@@ -0,0 +1,134 @@+import { useCallback, useLayoutEffect, useRef, useState, type CSSProperties, type KeyboardEvent, type PointerEvent, type ReactNode } from "react";+import { usePaneWidthReset } from "@/hooks/usePaneWidthReset";++function readWidth(storageKey: string): number | null {+ try {+ const stored = window.localStorage.getItem(storageKey);+ const value = stored === null ? NaN : Number(stored);+ return Number.isFinite(value) && value > 0 ? value : null;+ } catch {+ return null;+ }+}++/** Geometry and resize behavior for the proposed shell's contextual pane. */+export function DesignPageAside({ children, title, maximized, storageKey }: {+ children: ReactNode;+ title: string;+ maximized: boolean;+ storageKey: string;+}) {+ const asideRef = useRef<HTMLElement>(null);+ const [width, setWidth] = useState<number | null>(() => readWidth(storageKey));+ const [bounds, setBounds] = useState({ min: 0, max: 0, step: 0 });+ const [actualWidth, setActualWidth] = useState(0);+ const [dragging, setDragging] = useState(false);+ const { resetting, startReset, cancelReset, onResetTransitionEnd } = usePaneWidthReset();+ const dragRef = useRef<{ pointerId: number; startX: number; startWidth: number } | null>(null);+ const widthRef = useRef(width);++ const persistWidth = useCallback((next: number | null) => {+ try {+ if (next === null) window.localStorage.removeItem(storageKey);+ else window.localStorage.setItem(storageKey, String(next));+ } catch {+ // Resizing still works when browser storage is unavailable.+ }+ }, [storageKey]);++ useLayoutEffect(() => {+ cancelReset();+ const stored = readWidth(storageKey);+ widthRef.current = stored;+ setWidth(stored);+ }, [storageKey, cancelReset]);++ useLayoutEffect(() => { cancelReset(); }, [maximized, cancelReset]);++ useLayoutEffect(() => {+ const aside = asideRef.current;+ const shell = aside?.parentElement;+ const sidebar = shell?.querySelector<HTMLElement>(":scope > .design-page-navigation");+ if (!aside || !shell || !sidebar) return;+ const measure = () => {+ const style = getComputedStyle(aside);+ const min = parseFloat(style.getPropertyValue("--design-page-aside-min-width"));+ const mainMin = parseFloat(style.getPropertyValue("--design-page-main-min-width"));+ const step = parseFloat(style.getPropertyValue("--design-page-aside-resize-step"));+ const max = Math.max(min, shell.clientWidth - sidebar.getBoundingClientRect().width - mainMin);+ setBounds(previous => previous.min === min && previous.max === max && previous.step === step ? previous : { min, max, step });+ setActualWidth(Math.round(aside.getBoundingClientRect().width));+ };+ measure();+ const observer = new ResizeObserver(measure);+ observer.observe(shell);+ observer.observe(sidebar);+ observer.observe(aside);+ return () => observer.disconnect();+ }, []);++ const clamp = (next: number) => Math.round(Math.min(bounds.max, Math.max(bounds.min, next)));+ const updateWidth = (next: number | null) => {+ widthRef.current = next;+ setWidth(next);+ };+ const finishResize = () => {+ if (!dragRef.current) return;+ dragRef.current = null;+ setDragging(false);+ persistWidth(widthRef.current);+ };+ const startResize = (event: PointerEvent<HTMLDivElement>) => {+ if (event.button !== 0) return;+ event.preventDefault();+ const startWidth = asideRef.current!.getBoundingClientRect().width;+ cancelReset();+ if (resetting) updateWidth(startWidth);+ event.currentTarget.setPointerCapture(event.pointerId);+ dragRef.current = { pointerId: event.pointerId, startX: event.clientX, startWidth };+ setDragging(true);+ };+ const moveResize = (event: PointerEvent<HTMLDivElement>) => {+ const drag = dragRef.current;+ if (!drag || event.pointerId !== drag.pointerId) return;+ updateWidth(clamp(drag.startWidth + drag.startX - event.clientX));+ };+ const resetWidth = () => {+ startReset();+ updateWidth(null);+ persistWidth(null);+ };+ const resizeWithKeyboard = (event: KeyboardEvent<HTMLDivElement>) => {+ // Read the current geometry so consecutive key presses do not wait for ResizeObserver.+ const currentWidth = asideRef.current!.getBoundingClientRect().width;+ const next = event.key === "ArrowLeft" ? currentWidth + bounds.step+ : event.key === "ArrowRight" ? currentWidth - bounds.step+ : event.key === "Home" ? bounds.min+ : event.key === "End" ? bounds.max : null;+ if (next === null) return;+ event.preventDefault();+ cancelReset();+ const clamped = clamp(next);+ updateWidth(clamped);+ persistWidth(clamped);+ };++ return <aside ref={asideRef} className="design-page-aside" aria-label={title}+ data-width-resetting={resetting && !maximized && !dragging || undefined} onTransitionEnd={onResetTransitionEnd} style={{+ "--design-page-aside-user-width": width === null ? undefined : `${width}px`,+ "--design-page-aside-available-width": bounds.max ? `${bounds.max}px` : undefined,+ } as CSSProperties}>+ {!maximized && <div+ role="separator" aria-label="Resize right sidebar" aria-orientation="vertical"+ aria-controls="design-page-aside-content" aria-valuemin={bounds.min} aria-valuemax={bounds.max} aria-valuenow={actualWidth}+ tabIndex={0} data-dragging={dragging ? "" : undefined}+ className="pane-resize-handle design-page-aside-resize group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none"+ onPointerDown={startResize} onPointerMove={moveResize} onPointerUp={finishResize}+ onPointerCancel={finishResize} onLostPointerCapture={finishResize}+ onDoubleClick={resetWidth} onKeyDown={resizeWithKeyboard}+ >+ <div className={`mx-auto h-full w-0.5 transition-colors ${dragging ? "bg-ring" : "bg-transparent group-hover:bg-ring group-focus-visible:bg-ring"}`} />+ </div>}+ {children}+ </aside>;+}diff --git a/ui/src/components/DesignPageShell.tsx b/ui/src/components/DesignPageShell.tsxnew file mode 100644index 0000000000..9e2d8e9f7f--- /dev/null+++ b/ui/src/components/DesignPageShell.tsx@@ -0,0 +1,58 @@+import type { ReactNode } from "react";+import { SidebarShell } from "./SidebarShell";+import { DesignPageAside } from "./DesignPageAside";+import { useScrollbarWhileScrolling } from "./side-panel";+import { FlyoutAppearanceProvider } from "./ui/flyout";++export type DesignPageShellProps = {+ sidebar: ReactNode;+ title: string;+ children: ReactNode;+ sidebarStorageKey?: string;+ headerActions?: ReactNode;+ /** Omit for the two-pane layout. Content scrolls independently of the main pane. */+ rightSidebar?: ReactNode;+ rightSidebarTitle?: string;+ rightSidebarHeader?: ReactNode;+ rightSidebarControls?: ReactNode;+ rightSidebarMaximized?: boolean;+ rightSidebarStorageKey?: string;+};++/** Shared proposed desktop shell. Pages supply content; the shell owns pane geometry and scrolling. */+export function DesignPageShell({+ sidebar,+ title,+ children,+ sidebarStorageKey = "paperclip.design-proposal.sidebar-width",+ headerActions,+ rightSidebar,+ rightSidebarTitle = "Details",+ rightSidebarHeader,+ rightSidebarControls,+ rightSidebarMaximized = false,+ rightSidebarStorageKey = `${sidebarStorageKey}.right`,+}: DesignPageShellProps) {+ const handleMainScroll = useScrollbarWhileScrolling<HTMLElement>();+ const handleAsideScroll = useScrollbarWhileScrolling();+ const hasRightSidebar = rightSidebar != null && rightSidebar !== false;+ const maximized = hasRightSidebar && rightSidebarMaximized;+ return (+ <FlyoutAppearanceProvider><div className="task-row-design-preview design-page-shell" data-testid="design-page-shell" data-aside-maximized={maximized || undefined}>+ <a href={maximized ? "#design-page-aside-content" : "#design-page-content"} className="design-page-skip-link">Skip to main content</a>+ <SidebarShell open resizable storageKey={sidebarStorageKey} className="design-page-navigation">{sidebar}</SidebarShell>+ <div className="design-page-main">+ <header className="design-page-header"><h1>{title}</h1>{headerActions && <div className="design-page-header-actions">{headerActions}</div>}</header>+ <main id="design-page-content" className="design-page-content scrollbar-while-scrolling" onScroll={handleMainScroll} tabIndex={-1}>{children}</main>+ </div>+ {hasRightSidebar && <DesignPageAside title={rightSidebarTitle} maximized={maximized} storageKey={rightSidebarStorageKey}>+ <header className={`design-page-header${rightSidebarHeader ? " design-page-aside-header" : ""}`}>+ <h2 className={rightSidebarHeader ? "sr-only" : undefined}>{rightSidebarTitle}</h2>+ {rightSidebarHeader && <div className="design-page-aside-tabs">{rightSidebarHeader}</div>}+ {rightSidebarControls && <div className="design-page-aside-controls">{rightSidebarControls}</div>}+ </header>+ <div id="design-page-aside-content" className="design-page-content scrollbar-while-scrolling" onScroll={handleAsideScroll} role="region" aria-label={`${rightSidebarTitle} content`} tabIndex={0}>{rightSidebar}</div>+ </DesignPageAside>}+ </div></FlyoutAppearanceProvider>+ );+}diff --git a/ui/src/components/DesignSandboxSidebar.tsx b/ui/src/components/DesignSandboxSidebar.tsxnew file mode 100644index 0000000000..bb52b1a1f1--- /dev/null+++ b/ui/src/components/DesignSandboxSidebar.tsx@@ -0,0 +1,14 @@+import { useAccountIdentity } from "@/api/companies-query";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { useRecentTasks } from "@/hooks/useRecentTasks";+import { DesignSidebar } from "./DesignSidebar";++/** Data adapter only; the visual subject is Components / Sidebar. */+export function DesignSandboxSidebar() {+ const { selectedCompanyId } = useCompany();+ const { userId } = useAccountIdentity();+ const { openNewIssue } = useDialogActions();+ const { entries } = useRecentTasks({ companyId: selectedCompanyId, userId });+ return <DesignSidebar recentTasks={entries} onNewTask={() => openNewIssue()} />;+}diff --git a/ui/src/components/DesignSidebar.tsx b/ui/src/components/DesignSidebar.tsxnew file mode 100644index 0000000000..7489c4bed1--- /dev/null+++ b/ui/src/components/DesignSidebar.tsx@@ -0,0 +1,59 @@+import type { Issue } from "@paperclipai/shared";+import { Boxes, CircleCheck, CirclePlus, FolderOpen, History, LayoutDashboard, MessageCircle, Package, Repeat, Search, Unplug, Users } from "lucide-react";+import { useCompany } from "@/context/CompanyContext";+import { SidebarAccountMenu } from "./SidebarAccountMenu";+import { SidebarCompanyMenu } from "./SidebarCompanyMenu";+import { SidebarNavExpandedProvider, SidebarNavItem } from "./SidebarNavItem";+import { SidebarSection } from "./SidebarSection";+import { TruncatedTextMarqueeProvider } from "./TruncatedText";+import { Button } from "./ui/button";+import { FlyoutAppearanceProvider } from "./ui/flyout";+import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";+import { useScrollbarWhileScrolling } from "./side-panel/use-scrollbar-while-scrolling";++export type DesignSidebarRecentTask = Pick<Issue, "id" | "companyId" | "identifier" | "title">;++/** Shared staged sidebar. The caller supplies company-scoped recent tasks and actions. */+export function DesignSidebar({ onNewTask, recentTasks = [] }: { onNewTask: () => void; recentTasks?: readonly DesignSidebarRecentTask[] }) {+ const { selectedCompany } = useCompany();+ const root = `/${selectedCompany?.issuePrefix ?? "PAP"}`;+ const companyRecentTasks = recentTasks.filter(task => task.companyId === selectedCompany?.id);+ const handleRecentScroll = useScrollbarWhileScrolling();+ return (+ <FlyoutAppearanceProvider><TruncatedTextMarqueeProvider><SidebarNavExpandedProvider>+ <div className="design-sidebar">+ <div className="design-sidebar-brand">+ <SidebarCompanyMenu showChevron={false} />+ <Tooltip><TooltipTrigger asChild><Button variant="ghost" size="icon-sm" className="design-sidebar-search" aria-label="Global search" onClick={() => document.dispatchEvent(new KeyboardEvent("keydown", { key: "k", metaKey: true, bubbles: true, cancelable: true }))}><Search aria-hidden /></Button></TooltipTrigger><TooltipContent side="right">Search tasks, agents, projects</TooltipContent></Tooltip>+ </div>+ <nav className="design-sidebar-navigation" aria-label="Main navigation">+ <div className="design-sidebar-primary">+ <Button variant="ghost" className="design-sidebar-new-task" onClick={onNewTask}><CirclePlus aria-hidden />New Task</Button>+ <SidebarNavItem className="design-sidebar-item" to={`${root}/dashboard`} label="Dashboard" icon={LayoutDashboard} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/chats`} label="Chat" icon={MessageCircle} />+ </div>+ <SidebarSection label="Work">+ <SidebarNavItem className="design-sidebar-item" to={`${root}/issues`} label="Tasks" icon={CircleCheck} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/projects`} label="Projects" icon={FolderOpen} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/routines`} label="Routines" icon={Repeat} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/artifacts`} label="Artifacts" icon={Package} />+ </SidebarSection>+ <SidebarSection label="Org">+ <SidebarNavItem className="design-sidebar-item" to={`${root}/agents`} label="Agents" icon={Users} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/skills`} label="Skills" icon={Boxes} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/apps`} label="Connectors" icon={Unplug} />+ <SidebarNavItem className="design-sidebar-item" to={`${root}/activity`} label="Audit" icon={History} />+ </SidebarSection>+ {companyRecentTasks.length > 0 ? <div className="design-sidebar-recents">+ <SidebarSection label="Recent Tasks">+ <div onScroll={handleRecentScroll} className="design-sidebar-recent-list scrollbar-while-scrolling" role="region" aria-label="Recent tasks" tabIndex={0}>+ {companyRecentTasks.map(issue => <SidebarNavItem key={issue.id} className="design-sidebar-item" to={`${root}/issues/${issue.identifier}`} label={issue.title} />)}+ </div>+ </SidebarSection>+ </div> : null}+ </nav>+ <div className="design-sidebar-account"><SidebarAccountMenu forceExpanded /></div>+ </div>+ </SidebarNavExpandedProvider></TruncatedTextMarqueeProvider></FlyoutAppearanceProvider>+ );+}diff --git a/ui/src/components/HorizontalScrollViewport.tsx b/ui/src/components/HorizontalScrollViewport.tsxnew file mode 100644index 0000000000..9866c76a74--- /dev/null+++ b/ui/src/components/HorizontalScrollViewport.tsx@@ -0,0 +1,15 @@+import type { ReactNode } from "react";+import { useHorizontalScrollEdges } from "@/hooks/useHorizontalScrollEdges";+import { cn } from "@/lib/utils";++/** One horizontal scroll owner with non-interactive clipping indicators. */+export function HorizontalScrollViewport({ children, label, contentClassName }: { children: ReactNode; label: string; contentClassName?: string }) {+ const { scrollRef, contentRef, edges } = useHorizontalScrollEdges();+ return (+ <div className="horizontal-scroll-viewport" data-overflow-left={edges.left} data-overflow-right={edges.right}>+ <div ref={scrollRef} className="horizontal-scroll-area" role="region" aria-label={label} tabIndex={0}>+ <div ref={contentRef} className={cn("horizontal-scroll-content", contentClassName)}>{children}</div>+ </div>+ </div>+ );+}diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsxindex fa5ec8668c..8fe510106a 100644--- a/ui/src/components/IssueChatThread.test.tsx+++ b/ui/src/components/IssueChatThread.test.tsx@@ -177,7 +177,8 @@ vi.mock("./InlineEntitySelector", () => ({),}));-vi.mock("./Identity", () => ({+vi.mock("./Identity", async importOriginal => ({+ ...await importOriginal<typeof import("./Identity")>(),Identity: ({ name }: { name: string }) => <span>{name}</span>,}));diff --git a/ui/src/components/IssueChatThreadSystemNotice.test.tsx b/ui/src/components/IssueChatThreadSystemNotice.test.tsxindex 41a6e9a2a6..ab049d2423 100644--- a/ui/src/components/IssueChatThreadSystemNotice.test.tsx+++ b/ui/src/components/IssueChatThreadSystemNotice.test.tsx@@ -31,7 +31,10 @@ vi.mock("./MarkdownEditor", () => ({}));vi.mock("./InlineEntitySelector", () => ({ InlineEntitySelector: () => null }));-vi.mock("./Identity", () => ({ Identity: ({ name }: { name: string }) => <span>{name}</span> }));+vi.mock("./Identity", async importOriginal => ({+ ...await importOriginal<typeof import("./Identity")>(),+ Identity: ({ name }: { name: string }) => <span>{name}</span>,+}));vi.mock("./OutputFeedbackButtons", () => ({ OutputFeedbackButtons: () => null }));vi.mock("@/components/ui/tooltip", () => ({Tooltip: ({ children }: { children: ReactNode }) => <>{children}</>,diff --git a/ui/src/components/IssueFilterPanel.tsx b/ui/src/components/IssueFilterPanel.tsxnew file mode 100644index 0000000000..8dd1c3153d--- /dev/null+++ b/ui/src/components/IssueFilterPanel.tsx@@ -0,0 +1,64 @@+import { useId, useState, type ComponentProps, type CSSProperties, type ReactNode } from "react";+import { Bot, Search, User } from "lucide-react";+import type { IssueFiltersPopover } from "./IssueFiltersPopover";+import { Button } from "./ui/button";+import { Checkbox } from "./ui/checkbox";+import { Input } from "./ui/input";+import { FlyoutHeader } from "./ui/flyout";+import { StatusIcon } from "./StatusIcon";+import { TruncatedText } from "./TruncatedText";+import { issueFilterLabel, issueStatusOrder, searchIssueFilterOptions, toggleIssueFilterValue } from "@/lib/issue-filters";++type PanelProps = Pick<ComponentProps<typeof IssueFiltersPopover>, "state" | "onChange" | "activeFilterCount" | "agents" | "projects" | "labels" | "creators" | "currentUserId"> & { onClear: () => void };++function FilterGroup({ title, searchLabel, query, onQueryChange, children, optionsKey }: { title: string; searchLabel?: string; query?: string; onQueryChange?: (value: string) => void; children: ReactNode; optionsKey: string }) {+ const headingId = useId();+ return (+ <section className="task-filter-group" aria-labelledby={headingId}>+ <h3 id={headingId}>{title}</h3>+ <div className="task-filter-group-body">+ {searchLabel ? <div className="task-filter-search"><Search aria-hidden /><Input aria-label={`Search ${searchLabel}`} placeholder={`Search ${searchLabel}...`} value={query} onChange={event => onQueryChange?.(event.target.value)} /></div> : null}+ <div className="task-filter-options" data-filter-options={optionsKey}>{children}</div>+ </div>+ </section>+ );+}++function FilterRow({ label, checked, onToggle, icon }: { label: string; checked: boolean; onToggle: () => void; icon?: ReactNode }) {+ return <label className="task-filter-option" data-marquee-surface><Checkbox aria-label={label} checked={checked} onCheckedChange={onToggle} />{icon ? <span className="task-filter-icon" aria-hidden>{icon}</span> : null}<TruncatedText className="task-filter-option-label">{label}</TruncatedText></label>;+}++/** Proposed five-group IA; the collection retains ownership of filter state. */+export function IssueFilterPanel({ state, onChange, activeFilterCount, agents = [], projects = [], labels = [], creators = [], currentUserId, onClear }: PanelProps) {+ const [queries, setQueries] = useState({ projects: "", creators: "", assignees: "", labels: "" });+ const search = (key: keyof typeof queries) => (value: string) => setQueries(current => ({ ...current, [key]: value }));+ const visibleProjects = searchIssueFilterOptions(projects, queries.projects, option => option.name);+ const visibleCreators = searchIssueFilterOptions(creators, queries.creators, option => `${option.label} ${option.searchText ?? ""}`);+ const assignees = [{ id: "__unassigned", name: "No assignee", icon: null }, ...(currentUserId ? [{ id: "__me", name: "Me", icon: <User /> }] : []), ...agents.map(agent => ({ ...agent, icon: null }))];+ const visibleAssignees = searchIssueFilterOptions(assignees, queries.assignees, option => option.name);+ const visibleLabels = searchIssueFilterOptions(labels, queries.labels, option => option.name);+ return <>+ <FlyoutHeader className="task-filters-header"><span>Filters</span>{activeFilterCount ? <Button variant="ghost" onClick={() => { onClear(); setQueries({ projects: "", creators: "", assignees: "", labels: "" }); }}>Clear</Button> : null}</FlyoutHeader>+ <div className="task-filters-grid">+ <FilterGroup title="Status" optionsKey="statuses">+ {issueStatusOrder.map(status => <FilterRow key={status} label={issueFilterLabel(status)} checked={state.statuses.includes(status)} onToggle={() => onChange({ statuses: toggleIssueFilterValue(state.statuses, status) })} icon={<StatusIcon status={status} />} />)}+ </FilterGroup>+ <FilterGroup title="Project" optionsKey="projects" searchLabel="projects" query={queries.projects} onQueryChange={search("projects")}>+ {visibleProjects.map(project => <FilterRow key={project.id} label={project.name} checked={state.projects.includes(project.id)} onToggle={() => onChange({ projects: toggleIssueFilterValue(state.projects, project.id) })} />)}+ {!visibleProjects.length ? <p className="task-filter-empty">{queries.projects ? "No projects match." : "No projects available."}</p> : null}+ </FilterGroup>+ <FilterGroup title="Creator" optionsKey="creators" searchLabel="creators" query={queries.creators} onQueryChange={search("creators")}>+ {visibleCreators.map(creator => <FilterRow key={creator.id} label={creator.label} checked={state.creators.includes(creator.id)} onToggle={() => onChange({ creators: toggleIssueFilterValue(state.creators, creator.id) })} icon={creator.kind === "agent" ? <Bot /> : <User />} />)}+ {!visibleCreators.length ? <p className="task-filter-empty">{queries.creators ? "No creators match." : "No creators available."}</p> : null}+ </FilterGroup>+ <FilterGroup title="Assignee" optionsKey="responsible" searchLabel="assignees" query={queries.assignees} onQueryChange={search("assignees")}>+ {visibleAssignees.map(assignee => <FilterRow key={assignee.id} label={assignee.name} checked={state.assignees.includes(assignee.id)} onToggle={() => onChange({ assignees: toggleIssueFilterValue(state.assignees, assignee.id) })} icon={assignee.icon} />)}+ {!visibleAssignees.length ? <p className="task-filter-empty">No assignees match.</p> : null}+ </FilterGroup>+ <FilterGroup title="Label" optionsKey="labels" searchLabel="labels" query={queries.labels} onQueryChange={search("labels")}>+ {visibleLabels.map(label => <FilterRow key={label.id} label={label.name} checked={state.labels.includes(label.id)} onToggle={() => onChange({ labels: toggleIssueFilterValue(state.labels, label.id) })} icon={<span className="task-filter-label-dot" style={{ "--task-filter-label-color": label.color } as CSSProperties} />} />)}+ {!visibleLabels.length ? <p className="task-filter-empty">{queries.labels ? "No labels match." : "No labels available."}</p> : null}+ </FilterGroup>+ </div>+ </>;+}diff --git a/ui/src/components/IssueFiltersPopover.tsx b/ui/src/components/IssueFiltersPopover.tsxindex 97b82dfbea..792930368d 100644--- a/ui/src/components/IssueFiltersPopover.tsx+++ b/ui/src/components/IssueFiltersPopover.tsx@@ -26,6 +26,8 @@ import { externalObjectStatusIcon } from "../lib/status-colors";import { formatAssigneeUserLabel } from "../lib/assignees";import type { InboxApprovalFilter, InboxCategoryFilter } from "../lib/inbox";import { cn } from "../lib/utils";+import { IssueFilterPanel } from "./IssueFilterPanel";+import { FlyoutAppearanceProvider } from "./ui/flyout";type AgentOption = {id: string;@@ -127,10 +129,11 @@ export function IssueFiltersPopover({buttonVariant?: "ghost" | "outline";iconOnly?: boolean;creators?: CreatorOption[];- presentation?: "legacy" | "streamlined";+ presentation?: "legacy" | "streamlined" | "refreshed";inboxScopeFilters?: InboxScopeFilters;}) {const streamlined = presentation === "streamlined";+ const refreshed = presentation === "refreshed";const [creatorSearch, setCreatorSearch] = useState("");const [assigneeSearch, setAssigneeSearch] = useState("");const [projectSearch, setProjectSearch] = useState("");@@ -181,7 +184,7 @@ export function IssueFiltersPopover({inboxScopeFilters?.onClear();};- return (+ const popover = (<Popover><PopoverTrigger asChild><Button variant={buttonVariant} size={iconOnly ? "icon" : "sm"} className={`text-xs ${iconOnly ? "relative h-8 w-8 shrink-0" : ""} ${activeFilterCount > 0 ? "text-blue-600 dark:text-blue-400" : ""}`} title={iconOnly ? (activeFilterCount > 0 ? `Filters: ${activeFilterCount}` : "Filter") : undefined}>@@ -201,12 +204,13 @@ export function IssueFiltersPopover({</Button></PopoverTrigger><PopoverContent+ aria-label="Filters"align="end"- className={streamlined+ className={refreshed ? "task-filters-popover" : streamlined? "w-(--sz-calc-10) max-h-(--sz-calc-9) overflow-y-auto overscroll-contain p-0": "w-(--sz-calc-10) p-0"}>- <div className="space-y-3 p-3">+ {refreshed ? <IssueFilterPanel state={state} onChange={onChange} activeFilterCount={activeFilterCount} agents={agents} projects={projects} labels={labels} creators={creators} currentUserId={currentUserId} onClear={clearFilters} /> : <div className="space-y-3 p-3"><div className="flex items-center justify-between"><span className="text-sm font-medium">Filters</span>{activeFilterCount > 0 ? (@@ -532,8 +536,9 @@ export function IssueFiltersPopover({</div></div></div>- </div>+ </div>}</PopoverContent></Popover>);+ return refreshed ? <FlyoutAppearanceProvider>{popover}</FlyoutAppearanceProvider> : popover;}diff --git a/ui/src/components/IssueLinkQuicklook.tsx b/ui/src/components/IssueLinkQuicklook.tsxindex 3f08cad4cc..dc0fcbf02e 100644--- a/ui/src/components/IssueLinkQuicklook.tsx+++ b/ui/src/components/IssueLinkQuicklook.tsx@@ -15,6 +15,7 @@ import { cn } from "@/lib/utils";import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";import { StatusGlyph } from "@/components/StatusGlyph";import { ProjectTile } from "@/components/ProjectTile";+import { useFlyoutAppearance } from "@/components/ui/flyout-appearance";/* ------------------------------------------------------------------ *//* Single-flight quicklook store */@@ -169,18 +170,19 @@ export function IssueQuicklookCard({linkState?: unknown;compact?: boolean;}) {+ const appearance = useFlyoutAppearance();const description = useMemo(() => summarizeIssueDescription(issue.description), [issue.description]);const projectName = issue.project?.name;return (- <div className={cn("space-y-2", compact && "space-y-1.5")}>- <div className="flex items-center gap-1">- <div className="flex min-w-0 flex-1 items-center gap-1">+ <div className={appearance === "refreshed" ? "task-hover-card" : cn("space-y-2", compact && "space-y-1.5")}>+ <div data-slot="task-preview-meta" className="flex items-center gap-1">+ <div data-slot="task-preview-identity" className="flex min-w-0 flex-1 items-center gap-1"><StatusGlyph status={issue.status} size="md" title={statusLabel(issue.status)} />- <span className="shrink-0 font-mono text-(length:--text-micro) text-muted-foreground">+ <span data-slot="task-preview-id" className="shrink-0 font-mono text-(length:--text-micro) text-muted-foreground">{issue.identifier ?? issue.id.slice(0, 8)}</span>- {projectName ? (+ {projectName && appearance !== "refreshed" ? (<><QuicklookSeparator className="shrink-0 text-muted-foreground" /><span@@ -194,12 +196,13 @@ export function IssueQuicklookCard({</>) : null}</div>- <span className="shrink-0 text-(length:--text-micro) text-muted-foreground">+ <span data-slot="task-preview-time" className="shrink-0 text-(length:--text-micro) text-muted-foreground">{timeAgo(new Date(issue.updatedAt))}</span></div><RouterDom.Link+ data-slot="task-preview-title"to={linkTo}state={linkState ?? withIssueDetailHeaderSeed(null, issue)}className="block text-sm font-medium leading-snug hover:underline line-clamp-2"@@ -208,7 +211,7 @@ export function IssueQuicklookCard({</RouterDom.Link>{description ? (- <p className="text-xs leading-5 text-muted-foreground [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:4] overflow-hidden">+ <p data-slot="task-preview-description" className="text-xs leading-5 text-muted-foreground [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:4] overflow-hidden">{description}</p>) : null}diff --git a/ui/src/components/IssueProperties.test.tsx b/ui/src/components/IssueProperties.test.tsxindex 44ac2de0a1..c7c4ac1c1f 100644--- a/ui/src/components/IssueProperties.test.tsx+++ b/ui/src/components/IssueProperties.test.tsx@@ -131,7 +131,8 @@ vi.mock("../lib/assignees", () => ({},}));-vi.mock("./StatusIcon", () => ({+vi.mock("./StatusIcon", async importOriginal => ({+ ...await importOriginal<typeof import("./StatusIcon")>(),StatusIcon: ({ status, blockerAttention, className, glyphContainerClassName, size }: { status: string; blockerAttention?: Issue["blockerAttention"]; className?: string; glyphContainerClassName?: string; size?: string }) => (<span className={className} data-glyph-container-class={glyphContainerClassName} data-testid="status-icon" data-size={size} data-status-icon-state={blockerAttention?.state}>{status}</span>),@@ -141,7 +142,8 @@ vi.mock("./PriorityIcon", () => ({PriorityIcon: ({ priority }: { priority: string }) => <span>{priority}</span>,}));-vi.mock("./Identity", () => ({+vi.mock("./Identity", async importOriginal => ({+ ...await importOriginal<typeof import("./Identity")>(),Identity: ({ name, shape }: { name: string; shape?: string }) => <span data-shape={shape ?? "circle"}>{name}</span>,}));diff --git a/ui/src/components/IssueRow.test.tsx b/ui/src/components/IssueRow.test.tsxindex 188ece5f70..6727f3a78f 100644--- a/ui/src/components/IssueRow.test.tsx+++ b/ui/src/components/IssueRow.test.tsx@@ -7,16 +7,19 @@ import type { Issue } from "@paperclipai/shared";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { IssueRow } from "./IssueRow";import { StatusIcon } from "./StatusIcon";+import { TooltipProvider } from "./ui/tooltip";vi.mock("@/lib/router", () => ({Link: ({children,className,+ to,disableIssueQuicklook: _disableIssueQuicklook,issuePrefetch,...props- }: React.ComponentProps<"a"> & { disableIssueQuicklook?: boolean; issuePrefetch?: Issue | null }) => (+ }: React.ComponentProps<"a"> & { to?: string; disableIssueQuicklook?: boolean; issuePrefetch?: Issue | null }) => (<a+ href={to}className={className}data-disable-issue-quicklook={_disableIssueQuicklook ? "true" : undefined}data-issue-prefetch-id={issuePrefetch?.id}@@ -95,6 +98,7 @@ describe("IssueRow", () => {afterEach(() => {container.remove();+ vi.unstubAllGlobals();});it("renders the list status glyph at md (16px)", () => {@@ -185,6 +189,75 @@ describe("IssueRow", () => {act(() => root.unmount());});+ it("starts a truncated title reveal on link focus and keeps actions independent", async () => {+ const bounds = vi.spyOn(HTMLElement.prototype, "getBoundingClientRect").mockReturnValue(new DOMRect(0, 0, 200, 16));+ const createRange = document.createRange.bind(document);+ const rangeBounds = vi.spyOn(document, "createRange").mockImplementation(() => Object.assign(createRange(), {+ getBoundingClientRect: () => new DOMRect(0, 0, 400, 16),+ }));+ vi.stubGlobal("ResizeObserver", class {+ observe() {}+ unobserve() {}+ disconnect() {}+ });+ const root = createRoot(container);+ const title = "Define connector health states, failure recovery, and escalation ownership across teams";+ const onExpand = vi.fn();+ const onArchive = vi.fn();+ const onMarkRead = vi.fn();++ act(() => {+ root.render(+ <TooltipProvider>+ <IssueRow+ issue={createIssue({ title })}+ presentation="task"+ appearance="refreshed"+ unreadState="visible"+ onMarkRead={onMarkRead}+ leadingControl={<button type="button" onClick={onExpand}>Expand subtasks</button>}+ onArchive={onArchive}+ />+ </TooltipProvider>,+ );+ });++ const link = container.querySelector<HTMLAnchorElement>("[data-inbox-issue-link]");+ const expand = container.querySelector<HTMLButtonElement>('button:not([aria-label])');+ const archive = container.querySelector<HTMLButtonElement>('button[aria-label="Archive"]');+ expect(link?.href).toContain("/issues/PAP-1");+ expect(link?.contains(expand)).toBe(false);+ expect(link?.contains(archive)).toBe(false);+ // An inbox callback must not restore the old unread dot or its reserved slot.+ expect(container.querySelector('button[aria-label="Mark as read"]')).toBeNull();+ expect(container.querySelector('[data-testid="issue-row-unread-slot"]')).toBeNull();++ await reactAct(async () => link?.focus());+ expect(document.activeElement).toBe(link);+ expect(container.querySelector('[data-slot="task-row-title"]')?.getAttribute("data-revealing")).toBe("true");+ expect(container.querySelector('[data-slot="task-row-title-text"]')?.textContent).toBe(title);+ expect(document.querySelector('[role="tooltip"]')).toBeNull();++ act(() => link?.dispatchEvent(new MouseEvent("mouseout", { bubbles: true, relatedTarget: document.body })));+ expect(container.querySelector('[data-slot="task-row-title"]')?.getAttribute("data-revealing")).toBeNull();+ await reactAct(async () => { link?.blur(); link?.focus(); });+ expect(container.querySelector('[data-slot="task-row-title"]')?.getAttribute("data-revealing")).toBe("true");++ act(() => {+ link?.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true }));+ expand?.click();+ archive?.click();+ });+ expect(document.querySelector('[role="tooltip"]')).toBeNull();+ expect(container.querySelector('[data-slot="task-row-title"]')?.getAttribute("data-revealing")).toBeNull();+ expect(onExpand).toHaveBeenCalledTimes(1);+ expect(onArchive).toHaveBeenCalledTimes(1);++ act(() => root.unmount());+ bounds.mockRestore();+ rangeBounds.mockRestore();+ });+it("preserves the legacy archive action density", () => {const root = createRoot(container);diff --git a/ui/src/components/IssueRow.tsx b/ui/src/components/IssueRow.tsxindex f98b1e6edb..9bbf76d55a 100644--- a/ui/src/components/IssueRow.tsx+++ b/ui/src/components/IssueRow.tsx@@ -1,5 +1,5 @@import { requiresExecutionReconciliation } from "@paperclipai/shared";-import type { ReactNode } from "react";+import { useState, type CSSProperties, type ReactNode } from "react";import type { ExternalObjectSummary, Issue, IssueRecoveryAction } from "@paperclipai/shared";import { Link } from "@/lib/router";import { Archive, Flag } from "lucide-react";@@ -19,13 +19,18 @@ import {readRecoveryRetryLineage,type RecoveryLivenessContext,} from "../lib/recovery-lineage";-import { StatusIcon } from "./StatusIcon";+import { StatusIcon, getStatusIconLabel } from "./StatusIcon";import { hasAssignedBacklogBlocker } from "../lib/issue-blockers";import { ExternalObjectStatusSummary } from "./ExternalObjectStatusSummary";import { Badge } from "@/components/ui/badge";+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";+import { TaskRowColumnCells, useTaskListColumns, type TaskRowColumnValues } from "./TaskListColumns";+import { CellMarquee, HoveredCellContext, useCellMarqueeHover } from "./CellMarquee";export type IssueRowUnreadState = "hidden" | "visible" | "fading";export type IssueRowPresentation = "legacy" | "task";+export type IssueRowAppearance = "default" | "refreshed";+export type IssueRowDensity = "comfortable" | "compact";export interface IssueRowProps {issue: Issue;@@ -33,6 +38,12 @@ export interface IssueRowProps {selected?: boolean;/** Opt-in canonical collection layout. Legacy remains the default until each surface migrates. */presentation?: IssueRowPresentation;+ /** Reviewed in Storybook before adoption; only applies to the canonical task presentation. */+ appearance?: IssueRowAppearance;+ /** Refreshed task rows share their anatomy at either density. */+ density?: IssueRowDensity;+ /** Opt-in complete column contract for refreshed task lists. */+ columnValues?: TaskRowColumnValues;/** Interactive disclosure or selection control before the canonical status glyph. */leadingControl?: ReactNode;/** Optional status override; defaults to the task's shared StatusIcon. */@@ -122,6 +133,9 @@ export function IssueRow({issueLinkState,selected = false,presentation = "legacy",+ appearance = "default",+ density = "comfortable",+ columnValues,leadingControl,statusSlot,metadata,@@ -151,12 +165,15 @@ export function IssueRow({chevronInGuide = false,showDivider = false,}: IssueRowProps) {+ const visibleColumns = useTaskListColumns();+ const { hoveredCell, onMouseMove: handleCellHover, clearHoveredCell } = useCellMarqueeHover();+ const [titleFocused, setTitleFocused] = useState(false);+const issuePathId = issue.identifier ?? issue.id;const identifier = issue.identifier ?? issue.id.slice(0, 8);- // A row participates in the unread system whenever `unreadState` is supplied.- // Canonical rows overlay this affordance in their shared gutter, while legacy- // inbox rows retain their reserved slot until that presentation is migrated.- const showUnreadSlot = unreadState != null;+ // Refreshed task rows communicate unread state through title typography alone.+ // Existing presentations retain their unread control and its reserved space.+ const showUnreadSlot = unreadState != null && !(presentation === "task" && appearance === "refreshed");const showUnreadDot = unreadState === "visible" || unreadState === "fading";const unreadDotButton = (<button@@ -216,134 +233,194 @@ export function IssueRow({if (presentation === "task") {const isUnread = unreadState === "visible" || unreadState === "fading";- return (- <div- onMouseEnter={onMouseEnter}- data-slot="task-row"- data-unread={isUnread ? "true" : undefined}+ const refreshed = appearance === "refreshed";+ const statusLabel = getStatusIconLabel(issue.status, issue.externalConversationState, issue.blockerAttention);+ const statusIcon = <StatusIcon status={issue.status} externalConversationState={issue.externalConversationState} blockerAttention={issue.blockerAttention} size="md" className={selectedStatusClass} />;+ const status = statusSlot ?? (refreshed ? (+ <Tooltip>+ <TooltipTrigger asChild>+ <Link+ to={createIssueDetailPath(issuePathId)}+ state={detailState}+ disableIssueQuicklook+ issuePrefetch={issue}+ onClickCapture={() => rememberIssueDetailLocationState(issuePathId, detailState)}+ aria-label={`Open task ${identifier} (${statusLabel})`}+ className="task-row-status-link"+ data-slot="task-row-status"+ >+ {statusIcon}+ </Link>+ </TooltipTrigger>+ <TooltipContent className="task-row-status-tooltip">{statusLabel}</TooltipContent>+ </Tooltip>+ ) : statusIcon);+ const taskLink = (+ <Link+ to={createIssueDetailPath(issuePathId)}+ state={detailState}+ disableIssueQuicklook+ issuePrefetch={issue}+ data-inbox-issue-link+ id={checklistRowId}+ aria-current={checklistCurrentStep ? "step" : undefined}+ onClickCapture={() => rememberIssueDetailLocationState(issuePathId, detailState)}+ onFocus={appearance === "refreshed" ? () => setTitleFocused(true) : undefined}+ onBlur={appearance === "refreshed" ? () => setTitleFocused(false) : undefined}+ onKeyDown={appearance === "refreshed" ? (event) => {+ if (event.key === "Escape") {+ clearHoveredCell();+ setTitleFocused(false);+ }+ } : undefined}className={cn(- "group relative flex min-w-0 items-start gap-2 rounded-lg py-2.5 pr-2 text-sm no-underline text-inherit sm:items-center sm:py-2",- showUnreadSlot ? "pl-4" : "pl-2 sm:pl-4",- "[&_button]:relative [&_button]:z-10",- selected ? "bg-accent/50 hover:bg-accent/50" : "hover:bg-accent/50",- checklistCurrentStep && "bg-primary/5",- className,+ "absolute inset-0 rounded-lg no-underline text-inherit focus-visible:z-10 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring",+ refreshed && "task-row-link",)}>- <Link- to={createIssueDetailPath(issuePathId)}- state={detailState}- disableIssueQuicklook- issuePrefetch={issue}- data-inbox-issue-link- id={checklistRowId}- aria-current={checklistCurrentStep ? "step" : undefined}- onClickCapture={() => rememberIssueDetailLocationState(issuePathId, detailState)}- className="absolute inset-0 rounded-lg no-underline text-inherit focus-visible:z-10 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring"+ <span className="sr-only">Open {identifier}: {issue.title}</span>+ </Link>+ );+ return (+ <HoveredCellContext.Provider value={hoveredCell}>+ <div+ onMouseEnter={onMouseEnter}+ onMouseMove={refreshed ? handleCellHover : undefined}+ onMouseLeave={refreshed ? () => { clearHoveredCell(); setTitleFocused(false); } : undefined}+ role={refreshed && columnValues ? "row" : undefined}+ data-slot="task-row"+ data-unread={isUnread ? "true" : undefined}+ data-appearance={refreshed ? "refreshed" : undefined}+ data-density={refreshed ? density : undefined}+ data-columns={refreshed && columnValues ? "all" : undefined}+ data-status-hidden={refreshed && columnValues && !visibleColumns.includes("task") ? "true" : undefined}+ data-title-hidden={refreshed && columnValues && !visibleColumns.includes("task") ? "true" : undefined}+ style={refreshed ? { "--task-row-depth": treeGuides } as CSSProperties : undefined}+ data-selected={selected ? "true" : undefined}+ data-current-step={checklistCurrentStep ? "true" : undefined}+ className={cn(+ "group relative flex min-w-0 items-start gap-2 rounded-lg py-2.5 pr-2 text-sm no-underline text-inherit sm:items-center sm:py-2",+ !refreshed && (showUnreadSlot ? "pl-4" : "pl-2 sm:pl-4"),+ "[&_button]:relative [&_button]:z-10",+ selected ? "bg-accent/50 hover:bg-accent/50" : "hover:bg-accent/50",+ checklistCurrentStep && "bg-primary/5",+ refreshed && "task-row-refreshed",+ className,+ )}>- <span className="sr-only">Open {identifier}: {issue.title}</span>- </Link>+ {taskLink}- {showUnreadSlot ? (- <span- data-testid="issue-row-unread-slot"- className="absolute left-0 top-3 inline-flex h-4 w-4 items-center justify-center sm:top-1/2 sm:-translate-y-1/2"- >- {showUnreadDot ? unreadDotButton : null}- </span>- ) : null}+ {showUnreadSlot ? (+ <span+ data-testid="issue-row-unread-slot"+ className="absolute left-0 top-3 inline-flex h-4 w-4 items-center justify-center sm:top-1/2 sm:-translate-y-1/2"+ >+ {showUnreadDot ? unreadDotButton : null}+ </span>+ ) : null}- <span data-slot="task-row-leading" className="flex shrink-0 items-start self-stretch gap-1 pt-px sm:items-center sm:pt-0">- {treeGuides > 0- ? Array.from({ length: treeGuides }, (_, level) => {- const gapForChevron = chevronInGuide && level === treeGuides - 1;- return (- <span- key={`task-guide-${level}`}- data-slot="task-row-tree-guide"- aria-hidden="true"- className="relative block w-4 shrink-0 self-stretch"- >+ <span role={refreshed && columnValues ? "cell" : undefined} data-slot="task-row-leading" data-marquee-cell={refreshed ? "task" : undefined} className="flex shrink-0 items-start self-stretch gap-1 pt-px sm:items-center sm:pt-0">+ {treeGuides > 0+ ? Array.from({ length: treeGuides }, (_, level) => {+ const gapForChevron = chevronInGuide && level === treeGuides - 1;+ return (<span- data-slot="task-row-tree-connector"- className="absolute -inset-y-3 left-7 w-px bg-background"+ key={`task-guide-${level}`}+ data-slot="task-row-tree-guide"+ data-chevron-gap={gapForChevron ? "true" : undefined}+ aria-hidden="true"+ className="relative block w-4 shrink-0 self-stretch">- {gapForChevron ? (- <span className="absolute inset-0 flex flex-col">- <span className="flex-1 bg-border" />- <span className="h-3.5 shrink-0" />- <span className="flex-1 bg-border" />- </span>- ) : (- <span className="absolute inset-0 bg-border" />- )}+ <span+ data-slot="task-row-tree-connector"+ className="absolute -inset-y-3 left-7 w-px bg-background"+ >+ {gapForChevron ? (+ <span className="absolute inset-0 flex flex-col">+ <span data-slot="task-row-tree-line" className="flex-1 bg-border" />+ <span data-slot="task-row-tree-gap" className="h-3.5 shrink-0" />+ <span data-slot="task-row-tree-line" className="flex-1 bg-border" />+ </span>+ ) : (+ <span data-slot="task-row-tree-line" className="absolute inset-0 bg-border" />+ )}+ </span></span>- </span>- );- })- : null}- {leadingControl}- {statusSlot ?? (- <StatusIcon- status={issue.status} externalConversationState={issue.externalConversationState}- blockerAttention={issue.blockerAttention}- size="md"- className={selectedStatusClass}- />- )}- {parkedBlockerIndicator}- </span>+ );+ })+ : null}+ {refreshed ? (+ <span data-slot="task-row-leading-control">{leadingControl}</span>+ ) : leadingControl}+ {refreshed && columnValues && !visibleColumns.includes("task") ? null : status}+ {parkedBlockerIndicator}+ </span>- <span className="flex min-w-0 flex-1 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2">- <span data-slot="task-row-title-cluster" className="flex min-w-0 flex-1 items-baseline gap-1.5 sm:items-center">- <span- data-slot="task-row-title"- className={cn(- "min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",- isUnread && "font-semibold",- titleClassName,- )}- >- {issue.title}{titleSuffix}+ <span role={refreshed && columnValues ? "cell" : undefined} data-slot="task-row-content" data-marquee-cell={refreshed ? "task" : undefined} className="flex min-w-0 flex-1 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2">+ <span data-slot="task-row-title-cluster" className="flex min-w-0 flex-1 items-baseline gap-1.5 sm:items-center">+ {refreshed ? (+ <CellMarquee cell="task" active={titleFocused} slot="task-row-title" contentSlot="task-row-title-text" tabbable={false} className={cn("min-w-0", isUnread && "font-semibold", titleClassName)}>+ {issue.title}{titleSuffix}+ </CellMarquee>+ ) : <span+ data-slot="task-row-title"+ className={cn(+ "min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",+ isUnread && "font-semibold",+ titleClassName,+ )}+ >+ {issue.title}{titleSuffix}+ </span>}+ {recoveryIndicator}+ {mobileTitleMeta ? (+ <span className="ml-auto shrink-0 whitespace-nowrap text-right text-xs text-muted-foreground sm:hidden">+ {mobileTitleMeta}+ </span>+ ) : null}</span>- {recoveryIndicator}- {mobileTitleMeta ? (- <span className="ml-auto shrink-0 whitespace-nowrap text-right text-xs text-muted-foreground sm:hidden">- {mobileTitleMeta}- </span>+ {checklistDependencyChips ? (+ <span className="flex flex-wrap gap-1">{checklistDependencyChips}</span>+ ) : null}+ {mobileMeta ? (+ <span className="text-xs text-muted-foreground sm:hidden">{mobileMeta}</span>) : null}</span>- {checklistDependencyChips ? (- <span className="flex flex-wrap gap-1">{checklistDependencyChips}</span>- ) : null}- {mobileMeta ? (- <span className="text-xs text-muted-foreground sm:hidden">{mobileMeta}</span>- ) : null}- </span>- <span- data-slot="task-row-trailing"- className="ml-auto hidden min-w-0 shrink-0 items-center gap-2 sm:flex"- >- {externalObjectSummary ? (- <ExternalObjectStatusSummary summary={externalObjectSummary} compact />- ) : null}- {metadata ? <span data-slot="task-row-metadata" className="min-w-0">{metadata}</span> : null}- {desktopTrailing}- {actions ? <span data-slot="task-row-actions" className="flex shrink-0 items-center gap-1">{actions}</span> : null}- {onArchive ? <InboxArchiveButton onArchive={onArchive} disabled={archiveDisabled} compact /> : null}- {showIdentifier ? (- <span data-slot="task-row-identifier" className="w-20 shrink-0 text-right font-mono text-xs text-muted-foreground">- {identifier}- </span>- ) : null}- {trailingMeta ? (- <span data-slot="task-row-timestamp" className="w-24 shrink-0 truncate text-right text-xs text-muted-foreground">- {trailingMeta}- </span>- ) : null}- </span>- </div>+ <span+ data-slot="task-row-trailing"+ className="ml-auto hidden min-w-0 shrink-0 items-center gap-2 sm:flex"+ >+ {refreshed && columnValues ? (+ <>+ <TaskRowColumnCells identifier={identifier} values={columnValues} />+ {actions ? <span data-slot="task-row-actions" className="flex shrink-0 items-center gap-1">{actions}</span> : null}+ {onArchive ? <InboxArchiveButton onArchive={onArchive} disabled={archiveDisabled} compact /> : null}+ </>+ ) : (+ <>+ {externalObjectSummary ? (+ <ExternalObjectStatusSummary summary={externalObjectSummary} compact />+ ) : null}+ {metadata ? <span data-slot="task-row-metadata" data-marquee-cell={refreshed ? "metadata" : undefined} className="min-w-0">{refreshed ? <CellMarquee cell="metadata">{metadata}</CellMarquee> : metadata}</span> : null}+ {desktopTrailing}+ {actions ? <span data-slot="task-row-actions" className="flex shrink-0 items-center gap-1">{actions}</span> : null}+ {onArchive ? <InboxArchiveButton onArchive={onArchive} disabled={archiveDisabled} compact /> : null}+ {showIdentifier ? (+ <span data-slot="task-row-identifier" data-marquee-cell={refreshed ? "identifier" : undefined} className="w-20 shrink-0 text-right font-mono text-xs text-muted-foreground">+ {refreshed ? <CellMarquee cell="identifier">{identifier}</CellMarquee> : identifier}+ </span>+ ) : null}+ {trailingMeta ? (+ <span data-slot="task-row-timestamp" data-marquee-cell={refreshed ? "timestamp" : undefined} className="w-24 shrink-0 truncate text-right text-xs text-muted-foreground">+ {refreshed ? <CellMarquee cell="timestamp">{trailingMeta}</CellMarquee> : trailingMeta}+ </span>+ ) : null}+ </>+ )}+ </span>+ </div>+ </HoveredCellContext.Provider>);}diff --git a/ui/src/components/KanbanBoard.tsx b/ui/src/components/KanbanBoard.tsxindex 9b1c19f40e..1dfd808a01 100644--- a/ui/src/components/KanbanBoard.tsx+++ b/ui/src/components/KanbanBoard.tsx@@ -29,6 +29,7 @@ import { collectSubtreeLiveCounts } from "../lib/liveIssueIds";import { cn } from "../lib/utils";import { Card } from "@/components/ui/card";import { Badge } from "@/components/ui/badge";+import { HorizontalScrollViewport } from "./HorizontalScrollViewport";export const KANBAN_BOARD_HIGH_VOLUME_THRESHOLD = 100;export const KANBAN_COLUMN_PAGE_SIZE_OPTIONS = [10, 25, 50] as const;@@ -155,6 +156,8 @@ interface KanbanBoardProps {collapsedStatuses?: string[];initialVisibleCount?: number;revealIncrement?: number;+ /** Proposed clipping indicators, with a single horizontal scroll owner. */+ showOverflowFades?: boolean;onUpdateIssue: (id: string, data: Record<string, unknown>) => void;}@@ -391,6 +394,7 @@ export function KanbanBoard({collapsedStatuses = [],initialVisibleCount = KANBAN_COLUMN_INITIAL_VISIBLE_LIMIT,revealIncrement = KANBAN_COLUMN_REVEAL_INCREMENT,+ showOverflowFades = false,onUpdateIssue,}: KanbanBoardProps) {const [activeId, setActiveId] = useState<string | null>(null);@@ -455,6 +459,28 @@ export function KanbanBoard({// Could be used for visual feedback; keeping simple for now}+ const columns = boardStatuses.map((status) => (+ <KanbanColumn+ key={status}+ status={status}+ issues={columnIssues[status] ?? []}+ agents={agents}+ liveIssueIds={liveIssueIds}+ subtreeLiveCounts={subtreeLiveCounts}+ compactCards={compactCards}+ // Compact mode also collapses empty lanes to labeled rails.+ collapsed={collapsedStatusSet.has(status) || (collapsedStatusSet.size > 0 && columnIssues[status].length === 0)}+ visibleCount={visibleCountByStatus[status] ?? initialVisibleCount}+ revealIncrement={revealIncrement}+ onShowMore={() => {+ setVisibleState((current) => {+ const counts = current.paginationKey === paginationKey ? current.counts : {};+ return { paginationKey, counts: { ...counts, [status]: (counts[status] ?? initialVisibleCount) + revealIncrement } };+ });+ }}+ />+ ));+return (<DndContextsensors={sensors}@@ -462,37 +488,9 @@ export function KanbanBoard({onDragOver={handleDragOver}onDragEnd={handleDragEnd}>- <div className="flex gap-3 overflow-x-auto pb-4 -mx-2 px-2">- {boardStatuses.map((status) => (- <KanbanColumn- key={status}- status={status}- issues={columnIssues[status] ?? []}- agents={agents}- liveIssueIds={liveIssueIds}- subtreeLiveCounts={subtreeLiveCounts}- compactCards={compactCards}- // Compact mode (any lane explicitly collapsed) also collapses- // empty lanes to the same labeled rail, so an empty In Progress- // reads like the other rails instead of a lone expanded column.- collapsed={collapsedStatusSet.has(status) || (collapsedStatusSet.size > 0 && columnIssues[status].length === 0)}- visibleCount={visibleCountByStatus[status] ?? initialVisibleCount}- revealIncrement={revealIncrement}- onShowMore={() => {- setVisibleState((current) => {- const counts = current.paginationKey === paginationKey ? current.counts : {};- return {- paginationKey,- counts: {- ...counts,- [status]: (counts[status] ?? initialVisibleCount) + revealIncrement,- },- };- });- }}- />- ))}- </div>+ {showOverflowFades+ ? <HorizontalScrollViewport label="Task board columns" contentClassName="flex gap-3 pb-4 px-2">{columns}</HorizontalScrollViewport>+ : <div className="flex gap-3 overflow-x-auto pb-4 -mx-2 px-2">{columns}</div>}<DragOverlay>{activeIssue ? (<KanbanCard issue={activeIssue} agents={agents} isOverlay compact={compactCards} />diff --git a/ui/src/components/Layout.production.tsx b/ui/src/components/Layout.production.tsxindex 9ef6dddd4b..56afb99fc0 100644--- a/ui/src/components/Layout.production.tsx+++ b/ui/src/components/Layout.production.tsx@@ -1,3 +1,5 @@+import { useDesignSandbox } from "@/context/DesignSandboxContext";+import { DesignSandboxSidebar } from "./DesignSandboxSidebar";import { BoardDialogs } from "./BoardDialogs";import { ChatSetupSidebarProvider } from "@/context/ChatSetupSidebarContext";import { PluginAppShellOverlays } from "./PluginAppShellOverlays";@@ -113,6 +115,7 @@ function isSkillsStoreRoute(}export function Layout() {+ const designSandbox = useDesignSandbox();const {sidebarOpen,setSidebarOpen,@@ -636,18 +639,21 @@ export function Layout() {) : (<SidebarShellopen={sidebarOpen}- collapsed={collapsed}- peeking={peeking}+ collapsed={designSandbox ? false : collapsed}+ peeking={designSandbox ? false : peeking}resizable+ storageKey={designSandbox ? "paperclip.design-proposals.sandbox.sidebar-width" : undefined}onPanelMouseEnter={handlePanelPointerEnter}onPanelMouseLeave={handlePanelPointerLeave}onPanelFocusCapture={collapsed ? handlePanelFocus : undefined}onPanelBlurCapture={collapsed ? handlePanelBlur : undefined}>- <div className="flex flex-1 min-h-0">- <Sidebar />- </div>- <SidebarAccountMenu deploymentMode={health?.deploymentMode} />+ {designSandbox ? <DesignSandboxSidebar /> : <>+ <div className="flex flex-1 min-h-0">+ <Sidebar />+ </div>+ <SidebarAccountMenu deploymentMode={health?.deploymentMode} />+ </>}</SidebarShell>)}diff --git a/ui/src/components/Layout.test.tsx b/ui/src/components/Layout.test.tsxindex 733d537a3f..343e5f1a25 100644--- a/ui/src/components/Layout.test.tsx+++ b/ui/src/components/Layout.test.tsx@@ -6,6 +6,10 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { Layout } from "./Layout";+const mockDesignSandbox = vi.hoisted(() => ({ enabled: false }));+vi.mock("@/context/DesignSandboxContext", () => ({ useDesignSandbox: () => mockDesignSandbox.enabled }));+vi.mock("./DesignSandboxSidebar", () => ({ DesignSandboxSidebar: () => <div>Proposed sidebar</div> }));+const mockHealthApi = vi.hoisted(() => ({get: vi.fn(),}));@@ -308,6 +312,7 @@ describe("Layout", () => {let container: HTMLDivElement;beforeEach(() => {+ mockDesignSandbox.enabled = false;container = document.createElement("div");document.body.appendChild(container);currentPathname = "/PAP/dashboard";@@ -515,6 +520,20 @@ describe("Layout", () => {});});+ it("retains settings navigation and route content beside the proposed sandbox sidebar", async () => {+ currentPathname = "/PAP/company/settings/access";+ mockDesignSandbox.enabled = true;+ const root = createRoot(container);+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } });+ await act(async () => { root.render(<QueryClientProvider client={queryClient}><Layout /></QueryClientProvider>); });+ await flushReact();+ expect(container.textContent).toContain("Proposed sidebar");+ expect(container.textContent).toContain("Company settings sidebar");+ expect(container.textContent).toContain("Outlet content");+ expect(container.textContent).not.toContain("Main company nav");+ await act(async () => { root.unmount(); });+ });+it("replaces the app sidebar with settings navigation on Streamlined settings routes", async () => {currentPathname = "/PAP/company/settings/access";mockPluginSlots.slots = [@@ -869,7 +888,7 @@ describe("Layout", () => {});});- it("keeps global navigation beside Skills, Agent, and Routine details", async () => {+ it("keeps global navigation beside Agent and Routine details", async () => {async function renderAt(pathname: string) {currentPathname = pathname;const root = createRoot(container);@@ -886,7 +905,6 @@ describe("Layout", () => {}for (const [pathname, sidebarText] of [- ["/PAP/skills/studio", "Skills sidebar"],["/PAP/agents/briefing-analyst/skills", "Agent sidebar briefing-analyst"],["/PAP/agents/briefing-analyst/runs/run-1",@@ -951,6 +969,21 @@ describe("Layout", () => {}});+ it("uses the global rail without secondary Skills navigation in the streamlined shell", async () => {+ for (const path of ["/PAP/skills", "/PAP/skills?tab=discover", "/PAP/skills/studio", "/PAP/skills/sources"]) {+ currentPathname = path;+ const root = createRoot(container);+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } });+ await act(async () => { root.render(<QueryClientProvider client={queryClient}><Layout /></QueryClientProvider>); });+ await flushReact();+ await flushReact();+ expect(container.textContent).toContain("Main company nav");+ expect(container.textContent).not.toContain("Skills sidebar");+ await act(async () => root.unmount());+ container.innerHTML = "";+ }+ });+it("keeps the global rail beside Skills navigation in the legacy shell", async () => {currentPathname = "/PAP/skills/studio";mockInstanceSettingsApi.getExperimental.mockResolvedValue({diff --git a/ui/src/components/Layout.tsx b/ui/src/components/Layout.tsxindex eb4a3be13a..f20ee8fc6e 100644--- a/ui/src/components/Layout.tsx+++ b/ui/src/components/Layout.tsx@@ -1,3 +1,5 @@+import { useDesignSandbox } from "@/context/DesignSandboxContext";+import { DesignSandboxSidebar } from "./DesignSandboxSidebar";import { BoardDialogs } from "./BoardDialogs";import { SetupWizardSidebarOutlet } from "./SetupWizard";import { ChatSetupSidebarProvider } from "@/context/ChatSetupSidebarContext";@@ -79,6 +81,7 @@ const RESERVED_APP_SUBPATHS = new Set([]);export function Layout({ sidebarSections }: { sidebarSections?: ReactNode }) {+ const designSandbox = useDesignSandbox();const {sidebarOpen,setSidebarOpen,@@ -171,7 +174,7 @@ export function Layout({ sidebarSections }: { sidebarSections?: ReactNode }) {[routeSidebarCompanyId, routeSidebarCompanyPrefix],);// Most contextual routes replace the global navigation inside the same- // sidebar shell. Skills, Apps, Agent details, and Routine details are the+ // sidebar shell. Apps, Agent details, and Routine details are the// exceptions in Streamlined UI: their local navigation is a second rail// beside the persistent company nav.const sharedSecondarySidebar = isCompanySettingsRoute ? (@@ -210,13 +213,10 @@ export function Layout({ sidebarSections }: { sidebarSections?: ReactNode }) {<AgentContextualSidebar agentRef={agentId} />) : streamlinedUiEnabled && shellRoute.builtInContextualSurface === "routine" && routineId ? (<SetupWizardSidebarOutlet><RoutineContextualSidebar routineId={routineId} /></SetupWizardSidebarOutlet>- ) : streamlinedUiEnabled && shellRoute.builtInContextualSurface === "skills" ? (- <SkillsContextualSidebar />) : sharedSecondarySidebar;const hasSecondarySidebar = secondarySidebar != null;const keepsPrimarySidebar = streamlinedUiEnabled && hasSecondarySidebar && (isAgentChatRoute- || shellRoute.builtInContextualSurface === "skills"|| shellRoute.builtInContextualSurface === "agent"|| shellRoute.builtInContextualSurface === "routine"|| isAppsRoute@@ -625,29 +625,32 @@ export function Layout({ sidebarSections }: { sidebarSections?: ReactNode }) {) : (<SidebarShellopen={sidebarOpen}- collapsed={replacesPrimarySidebar ? false : collapsed}- peeking={replacesPrimarySidebar ? false : peeking}+ collapsed={designSandbox || replacesPrimarySidebar ? false : collapsed}+ peeking={designSandbox || replacesPrimarySidebar ? false : peeking}resizable+ storageKey={designSandbox ? "paperclip.design-proposals.sandbox.sidebar-width" : undefined}onPanelMouseEnter={replacesPrimarySidebar ? undefined : handlePanelPointerEnter}onPanelMouseLeave={replacesPrimarySidebar ? undefined : handlePanelPointerLeave}onPanelFocusCapture={!replacesPrimarySidebar && collapsed ? handlePanelFocus : undefined}onPanelBlurCapture={!replacesPrimarySidebar && collapsed ? handlePanelBlur : undefined}>- <div className="flex flex-1 min-h-0">- {replacesPrimarySidebar ? (- <SecondarySidebar>{secondarySidebar}</SecondarySidebar>- ) : (- <Sidebar>{sidebarSections}</Sidebar>- )}- </div>- <SidebarAccountMenu- deploymentMode={health?.deploymentMode}- forceExpanded={replacesPrimarySidebar}- />+ {designSandbox ? <DesignSandboxSidebar /> : <>+ <div className="flex flex-1 min-h-0">+ {replacesPrimarySidebar ? (+ <SecondarySidebar>{secondarySidebar}</SecondarySidebar>+ ) : (+ <Sidebar>{sidebarSections}</Sidebar>+ )}+ </div>+ <SidebarAccountMenu+ deploymentMode={health?.deploymentMode}+ forceExpanded={replacesPrimarySidebar}+ />+ </>}</SidebarShell>)}- {!isMobile && showsAdjacentSecondarySidebar && !keepsPrimarySidebar ? (+ {!isMobile && ((showsAdjacentSecondarySidebar && !keepsPrimarySidebar) || (designSandbox && replacesPrimarySidebar)) ? (<SecondarySidebar className="w-60 shrink-0">{secondarySidebar}</SecondarySidebar>diff --git a/ui/src/components/MarkdownBody.tsx b/ui/src/components/MarkdownBody.tsxindex 32a518bc78..0047952986 100644--- a/ui/src/components/MarkdownBody.tsx+++ b/ui/src/components/MarkdownBody.tsx@@ -1,4 +1,5 @@-import { isValidElement, memo, useCallback, useEffect, useId, useMemo, useRef, useState, type ReactNode } from "react";+import { MarkdownWordStreaming, rehypeStreamingWords } from "./MarkdownWordStreaming";+import { isValidElement, memo, useContext, useCallback, useEffect, useId, useMemo, useRef, useState, type ReactNode } from "react";import { useQuery, useQueryClient } from "@tanstack/react-query";import { Check, Copy, ExternalLink, WrapText } from "lucide-react";import Markdown, { defaultUrlTransform, type Components, type Options } from "react-markdown";@@ -795,6 +796,7 @@ function MarkdownBodyImpl({resolveWorkspaceFileRef,}: MarkdownBodyProps) {const { theme } = useTheme();+ const streamWords = useContext(MarkdownWordStreaming);// Read company prefixes non-throwingly: MarkdownBody renders in surfaces that// may lack a CompanyProvider. A null context (or no companies yet) leaves// knownPrefixes undefined, which keeps issue auto-linking permissive.@@ -1035,6 +1037,7 @@ function MarkdownBodyImpl({><MarkdownremarkPlugins={remarkPlugins}+ rehypePlugins={streamWords ? [rehypeStreamingWords] : undefined}components={components}urlTransform={safeMarkdownUrlTransform}>diff --git a/ui/src/components/MarkdownWordStreaming.tsx b/ui/src/components/MarkdownWordStreaming.tsxnew file mode 100644index 0000000000..6bc3db3715--- /dev/null+++ b/ui/src/components/MarkdownWordStreaming.tsx@@ -0,0 +1,26 @@+import { createContext } from "react";++/** Opt-in for synthetic streaming previews; settled/ordinary Markdown stays+ * unchanged. New word elements animate once; existing DOM words are retained. */+export const MarkdownWordStreaming = createContext(false);++type WordNode = {+ type: string; value?: string; tagName?: string;+ properties?: Record<string, unknown>; children?: WordNode[];+};+export function rehypeStreamingWords() {+ return (tree: WordNode) => {+ const visit = (node: WordNode) => {+ // Code renderers consume text directly and own their own syntax markup.+ if (!node.children || node.tagName === "pre" || node.tagName === "code") return;+ node.children = node.children.flatMap(child => {+ if (child.type !== "text" || !child.value) { visit(child); return [child]; }+ return (child.value.match(/\s+|\S+/gu) ?? []).map(value => /\S/u.test(value) ? {+ type: "element", tagName: "span", properties: { className: ["conversation-stream-word"] },+ children: [{ type: "text", value }],+ } : { type: "text", value });+ });+ };+ visit(tree);+ };+}diff --git a/ui/src/components/MetricCard.tsx b/ui/src/components/MetricCard.tsxindex 38a2f9d1d1..4be5e2d131 100644--- a/ui/src/components/MetricCard.tsx+++ b/ui/src/components/MetricCard.tsx@@ -1,6 +1,7 @@import type { LucideIcon } from "lucide-react";import type { ReactNode } from "react";import { Link } from "@/lib/router";+import { Card } from "./ui/card";interface MetricCardProps {icon: LucideIcon;@@ -9,29 +10,33 @@ interface MetricCardProps {description?: ReactNode;to?: string;onClick?: () => void;+ /** Use the shared bordered Card surface instead of an unframed metric. */+ appearance?: "plain" | "card";}-export function MetricCard({ icon: Icon, value, label, description, to, onClick }: MetricCardProps) {+export function MetricCard({ icon: Icon, value, label, description, to, onClick, appearance = "plain" }: MetricCardProps) {const isClickable = !!(to || onClick);- const inner = (- <div className={`h-full px-4 py-4 sm:px-5 sm:py-5 rounded-lg transition-colors${isClickable ? " hover:bg-accent/50 cursor-pointer" : ""}`}>- <div className="flex items-start justify-between gap-3">- <div className="flex-1 min-w-0">- <p className="text-2xl sm:text-3xl font-semibold tracking-tight tabular-nums">- {value}- </p>- <p className="text-xs sm:text-sm font-medium text-muted-foreground mt-1">- {label}- </p>- {description && (- <div className="text-xs text-muted-foreground/70 mt-1.5 hidden sm:block">{description}</div>- )}- </div>- <Icon className="h-4 w-4 text-muted-foreground/50 shrink-0 mt-1.5" />+ const content = (+ <div className="flex items-start justify-between gap-3">+ <div className="flex-1 min-w-0">+ <p className={`text-2xl sm:text-3xl font-semibold tracking-tight tabular-nums${appearance === "card" ? " text-foreground" : ""}`}>+ {value}+ </p>+ <p className="text-xs sm:text-sm font-medium text-muted-foreground mt-1">+ {label}+ </p>+ {description && (+ <div className="text-xs text-muted-foreground/70 mt-1.5 hidden sm:block">{description}</div>+ )}</div>+ <Icon className="h-4 w-4 text-muted-foreground/50 shrink-0 mt-1.5" /></div>);+ const surfaceClassName = `h-full px-4 py-4 sm:px-5 sm:py-5 rounded-lg transition-colors${isClickable ? " hover:bg-accent/50 cursor-pointer" : ""}`;+ const inner = appearance === "card"+ ? <Card elevation="low" className={surfaceClassName}>{content}</Card>+ : <div className={surfaceClassName}>{content}</div>;if (to) {return (diff --git a/ui/src/components/PageTabBar.tsx b/ui/src/components/PageTabBar.tsxindex a0f5148880..db51e9bd2b 100644--- a/ui/src/components/PageTabBar.tsx+++ b/ui/src/components/PageTabBar.tsx@@ -1,6 +1,6 @@import type { ReactNode } from "react";import { ChevronDown } from "lucide-react";-import { TabsList, TabsTrigger } from "@/components/ui/tabs";+import { TabBar, type TabSize } from "./TabBar";import { useSidebar } from "../context/SidebarContext";export interface PageTabItem {@@ -13,9 +13,10 @@ interface PageTabBarProps {value?: string;onValueChange?: (value: string) => void;align?: "center" | "start";+ size?: TabSize;}-export function PageTabBar({ items, value, onValueChange, align = "center" }: PageTabBarProps) {+export function PageTabBar({ items, value, onValueChange, align = "center", size = "standard" }: PageTabBarProps) {const { isMobile } = useSidebar();if (isMobile && value !== undefined && onValueChange) {@@ -39,12 +40,6 @@ export function PageTabBar({ items, value, onValueChange, align = "center" }: Pa}return (- <TabsList variant="line" className={align === "start" ? "justify-start" : undefined}>- {items.map((item) => (- <TabsTrigger key={item.value} value={item.value}>- {item.label}- </TabsTrigger>- ))}- </TabsList>+ <TabBar items={items} size={size} className={align === "start" ? "justify-start" : undefined} />);}diff --git a/ui/src/components/ProjectsToolbar.tsx b/ui/src/components/ProjectsToolbar.tsxnew file mode 100644index 0000000000..dae5d59477--- /dev/null+++ b/ui/src/components/ProjectsToolbar.tsx@@ -0,0 +1,71 @@+import { ArrowUpDown, Check, Plus } from "lucide-react";+import { ToolbarSearch } from "./ToolbarSearch";+import { Button } from "./ui/button";+import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";++export type ProjectSortField = "name" | "updated" | "created" | "targetDate";+export type ProjectSortDir = "asc" | "desc";++const PROJECT_SORT_OPTIONS: Array<{ field: ProjectSortField; label: string }> = [+ { field: "name", label: "Name" },+ { field: "updated", label: "Updated" },+ { field: "created", label: "Created" },+ { field: "targetDate", label: "Target date" },+];++/** Canonical project search, sorting and creation controls. State stays with the page. */+export function ProjectsToolbar({ query, onQueryChange, sortField, sortDir, onSortChange, onNewProject: openNewProject }: {+ query: string;+ onQueryChange: (value: string) => void;+ sortField: ProjectSortField;+ sortDir: ProjectSortDir;+ onSortChange: (field: ProjectSortField, direction: ProjectSortDir) => void;+ onNewProject: () => void;+}) {+ const sortLabel = PROJECT_SORT_OPTIONS.find(option => option.field === sortField)?.label ?? "Name";+ return <div data-canonical-toolbar="projects" role="toolbar" aria-label="Projects controls" className="flex flex-wrap items-center gap-4">+ <ToolbarSearch query={query} onQueryChange={onQueryChange} label="Search projects" placeholder="Search projects…" />+ <Popover>+ <PopoverTrigger asChild>+ <Button variant="outline" size="sm" title="Sort">+ <ArrowUpDown className="h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1" />+ <span>Sort: {sortLabel}</span>+ </Button>+ </PopoverTrigger>+ <PopoverContent align="start" className="w-44 p-0">+ <div className="p-2 space-y-0.5">+ {PROJECT_SORT_OPTIONS.map((option) => (+ <button+ key={option.field}+ type="button"+ className={`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${+ sortField === option.field+ ? "bg-accent/50 text-foreground"+ : "text-muted-foreground hover:bg-accent/50"+ }`}+ onClick={() => {+ onSortChange(option.field, sortField === option.field+ ? (sortDir === "asc" ? "desc" : "asc")+ : (option.field === "name" || option.field === "targetDate" ? "asc" : "desc"));+ }}+ >+ <span>{option.label}</span>+ {sortField === option.field ? (+ <span className="flex items-center gap-1 text-xs text-muted-foreground">+ <Check className="h-3 w-3" />+ {sortDir === "asc" ? "Asc" : "Desc"}+ </span>+ ) : null}+ </button>+ ))}+ </div>+ </PopoverContent>+ </Popover>+ <div className="design-toolbar-actions">+ <Button size="sm" variant="outline" data-toolbar-primary onClick={openNewProject}>+ <Plus className="h-4 w-4 mr-1" />+ Add Project+ </Button>+ </div>+ </div>;+}diff --git a/ui/src/components/PropertiesPanel.test.tsx b/ui/src/components/PropertiesPanel.test.tsxindex e478d654f6..c5d1ebc079 100644--- a/ui/src/components/PropertiesPanel.test.tsx+++ b/ui/src/components/PropertiesPanel.test.tsx@@ -7,6 +7,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { TooltipProvider } from "@/components/ui/tooltip";import { PropertiesPanel } from "./PropertiesPanel";+const mockSandbox = vi.hoisted(() => ({ enabled: false }));+vi.mock("@/context/DesignSandboxContext", () => ({ useDesignSandbox: () => mockSandbox.enabled }));+const mockInstanceSettingsApi = vi.hoisted(() => ({getExperimental: vi.fn(),}));@@ -81,6 +84,7 @@ describe("PropertiesPanel", () => {mockSetPanelVisible.mockClear();mockClearPanelMaximizeRequest.mockClear();mockPanelState.panelMaximizeRequested = false;+ mockSandbox.enabled = false;});afterEach(() => {@@ -91,6 +95,7 @@ describe("PropertiesPanel", () => {container.remove();Object.defineProperty(window, "innerWidth", { configurable: true, value: originalInnerWidth });vi.clearAllMocks();+ document.documentElement.style.removeProperty("--design-page-aside-width");});describe("classic task interface on (legacy panel)", () => {@@ -143,6 +148,28 @@ describe("PropertiesPanel", () => {);});+ it("uses the proposal width token and resets only the sandbox's saved width", async () => {+ mockSandbox.enabled = true;+ document.documentElement.style.setProperty("--design-page-aside-width", "320px");+ window.localStorage.setItem("taskChatRedesign.taskDetailPropertiesPaneWidth", "434");+ window.localStorage.setItem("paperclip.design-proposal.properties-pane-width.task-detail", "480");+ await renderPanel({ taskDetailLayout: true });+ const aside = container.querySelector("aside")!;+ expect(aside.style.width).toBe("480px");+ const grip = aside.querySelector('[aria-label="Resize panel"]')!;+ grip.dispatchEvent(new MouseEvent("dblclick", { bubbles: true }));+ await flushReact();+ expect(aside.style.width).toBe("320px");+ expect(window.localStorage.getItem("paperclip.design-proposal.properties-pane-width.task-detail")).toBeNull();+ expect(window.localStorage.getItem("taskChatRedesign.taskDetailPropertiesPaneWidth")).toBe("434");++ // Reset reads the current token, including subsequent foundation tuning.+ document.documentElement.style.setProperty("--design-page-aside-width", "360px");+ grip.dispatchEvent(new MouseEvent("dblclick", { bubbles: true }));+ await flushReact();+ expect(aside.style.width).toBe("360px");+ });+it("removes the left divider only while the sidebar is maximized", async () => {await renderPanel({ taskDetailLayout: true });const aside = container.querySelector("aside")!;diff --git a/ui/src/components/PropertiesPanel.tsx b/ui/src/components/PropertiesPanel.tsxindex 783ec1dd39..babd7bed3c 100644--- a/ui/src/components/PropertiesPanel.tsx+++ b/ui/src/components/PropertiesPanel.tsx@@ -7,6 +7,7 @@ import { cn } from "../lib/utils";import { Button } from "@/components/ui/button";import { ScrollArea } from "@/components/ui/scroll-area";import { SidePanelFrame, SidePanelWindowControls } from "@/components/side-panel";+import { useDesignSandbox } from "@/context/DesignSandboxContext";export function PropertiesPanel({ taskDetailLayout = false }: { taskDetailLayout?: boolean }) {const {@@ -19,6 +20,7 @@ export function PropertiesPanel({ taskDetailLayout = false }: { taskDetailLayout} = usePanel();const { enabled: classicTaskInterfaceEnabled } = useClassicTaskInterfaceEnabled();const { enabled: streamlinedUiEnabled } = useStreamlinedUiEnabled();+ const designSandbox = useDesignSandbox();const streamlinedTaskDetailLayout = streamlinedUiEnabled && taskDetailLayout;if (!panelContent) return null;@@ -46,12 +48,13 @@ export function PropertiesPanel({ taskDetailLayout = false }: { taskDetailLayoutreturn (<ResizablePropertiesPanel- key={streamlinedTaskDetailLayout ? "task-detail" : "default"}+ key={`${streamlinedTaskDetailLayout ? "task-detail" : "default"}-${designSandbox ? "proposal" : "production"}`}panelContent={panelContent}panelContentMode={panelContentMode}panelVisible={panelVisible}setPanelVisible={setPanelVisible}taskDetailLayout={streamlinedTaskDetailLayout}+ designSandbox={designSandbox}maximizeRequested={panelMaximizeRequested}clearMaximizeRequest={clearPanelMaximizeRequest}/>@@ -80,6 +83,7 @@ export const PROPERTIES_PANE_FOOTER_SLOT_ID = "properties-pane-footer-slot";const WIDTH_STORAGE_KEY = "taskChatRedesign.propertiesPaneWidth";const TASK_DETAIL_WIDTH_STORAGE_KEY = "taskChatRedesign.taskDetailPropertiesPaneWidth";+const PROPOSAL_WIDTH_STORAGE_KEY = "paperclip.design-proposal.properties-pane-width";const DEFAULT_PANE_WIDTH = 322;const TASK_DETAIL_DEFAULT_PANE_WIDTH = 434;const MIN_PANE_WIDTH = 260;@@ -94,6 +98,12 @@ const MAXIMIZED_CONTENT_MAX_WIDTH = 840;*/const RESTORE_FALLBACK_DELAY = 400;+function readProposalPaneWidth(fallback: number): number {+ if (typeof window === "undefined") return fallback;+ const tokenWidth = Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--design-page-aside-width"));+ return Number.isFinite(tokenWidth) && tokenWidth > 0 ? tokenWidth : fallback;+}+function clampPaneWidth(width: number): number {const max =typeof window === "undefined"@@ -153,6 +163,7 @@ interface ResizablePropertiesPanelProps {panelVisible: boolean;setPanelVisible: (visible: boolean) => void;taskDetailLayout: boolean;+ designSandbox: boolean;/** Pending `viewer=full` deep-link request (LOOA-2181); cleared once consumed. */maximizeRequested: boolean;clearMaximizeRequest: () => void;@@ -164,13 +175,17 @@ function ResizablePropertiesPanel({panelVisible,setPanelVisible,taskDetailLayout,+ designSandbox,maximizeRequested,clearMaximizeRequest,}: ResizablePropertiesPanelProps) {- const defaultPaneWidth = taskDetailLayout+ const productionPaneWidth = taskDetailLayout? TASK_DETAIL_DEFAULT_PANE_WIDTH: DEFAULT_PANE_WIDTH;- const widthStorageKey = taskDetailLayout+ const defaultPaneWidth = designSandbox ? readProposalPaneWidth(productionPaneWidth) : productionPaneWidth;+ const widthStorageKey = designSandbox+ ? `${PROPOSAL_WIDTH_STORAGE_KEY}.${taskDetailLayout ? "task-detail" : "default"}`+ : taskDetailLayout? TASK_DETAIL_WIDTH_STORAGE_KEY: WIDTH_STORAGE_KEY;const [width, setWidth] = useState(() =>@@ -264,9 +279,9 @@ function ResizablePropertiesPanel({}, [endDrag]);const handleGripDoubleClick = useCallback(() => {- setWidth(defaultPaneWidth);+ setWidth(designSandbox ? clampPaneWidth(readProposalPaneWidth(productionPaneWidth)) : defaultPaneWidth);clearStoredPaneWidth(widthStorageKey);- }, [defaultPaneWidth, widthStorageKey]);+ }, [defaultPaneWidth, designSandbox, productionPaneWidth, widthStorageKey]);const handleMaximize = useCallback(() => {const aside = asideRef.current;@@ -359,7 +374,7 @@ function ResizablePropertiesPanel({panelVisible ? "overflow-visible" : "overflow-hidden",// The width/opacity transition would fight pointer-driven// resizing, so it is suspended while dragging.- !dragging && "transition-(--tp-width-opacity) duration-200 ease-in-out",+ !dragging && "transition-(--tp-width-opacity) duration-(--motion-pane-width-reset) ease-(--motion-ease-pane-width-reset)",),)}style={@@ -380,7 +395,7 @@ function ResizablePropertiesPanel({aria-orientation="vertical"aria-label="Resize panel"data-dragging={dragging ? "" : undefined}- className="group absolute inset-y-0 z-10 cursor-col-resize touch-none"+ className="pane-resize-handle group absolute inset-y-0 z-10 cursor-col-resize touch-none"style={{ left: -4, width: 8 }}onPointerDown={handleGripPointerDown}onPointerMove={handleGripPointerMove}diff --git a/ui/src/components/RoutinesToolbar.tsx b/ui/src/components/RoutinesToolbar.tsxnew file mode 100644index 0000000000..084810b6a9--- /dev/null+++ b/ui/src/components/RoutinesToolbar.tsx@@ -0,0 +1,106 @@+import { ArrowUpDown, Check, Layers, Plus } from "lucide-react";+import { Link } from "@/lib/router";+import { ToolbarSearch } from "./ToolbarSearch";+import { Button } from "./ui/button";+import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";++export type RoutineGroupBy = "folder" | "none" | "project" | "assignee";+export type RoutineSortField = "updated" | "created" | "title" | "lastRun";+export type RoutineSortDir = "asc" | "desc";++export function RoutinesToolbar({ query, onQueryChange, sortField, sortDir, groupBy, onSortChange, onGroupChange, onNewFolder, onCreateRoutine, runsHref, selectMode, onToggleSelect }: {+ query: string;+ onQueryChange: (value: string) => void;+ sortField: RoutineSortField;+ sortDir: RoutineSortDir;+ groupBy: RoutineGroupBy;+ onSortChange: (field: RoutineSortField, direction: RoutineSortDir) => void;+ onGroupChange: (value: RoutineGroupBy) => void;+ onNewFolder?: () => void;+ onCreateRoutine: () => void;+ runsHref?: string;+ selectMode?: boolean;+ onToggleSelect?: () => void;+}) {+ return <div data-canonical-toolbar="routines" role="toolbar" aria-label="Routines controls" className="flex flex-wrap items-center gap-4">+ <ToolbarSearch query={query} onQueryChange={onQueryChange} label="Search routines" placeholder="Search routines…" />+ <Popover>+ <PopoverTrigger asChild>+ <Button variant="outline" size="sm" title="Sort">+ <ArrowUpDown className="h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1" />+ <span >Sort</span>+ </Button>+ </PopoverTrigger>+ <PopoverContent align="end" className="w-44 p-0">+ <div className="p-2 space-y-0.5">+ {([+ ["updated", "Updated"],+ ["created", "Created"],+ ["lastRun", "Last run"],+ ["title", "Title"],+ ] as const).map(([field, label]) => (+ <button+ type="button"+ key={field}+ className={`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${+ sortField === field+ ? "bg-accent/50 text-foreground"+ : "text-muted-foreground hover:bg-accent/50"+ }`}+ onClick={() => {+ onSortChange(field, sortField === field+ ? (sortDir === "asc" ? "desc" : "asc")+ : (field === "title" ? "asc" : "desc"));+ }}+ >+ <span>{label}</span>+ {sortField === field ? (+ <span className="text-xs text-muted-foreground">+ {sortDir === "asc" ? "Asc" : "Desc"}+ </span>+ ) : null}+ </button>+ ))}+ </div>+ </PopoverContent>+ </Popover>+ <Popover>+ <PopoverTrigger asChild>+ <Button variant="outline" size="sm" title="Group">+ <Layers className="h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1" />+ <span >Group</span>+ </Button>+ </PopoverTrigger>+ <PopoverContent align="end" className="w-44 p-0">+ <div className="p-2 space-y-0.5">+ {([+ ["folder", "Folder"],+ ["project", "Project"],+ ["assignee", "Agent"],+ ["none", "None"],+ ] as const).map(([value, label]) => (+ <button+ type="button"+ key={value}+ className={`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${+ groupBy === value+ ? "bg-accent/50 text-foreground"+ : "text-muted-foreground hover:bg-accent/50"+ }`}+ onClick={() => onGroupChange(value)}+ >+ <span>{label}</span>+ {groupBy === value ? <Check className="h-3.5 w-3.5" /> : null}+ </button>+ ))}+ </div>+ </PopoverContent>+ </Popover>+ <div className="design-toolbar-actions">+ {onToggleSelect && <Button variant="outline" size="sm" onClick={onToggleSelect}>{selectMode ? "Done" : "Select"}</Button>}+ {runsHref && <Button variant="outline" size="sm" asChild><Link data-toolbar-control to={runsHref}>View all runs</Link></Button>}+ {onNewFolder && <Button variant="outline" size="sm" onClick={onNewFolder}><Plus className="h-4 w-4" />New folder</Button>}+ <Button variant="outline" size="sm" data-toolbar-primary onClick={onCreateRoutine}><Plus className="h-4 w-4" />Create routine</Button>+ </div>+ </div>;+}diff --git a/ui/src/components/SidebarAccountMenu.tsx b/ui/src/components/SidebarAccountMenu.tsxindex b87beea361..f1592b3947 100644--- a/ui/src/components/SidebarAccountMenu.tsx+++ b/ui/src/components/SidebarAccountMenu.tsx@@ -1,4 +1,4 @@-import { useState } from "react";+import { useState, type CSSProperties } from "react";import { useQuery } from "@tanstack/react-query";import {BookOpen,@@ -20,12 +20,14 @@ import { useSignOut } from "@/hooks/useSignOut";import { useStagingCommit } from "@/hooks/useStagingCommit";import { userProfilePath } from "@/lib/userProfileLinks";import { useSidebar } from "../context/SidebarContext";-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";+import { Popover, PopoverTrigger } from "@/components/ui/popover";+import { FlyoutContent, FlyoutHeader, FlyoutOptions } from "@/components/ui/flyout";import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import { cn, SIDEBAR_RAIL_HIDDEN_LABEL } from "../lib/utils";import { ThemeToggle } from "./ThemeToggle";import { SidebarServerInfo } from "./SidebarServerInfo";+import { TruncatedText } from "./TruncatedText";const INVITES_PATH = "/company/settings/members?tab=invites";const DOCS_URL = "https://docs.paperclip.ing/";@@ -37,6 +39,8 @@ interface SidebarAccountMenuProps {onOpenChange?: (open: boolean) => void;/** Contextual navigation occupies a full sidebar even if the saved global nav mode is collapsed. */forceExpanded?: boolean;+ /** Optional local shadow preview; the shared token remains the default. */+ shadow?: CSSProperties["boxShadow"];}interface MenuActionProps {@@ -78,7 +82,7 @@ function MenuAction({<span className="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><Icon className="size-4" /></span>- <span className="min-w-0 flex-1 truncate">{label}</span>+ <TruncatedText className="min-w-0 flex-1 truncate">{label}</TruncatedText></>);@@ -118,6 +122,7 @@ export function SidebarAccountMenu({open: controlledOpen,onOpenChange,forceExpanded = false,+ shadow,}: SidebarAccountMenuProps) {const cloud = useCloudInstance();const isCloud = Boolean(cloud);@@ -185,17 +190,19 @@ export function SidebarAccountMenu({{session?.user.image ? <AvatarImage src={session.user.image} alt={displayName} /> : null}<AvatarFallback>{initials}</AvatarFallback></Avatar>- <span className={cn("min-w-0 flex-1 truncate", rail && SIDEBAR_RAIL_HIDDEN_LABEL)}>{displayName}</span>+ <TruncatedText className={cn("min-w-0 flex-1 truncate", rail && SIDEBAR_RAIL_HIDDEN_LABEL)}>{displayName}</TruncatedText></button></PopoverTrigger>- <PopoverContent+ <FlyoutContent+ shadow={shadow}+ aria-label="Account"side="top"align="start"sideOffset={10}className="min-h-(--profile-popover-min-height) w-(--profile-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-border bg-popover p-0 shadow-(--shadow-profile-popover)">{/* The profile link is a stretched overlay so the staging SHA anchor can sit beside the email without nesting anchors. */}- <div className="relative flex h-(--profile-popover-header-height) shrink-0 items-center gap-2.5 px-3.5">+ <FlyoutHeader data-flyout-profile data-marquee-surface className="relative flex h-(--profile-popover-header-height) shrink-0 items-center gap-2.5 px-3.5"><Linkto={profileHref}aria-label="View profile"@@ -207,12 +214,12 @@ export function SidebarAccountMenu({<AvatarFallback className="text-xs text-foreground">{initials}</AvatarFallback></Avatar><div className="pointer-events-none relative min-w-0 flex-1">- <h2 className="truncate text-sm font-semibold leading-(--profile-popover-label-line-height) text-foreground">+ <TruncatedText as="h2" className="truncate text-sm font-semibold leading-(--profile-popover-label-line-height) text-foreground">{displayName}- </h2>- <p className="truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-muted-foreground">+ </TruncatedText>+ <TruncatedText as="p" className="truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-muted-foreground">{secondaryLabel}- </p>+ </TruncatedText>{stagingCommit ? (<aclassName="pointer-events-auto block truncate font-mono text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-muted-foreground hover:underline focus-visible:underline"@@ -226,9 +233,9 @@ export function SidebarAccountMenu({</a>) : null}</div>- </div>+ </FlyoutHeader>- <div className="flex flex-1 flex-col gap-0.5 border-t border-border px-2.5 pb-2.5 pt-2">+ <FlyoutOptions className="flex flex-1 flex-col gap-0.5 border-t border-border px-2.5 pb-2.5 pt-2"><MenuActionlabel="Settings"icon={Settings}@@ -265,14 +272,14 @@ export function SidebarAccountMenu({<span className="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><LogOut className="size-4" /></span>- <span className="min-w-0 flex-1 truncate">+ <TruncatedText className="min-w-0 flex-1 truncate">{signOutMutation.isPending ? "Signing out..." : "Sign out"}- </span>+ </TruncatedText></button>) : null}<SidebarServerInfo />- </div>- </PopoverContent>+ </FlyoutOptions>+ </FlyoutContent></Popover>{!rail && !isCloud ? (<Tooltip>diff --git a/ui/src/components/SidebarCompanyMenu.tsx b/ui/src/components/SidebarCompanyMenu.tsxindex 3a9e95f533..c1072143bc 100644--- a/ui/src/components/SidebarCompanyMenu.tsx+++ b/ui/src/components/SidebarCompanyMenu.tsx@@ -41,12 +41,15 @@ import { queryKeys } from "@/lib/queryKeys";import { cn, SIDEBAR_RAIL_HIDDEN_LABEL } from "@/lib/utils";import { useSidebar } from "../context/SidebarContext";import { CompanyPatternIcon } from "./CompanyPatternIcon";+import { TruncatedText } from "./TruncatedText";+import { FlyoutHeader, FlyoutOptions } from "./ui/flyout";import { PluginOrganizationSwitcher } from "./PluginOrganizationSwitcher";interface SidebarCompanyMenuProps {open?: boolean;onOpenChange?: (open: boolean) => void;+ showChevron?: boolean;}const TRIGGER_WORKSPACE_ICON_CLASS = "size-5 shrink-0 rounded-md text-(length:--text-micro)";@@ -91,6 +94,7 @@ function SortableCompanyItem({return (<DropdownMenuItemref={setNodeRef}+ data-selected={isSelected || undefined}style={{transform: CSS.Transform.toString(transform),transition,@@ -111,13 +115,13 @@ function SortableCompanyItem({><WorkspaceIcon company={company} inPopover /><span className="min-w-0 flex-1">- <span className="block truncate font-medium leading-(--organization-popover-name-line-height)">+ <TruncatedText className="block truncate font-medium leading-(--organization-popover-name-line-height)">{company.name}- </span>+ </TruncatedText>{isEditing ? null : (- <span className="block truncate text-(length:--text-nano) leading-(--organization-popover-prefix-line-height) text-muted-foreground">+ <TruncatedText className="block truncate text-(length:--text-nano) leading-(--organization-popover-prefix-line-height) text-muted-foreground">{company.issuePrefix}- </span>+ </TruncatedText>)}</span>{isEditing ? (@@ -144,15 +148,15 @@ function SortableCompanyItem({);}-export function SidebarCompanyMenu(props: SidebarCompanyMenuProps = {}) {+export function SidebarCompanyMenu({ showChevron, ...props }: SidebarCompanyMenuProps = {}) {return (<PluginOrganizationSwitcher {...props}>- <BuiltinCompanyMenu {...props} />+ <BuiltinCompanyMenu {...props} showChevron={showChevron} /></PluginOrganizationSwitcher>);}-function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompanyMenuProps) {+function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange, showChevron = true }: SidebarCompanyMenuProps) {const [internalOpen, setInternalOpen] = useState(false);const [isEditingOrder, setIsEditingOrder] = useState(false);const { companies, selectedCompany, setSelectedCompanyId, companyListUnavailable, retryCompanies } =@@ -278,7 +282,8 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompacontrol (~142px on mobile, which hides it) — search moved tothe nav to buy that width. A name that stilltruncates stays hover-recoverable via title. */}- <span+ <TruncatedText+ marqueeResetKey={open}className={cn("min-w-0 truncate text-sm font-bold text-foreground",rail && SIDEBAR_RAIL_HIDDEN_LABEL,@@ -286,9 +291,9 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompatitle={currentName ?? undefined}>{currentName ?? `Select ${switcherNoun}`}- </span>+ </TruncatedText></span>- {!rail && <ChevronsUpDown className="size-3.5 shrink-0 text-muted-foreground" />}+ {!rail && showChevron && <ChevronsUpDown className="size-3.5 shrink-0 text-muted-foreground" />}</Button></DropdownMenuTrigger><DropdownMenuContent@@ -296,7 +301,7 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompasideOffset={8}className="ml-2 w-(--organization-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-border bg-popover p-0 shadow-(--shadow-profile-popover)">- <div className="flex h-(--organization-popover-header-height) items-center justify-between gap-2 px-3.5">+ <FlyoutHeader className="flex h-(--organization-popover-header-height) items-center justify-between gap-2 px-3.5"><DropdownMenuLabel className="p-0 text-(length:--text-compact) font-semibold text-foreground">Organizations</DropdownMenuLabel>@@ -311,8 +316,8 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompa>{isEditingOrder ? "Done" : "Edit"}</button>- </div>- <div className="flex max-h-96 flex-col gap-0.5 overflow-y-auto px-2.5 pb-2 pt-1">+ </FlyoutHeader>+ <FlyoutOptions className="flex max-h-96 flex-col gap-0.5 overflow-y-auto px-2.5 pb-2 pt-1"><DndContextsensors={sensors}collisionDetection={closestCenter}@@ -356,8 +361,8 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompa<DropdownMenuItem disabled>No organizations</DropdownMenuItem>)) : null}- </div>- <div className="flex flex-col gap-0.5 border-t border-border px-2.5 pb-2.5 pt-2">+ </FlyoutOptions>+ <FlyoutOptions className="flex flex-col gap-0.5 border-t border-border px-2.5 pb-2.5 pt-2">{!companyCreationManaged && (<DropdownMenuItemonClick={addCompany}@@ -367,7 +372,7 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompa<span className="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><Plus className="size-4" /></span>- <span className="min-w-0 flex-1 truncate">Create organization</span>+ <TruncatedText className="min-w-0 flex-1 truncate">Create organization</TruncatedText></DropdownMenuItem>)}{showInvitePeople ? (@@ -385,9 +390,9 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompa<span className="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><UserPlus className="size-4" /></span>- <span className="min-w-0 flex-1 truncate">+ <TruncatedText className="min-w-0 flex-1 truncate">{currentName ? `Invite people to ${currentName}` : "Invite people"}- </span>+ </TruncatedText></Link></DropdownMenuItem>) : null}@@ -400,12 +405,12 @@ function BuiltinCompanyMenu({ open: controlledOpen, onOpenChange }: SidebarCompa<span className="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><LogOut className="size-4" /></span>- <span className="min-w-0 flex-1 truncate">+ <TruncatedText className="min-w-0 flex-1 truncate">{signOutMutation.isPending ? "Signing out..." : "Sign out"}- </span>+ </TruncatedText></DropdownMenuItem>) : null}- </div>+ </FlyoutOptions></DropdownMenuContent></DropdownMenu>);diff --git a/ui/src/components/SidebarNavItem.tsx b/ui/src/components/SidebarNavItem.tsxindex efbcfa4e56..1542270e63 100644--- a/ui/src/components/SidebarNavItem.tsx+++ b/ui/src/components/SidebarNavItem.tsx@@ -6,6 +6,7 @@ import { useSidebar } from "../context/SidebarContext";import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";import type { LucideIcon } from "lucide-react";import { Badge } from "@/components/ui/badge";+import { TruncatedText } from "./TruncatedText";/*** Forces the full-label (non-rail) presentation for any `SidebarNavItem`@@ -167,7 +168,7 @@ export function SidebarNavItem({)}</span>) : null}- <span className={rail ? SIDEBAR_RAIL_HIDDEN_LABEL : cn("min-w-0 flex-1 truncate", labelClassName)}>{label}</span>+ <TruncatedText className={rail ? SIDEBAR_RAIL_HIDDEN_LABEL : cn("min-w-0 flex-1 truncate", labelClassName)}>{label}</TruncatedText>{!rail && trailing}{!rail && textBadge && (<Badge variant="ghost"diff --git a/ui/src/components/SidebarSection.tsx b/ui/src/components/SidebarSection.tsxindex 34c7f8d8bc..94ae059d51 100644--- a/ui/src/components/SidebarSection.tsx+++ b/ui/src/components/SidebarSection.tsx@@ -88,7 +88,7 @@ function SidebarSectionHeader({"h-5 w-5 shrink-0 text-muted-foreground/60 transition-opacity hover:text-foreground data-[state=open]:opacity-100",headerControlVisibilityClassName,);- const headerContent = <span className={labelClassName}>{label}</span>;+ const headerContent = <span data-slot="sidebar-group-label" className={labelClassName}>{label}</span>;const HeaderActionIcon = headerAction?.icon;const headingControl = hasMenu ? (diff --git a/ui/src/components/SidebarShell.test.tsx b/ui/src/components/SidebarShell.test.tsxindex b4571b8195..97163cd941 100644--- a/ui/src/components/SidebarShell.test.tsx+++ b/ui/src/components/SidebarShell.test.tsx@@ -109,6 +109,31 @@ describe("SidebarShell", () => {expect(indicator?.className).toContain("group-focus-visible:bg-ring");});+ it("restores and persists the default width on double-click, then resizes from that width", () => {+ window.localStorage.setItem("test.sidebar.width", "320");+ window.localStorage.setItem("other.sidebar.width", "400");+ act(() => {+ root.render(<SidebarShell open resizable storageKey="test.sidebar.width"><div>Sidebar</div></SidebarShell>);+ });+ const separator = handle()!;+ separator.setPointerCapture = vi.fn();+ act(() => {+ separator.dispatchEvent(new MouseEvent("dblclick", { bubbles: true }));+ });+ expect(spacer().style.width).toBe("240px");+ expect(panel().style.width).toBe("240px");+ expect(separator.getAttribute("aria-valuenow")).toBe("240");+ expect(window.localStorage.getItem("test.sidebar.width")).toBe("240");+ expect(window.localStorage.getItem("other.sidebar.width")).toBe("400");+ act(() => {+ separator.dispatchEvent(pointerEvent("pointerdown", 240));+ separator.dispatchEvent(pointerEvent("pointermove", 272));+ separator.dispatchEvent(pointerEvent("pointerup", 272));+ });+ expect(panel().style.width).toBe("272px");+ expect(window.localStorage.getItem("test.sidebar.width")).toBe("272");+ });+it("supports keyboard resizing and clamps to the configured bounds", () => {act(() => {root.render(diff --git a/ui/src/components/SidebarShell.tsx b/ui/src/components/SidebarShell.tsxindex 9834434c0b..fb67580ebc 100644--- a/ui/src/components/SidebarShell.tsx+++ b/ui/src/components/SidebarShell.tsx@@ -11,6 +11,7 @@ import {type ReactNode,} from "react";import { cn } from "@/lib/utils";+import { usePaneWidthReset } from "@/hooks/usePaneWidthReset";const DEFAULT_SIDEBAR_WIDTH = 240;const MIN_SIDEBAR_WIDTH = 208;@@ -86,7 +87,7 @@ type SidebarShellProps = {** Opening/closing is intentionally instant (no width transition): the pin toggle* and peek snap between rail and expanded widths so the content never appears to- * slide. Resizing the drag handle is likewise direct.+ * slide. Resizing the drag handle is likewise direct; only double-click reset animates.*/export function SidebarShell({children,@@ -103,14 +104,19 @@ export function SidebarShell({}: SidebarShellProps) {const [width, setWidth] = useState(() => readStoredSidebarWidth(storageKey));const [isResizing, setIsResizing] = useState(false);+ const shellRef = useRef<HTMLDivElement>(null);+ const { resetting, startReset, cancelReset, onResetTransitionEnd } = usePaneWidthReset();const widthRef = useRef(width);const dragState = useRef<{ startX: number; startWidth: number } | null>(null);useEffect(() => {+ cancelReset();const storedWidth = readStoredSidebarWidth(storageKey);widthRef.current = storedWidth;setWidth(storedWidth);- }, [storageKey]);+ }, [storageKey, cancelReset]);++ useEffect(() => { cancelReset(); }, [open, collapsed, peeking, cancelReset]);// Unified width function (plan §5): one code path for every pinned state.const expandedWidth = open ? width : 0;@@ -132,13 +138,15 @@ export function SidebarShell({);const commitWidth = useCallback(- (nextWidth: number) => {+ (nextWidth: number, animate = false) => {+ if (animate) startReset();+ else cancelReset();const clamped = clampSidebarWidth(nextWidth);widthRef.current = clamped;setWidth(clamped);writeStoredSidebarWidth(storageKey, clamped);},- [storageKey],+ [storageKey, startReset, cancelReset],);const handlePointerDown = useCallback(@@ -146,11 +154,15 @@ export function SidebarShell({if (!canResize) return;event.preventDefault();+ const startWidth = resetting ? shellRef.current!.getBoundingClientRect().width : widthRef.current;+ cancelReset();+ widthRef.current = startWidth;+ setWidth(startWidth);event.currentTarget.setPointerCapture(event.pointerId);- dragState.current = { startX: event.clientX, startWidth: widthRef.current };+ dragState.current = { startX: event.clientX, startWidth };setIsResizing(true);},- [canResize],+ [canResize, resetting, cancelReset],);const handlePointerMove = useCallback(@@ -176,13 +188,14 @@ export function SidebarShell({const handleKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {if (!canResize) return;+ const currentWidth = resetting ? shellRef.current!.getBoundingClientRect().width : width;if (event.key === "ArrowLeft") {event.preventDefault();- commitWidth(width - SIDEBAR_WIDTH_STEP);+ commitWidth(currentWidth - SIDEBAR_WIDTH_STEP);} else if (event.key === "ArrowRight") {event.preventDefault();- commitWidth(width + SIDEBAR_WIDTH_STEP);+ commitWidth(currentWidth + SIDEBAR_WIDTH_STEP);} else if (event.key === "Home") {event.preventDefault();commitWidth(MIN_SIDEBAR_WIDTH);@@ -191,14 +204,15 @@ export function SidebarShell({commitWidth(MAX_SIDEBAR_WIDTH);}},- [canResize, commitWidth, width],+ [canResize, commitWidth, width, resetting],);return (- <div className={cn("relative h-full shrink-0", className)} style={reservedStyle}>+ <div ref={shellRef} className={cn("sidebar-shell relative h-full shrink-0", className)} style={reservedStyle}+ data-width-resetting={resetting && canResize && !isResizing || undefined} onTransitionEnd={onResetTransitionEnd}><divclassName={cn(- "absolute inset-y-0 left-0 flex flex-col overflow-hidden",+ "sidebar-shell-panel absolute inset-y-0 left-0 flex flex-col overflow-hidden",// Open/close is instant (PAP-10676): no width transition so the rail and// expanded states snap without any sliding motion.// Overlay styling only while the panel is wider than its reserved@@ -226,13 +240,14 @@ export function SidebarShell({aria-valuenow={width}tabIndex={0}data-dragging={isResizing ? "" : undefined}- className="group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none"+ className="pane-resize-handle group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none"style={{ right: -4, width: 8 }}onPointerDown={handlePointerDown}onPointerMove={handlePointerMove}onPointerUp={endResize}onPointerCancel={endResize}onLostPointerCapture={endResize}+ onDoubleClick={() => commitWidth(DEFAULT_SIDEBAR_WIDTH, true)}onKeyDown={handleKeyDown}><divdiff --git a/ui/src/components/StatusIcon.tsx b/ui/src/components/StatusIcon.tsxindex 30f90f0401..f82fd10207 100644--- a/ui/src/components/StatusIcon.tsx+++ b/ui/src/components/StatusIcon.tsx@@ -66,6 +66,12 @@ function blockedAttentionLabel(blockerAttention: IssueBlockerAttention | null |return "Blocked";}+/** Shared accessible/tooltip copy, including waiting and covered-blocker states. */+export function getStatusIconLabel(status: string, externalConversationState?: "active" | "waiting" | null, blockerAttention?: IssueBlockerAttention | null): string {+ const displayStatus = status === "in_review" && externalConversationState === "waiting" ? "idle" : status;+ return status === "blocked" ? blockedAttentionLabel(blockerAttention) : statusLabel(displayStatus);+}+/*** Task/issue status indicator — renders the unified, color-blind-safe* {@link StatusGlyph} (one distinct shape per status). With `onChange` it also@@ -82,7 +88,7 @@ export function StatusIcon({ status, externalConversationState, blockerAttentionconst [open, setOpen] = useState(false);const displayStatus = status === "in_review" && externalConversationState === "waiting" ? "idle" : status;const isCoveredBlocked = status === "blocked" && blockerAttention?.state === "covered";- const ariaLabel = status === "blocked" ? blockedAttentionLabel(blockerAttention) : statusLabel(displayStatus);+ const ariaLabel = getStatusIconLabel(status, externalConversationState, blockerAttention);const glyphStatus = isCoveredBlocked ? "in_queue" : displayStatus;const glyphIcon = (diff --git a/ui/src/components/TabBar.tsx b/ui/src/components/TabBar.tsxnew file mode 100644index 0000000000..f983e42134--- /dev/null+++ b/ui/src/components/TabBar.tsx@@ -0,0 +1,38 @@+import type { ReactNode } from "react";+import { ToggleGroup } from "radix-ui";+import { TabsList, TabsTrigger } from "./ui/tabs";+import { cn } from "@/lib/utils";++export type TabSize = "compact" | "standard";+export interface TabBarItem<T extends string = string> {+ value: T;+ label: ReactNode;+ disabled?: boolean;+}+interface TabBarProps {+ items: readonly TabBarItem[];+ size?: TabSize;+ label?: string;+ className?: string;+}++/** Canonical content tabs. Compose inside Tabs with matching TabsContent panels. */+export function TabBar({ items, size = "standard", label, className }: TabBarProps) {+ return <TabsList variant="line" data-canonical-tabs={size} aria-label={label} className={cn("canonical-tab-list", className)}>+ {items.map(item => <TabsTrigger key={item.value} value={item.value} disabled={item.disabled} className="canonical-tab">{item.label}</TabsTrigger>)}+ </TabsList>;+}++/** Same two visual sizes for collection filters; radio choices are not panels. */+export function TabFilters<T extends string>({ items, value, onValueChange, size = "standard", label, className }: {+ items: readonly TabBarItem<T>[];+ value: T;+ onValueChange: (value: T) => void;+ size?: TabSize;+ label: string;+ className?: string;+}) {+ return <ToggleGroup.Root type="single" value={value} onValueChange={next => { if (next) onValueChange(next as T); }} data-canonical-tabs={size} aria-label={label} className={cn("canonical-tab-list", className)}>+ {items.map(item => <ToggleGroup.Item key={item.value} value={item.value} disabled={item.disabled} className="canonical-tab">{item.label}</ToggleGroup.Item>)}+ </ToggleGroup.Root>;+}diff --git a/ui/src/components/TaskChatThread.test.tsx b/ui/src/components/TaskChatThread.test.tsxindex 90ab8e828b..42faadcedf 100644--- a/ui/src/components/TaskChatThread.test.tsx+++ b/ui/src/components/TaskChatThread.test.tsx@@ -4145,7 +4145,7 @@ describe("TaskChatThread live transcript", () => {expect(tail!.textContent).toContain("Syncing workspace to environment");expect(tail!.textContent).not.toContain("Waiting for transcript...");- // Without a runtime status, the generic wait message still shows.+ // Without a runtime status, the working indicator remains the only visible activity.renderThread({comments: [],onAdd: async () => {},@@ -4155,7 +4155,8 @@ describe("TaskChatThread live transcript", () => {const tail2 = container.querySelector('[data-testid="task-chat-live-transcript"]',);- expect(tail2!.textContent).toContain("Waiting for transcript...");+ expect(tail2!.textContent).toContain("Working");+ expect(tail2!.textContent).not.toContain("Waiting for transcript...");});it("does not send a workspace bootstrap failure to connection settings", () => {diff --git a/ui/src/components/TaskChatThread.tsx b/ui/src/components/TaskChatThread.tsxindex 3c95db5532..40dced3211 100644--- a/ui/src/components/TaskChatThread.tsx+++ b/ui/src/components/TaskChatThread.tsx@@ -1,3 +1,4 @@+import { TaskChatShimmerScope } from "@/components/task-chat/TaskChatShimmer";import {ISSUE_DETAIL_CONTENT_PAINT_MARK,ISSUE_DETAIL_CONTENT_MEASURE,@@ -3125,7 +3126,7 @@ export function TaskChatThread(props: TaskChatThreadProps) {}/>) : (- <>+ <TaskChatShimmerScope items={tailItems}><TaskChatLiveRunPillstatus={tailStatus}execution={@@ -3152,7 +3153,7 @@ export function TaskChatThread(props: TaskChatThreadProps) {: "Waiting for transcript...")}/>- </>+ </TaskChatShimmerScope>)}</div>) : null}diff --git a/ui/src/components/TaskList.tsx b/ui/src/components/TaskList.tsxnew file mode 100644index 0000000000..8b040b782f--- /dev/null+++ b/ui/src/components/TaskList.tsx@@ -0,0 +1,130 @@+import { Fragment, useState, type ReactNode } from "react";+import type { Issue } from "@paperclipai/shared";+import { ChevronDown, ChevronRight, GitBranch } from "lucide-react";+import { buildIssueTree } from "../lib/issue-tree";+import { issueFilterLabel } from "../lib/issue-filters";+import { allTaskListColumns, defaultTaskListColumns, defaultTaskListSort, sortTaskListItems, type TaskListColumnId, type TaskListSort } from "../lib/task-list";+import { timeAgo } from "../lib/timeAgo";+import { IssueRow, type IssueRowDensity } from "./IssueRow";+import { IssueGroupHeader } from "./IssueGroupHeader";+import { TaskListColumnHeader, TaskListColumnSettings, TaskListViewport } from "./TaskListColumns";+import { TaskRowGroup } from "./TaskRowGroup";+import { Badge } from "./ui/badge";+import { Button } from "./ui/button";++export type TaskListItem = {+ issue: Issue;+ unread?: boolean;+ createdBy?: string | null;+ assignee?: string | null;+};++export type TaskListGrouping = "none" | "status" | "project";++/** Keep matching subtasks in their hierarchy without pulling in unrelated siblings. */+export function includeTaskListAncestors(items: readonly TaskListItem[], matches: readonly TaskListItem[]): TaskListItem[] {+ const byId = new Map(items.map(item => [item.issue.id, item]));+ const included = new Set<string>();+ for (const match of matches) {+ let item: TaskListItem | undefined = match;+ while (item && !included.has(item.issue.id)) {+ included.add(item.issue.id);+ item = item.issue.parentId ? byId.get(item.issue.parentId) : undefined;+ }+ }+ return items.filter(item => included.has(item.issue.id));+}++/** Opt-in collection built from the reviewed row, hierarchy and column primitives. */+export function TaskList({ items, allItems = items, initialColumns = defaultTaskListColumns, density = "comfortable", collapsedIds, onCollapsedIdsChange, groupBy = "none", emptyState }: {+ items: readonly TaskListItem[];+ allItems?: readonly TaskListItem[];+ initialColumns?: readonly TaskListColumnId[];+ density?: IssueRowDensity;+ collapsedIds?: ReadonlySet<string>;+ onCollapsedIdsChange?: (ids: ReadonlySet<string>) => void;+ groupBy?: TaskListGrouping;+ emptyState?: ReactNode;+}) {+ const [columns, setColumns] = useState(initialColumns);+ const [columnOrder, setColumnOrder] = useState(allTaskListColumns);+ const [sort, setSort] = useState<TaskListSort>();+ const [localCollapsed, setLocalCollapsed] = useState<ReadonlySet<string>>(new Set());+ const collapsed = collapsedIds ?? localCollapsed;+ const setCollapsed = onCollapsedIdsChange ?? setLocalCollapsed;+ const byId = new Map(allItems.map(item => [item.issue.id, item]));+ const visibleById = new Map(items.map(item => [item.issue.id, item]));+ const sortValue = (issue: Issue, column: TaskListColumnId) => {+ const item = byId.get(issue.id)!;+ const parent = issue.parentId ? byId.get(issue.parentId)?.issue : null;+ switch (column) {+ case "task": return issue.title;+ case "taskId": return issue.identifier;+ case "createdBy": return item.createdBy;+ case "assignee": return item.assignee;+ case "project": return issue.project?.name;+ case "parentTask": return parent ? `${parent.identifier} ${parent.title}` : null;+ case "tags": return issue.labels?.map(label => label.name).sort().join(", ");+ case "worktree": return issue.currentExecutionWorkspace?.branchName;+ case "lastUpdated": return new Date(issue.updatedAt).getTime();+ }+ };+ const { roots, childMap } = buildIssueTree(sortTaskListItems(items.map(item => item.issue), sort ?? defaultTaskListSort, sortValue));+ const updateColumns = (next: readonly TaskListColumnId[]) => {+ setColumns(next);+ if (sort && !next.includes(sort.column)) setSort(undefined);+ };+ const renderBranch = (issue: Issue, depth: number): ReactNode => {+ const item = visibleById.get(issue.id)!;+ const children = childMap.get(issue.id) ?? [];+ const expanded = !collapsed.has(issue.id);+ const parent = issue.parentId ? byId.get(issue.parentId)?.issue : null;+ const branch = issue.currentExecutionWorkspace?.branchName;+ return (+ <Fragment key={issue.id}>+ <IssueRow+ issue={issue} presentation="task" appearance="refreshed" density={density}+ unreadState={item.unread ? "visible" : "hidden"}+ treeGuides={depth} chevronInGuide={depth > 0 && children.length > 0}+ leadingControl={children.length ? (+ <Button variant="ghost" size="icon-xs" className="task-row-disclosure" aria-label={`${expanded ? "Collapse" : "Expand"} ${issue.title}`} aria-expanded={expanded} onClick={() => {+ const next = new Set(collapsed);+ if (next.has(issue.id)) next.delete(issue.id); else next.add(issue.id);+ setCollapsed(next);+ }}>{expanded ? <ChevronDown aria-hidden /> : <ChevronRight aria-hidden />}</Button>+ ) : undefined}+ columnValues={{+ createdBy: item.createdBy,+ assignee: item.assignee ?? "Unassigned",+ project: issue.project?.name,+ parentTask: parent ? <span><span className="font-mono">{parent.identifier}</span> {parent.title}</span> : undefined,+ tags: issue.labels?.length ? <span className="inline-flex items-center gap-1">{issue.labels.map(label => <Badge key={label.id} variant="secondary" className="shrink-0 px-1.5 py-0">{label.name}</Badge>)}</span> : undefined,+ worktree: branch ? <span className="inline-flex items-center gap-1.5"><GitBranch className="size-3 shrink-0" aria-hidden />{branch}</span> : undefined,+ lastUpdated: timeAgo(issue.updatedAt),+ }}+ />+ {expanded ? children.map(child => renderBranch(child, depth + 1)) : null}+ </Fragment>+ );+ };+ const groups = new Map<string, Issue[]>();+ for (const root of roots) {+ const label = groupBy === "status" ? issueFilterLabel(root.status) : groupBy === "project" ? root.project?.name ?? "No project" : "";+ groups.set(label, [...(groups.get(label) ?? []), root]);+ }+ return (+ <TaskListViewport visibleColumns={columns} columnOrder={columnOrder} controls={<TaskListColumnSettings visibleColumns={columns} onVisibleColumnsChange={updateColumns} onColumnOrderChange={setColumnOrder} onResetDefaults={() => setSort(undefined)} />}>+ <TaskListColumnHeader sort={sort} onSortChange={setSort} onColumnOrderChange={setColumnOrder} />+ {items.length === 0 ? emptyState : (+ <div aria-label={`${density} task list`}>+ {[...groups].map(([label, groupRoots]) => (+ <Fragment key={label}>+ {label ? <IssueGroupHeader label={label} className="task-list-group-heading" trailing={<span className="text-xs text-muted-foreground">{groupRoots.length}</span>} /> : null}+ {groupRoots.map(issue => <TaskRowGroup key={issue.id} role="rowgroup" aria-label={`${issue.title} task group`}>{renderBranch(issue, 0)}</TaskRowGroup>)}+ </Fragment>+ ))}+ </div>+ )}+ </TaskListViewport>+ );+}diff --git a/ui/src/components/TaskListColumns.tsx b/ui/src/components/TaskListColumns.tsxnew file mode 100644index 0000000000..d1dd128f52--- /dev/null+++ b/ui/src/components/TaskListColumns.tsx@@ -0,0 +1,192 @@+import { createContext, useContext, useId, type CSSProperties, type ReactNode } from "react";+import { DndContext, PointerSensor, closestCenter, pointerWithin, useSensor, useSensors } from "@dnd-kit/core";+import { SortableContext, horizontalListSortingStrategy, useSortable } from "@dnd-kit/sortable";+import { CSS } from "@dnd-kit/utilities";+import { ArrowDown, ArrowUp, Ellipsis } from "lucide-react";+import { Button } from "./ui/button";+import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "./ui/dropdown-menu";+import { allTaskListColumns, defaultTaskListColumns, reorderTaskListColumns, taskListColumnStart, taskListColumns, type TaskListColumnId, type TaskListSort } from "../lib/task-list";+import { CellMarquee } from "./CellMarquee";+import { FlyoutAppearanceProvider, FlyoutHeader, FlyoutOptions } from "./ui/flyout";+import { useHorizontalScrollEdges } from "@/hooks/useHorizontalScrollEdges";++export { taskListColumns } from "../lib/task-list";+export type { TaskListColumnId, TaskListSort } from "../lib/task-list";++const ColumnContext = createContext({ columns: defaultTaskListColumns, order: allTaskListColumns });+export const useTaskListColumns = () => useContext(ColumnContext).columns;++function columnLayout(visibleColumns: readonly TaskListColumnId[], hasControls: boolean): CSSProperties {+ const columns = visibleColumns.map(id => taskListColumns.find(column => column.id === id)!);+ const hasTitle = visibleColumns.includes("task");+ const leadingWidth = hasTitle ? "var(--task-list-column-status)" : "var(--task-row-control-size)";+ const widths = columns.flatMap(column => column.id === "task" ? [leadingWidth, "var(--task-list-column-title-min)"] : [column.width]);+ const tracks = columns.flatMap(column => column.id === "task" ? [leadingWidth, "minmax(var(--task-list-column-title-min), 1fr)"] : [column.width]);+ if (!hasTitle) { widths.unshift(leadingWidth); tracks.unshift(`minmax(${leadingWidth}, 1fr)`); }+ return {+ "--task-list-columns": tracks.join(" "),+ "--task-list-task-start": hasTitle ? taskListColumnStart(visibleColumns, "task") : 1,+ "--task-list-min-width": `calc(${widths.join(" + ")} + var(--task-row-gap) * ${widths.length - 1} + var(--task-row-padding-inline) * 2${hasControls ? " + var(--task-list-controls-width)" : ""})`,+ "--task-list-controls-space": hasControls ? "var(--task-list-controls-width)" : "var(--task-list-no-controls-space)",+ } as CSSProperties;+}++/** Shared collection viewport: fades only the edges with content beyond them. */+export function TaskListViewport({ children, visibleColumns = defaultTaskListColumns, columnOrder = allTaskListColumns, controls }: {+ children: ReactNode;+ visibleColumns?: readonly TaskListColumnId[];+ columnOrder?: readonly TaskListColumnId[];+ controls?: ReactNode;+}) {+ const { scrollRef, contentRef, edges } = useHorizontalScrollEdges();+ const orderedColumns = columnOrder.filter(id => visibleColumns.includes(id));++ return (+ <ColumnContext.Provider value={{ columns: orderedColumns, order: columnOrder }}>+ <div role="table" aria-label="Task list" data-slot="task-list-viewport" data-overflow-left={edges.left} data-overflow-right={edges.right} className="task-list-viewport" style={columnLayout(orderedColumns, Boolean(controls))}>+ <div ref={scrollRef} role="region" aria-label="Task list columns" tabIndex={0} className="task-list-columns-scroll">+ <div ref={contentRef} className="task-list-columns-content">{children}</div>+ </div>+ {controls ? <div className="task-list-header-controls">{controls}</div> : null}+ </div>+ </ColumnContext.Provider>+ );+}++const detailColumns = taskListColumns.filter(column => column.id !== "task");+type DetailColumn = Exclude<(typeof detailColumns)[number]["id"], "taskId">;++/** Values are resolved by the collection; identity columns intentionally accept names only. */+export type TaskRowColumnValues = Partial<Record<Exclude<DetailColumn, "createdBy" | "assignee">, ReactNode>> & {+ createdBy?: string | null;+ assignee?: string | null;+};++function SortableColumnHeader({ id, label, start, sort, onSortChange, onColumnOrderChange, helpId }: {+ id: TaskListColumnId;+ label: string;+ start: number;+ sort?: TaskListSort;+ onSortChange?: (sort: TaskListSort) => void;+ onColumnOrderChange?: (columns: readonly TaskListColumnId[]) => void;+ helpId: string;+}) {+ const { columns, order } = useContext(ColumnContext);+ const sortable = useSortable({ id, disabled: !onColumnOrderChange, transition: null });+ const active = sort?.column === id;+ const direction = active && sort.direction === "ascending" ? "descending" : "ascending";+ return (+ <span+ ref={sortable.setNodeRef}+ role="columnheader"+ data-column={id}+ data-dragging={sortable.isDragging || undefined}+ aria-colspan={id === "task" ? 2 : undefined}+ aria-sort={active ? sort.direction : "none"}+ style={{+ gridColumn: `${start} / span ${id === "task" ? 2 : 1}`,+ transform: sortable.transform ? CSS.Translate.toString({ ...sortable.transform, y: 0 }) : undefined,+ }}+ >+ {onSortChange || onColumnOrderChange ? (+ <Button+ ref={sortable.setActivatorNodeRef}+ {...sortable.attributes}+ {...sortable.listeners}+ type="button" variant="ghost" size="sm" className="task-list-sort-button"+ data-active={active || undefined} data-reorderable={Boolean(onColumnOrderChange)}+ aria-label={onSortChange ? `${label}: sort ${direction}` : label}+ aria-describedby={onColumnOrderChange ? helpId : undefined}+ aria-keyshortcuts={onColumnOrderChange ? "Alt+ArrowLeft Alt+ArrowRight" : undefined}+ onClick={() => onSortChange?.({ column: id, direction })}+ onKeyDown={event => {+ if (!onColumnOrderChange || !event.altKey || !["ArrowLeft", "ArrowRight"].includes(event.key)) return;+ event.preventDefault();+ const target = columns[columns.indexOf(id) + (event.key === "ArrowLeft" ? -1 : 1)];+ if (target) onColumnOrderChange(reorderTaskListColumns(order, id, target));+ }}+ >+ <span>{label}</span>+ {active ? sort.direction === "ascending"+ ? <ArrowUp className="size-3" data-slot="task-list-sort-direction" aria-hidden />+ : <ArrowDown className="size-3" data-slot="task-list-sort-direction" aria-hidden /> : null}+ </Button>+ ) : label}+ </span>+ );+}++export function TaskListColumnHeader({ sort, onSortChange, onColumnOrderChange }: {+ sort?: TaskListSort;+ onSortChange?: (sort: TaskListSort) => void;+ onColumnOrderChange?: (columns: readonly TaskListColumnId[]) => void;+}) {+ const { columns, order } = useContext(ColumnContext);+ const helpId = useId();+ const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 6 } }));+ return (+ <DndContext sensors={sensors} collisionDetection={args => {+ const targets = pointerWithin(args);+ return targets.length ? targets : closestCenter(args);+ }} onDragEnd={({ active, over }) => {+ if (over) onColumnOrderChange?.(reorderTaskListColumns(order, active.id as TaskListColumnId, over.id as TaskListColumnId));+ }} accessibility={{ screenReaderInstructions: { draggable: "Click to sort. Drag horizontally to reorder, or use Alt plus Left or Right Arrow." } }}>+ <span id={helpId} className="sr-only">Drag to reorder columns, or use Alt plus Left or Right Arrow. Click to sort.</span>+ <SortableContext items={[...columns]} strategy={horizontalListSortingStrategy}>+ <div role="row" data-slot="task-list-column-header" className="task-list-column-header">+ {!columns.includes("task") ? <span role="columnheader" aria-label="Task hierarchy" /> : null}+ {columns.map(id => <SortableColumnHeader key={id} id={id} label={taskListColumns.find(column => column.id === id)!.label} start={taskListColumnStart(columns, id)} sort={sort} onSortChange={onSortChange} onColumnOrderChange={onColumnOrderChange} helpId={helpId} />)}+ </div>+ </SortableContext>+ </DndContext>+ );+}++/** Compact refresh variant; the existing inbox picker uses legacy column IDs. */+export function TaskListColumnSettings({ visibleColumns, onVisibleColumnsChange, onColumnOrderChange, onResetDefaults }: {+ visibleColumns: readonly TaskListColumnId[];+ onVisibleColumnsChange: (columns: readonly TaskListColumnId[]) => void;+ onColumnOrderChange?: (columns: readonly TaskListColumnId[]) => void;+ onResetDefaults?: () => void;+}) {+ const { order } = useContext(ColumnContext);+ return (+ <FlyoutAppearanceProvider><DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button type="button" variant="ghost" size="icon-xs" className="task-list-settings-trigger" aria-label="Columns"><Ellipsis aria-hidden /></Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end" className="task-list-options" aria-label="Columns">+ <DropdownMenuLabel asChild><FlyoutHeader className="task-list-options-heading">Columns</FlyoutHeader></DropdownMenuLabel>+ <FlyoutOptions className="task-list-options-items">+ {order.map(id => (+ <DropdownMenuCheckboxItem+ key={id}+ className="task-list-options-item"+ checked={visibleColumns.includes(id)}+ disabled={visibleColumns.length === 1 && visibleColumns.includes(id)}+ onSelect={event => event.preventDefault()}+ onCheckedChange={checked => onVisibleColumnsChange(order.filter(column => column === id ? checked === true : visibleColumns.includes(column)))}+ >+ {taskListColumns.find(column => column.id === id)!.label}+ </DropdownMenuCheckboxItem>+ ))}+ <DropdownMenuItem className="task-list-options-reset" onSelect={event => { event.preventDefault(); onColumnOrderChange?.(allTaskListColumns); onVisibleColumnsChange(defaultTaskListColumns); onResetDefaults?.(); }}>Reset defaults</DropdownMenuItem>+ </FlyoutOptions>+ </DropdownMenuContent>+ </DropdownMenu></FlyoutAppearanceProvider>+ );+}++export function TaskRowColumnCells({ identifier, values }: { identifier: string; values: TaskRowColumnValues }) {+ const columns = useTaskListColumns();+ if (!detailColumns.some(column => columns.includes(column.id))) return null;+ return (+ <span data-slot="task-row-columns" className="task-row-columns">+ {columns.filter(id => id !== "task").map(id => (+ <span key={id} role="cell" data-column={id} data-marquee-cell={id} className="task-row-column" style={{ gridColumn: taskListColumnStart(columns, id) }}>+ <CellMarquee cell={id}>{id === "taskId" ? identifier : values[id] ?? "—"}</CellMarquee>+ </span>+ ))}+ </span>+ );+}diff --git a/ui/src/components/TaskListToolbar.tsx b/ui/src/components/TaskListToolbar.tsxnew file mode 100644index 0000000000..6432a888f3--- /dev/null+++ b/ui/src/components/TaskListToolbar.tsx@@ -0,0 +1,49 @@+import type { ComponentProps, Ref } from "react";+import { ChevronDown, CirclePlus, Columns3, List, ListTree } from "lucide-react";+import { IssueFiltersPopover } from "./IssueFiltersPopover";+import { Button } from "./ui/button";+import { ToolbarSearch } from "./ToolbarSearch";+import { FlyoutHeader, FlyoutOptions } from "./ui/flyout";+import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./ui/dropdown-menu";+import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";+import { taskListViews as views, type TaskListView } from "@/lib/task-list-views";++/** Canonical proposed task toolbar; review under Components / Toolbars / Tasks. */+export function TaskListToolbar({ view, onViewChange, query, onQueryChange, searchRef, layout, onLayoutChange, allExpanded, onToggleExpanded, onNewTask, filters }: {+ view: TaskListView;+ onViewChange: (view: TaskListView) => void;+ query: string;+ onQueryChange: (query: string) => void;+ searchRef?: Ref<HTMLInputElement>;+ layout: "list" | "board";+ onLayoutChange: (layout: "list" | "board") => void;+ allExpanded: boolean;+ onToggleExpanded: () => void;+ onNewTask: () => void;+ filters: ComponentProps<typeof IssueFiltersPopover>;+}) {+ return (+ <div data-canonical-toolbar="tasks" className="design-page-toolbar" role="toolbar" aria-label="Task list controls">+ <DropdownMenu>+ <DropdownMenuTrigger asChild><Button variant="outline" className="design-toolbar-button design-view-trigger" aria-label={`Task view: ${views.find(option => option.value === view)!.label}`}>{views.find(option => option.value === view)!.label}<ChevronDown aria-hidden /></Button></DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="task-list-options" aria-label="Task views">+ <DropdownMenuLabel asChild><FlyoutHeader className="task-list-options-heading">Views</FlyoutHeader></DropdownMenuLabel>+ <DropdownMenuRadioGroup asChild value={view} onValueChange={value => onViewChange(value as TaskListView)}><FlyoutOptions className="task-list-options-items">+ {views.map(option => <DropdownMenuRadioItem className="task-list-options-item" key={option.value} value={option.value}>{option.label}</DropdownMenuRadioItem>)}+ </FlyoutOptions></DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ <ToolbarSearch query={query} onQueryChange={onQueryChange} inputRef={searchRef} label="Search tasks" placeholder="Search tasks…" />+ <div className="design-view-toggle" role="group" aria-label="Task layout">+ {[{ value: "list", label: "List view", icon: List }, { value: "board", label: "Board view", icon: Columns3 }].map(({ value, label, icon: Icon }) => (+ <Tooltip key={value}><TooltipTrigger asChild><Button variant="ghost" className="design-toolbar-button design-toolbar-icon" aria-label={label} aria-pressed={layout === value} onClick={() => onLayoutChange(value as "list" | "board")}><Icon aria-hidden /></Button></TooltipTrigger><TooltipContent>{label}</TooltipContent></Tooltip>+ ))}+ </div>+ <div className="design-toolbar-actions">+ <Tooltip><TooltipTrigger asChild><Button variant="outline" className="design-toolbar-button design-toolbar-icon" disabled={layout !== "list"} aria-label={allExpanded ? "Collapse all tasks" : "Expand all tasks"} onClick={onToggleExpanded}><ListTree aria-hidden /></Button></TooltipTrigger><TooltipContent>{allExpanded ? "Collapse all tasks" : "Expand all tasks"}</TooltipContent></Tooltip>+ <div className="design-toolbar-filter"><IssueFiltersPopover {...filters} presentation="refreshed" buttonVariant="outline" iconOnly enableExternalObjectFilters={false} /></div>+ <Button className="design-toolbar-button design-new-task" onClick={onNewTask}><CirclePlus aria-hidden />New Task</Button>+ </div>+ </div>+ );+}diff --git a/ui/src/components/TaskRowGroup.tsx b/ui/src/components/TaskRowGroup.tsxnew file mode 100644index 0000000000..8b416a03c8--- /dev/null+++ b/ui/src/components/TaskRowGroup.tsx@@ -0,0 +1,18 @@+import type { ComponentProps } from "react";+import { cn } from "../lib/utils";++/**+ * One root task and its visible descendants. The group owns the outer dividers;+ * IssueRow owns indentation and vertical guides, with no interior separators.+ * Render separate groups as adjacent siblings to share their boundary line.+ */+export function TaskRowGroup({ className, ...props }: ComponentProps<"div">) {+ return (+ <div+ data-slot="task-row-group"+ role="group"+ className={cn("task-row-group", className)}+ {...props}+ />+ );+}diff --git a/ui/src/components/TaskSummaryList.tsx b/ui/src/components/TaskSummaryList.tsxnew file mode 100644index 0000000000..5a6ab7df0f--- /dev/null+++ b/ui/src/components/TaskSummaryList.tsx@@ -0,0 +1,22 @@+import type { Issue } from "@paperclipai/shared";+import { timeAgo } from "@/lib/timeAgo";+import { IssueRow } from "./IssueRow";++/** Flat, read-style summary of caller-ordered tasks. Reuses the canonical row's+ * navigation, status tooltip, hover, focus and cell-local marquee. Rendering a+ * summary never changes the task's actual read state. */+export function TaskSummaryList({ issues, label = "Recent tasks", showIdentifier = true, showUpdated = true, issueLinkState }: {+ issues: readonly Issue[];+ label?: string;+ showIdentifier?: boolean;+ showUpdated?: boolean;+ issueLinkState?: unknown;+}) {+ return <ul className="task-summary-list" aria-label={label}>+ {issues.map(issue => <li key={issue.id}>+ <IssueRow issue={issue} presentation="task" appearance="refreshed" density="comfortable"+ className="task-summary-row" unreadState="hidden" showIdentifier={showIdentifier}+ trailingMeta={showUpdated ? timeAgo(issue.updatedAt) : undefined} issueLinkState={issueLinkState} />+ </li>)}+ </ul>;+}diff --git a/ui/src/components/ToolbarSearch.tsx b/ui/src/components/ToolbarSearch.tsxnew file mode 100644index 0000000000..d8be76b76a--- /dev/null+++ b/ui/src/components/ToolbarSearch.tsx@@ -0,0 +1,21 @@+import type { Ref } from "react";+import { Search, X } from "lucide-react";+import { Button } from "./ui/button";+import { Input } from "./ui/input";++/** Shared collection search field: one surface, focus ring and clear affordance. */+export function ToolbarSearch({ query, onQueryChange, label, placeholder, clearLabel = "Clear search", inputRef, inputType = "text" }: {+ query: string;+ onQueryChange: (value: string) => void;+ label: string;+ placeholder: string;+ clearLabel?: string;+ inputRef?: Ref<HTMLInputElement>;+ inputType?: "text" | "search";+}) {+ return <div className="design-task-search" data-toolbar-search>+ <Search aria-hidden />+ <Input ref={inputRef} type={inputType} aria-label={label} placeholder={placeholder} value={query} onChange={event => onQueryChange(event.target.value)} />+ {query && <Button variant="ghost" size="icon-xs" data-toolbar-clear aria-label={clearLabel} onClick={() => onQueryChange("")}><X aria-hidden /></Button>}+ </div>;+}diff --git a/ui/src/components/TruncatedText.tsx b/ui/src/components/TruncatedText.tsxnew file mode 100644index 0000000000..611fb7ccf5--- /dev/null+++ b/ui/src/components/TruncatedText.tsx@@ -0,0 +1,22 @@+import { createContext, useContext, type ReactNode } from "react";+import { CellMarquee } from "./CellMarquee";++const MarqueeContext = createContext(false);++/** Opt-in overflow treatment; existing production layouts keep their current labels. */+export function TruncatedTextMarqueeProvider({ children }: { children: ReactNode }) {+ return <MarqueeContext.Provider value>{children}</MarqueeContext.Provider>;+}++export function TruncatedText({ children, className, title, as: Tag = "span", marqueeResetKey }: {+ children: ReactNode;+ className?: string;+ title?: string;+ as?: "span" | "h2" | "p";+ marqueeResetKey?: string | number | boolean;+}) {+ const marquee = useContext(MarqueeContext);+ return <Tag className={className} title={marquee ? undefined : title}>{marquee+ ? <CellMarquee cell="truncated-label" interactWithParent tabbable={false} resetKey={marqueeResetKey}>{children}</CellMarquee>+ : children}</Tag>;+}diff --git a/ui/src/components/artifacts/ArtifactsToolbar.tsx b/ui/src/components/artifacts/ArtifactsToolbar.tsxnew file mode 100644index 0000000000..0a3c65dff5--- /dev/null+++ b/ui/src/components/artifacts/ArtifactsToolbar.tsx@@ -0,0 +1,86 @@+import { Check, Layers } from "lucide-react";+import type { ArtifactGroupBy, ArtifactKindFilter } from "@/api/artifacts";+import { TabFilters, type TabSize } from "@/components/TabBar";+import { Button } from "@/components/ui/button";+import { ToolbarSearch } from "@/components/ToolbarSearch";+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";+import { cn } from "@/lib/utils";++export const ARTIFACT_KIND_FILTERS: { value: ArtifactKindFilter; label: string }[] = [+ { value: "all", label: "All" },+ { value: "image", label: "Images" },+ { value: "video", label: "Videos" },+ { value: "document", label: "Documents" },+ { value: "text", label: "Text" },+ { value: "file", label: "Files" },+];++export const ARTIFACT_GROUP_OPTIONS: { value: ArtifactGroupBy; label: string }[] = [+ { value: "none", label: "None" },+ { value: "task", label: "Task" },+ { value: "parent_task", label: "Parent task" },+];++export function artifactGroupByLabel(value: ArtifactGroupBy): string {+ return ARTIFACT_GROUP_OPTIONS.find((option) => option.value === value)?.label ?? "None";+}++/** Canonical collection filters; compact standalone, standard in the toolbar. */+export function ArtifactKindFilters({ kind, onKindChange, size = "compact" }: { kind: ArtifactKindFilter; onKindChange: (value: ArtifactKindFilter) => void; size?: TabSize }) {+ return <TabFilters items={ARTIFACT_KIND_FILTERS} value={kind} onValueChange={onKindChange} size={size} label="Filter artifacts by type" />;+}++export interface ArtifactsToolbarProps {+ query: string;+ onQueryChange: (value: string) => void;+ groupBy: ArtifactGroupBy;+ onGroupByChange: (value: ArtifactGroupBy) => void;+ kind: ArtifactKindFilter;+ onKindChange: (value: ArtifactKindFilter) => void;+}++/** Shared shipped Artifacts controls. Canonical proposal: Components / Toolbars / Artifacts. */+export function ArtifactsToolbar({ query: draftQuery, onQueryChange: setDraftQuery, groupBy, onGroupByChange: selectGroupBy, kind, onKindChange: selectKind }: ArtifactsToolbarProps) {+ const grouping = groupBy !== "none";+ return (+ <div data-canonical-toolbar="artifacts" role="toolbar" aria-label="Artifacts controls" className="flex flex-col items-start gap-4">+ <div className="design-toolbar-controls flex w-full flex-wrap items-center gap-4">+ <ToolbarSearch query={draftQuery} onQueryChange={setDraftQuery} label="Search artifacts" placeholder="Search artifacts…" clearLabel="Clear artifact search" />++ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button+ type="button"+ variant="outline"+ size="icon"+ aria-label={`Group artifacts (currently ${artifactGroupByLabel(groupBy)})`}+ title="Group artifacts"+ data-testid="artifact-group-control"+ data-group-by={groupBy}+ data-active={grouping}+ className={cn("h-8 w-8 shrink-0", grouping && "bg-accent")}+ >+ <Layers className="h-3.5 w-3.5" aria-hidden="true" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end" className="w-44">+ <DropdownMenuLabel>Group by</DropdownMenuLabel>+ {ARTIFACT_GROUP_OPTIONS.map((option) => (+ <DropdownMenuItem+ key={option.value}+ data-testid={`artifact-group-option-${option.value}`}+ aria-selected={groupBy === option.value}+ onSelect={() => selectGroupBy(option.value)}+ className="justify-between"+ >+ {option.label}+ {groupBy === option.value ? <Check className="h-3.5 w-3.5" /> : null}+ </DropdownMenuItem>+ ))}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ <ArtifactKindFilters kind={kind} onKindChange={selectKind} size="standard" />+ </div>+ );+}diff --git a/ui/src/components/design-sandbox/ConversationPlayback.tsx b/ui/src/components/design-sandbox/ConversationPlayback.tsxnew file mode 100644index 0000000000..714edb917e--- /dev/null+++ b/ui/src/components/design-sandbox/ConversationPlayback.tsx@@ -0,0 +1,77 @@+import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";+import { Pause, Play, RotateCcw } from "lucide-react";+import type { Agent } from "@paperclipai/shared";+import { Button } from "../ui/button";+import { TaskChatThreadView } from "../task-chat/TaskChatThreadView";+import { transcriptToTaskChatItems } from "../task-chat/transcript-adapter";+import { parseCssTimeMs } from "../task-chat/motion-tokens";+import type { TaskChatMessageItem } from "../task-chat/task-chat-model";+import { CONVERSATION_PLAYBACK_STAGES, conversationPlaybackSnapshot, previewHistory, SYNTHETIC_FINAL, PLAYBACK_FOLLOW_UP_STAGE, PLAYBACK_FOLLOW_UP, PLAYBACK_VERIFICATION_FINAL } from "./task-thread-fixtures";+import { ConversationPlaybackTurn } from "./ConversationPlaybackTurn";+import { settledPreviewReply } from "./settled-preview-reply";++/** A local clock feeds cumulative synthetic transcript snapshots into the real+ * conversation renderer. One thread persists throughout; no fixture carousel. */+export function ConversationPlayback({ header, agentName, agent, onShowSavedThread }: {+ header: ReactNode; agentName: string; agent?: Agent; onShowSavedThread?: () => void;+}) {+ const [elapsed, setElapsed] = useState(0);+ const [started, setStarted] = useState(false);+ const [playing, setPlaying] = useState(false);+ const [generation, setGeneration] = useState(0);+ const [stepMs, setStepMs] = useState(0);+ const tick = useRef(0);+ useEffect(() => {+ const styles = getComputedStyle(document.documentElement);+ setStepMs(parseCssTimeMs(styles.getPropertyValue("--motion-sandbox-playback-step")));+ tick.current = parseCssTimeMs(styles.getPropertyValue("--motion-sandbox-stream-tick"));+ }, []);+ const duration = CONVERSATION_PLAYBACK_STAGES.reduce((sum, stage) => sum + stage.units * stepMs, 0);+ const ended = started && duration > 0 && elapsed >= duration;+ useEffect(() => {+ if (!playing || !stepMs || !tick.current) return;+ const timer = window.setInterval(() => setElapsed(value => Math.min(duration, value + tick.current)), tick.current);+ return () => window.clearInterval(timer);+ }, [playing, stepMs, duration]);+ useEffect(() => { if (ended) setPlaying(false); }, [ended]);+ let offset = 0;+ let stage = 0;+ for (const current of CONVERSATION_PLAYBACK_STAGES) {+ if (elapsed < offset + current.units * stepMs) break;+ offset += current.units * stepMs;+ stage++;+ }+ const progress = stepMs && stage < CONVERSATION_PLAYBACK_STAGES.length ? (elapsed - offset) / (CONVERSATION_PLAYBACK_STAGES[stage].units * stepMs) : 1;+ const snapshot = useMemo(() => conversationPlaybackSnapshot(stage, progress), [stage, progress]);+ const parsed = useMemo(() => transcriptToTaskChatItems(snapshot.entries, { runId: "conversation-playback", agentName, running: !ended }), [snapshot, agentName, ended]);+ const human = useMemo(() => previewHistory(agentName).human, [agentName]);+ const followUp = stage >= PLAYBACK_FOLLOW_UP_STAGE;+ const firstSnapshot = useMemo(() => followUp ? conversationPlaybackSnapshot(6, 1) : snapshot, [followUp, snapshot]);+ const firstItems = useMemo(() => followUp ? transcriptToTaskChatItems(firstSnapshot.entries, { runId: "playback-count", agentName, running: false }) : parsed, [followUp, firstSnapshot, parsed, agentName]);+ const firstResponse = useMemo((): TaskChatMessageItem => ({ id: "playback-response", kind: "message", author: "agent", authorName: agentName, agent, channel: "final", text: SYNTHETIC_FINAL, timestamp: "10:11 AM" }), [agentName, agent]);+ const secondResponse = useMemo((): TaskChatMessageItem => ({ id: "playback-verification", kind: "message", author: "agent", authorName: agentName, agent, channel: "final", text: PLAYBACK_VERIFICATION_FINAL, timestamp: "10:13 AM" }), [agentName, agent]);+ const firstSettled = useMemo(() => settledPreviewReply(firstResponse, conversationPlaybackSnapshot(6, 1).entries, "playback-count", false, CONVERSATION_PLAYBACK_STAGES.slice(0, PLAYBACK_FOLLOW_UP_STAGE).reduce((sum, item) => sum + item.units * stepMs, 0)), [firstResponse, stepMs]);+ const secondSettled = useMemo(() => ended ? settledPreviewReply(secondResponse, snapshot.entries, "conversation-playback", false, CONVERSATION_PLAYBACK_STAGES.slice(PLAYBACK_FOLLOW_UP_STAGE).reduce((sum, item) => sum + item.units * stepMs, 0)) : [], [ended, secondResponse, snapshot.entries, stepMs]);+ const followUpMessage = useMemo((): TaskChatMessageItem[] => [{ id: "playback-follow-up", kind: "message", author: "human", isCurrentUser: true, text: PLAYBACK_FOLLOW_UP, timestamp: "10:12 AM" }], []);+ const restart = () => { setElapsed(0); setGeneration(value => value + 1); setStarted(true); setPlaying(true); };++ return <section className="flex min-h-0 flex-1 flex-col" data-testid="conversation-playback" data-playback-state={ended ? "complete" : playing ? "playing" : started ? "paused" : "idle"} data-playback-stage={stage}>+ <div className="flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-background py-2 text-xs">+ <Button size="sm" variant="outline" disabled={!stepMs} onClick={() => !started || ended ? restart() : setPlaying(value => !value)}>+ {ended ? <RotateCcw /> : playing ? <Pause /> : <Play />}+ {ended ? "Replay conversation" : playing ? "Pause" : started ? "Resume conversation" : "Play conversation"}+ </Button>+ {started && !ended ? <Button size="sm" variant="ghost" onClick={restart}><RotateCcw />Replay</Button> : null}+ {onShowSavedThread ? <Button size="sm" variant="ghost" onClick={onShowSavedThread}>Show saved thread</Button> : null}+ <span className="text-muted-foreground" role="status">{started ? ended ? "Conversation complete" : `${playing ? "" : "Paused · "}${CONVERSATION_PLAYBACK_STAGES[stage]?.label}` : "Watch a typical conversation · synthetic preview"}</span>+ </div>+ <TaskChatThreadView key={generation} header={header} items={started ? [human] : []} contentKey={`${elapsed}:${generation}`} tail={started ? <div className="flex flex-col gap-8">+ <ConversationPlaybackTurn settled={followUp} snapshot={firstSnapshot} items={firstItems} response={firstResponse} settledItems={firstSettled} />+ {followUp ? <>+ <TaskChatThreadView scroll={false} className="p-0 md:p-0" items={followUpMessage} />+ <ConversationPlaybackTurn settled={ended} snapshot={snapshot} items={parsed} response={secondResponse} settledItems={secondSettled} />+ </> : null}+ </div> : undefined} />++ </section>;+}diff --git a/ui/src/components/design-sandbox/ConversationPlaybackTurn.tsx b/ui/src/components/design-sandbox/ConversationPlaybackTurn.tsxnew file mode 100644index 0000000000..49a9fa49cf--- /dev/null+++ b/ui/src/components/design-sandbox/ConversationPlaybackTurn.tsx@@ -0,0 +1,35 @@+import { useMemo } from "react";+import type { ThreadPreviewSnapshot } from "./task-thread-fixtures";+import { MarkdownWordStreaming } from "../MarkdownWordStreaming";+import { TaskChatThreadView } from "../task-chat/TaskChatThreadView";+import { TaskChatLiveTail } from "../task-chat/TaskChatLiveTail";+import { TaskChatLiveRunPill, toolCountSummaryFromEntries } from "../task-chat/TaskChatLiveRunPill";+import { TaskChatProtocolCard } from "../task-chat/TaskChatProtocolCard";+import { TaskChatTurnHandoff } from "../task-chat/TaskChatTurnHandoff";+import { TaskChatShimmerScope } from "../task-chat/TaskChatShimmer";+import { TaskChatBubbleActions } from "../task-chat/TaskChatBubbleActions";+import type { TaskChatItem, TaskChatMessageItem, TaskChatRuntimeRequestItem } from "../task-chat/task-chat-model";++/** Streaming and durable replies share one render key and the same bubble.+ * Only the activity region folds; the response moves with normal document flow. */+export function ConversationPlaybackTurn({ settled, snapshot, items, response, settledItems }: {+ settled: boolean;+ snapshot: ThreadPreviewSnapshot;+ items: TaskChatItem[];+ response: TaskChatMessageItem;+ settledItems: TaskChatItem[];+}) {+ const pending = items.find((item): item is TaskChatRuntimeRequestItem => item.kind === "protocol" && item.surface === "runtime_request" && item.status === "pending");+ const streamed = items.find((item): item is TaskChatMessageItem => item.kind === "message" && item.channel === "final");+ const liveReply = useMemo(() => streamed ? [{ ...response, text: streamed.text, timestamp: undefined, attachedTurn: undefined }] : [], [response, streamed]);+ const actions = (item: TaskChatMessageItem) => <TaskChatBubbleActions copyText={item.text} />;+ return <TaskChatTurnHandoff settled={settled} activity={settled ? null : <TaskChatShimmerScope items={items}>+ {!pending ? <TaskChatLiveRunPill status={snapshot.status} startedAtMs={null} toolSummary={toolCountSummaryFromEntries(snapshot.entries)} /> : null}+ <MarkdownWordStreaming.Provider value><TaskChatLiveTail items={items.filter(item => item !== pending)} excludeFinal emptyMessage={snapshot.emptyMessage} /></MarkdownWordStreaming.Provider>+ {pending ? <TaskChatProtocolCard key={pending.id} item={pending} presentation="takeover" /> : null}+ </TaskChatShimmerScope>}>+ {complete => <MarkdownWordStreaming.Provider value>+ <TaskChatThreadView scroll={false} className="p-0 md:p-0" items={complete ? settledItems : liveReply} renderMessageActions={complete ? actions : undefined} />+ </MarkdownWordStreaming.Provider>}+ </TaskChatTurnHandoff>;+}diff --git a/ui/src/components/design-sandbox/DesignSandboxTaskThread.test.tsx b/ui/src/components/design-sandbox/DesignSandboxTaskThread.test.tsxnew file mode 100644index 0000000000..d12a1ac996--- /dev/null+++ b/ui/src/components/design-sandbox/DesignSandboxTaskThread.test.tsx@@ -0,0 +1,172 @@+// @vitest-environment jsdom+import { act, type ReactNode } from "react";+import { flushSync } from "react-dom";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, beforeEach, expect, it, vi } from "vitest";+import { MemoryRouter } from "react-router-dom";+import { ThemeProvider } from "@/context/ThemeContext";+import DesignSandboxTaskThread from "./DesignSandboxTaskThread";+import { THREAD_PREVIEW_CASES } from "./task-thread-fixtures";+import { transcriptToTaskChatItems } from "../task-chat/transcript-adapter";++// Real composer behavior is covered in the browser. Retain its takeover slots+// and callbacks here; the transcript/history/protocol surfaces are all real.+vi.mock("../task-chat/TaskChatComposer", async () => {+ const { TaskChatPausedTakeover } = await import("../task-chat/TaskChatPausedTakeover");+ return { TaskChatComposer: ({ onAdd, takeover, pause, onStop }: {+ onAdd: (body: string) => void; takeover?: { content: ReactNode } | null;+ pause?: Parameters<typeof TaskChatPausedTakeover>[0]; onStop?: () => void;+ }) => pause ? <TaskChatPausedTakeover {...pause} /> : takeover ? takeover.content : <>+ <button onClick={() => onAdd("Please check timeouts.")}>Send synthetic reply</button>+ {onStop ? <button onClick={onStop}>Stop synthetic run</button> : null}+ </> };+});+let host: HTMLDivElement;+let root: Root;+const network = vi.fn();+beforeEach(() => {+ host = document.body.appendChild(document.createElement("div"));+ root = createRoot(host);+ vi.stubGlobal("fetch", network);+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);+ network.mockReset();+});+afterEach(() => {+ flushSync(() => root.unmount());+ host.remove();+ vi.unstubAllGlobals();+ vi.useRealTimers();+ document.documentElement.style.removeProperty("--motion-sandbox-stream-tick");+ document.documentElement.style.removeProperty("--motion-sandbox-playback-step");+});+function render(query = "", defaultConversation = false, previewMode: "catalog" | "playback" = "catalog") {+ flushSync(() => root.render(<MemoryRouter initialEntries={[`/DES/issues/DES-1${query}`]}>+ <ThemeProvider>+ <DesignSandboxTaskThread previewMode={previewMode} header={<h2>Task title</h2>} agentName="Preview engineer" defaultConversation={defaultConversation}>+ <p>Saved conversation</p>+ </DesignSandboxTaskThread>+ </ThemeProvider>+ </MemoryRouter>));+}+function button(label: string) {+ const match = [...host.querySelectorAll("button")].find(el => el.textContent === label);+ expect(match, `button ${label}`).toBeTruthy();+ return match!;+}+it("leaves the saved conversation as the default on ordinary sandbox tasks", () => {+ render();+ expect(host.textContent).toContain("Saved conversation");+ expect(host.querySelector("[data-preview-case]")).toBeNull();+});+it("defaults the demonstration task to a staging-style conversation", () => {+ render("", true);+ expect(host.querySelector('[data-preview-case="staging-conversation"]')).not.toBeNull();+ expect(host.querySelector('[data-testid="task-chat-human-bubble"]')).not.toBeNull();+ expect(host.querySelector('[data-testid="task-chat-bubble-attached-turn"]')).not.toBeNull();+ expect(host.querySelector('[data-testid="task-chat-live-run-pill"]')).not.toBeNull();+ expect(host.textContent).toContain("Thought through the task");+ expect(host.textContent).toContain("Read files");+ expect(host.querySelector('[data-testid="task-chat-runner-turn"]')).toBeNull();+ expect(network).not.toHaveBeenCalled();+});+it("renders every snapshot through real thread surfaces", () => {+ render("?threadPreview=all");+ expect(host.querySelectorAll("[data-preview-case]")).toHaveLength(THREAD_PREVIEW_CASES.length);+ expect(host.querySelector('[data-testid="task-chat-runner-turn"]')).not.toBeNull();+ expect(host.querySelector('[data-testid="paused-composer-takeover"]')).not.toBeNull();+ expect(host.textContent).toContain("Choose a reconnect policy");+ expect(network).not.toHaveBeenCalled();+});+it("keeps completed commentary and tools in the Activity disclosure", async () => {+ render("?threadPreview=completed");+ const summaries = [...host.querySelectorAll<HTMLButtonElement>('[data-testid="task-chat-turn-summary"]')];+ expect(summaries).toHaveLength(2);+ expect(summaries.every(el => el.getAttribute("aria-expanded") === "false")).toBe(true);+ await act(async () => summaries[1].click());+ expect(summaries[1].getAttribute("aria-expanded")).toBe("true");+ expect(host.textContent).toContain("The follow-up asks how I arrived at the count.");+ expect(host.querySelector('[data-testid="task-chat-activity-phase-toggle"]')).not.toBeNull();+});+it("resolves permissions locally in the composer takeover", async () => {+ render("?threadPreview=awaiting-approval");+ await act(async () => button("Allow once").click());+ expect(host.textContent?.toLowerCase()).toContain("resolved");+ expect(network).not.toHaveBeenCalled();+});+it("stops synthetic activity without touching a real run", async () => {+ render("?threadPreview=working");+ await act(async () => button("Stop synthetic run").click());+ expect(host.textContent).toContain("Run cancelled");+ expect(host.querySelector('[data-testid="task-chat-live-run-pill"]')?.textContent).toContain("Stopped");+ expect(network).not.toHaveBeenCalled();+});+it("keeps the native renderer separate from the staging transcript layout", () => {+ render("?threadPreview=runner-running");+ expect(host.querySelector('[data-testid="task-chat-runner-turn"]')).not.toBeNull();+ expect(host.querySelector('[data-testid="task-chat-live-run-pill"]')).toBeNull();+});+it("preserves failure, incomplete-tool and streaming lifecycles through the real event adapter", () => {+ const itemsFor = (id: string, running: boolean) => transcriptToTaskChatItems(+ THREAD_PREVIEW_CASES.find(item => item.id === id)!.build().entries,+ { runId: "fixture-check", running },+ );+ expect(itemsFor("tool-failed", true)).toContainEqual(expect.objectContaining({ kind: "tool", status: "failed" }));+ expect(itemsFor("tool-interrupted", false)).toContainEqual(expect.objectContaining({ kind: "tool", status: "interrupted" }));+ expect(itemsFor("streaming-final", true)).toContainEqual(expect.objectContaining({ kind: "message", channel: "final", streaming: true }));+ expect(itemsFor("native-failed", false)).toContainEqual(expect.objectContaining({ kind: "protocol", surface: "run_terminal", runState: "failed" }));+});+it("keeps replies local and restores the saved conversation", async () => {+ render("?threadPreview=human-message");+ await act(async () => button("Send synthetic reply").click());+ expect(host.textContent).toContain("Please check timeouts.");+ expect(host.textContent).toContain("Preview reply received.");+ await act(async () => button("Show saved thread").click());+ expect(host.textContent).toContain("Saved conversation");+ expect(host.textContent).not.toContain("Preview reply received.");+ expect(network).not.toHaveBeenCalled();+});++it("plays one cumulative conversation, freezes on pause, settles and replays locally", async () => {+ vi.useFakeTimers();+ document.documentElement.style.setProperty("--motion-sandbox-stream-tick", "40ms");+ document.documentElement.style.setProperty("--motion-sandbox-playback-step", "4s");+ await act(async () => render("?threadPreview=all", true, "playback"));+ const playback = () => host.querySelector('[data-testid="conversation-playback"]')!;+ expect(playback().getAttribute("data-playback-state")).toBe("idle");+ expect(host.querySelectorAll('[data-testid="task-chat-human-bubble"]')).toHaveLength(0);+ expect(host.querySelector("#sandbox-thread-state")).toBeNull();+ await act(async () => button("Play conversation").click());+ expect(host.querySelectorAll('[data-testid="task-chat-human-bubble"]')).toHaveLength(1);+ await act(async () => vi.advanceTimersByTime(2500));+ expect(playback().getAttribute("data-playback-stage")).toBe("1");+ await act(async () => button("Pause").click());+ const paused = host.textContent;+ await act(async () => vi.advanceTimersByTime(10_000));+ expect(host.textContent).toBe(paused);+ expect(playback().getAttribute("data-playback-state")).toBe("paused");+ await act(async () => button("Resume conversation").click());+ await act(async () => vi.advanceTimersByTime(60_000));+ expect(playback().getAttribute("data-playback-state")).toBe("complete");+ expect(host.textContent).toContain("26 component source files");+ expect(host.querySelector('[data-testid="task-chat-bubble-attached-turn"]')).not.toBeNull();+ expect(host.querySelectorAll('[data-testid="task-chat-human-bubble"]')).toHaveLength(2);+ expect(host.querySelectorAll('[data-testid="task-chat-agent-bubble"]')).toHaveLength(2);+ expect(host.textContent).toContain("Verification complete");+ await act(async () => button("Replay conversation").click());+ expect(playback().getAttribute("data-playback-stage")).toBe("0");+ expect(host.querySelector('[data-testid="task-chat-agent-bubble"]')).toBeNull();+ await act(async () => button("Show saved thread").click());+ expect(host.textContent).toContain("Saved conversation");+ expect(host.querySelector('[data-testid="conversation-playback"]')).toBeNull();+ expect(network).not.toHaveBeenCalled();+});+it("shows the saved conversation for an unknown playback preview", () => {+ render("?threadPreview=unknown", true, "playback");+ expect(host.textContent).toContain("Saved conversation");+ expect(host.querySelector('[data-testid="conversation-playback"]')).toBeNull();+});+it("retains the saved conversation on ordinary tasks in playback mode", () => {+ render("", false, "playback");+ expect(host.textContent).toContain("Saved conversation");+ expect(host.querySelector('[data-testid="conversation-playback"]')).toBeNull();+});diff --git a/ui/src/components/design-sandbox/DesignSandboxTaskThread.tsx b/ui/src/components/design-sandbox/DesignSandboxTaskThread.tsxnew file mode 100644index 0000000000..10f985c1e5--- /dev/null+++ b/ui/src/components/design-sandbox/DesignSandboxTaskThread.tsx@@ -0,0 +1,172 @@+import { TaskChatShimmerScope } from "../task-chat/TaskChatShimmer";+import { revealWords, wordCount } from "./word-reveal";+import { MarkdownWordStreaming } from "../MarkdownWordStreaming";+import { ConversationPlayback } from "./ConversationPlayback";+import { settledPreviewReply as settledReply } from "./settled-preview-reply";+import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";+import { useSearchParams } from "react-router-dom";+import type { Agent, FeedbackVoteValue, IssueWorkMode } from "@paperclipai/shared";+import { useStreamlinedUiEnabled } from "../../hooks/useStreamlinedUiEnabled";+import { Button } from "../ui/button";+import { NativeSelect } from "../ui/select";+import { useScrollbarWhileScrolling } from "../side-panel/use-scrollbar-while-scrolling";+import { TaskChatThreadView } from "../task-chat/TaskChatThreadView";+import { TaskChatRunnerTurn } from "../task-chat/TaskChatRunnerTurn";+import { TaskChatLiveRunPill, toolCountSummaryFromEntries } from "../task-chat/TaskChatLiveRunPill";+import { TaskChatLiveTail } from "../task-chat/TaskChatLiveTail";+import { TaskChatComposer } from "../task-chat/TaskChatComposer";+import { TaskChatComposerDock } from "../task-chat/TaskChatComposerDock";+import { TaskChatProtocolCard } from "../task-chat/TaskChatProtocolCard";+import { TaskChatBubbleActions } from "../task-chat/TaskChatBubbleActions";+import { TaskChatPresentationProvider } from "../task-chat/presentation-mode";+import { parseCssTimeMs } from "../task-chat/motion-tokens";+import { isTerminalRunStatus, paperclipRunnerFinalResponse, transcriptToTaskChatItems } from "../task-chat/transcript-adapter";+import type { TaskChatItem, TaskChatMessageItem, TaskChatRuntimeRequestDecision, TaskChatRuntimeRequestItem } from "../task-chat/task-chat-model";+import { previewHistory, THREAD_PREVIEW_ALIASES, THREAD_PREVIEW_CASES, type ThreadPreviewCase } from "./task-thread-fixtures";++/** Local design sandbox only. Uses the same transport adapter and rendered+ * surfaces as TaskChatThread; no lab scenarios or imitation thread markup. */+export default function DesignSandboxTaskThread({+ children, header, agentName, agent, defaultConversation, previewMode = "catalog",+}: {+ children: ReactNode;+ header: ReactNode;+ agentName: string;+ agent?: Agent;+ defaultConversation: boolean;+ previewMode?: "catalog" | "playback";+}) {+ const [params, setParams] = useSearchParams();+ const requested = params.get("threadPreview") ?? (defaultConversation ? "staging-conversation" : "saved");+ const aliased = THREAD_PREVIEW_ALIASES[requested] ?? requested;+ const selected = aliased === "all" || THREAD_PREVIEW_CASES.some(item => item.id === aliased) ? aliased : "saved";+ const [generation, setGeneration] = useState(0);+ const { enabled: streamlined } = useStreamlinedUiEnabled();+ const viewport = useRef<HTMLDivElement>(null);+ const onScroll = useScrollbarWhileScrolling();+ const choose = (value: string) => setParams(current => {+ const next = new URLSearchParams(current);+ next.set("threadPreview", value);+ return next;+ }, { replace: true });+ const cases = selected === "all" ? THREAD_PREVIEW_CASES : THREAD_PREVIEW_CASES.filter(item => item.id === selected);+ useEffect(() => { if (viewport.current) viewport.current.scrollTop = 0; }, [selected]);++ if (previewMode === "playback" && selected !== "saved") return <TaskChatPresentationProvider mode={streamlined ? "streamlined" : "production"}><ConversationPlayback header={header} agentName={agentName} agent={agent} onShowSavedThread={() => choose("saved")} /></TaskChatPresentationProvider>;++ return <div className="flex min-h-0 flex-1 flex-col" data-testid="sandbox-task-thread" data-preview-state={selected}>+ <div className="flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-background py-2 text-xs">+ <label htmlFor="sandbox-thread-state" className="font-normal text-foreground">Thread preview</label>+ <NativeSelect id="sandbox-thread-state" value={selected} onChange={event => choose(event.target.value)} className="w-auto min-w-0 max-w-full text-xs" aria-label="Thread preview state">+ <option value="saved">Saved thread</option>+ <option value="all">All states ({THREAD_PREVIEW_CASES.length})</option>+ {[...new Set(THREAD_PREVIEW_CASES.map(item => item.group))].map(group => <optgroup key={group} label={group}>+ {THREAD_PREVIEW_CASES.filter(item => item.group === group).map(item => <option key={item.id} value={item.id}>{item.label}</option>)}+ </optgroup>)}+ </NativeSelect>+ {selected !== "saved" ? <>+ <Button size="sm" variant="outline" onClick={() => setGeneration(value => value + 1)}>Reset / replay</Button>+ <Button size="sm" variant="ghost" onClick={() => choose("saved")}>Show saved thread</Button>+ <span className="text-muted-foreground">Production renderers · synthetic data · preview actions stay local</span>+ </> : null}+ </div>+ {selected === "saved" ? children : <TaskChatPresentationProvider mode={streamlined ? "streamlined" : "production"}>+ <div ref={viewport} onScroll={onScroll} className={`scrollbar-while-scrolling flex min-h-0 flex-1 flex-col ${selected === "all" ? "overflow-y-auto" : ""}`} data-testid="sandbox-thread-viewport">+ {selected === "all" ? <div className="mx-auto w-full max-w-(--tc-shell-max-w) pt-3">{header}</div> : null}+ {cases.map(example => <PreviewCase key={`${selected}:${example.id}:${generation}`} example={example} header={header} agentName={agentName} agent={agent} replay={selected !== "all"} streamlined={streamlined} />)}+ </div>+ </TaskChatPresentationProvider>}+ </div>;+}++function PreviewCase({ example, header, agentName, agent, replay, streamlined }: {+ example: ThreadPreviewCase; header: ReactNode; agentName: string; agent?: Agent; replay: boolean; streamlined: boolean;+}) {+ const scenario = useMemo(() => example.build(), [example]);+ const startedAt = useRef(Date.now() - 40_000);+ const [characters, setCharacters] = useState(replay ? 1 : Infinity);+ const [decisions, setDecisions] = useState<Record<string, TaskChatRuntimeRequestDecision>>({});+ const [votes, setVotes] = useState<Record<string, FeedbackVoteValue>>({});+ const [stopped, setStopped] = useState(false);+ const [resumed, setResumed] = useState(false);+ const [takeoverDismissed, setTakeoverDismissed] = useState(false);+ const [workMode, setWorkMode] = useState<IssueWorkMode>("standard");+ const [messages, setMessages] = useState<TaskChatItem[]>([]);+ const status = stopped ? "cancelled" : scenario.status;+ const terminal = isTerminalRunStatus(status);+ const parsed = useMemo(() => transcriptToTaskChatItems(scenario.entries, { runId: `synthetic-${example.id}`, agentName, running: !terminal }), [scenario, example.id, agentName, terminal]);+ const streamingLength = parsed.reduce((length, item) => item.kind === "message" && item.streaming ? Math.max(length, wordCount(item.text)) : item.kind === "thinking" && item.streaming ? Math.max(length, wordCount(item.lines.join("\n"))) : length, 0);+ useEffect(() => {+ if (!replay || !streamingLength) return;+ const interval = parseCssTimeMs(getComputedStyle(document.documentElement).getPropertyValue("--motion-sandbox-word-tick"));+ if (!interval || window.matchMedia("(prefers-reduced-motion: reduce)").matches) { setCharacters(Infinity); return; }+ const timer = window.setInterval(() => setCharacters(count => {+ if (count >= streamingLength) { window.clearInterval(timer); return Infinity; }+ return count + 1;+ }), interval);+ return () => window.clearInterval(timer);+ }, [replay, streamingLength]);+ const items = parsed.map(item => {+ if (item.kind === "message" && item.streaming) return { ...item, text: revealWords(item.text, characters) };+ if (item.kind === "thinking" && item.streaming) return { ...item, lines: [revealWords(item.lines.join("\n"), characters)] };+ if (item.kind === "protocol" && item.surface === "runtime_request" && decisions[item.id]) {+ const decision = decisions[item.id];+ return { ...item, status: "resolved" as const, resolvedAction: decision.action, ...("response" in decision ? { response: decision.response } : {}) };+ }+ return item;+ });+ const pending = items.find((item): item is TaskChatRuntimeRequestItem => item.kind === "protocol" && item.surface === "runtime_request" && item.status === "pending");+ const runtimeDecision = (item: TaskChatRuntimeRequestItem, decision: TaskChatRuntimeRequestDecision) => setDecisions(current => ({ ...current, [item.id]: decision }));+ const history = useMemo(() => {+ const prior = previewHistory(agentName);+ return [prior.human, ...settledReply({ ...prior.response, agent }, prior.entries, `synthetic-${example.id}-history`)];+ }, [agentName, agent, example.id]);+ const actions = (item: TaskChatMessageItem) => item.author === "agent" && !item.streaming ? <TaskChatBubbleActions copyText={item.text} feedback={{+ activeVote: votes[item.id] ?? null, sharingPreference: "allowed", termsUrl: null,+ onVote: async vote => { setVotes(current => ({ ...current, [item.id]: vote })); },+ }} /> : null;+ const followup: TaskChatMessageItem = { id: "synthetic-followup", kind: "message", author: "human", isCurrentUser: true, text: "Tell me your method for finding this out.", timestamp: "10:12 AM", optimistic: scenario.messageState };+ const final = terminal && !scenario.renderer ? paperclipRunnerFinalResponse(parsed, { allowFallback: true }) : undefined;+ const failed = ["failed", "timed_out", "cancelled"].includes(status);+ const notice: TaskChatItem[] = scenario.notice ? [{ id: "synthetic-notice", kind: "message", author: "system", text: "Synthetic workspace notice. Expand this row to inspect the details.", timestamp: "10:13 AM", presentation: { kind: "system_notice", tone: scenario.notice, title: `Workspace preview · ${scenario.notice}`, detailsDefaultOpen: false, density: "compact" } }] : [];+ const historyItems = [...history, followup, ...(final ? settledReply({ ...final, interstitial: false, streaming: false, authorName: agentName, agent, timestamp: "10:13 AM" }, scenario.entries, `synthetic-${example.id}`, failed) : []), ...notice, ...messages];+ const showTail = !final && !scenario.paused && !scenario.notice && !scenario.messageState;+ const showComposer = replay || Boolean(pending || scenario.paused || scenario.messageState);+ const agentMap = useMemo(() => new Map([[agent?.id ?? "synthetic-agent", agent ?? { id: "synthetic-agent", name: agentName }]]), [agent, agentName]);+ return <section className={`flex min-w-0 flex-1 flex-col ${replay ? "min-h-0" : "pt-4"}`} data-preview-case={example.id} data-preview-renderer={scenario.renderer ?? "transcript"} aria-label={example.label}>+ {!replay ? <h3 className="mx-auto mb-3 w-full max-w-(--tc-shell-max-w) border-t border-border pt-4 text-xs font-normal text-muted-foreground">{example.label}</h3> : null}+ <TaskChatThreadView items={historyItems} scroll={replay} header={replay ? header : undefined} className={replay ? "pt-3" : undefined} renderMessageActions={actions} onRuntimeRequestDecision={runtimeDecision} tail={showTail ? <>+ {scenario.renderer === "native" ? <TaskChatRunnerTurn+ runId={`synthetic-${example.id}`} agentName={agentName} agent={agent} items={items} status={status}+ startedAtMs={status === "queued" ? null : startedAt.current} finishedAtMs={terminal ? startedAt.current + 40_000 : null}+ activityUnavailable={scenario.activityUnavailable} continuedAfterSteering={scenario.continuedAfterSteering}+ onRuntimeRequestDecision={runtimeDecision}+ /> : <TaskChatShimmerScope items={items}>+ <TaskChatLiveRunPill status={status} startedAtMs={status === "queued" ? null : startedAt.current} finishedAtMs={terminal ? startedAt.current + 40_000 : null} toolSummary={toolCountSummaryFromEntries(scenario.entries)} />+ <MarkdownWordStreaming.Provider value={replay}><TaskChatLiveTail items={items} emptyMessage={scenario.emptyMessage ?? "Waiting for transcript…"} onRuntimeRequestDecision={runtimeDecision} /></MarkdownWordStreaming.Provider>+ {failed ? <TaskChatThreadView items={[{ id: "synthetic-run-stop", kind: "marker", variant: "interrupted", tone: status === "cancelled" ? "neutral" : "error", collapsible: true, label: status === "cancelled" ? "Run cancelled" : status === "timed_out" ? "Run timed out" : "Run failed", detail: status === "cancelled" ? "The synthetic run was stopped; no saved task was changed." : "Synthetic provider failure: the test process stopped before a final reply was available." }]} scroll={false} /> : null}+ </TaskChatShimmerScope>}+ </> : null} />+ {showComposer ? <TaskChatComposerDock mobile={false} streamlined={streamlined}>+ <TaskChatComposer+ agentMap={agentMap} modelAgents={agent ? new Map([[agent.id, agent]]) : undefined} currentAssigneeValue={`agent:${agent?.id ?? "synthetic-agent"}`}+ enableReassign reassignOptions={[{ id: `agent:${agent?.id ?? "synthetic-agent"}`, label: agentName }]}+ workMode={workMode} onWorkModeChange={setWorkMode}+ placeholder={`Message ${agentName} — synthetic reply…`}+ draftKey={`paperclip:design-sandbox:synthetic-thread:${example.id}`}+ onStop={!terminal ? async () => setStopped(true) : undefined}+ pause={scenario.paused && !resumed ? { scope: scenario.paused, onResume: async () => setResumed(true) } : null}+ takeover={pending && !takeoverDismissed ? {+ id: pending.id, label: pending.requestType === "permission" ? "Permission" : "Questions", pendingCount: 1,+ content: <TaskChatProtocolCard item={pending} presentation="takeover" onRuntimeRequestDecision={runtimeDecision} />,+ onDismiss: () => setTakeoverDismissed(true), onSkip: () => runtimeDecision(pending, { action: "cancel" }),+ } : null}+ pendingTakeover={pending && takeoverDismissed ? { count: 1, label: "1 pending input", onOpen: () => setTakeoverDismissed(false) } : null}+ onAdd={async body => setMessages(current => [...current,+ { id: `local-human-${current.length}`, kind: "message", author: "human", text: body, timestamp: "Just now", isCurrentUser: true },+ { id: `local-agent-${current.length}`, kind: "message", author: "agent", authorName: agentName, agent, text: "Preview reply received. This exchange exists only in your browser; no agent was started.", timestamp: "Just now" },+ ])}+ />+ </TaskChatComposerDock> : null}+ </section>;+}diff --git a/ui/src/components/design-sandbox/settled-preview-reply.ts b/ui/src/components/design-sandbox/settled-preview-reply.tsnew file mode 100644index 0000000000..1c5b06149a--- /dev/null+++ b/ui/src/components/design-sandbox/settled-preview-reply.ts@@ -0,0 +1,13 @@+import { attachSettledTurns, buildTurnSummary, settledRunChildren, transcriptToTaskChatItems } from "../task-chat/transcript-adapter";+import type { TaskChatItem, TaskChatMessageItem, TaskChatTurnItem } from "../task-chat/task-chat-model";++/** Same history primitives as the production controller: the posted reply owns+ * its text and the settled transcript lives in the Activity footer. */+export function settledPreviewReply(response: TaskChatMessageItem, entries: Parameters<typeof transcriptToTaskChatItems>[0], runId: string, failed = false, durationMs = 74_000): TaskChatItem[] {+ const parsed = transcriptToTaskChatItems(entries, { runId, agentName: response.authorName, running: false });+ const turn: TaskChatTurnItem = {+ id: `${runId}:turn`, kind: "turn", settled: true, historical: true,+ items: settledRunChildren(parsed), summary: buildTurnSummary(entries, { durationMs, failed }),+ };+ return attachSettledTurns([response, turn], new Map([[turn.id, { agentKey: "synthetic-agent", agentName: response.authorName, parts: [{ entries, durationMs, failed }] }]]));+}diff --git a/ui/src/components/design-sandbox/task-thread-fixtures.ts b/ui/src/components/design-sandbox/task-thread-fixtures.tsnew file mode 100644index 0000000000..1c21e8c96e--- /dev/null+++ b/ui/src/components/design-sandbox/task-thread-fixtures.ts@@ -0,0 +1,221 @@+import { revealWordProgress } from "./word-reveal";+import type { HeartbeatRunEvent } from "@paperclipai/shared";+import type { TranscriptEntry } from "../../adapters";+import { nativeRunEventsToTranscript } from "../transcript/native-run-events";+import type { TaskChatMessageItem } from "../task-chat/task-chat-model";++/** Synthetic transport snapshots, not saved runs or copies of the chat-lab UI. */+export interface ThreadPreviewSnapshot {+ entries: TranscriptEntry[];+ status: "queued" | "running" | "succeeded" | "failed" | "timed_out" | "cancelled";+ renderer?: "native";+ emptyMessage?: string;+ activityUnavailable?: boolean;+ paused?: "leaf" | "subtree";+ messageState?: "pending" | "queued";+ notice?: "neutral" | "info" | "success" | "warning" | "danger";+ continuedAfterSteering?: boolean;+}+export interface ThreadPreviewCase {+ id: string;+ label: string;+ group: string;+ build: () => ThreadPreviewSnapshot;+}+const ts = (second: number) => new Date(Date.UTC(2026, 9, 15, 17, 12, second)).toISOString();+const event = (seq: number, type: string, payload: Record<string, unknown>, itemId?: string): HeartbeatRunEvent => ({+ id: seq, companyId: "synthetic-company", agentId: "synthetic-agent", runId: "synthetic-run", seq,+ eventType: type, stream: "system", level: "info", color: null, message: null, createdAt: new Date(ts(seq)),+ payload: { prpEvent: {+ schema: "paperclip.prp.event.v1", sourceEventId: `synthetic-event-${seq}`, sourceSeq: seq,+ sourceInstanceId: "synthetic-runner", sourceKind: "runner", runId: "synthetic-run",+ normalizedSessionId: "synthetic-session", eventType: type, schemaVersion: 1, priority: 1,+ emittedAt: ts(seq), payload, ...(itemId ? { itemId } : {}),+ } },+});+const reasoning = (complete = true, channel = "summary", text = "I’ll check the component alias and file list before explaining how the count was obtained.") => [+ event(1, "item.started", { kind: "reasoning", channel, text: "" }, "reasoning-1"),+ event(2, "item.delta", { text }, "reasoning-1"),+ ...(complete ? [event(3, "item.completed", { kind: "reasoning", channel, text }, "reasoning-1")] : []),+];+const commentary = (seq: number, text: string, final = false) => event(seq, "item.completed", {+ kind: "assistant_message", channel: final ? "final" : "progress", text,+}, `message-${seq}`);+const tool = (seq: number, name = "read_file", done = true, failed = false, options: { command?: string; result?: string } = {}) => [+ event(seq, "item.started", { kind: "dynamicToolCall", item: {+ type: "tool_use", id: `tool-${seq}`, name,+ input: name === "exec_command" ? { command: options.command ?? "rg --files ui/src/components/ui" } : { path: "ui/components.json" },+ } }, `tool-${seq}`),+ ...(done ? [event(seq + 1, "item.completed", { kind: "dynamicToolCall", item: {+ type: "tool_result", id: `tool-${seq}`, tool_use_id: `tool-${seq}`,+ result: failed ? "Synthetic command failed: the reconnect test timed out." : options.result ?? (name === "read_file" ? '{ "aliases": { "ui": "@/components/ui" } }' : "26 component source files · three project-specific wrappers"),+ is_error: failed,+ } }, `tool-${seq}`)] : []),+];+const progressText = "The follow-up asks how I arrived at the count. I’ll check the repository configuration and file list, then explain the method.";+export const SYNTHETIC_FINAL = "## Done\n\nI checked the configured component directory and excluded test files.\n\n- **26 component source files** in `ui/src/components/ui/`.\n- Three are project-specific wrappers; 23 are registry-style components.\n- No code changes were needed.\n\n```sh\nrg --files ui/src/components/ui | rg \"\\.tsx$\"\n```";+const workingEvents = () => [+ ...reasoning(), commentary(4, progressText), ...tool(5),+ commentary(8, "The alias points to `ui/src/components/ui/`. I’m checking the filenames and separating registry components from local wrappers."),+ ...tool(9, "exec_command", false),+];+const completedEvents = () => [...workingEvents().slice(0, -1), ...tool(9, "exec_command"), commentary(12, SYNTHETIC_FINAL, true)];+const snapshot = (events: HeartbeatRunEvent[], status: ThreadPreviewSnapshot["status"] = "running", extra: Partial<ThreadPreviewSnapshot> = {}): ThreadPreviewSnapshot => ({+ entries: nativeRunEventsToTranscript(events), status, ...extra,+});+const example = (id: string, label: string, group: string, build: () => ThreadPreviewSnapshot): ThreadPreviewCase => ({ id, label, group, build });+const direct = (id: string, label: string, group: string, entries: TranscriptEntry[], extra: Partial<ThreadPreviewSnapshot> = {}) => example(id, label, group, () => ({ entries, status: "running", ...extra }));++/** The prior exchange makes each state a realistic conversation, like staging. */+export function previewHistory(agentName: string): { human: TaskChatMessageItem; response: TaskChatMessageItem; entries: TranscriptEntry[] } {+ return {+ human: { id: "preview-request", kind: "message", author: "human", isCurrentUser: true, text: "How many UI components are in this project?", timestamp: "10:10 AM" },+ response: { id: "preview-response", kind: "message", author: "agent", authorName: agentName, text: "Done\n\n- Counted **26 component source files** in `ui/src/components/ui/`.\n- The count excludes test files. Three files are project-specific wrappers.\n- Verified the list directly from the repository; no changes were needed.", timestamp: "10:11 AM", channel: "final" },+ entries: nativeRunEventsToTranscript(completedEvents()),+ };+}++const permission = (status: "pending" | "resolved" | "expired" | "cancelled", input = false): Extract<TranscriptEntry, { kind: "runtime_request" }> => ({+ kind: "runtime_request", ts: ts(15), requestId: `preview-${input ? "question" : "permission"}`, requestKind: input ? "elicitation" : "command_approval",+ turnId: "synthetic-turn", requestType: input ? "input" : "permission", status,+ prompt: input ? "Which reconnect behavior should I verify?" : "Allow running the focused reconnect tests?",+ choices: input ? [] : [{ key: "accept", label: "Allow once" }, { key: "decline", label: "Deny" }], fields: [],+ questionSet: input ? { schema: "paperclip.question_set.v1", title: "Choose a reconnect policy", questions: [{+ id: "policy", prompt: "Which reconnect policy should I test?", required: true, answerMode: "single_select",+ options: [{ id: "bounded", label: "Bounded retry", description: "Stop after three attempts." }, { id: "manual", label: "Manual recovery", description: "Ask before reconnecting." }],+ }] } : null,+ resolvedAction: status === "resolved" ? "accept" : null,+});+const providerFamilies = ["plan", "tool_execution", "research", "delegation", "model_identity", "context", "artifact", "review", "hook", "memory", "safety", "terminal", "wait", "provider_notice"] as const;++export const THREAD_PREVIEW_CASES: ThreadPreviewCase[] = [+ example("staging-conversation", "Conversation · live work (staging layout)", "Conversation", () => snapshot(workingEvents())),+ example("session-start", "Starting · waiting for activity", "Conversation", () => snapshot([], "running")),+ example("runner-queued", "Queued · waiting to start", "Conversation", () => snapshot([], "queued", { emptyMessage: "Waiting to start…" })),+ example("thinking", "Thinking · live reasoning", "Conversation", () => snapshot(reasoning(false))),+ ...(["summary", "detail", "unknown"] as const).map(channel => example(`reasoning-${channel}`, `Reasoning · ${channel === "unknown" ? "lifecycle only" : channel}`, "Reasoning and tools", () => snapshot(reasoning(false, channel, channel === "unknown" ? "" : undefined)))),+ example("tool-call", "Tool · reading files", "Reasoning and tools", () => snapshot([...reasoning(), commentary(4, progressText), ...tool(5, "read_file", false)])),+ example("working", "Tool · running a command", "Reasoning and tools", () => snapshot(workingEvents())),+ example("tool-completed", "Tool · completed", "Reasoning and tools", () => snapshot([...reasoning(), commentary(4, progressText), ...tool(5)])),+ example("tool-failed", "Tool · failed", "Reasoning and tools", () => snapshot([...reasoning(), commentary(4, progressText), ...tool(5, "exec_command", true, true)])),+ example("tool-interrupted", "Tool · interrupted", "Reasoning and tools", () => snapshot([...tool(5, "exec_command", false)], "cancelled")),+ example("responding", "Commentary · streaming", "Conversation", () => snapshot([+ ...reasoning(), commentary(4, progressText), ...tool(5), event(8, "item.started", { kind: "assistant_message", channel: "progress", text: "" }, "streaming"),+ event(9, "item.delta", { text: "The earlier answer counted files in the directory configured for UI components. I’m checking the exact filenames so the explanation is reproducible." }, "streaming"),+ ])),+ example("streaming-final", "Final answer · streaming", "Conversation", () => snapshot([+ ...completedEvents().slice(0, -1), event(12, "item.started", { kind: "assistant_message", channel: "final", text: "" }, "final"),+ event(13, "item.delta", { text: SYNTHETIC_FINAL }, "final"),+ ])),+ example("completed", "Completed · answer and Activity disclosure", "Conversation", () => snapshot(completedEvents(), "succeeded")),+ example("activity-phases", "Completed · multiple activity groups", "Conversation", () => snapshot(completedEvents(), "succeeded")),+ ...(["failed", "timed_out", "cancelled"] as const).map(status => example(`runner-${status}`, `Run · ${status.replaceAll("_", " ")}`, "Run outcomes", () => snapshot([...reasoning(), ...tool(5, "exec_command", false)], status))),+ example("runner-running", "Native runner · live activity", "Native runner", () => snapshot(workingEvents(), "running", { renderer: "native" })),+ example("runner-succeeded", "Native runner · completed response", "Native runner", () => snapshot(completedEvents(), "succeeded", { renderer: "native" })),+ ...(["failed", "timed_out", "cancelled"] as const).map(status => example(`native-${status}`, `Native runner · ${status.replaceAll("_", " ")}`, "Native runner", () => snapshot([...reasoning(), ...tool(5, "exec_command", false), event(15, "run.terminal", { schema: "paperclip.prp.terminal.v1", turnTerminalState: status === "cancelled" ? "cancelled" : "failed", runTerminalState: status === "cancelled" ? "cancelled" : "failed", reportedWorkDisposition: "needs_review", stopReason: { schema: "paperclip.stop_reason.v1", code: "synthetic_provider_stop", message: status === "cancelled" ? "The synthetic run was cancelled." : "The synthetic test process stopped before a final reply." } })], status, { renderer: "native" }))),+ example("native-streaming", "Native runner · streaming final response", "Native runner", () => snapshot([...reasoning(), ...tool(5), event(12, "item.started", { kind: "assistant_message", channel: "final", text: "" }, "final"), event(13, "item.delta", { text: SYNTHETIC_FINAL }, "final")], "running", { renderer: "native" })),+ example("native-starting", "Native runner · starting", "Native runner", () => snapshot([], "queued", { renderer: "native" })),+ example("native-reconnecting", "Native runner · activity unavailable", "Native runner", () => snapshot(workingEvents(), "running", { renderer: "native", activityUnavailable: true })),+ example("native-steering", "Native runner · continued after steering", "Native runner", () => snapshot(workingEvents(), "running", { renderer: "native", continuedAfterSteering: true })),+ ...(["pending", "queued"] as const).map(messageState => example(`message-${messageState}`, `Human message · ${messageState}`, "Messages and composer", () => snapshot([], "queued", { messageState }))),+ ...(["leaf", "subtree"] as const).map(paused => example(`paused-${paused}`, paused === "leaf" ? "Task paused · draft preserved" : "Subtree paused · draft preserved", "Messages and composer", () => snapshot([], "cancelled", { paused }))),+ ...(["neutral", "info", "success", "warning", "danger"] as const).map(notice => example(`notice-${notice}`, `System notice · ${notice}`, "Messages and composer", () => snapshot([], "succeeded", { notice }))),+ ...(["pending", "resolved", "expired", "cancelled"] as const).map(status => direct(`permission-${status}`, `Permission request · ${status}`, "Requests and results", [permission("pending"), ...(status !== "pending" ? [permission(status)] : [])], { emptyMessage: "Waiting for permission…" })),+ direct("permission-denied", "Permission request · denied", "Requests and results", [{ ...permission("resolved"), resolvedAction: "decline" }]),+ direct("question-text", "Question · free-text input", "Requests and results", [{ ...permission("pending", true), questionSet: null, fields: [{ name: "delay", label: "Reconnect delay", placeholder: "For example, 30 seconds" }] }], { emptyMessage: "Waiting for your answer…" }),+ ...(["pending", "resolved", "expired", "cancelled"] as const).map(status => direct(`question-${status}`, `Question · ${status}`, "Requests and results", [permission("pending", true), ...(status !== "pending" ? [{ ...permission(status, true), response: status === "resolved" ? { schema: "paperclip.question_response.v1" as const, answers: { policy: { selectedOptionIds: ["bounded"] } } } : null }] : [])], { emptyMessage: "Waiting for your answer…" })),+ ...(["done", "blocked", "needs_review", "yielded"] as const).map(disposition => direct(`result-${disposition}`, `Run result · ${disposition.replaceAll("_", " ")}`, "Requests and results", [{+ kind: "run_result", ts: ts(20), disposition, summary: "The reconnect implementation is ready for review.", objectiveSatisfied: disposition === "done",+ verification: [{ commandOrCheck: "Reconnect tests", status: "passed", detail: "12 cases passed" }, { commandOrCheck: "Live provider smoke test", status: "not_run", detail: "No provider is contacted by this preview" }],+ remainingWork: disposition === "done" ? [] : [{ description: "Review the recovery message.", blocksCompletion: true }],+ blocker: disposition === "blocked" ? { reasonCode: "review_required", unblockAction: "Confirm the recovery behavior.", scope: "current_track" } : null, artifacts: [],+ }], { renderer: "native", status: disposition === "yielded" ? "running" : "succeeded" })),+ ...providerFamilies.map(family => direct(`provider-${family}`, `Provider activity · ${family.replaceAll("_", " ")}`, "Provider and workspace", [{+ kind: "provider_activity", ts: ts(10), family, eventType: `synthetic.${family}`, status: "completed", title: `${family.replaceAll("_", " ")} activity`,+ summary: "Synthetic provider activity using the shipped transcript contract.", payload: family === "plan" ? { steps: [{ stepId: "read", body: "Inspect the reconnect boundary", status: "completed" }, { stepId: "test", body: "Run focused tests", status: "in_progress" }, { stepId: "review", body: "Review recovery messages", status: "pending" }] } : family === "delegation" ? { children: [{ childId: "reviewer", role: "Test reviewer", status: "completed", summary: "Checked the reconnect cases." }, { childId: "writer", role: "Documentation writer", status: "running", activitySummary: "Updating recovery examples" }] } : family === "tool_execution" ? { name: "pnpm test:run", operation: "execute", transport: "process", output: "PASS reconnect.test.ts\n12 tests passed", outputTruncated: false } : { summary: "Synthetic provider activity details.", message: "No provider or agent is contacted." },+ }], { renderer: "native" })),+ ...(["running", "failed", "interrupted", "informational"] as const).map(status => direct(`provider-status-${status}`, `Provider activity · ${status}`, "Provider and workspace", [{ kind: "provider_activity", ts: ts(10), family: "tool_execution", eventType: "synthetic.tool", status, title: "Running reconnect tests", summary: status === "failed" ? "The reconnect test timed out." : "Checking reconnect behavior.", payload: { name: "pnpm test:run", operation: "execute", transport: "process", output: status === "failed" ? "FAIL reconnect.test.ts\nExpected reconnect after 3 attempts; received timeout." : "Checking reconnect tests…" } }], { renderer: "native" })),+ direct("workspace-changes", "Workspace · diff summary", "Provider and workspace", [{+ kind: "workspace_change", ts: ts(15), changeSetId: "synthetic-changes", revision: 1, source: "runner_verified", complete: true, patchArtifactRef: null,+ totals: { files: 1, additions: 1, deletions: 1 }, files: [{ path: "connectors/reconnect.ts", operation: "modify", previousPath: null, additions: 1, deletions: 1, binary: false, diff: "- const delay = 1000;\n+ const delay = Math.min(attempt * 1000, 30_000);" }],+ }], { renderer: "native" }),+ direct("workspace-file", "Workspace · code preview", "Provider and workspace", [{+ kind: "workspace_file_reference", ts: ts(15), referenceId: "synthetic-file", source: "harness_reported", path: "connectors/reconnect.ts", displayName: "Reconnect implementation", mediaType: "text/typescript", presentation: "code", line: 12,+ preview: "export const retryDelay = (attempt: number) => Math.min(attempt * 1000, 30_000);", previewTruncated: false, contentDigest: null,+ }], { renderer: "native" }),+ direct("live-token-cost", "Usage · run and provider totals", "Provider and workspace", [{ kind: "result", ts: ts(18), text: "", inputTokens: 12000, outputTokens: 1800, cachedTokens: 4000, costUsd: 0.042, subtype: "paperclip_runner_usage", isError: false, errors: [] }, { kind: "result", ts: ts(19), text: "Cumulative provider usage includes earlier turns.", inputTokens: 50000, outputTokens: 6000, cachedTokens: 16000, costUsd: 0.19, subtype: "paperclip_runner_session_usage", isError: false, errors: [] }]),+];++// Keep links shared during the first preview usable without retaining lab-only UI.+export const THREAD_PREVIEW_ALIASES: Record<string, string> = {+ "human-message": "staging-conversation", "agent-message": "completed", "responding-burst": "responding",+ "running": "working", "diff": "workspace-changes", "awaiting-approval": "permission-pending", "runtime-input": "question-pending",+ "interrupted": "runner-cancelled", "refused": "permission-denied", "truncated": "runner-failed", "plan-todo": "provider-plan",+ "tool-pending": "tool-call", "tool-in_progress": "working", "tool-rejected": "permission-denied",+};++/** One cumulative, successful conversation for the watchable preview. Timing+ * uses units of --motion-sandbox-playback-step; no agent/provider is contacted. */+export const CONVERSATION_PLAYBACK_STAGES = [+ { label: "Starting", units: 0.25 },+ { label: "Thinking", units: 0.5 },+ { label: "Commentary", units: 0.5 },+ { label: "Reading files", units: 0.5 },+ { label: "Reviewing the component list", units: 0.5 },+ { label: "Running a command", units: 0.75 },+ { label: "Writing the answer", units: 1 },+ { label: "Follow-up · queued", units: 0.5 },+ { label: "Planning the verification", units: 0.5 },+ { label: "Clarification · demo answer follows automatically", units: 0.75 },+ { label: "Answered · bounded retry", units: 0.5 },+ { label: "Permission · demo approval follows automatically", units: 0.75 },+ { label: "Running focused tests", units: 0.75 },+ { label: "Test failed · inspecting the timeout", units: 0.75 },+ { label: "Explaining the retry", units: 0.5 },+ { label: "Retrying the focused test", units: 0.75 },+ { label: "Reviewing the file preview and usage", units: 0.75 },+ { label: "Writing the verification result", units: 1 },+] as const;++export const PLAYBACK_FOLLOW_UP_STAGE = 7;+export const PLAYBACK_FOLLOW_UP = "Thanks. Can you also verify the reconnect behavior and show me the relevant code?";+export const PLAYBACK_VERIFICATION_FINAL = "## Verification complete\n\nThe bounded retry behavior passed the focused checks on retry.\n\n- The first test attempt timed out; the second passed.\n- The implementation caps the reconnect delay at 30 seconds.\n- No source files were changed.\n\nThis is synthetic preview data; no command or provider was contacted.";++export function conversationPlaybackSnapshot(stage: number, progress: number): ThreadPreviewSnapshot {+ const thought = "I’ll check the component directory configured for this project, then count the source files and exclude tests.";+ const update = "I’ll inspect the component alias first, then check the file list. No code changes are needed.";+ const next = "The alias points to `ui/src/components/ui/`. I’m separating registry components from local wrappers.";+ if (stage === 0) return { entries: [], status: "queued" };+ // Burst through whole words, then leave a short reading dwell. Transport+ // deltas themselves are not guaranteed to align with word boundaries.+ const text = (value: string) => revealWordProgress(value, Math.min(1, progress * 2));+ if (stage >= PLAYBACK_FOLLOW_UP_STAGE) {+ if (stage === 7) return snapshot([], "queued", { emptyMessage: "Waiting to start…" });+ const entries: TranscriptEntry[] = [...THREAD_PREVIEW_CASES.find(item => item.id === "provider-plan")!.build().entries];+ if (stage >= 9) entries.push({ ...permission(stage > 9 ? "resolved" : "pending", true), response: stage > 9 ? { schema: "paperclip.question_response.v1", answers: { policy: { selectedOptionIds: ["bounded"] } } } : null });+ if (stage >= 11) entries.push(permission(stage > 11 ? "resolved" : "pending"));+ const test = (seq: number, done: boolean, failed = false) => tool(seq, "exec_command", done, failed, {+ command: "pnpm exec vitest run reconnect.test.ts", result: "PASS reconnect.test.ts · 12 cases passed",+ });+ if (stage >= 12) entries.push(...nativeRunEventsToTranscript(test(20, stage > 12, true)));+ if (stage >= 14) entries.push(...nativeRunEventsToTranscript([commentary(23, stage === 14 ? text("The test process timed out before returning a result. I’ll retry the focused check once and inspect the bounded delay implementation.") : "The test process timed out before returning a result. I’ll retry the focused check once and inspect the bounded delay implementation.")]));+ if (stage >= 15) entries.push(...nativeRunEventsToTranscript(test(24, stage > 15)));+ if (stage >= 16) entries.push(...THREAD_PREVIEW_CASES.find(item => item.id === "workspace-file")!.build().entries, ...THREAD_PREVIEW_CASES.find(item => item.id === "live-token-cost")!.build().entries);+ if (stage >= 17) entries.push(...nativeRunEventsToTranscript([+ event(28, "item.started", { kind: "assistant_message", channel: "final", text: "" }, "verification-final"),+ event(29, "item.delta", { text: stage === 17 ? text(PLAYBACK_VERIFICATION_FINAL) : PLAYBACK_VERIFICATION_FINAL }, "verification-final"),+ ...(stage > 17 ? [event(30, "item.completed", { kind: "assistant_message", channel: "final", text: PLAYBACK_VERIFICATION_FINAL }, "verification-final")] : []),+ ]));+ return { entries, status: stage >= CONVERSATION_PLAYBACK_STAGES.length ? "succeeded" : "running" };+ }+ const events = reasoning(stage > 1, "summary", stage === 1 ? text(thought) : thought);+ if (stage >= 2) events.push(commentary(4, stage === 2 ? text(update) : update));+ if (stage >= 3) events.push(...tool(5, "read_file", stage > 3));+ if (stage >= 4) events.push(commentary(8, stage === 4 ? text(next) : next));+ if (stage >= 5) events.push(...tool(9, "exec_command", stage > 5));+ if (stage === 6) events.push(+ event(12, "item.started", { kind: "assistant_message", channel: "final", text: "" }, "playback-final"),+ event(13, "item.delta", { text: text(SYNTHETIC_FINAL) }, "playback-final"),+ );+ return snapshot(events);+}diff --git a/ui/src/components/design-sandbox/word-reveal.test.ts b/ui/src/components/design-sandbox/word-reveal.test.tsnew file mode 100644index 0000000000..778a6ce2a7--- /dev/null+++ b/ui/src/components/design-sandbox/word-reveal.test.ts@@ -0,0 +1,22 @@+import { describe, expect, it } from "vitest";+import { revealWordProgress, revealWords, wordCount } from "./word-reveal";++describe("whole-word preview streaming", () => {+ it("preserves Markdown, Unicode and whitespace without partial words", () => {+ const text = " I’ll inspect **components**.\n\n`ui/src/` is next. ";+ expect(wordCount(text)).toBe(6);+ expect(revealWords(text, 0)).toBe("");+ expect(revealWords(text, 1)).toBe(" I’ll ");+ expect(revealWords(text, 3)).toBe(" I’ll inspect **components**.\n\n");+ expect(revealWords(text, Infinity)).toBe(text);+ const prefixes = Array.from({ length: 101 }, (_, index) => revealWordProgress(text, index / 100));+ const completePrefixes = new Set(Array.from({ length: 6 }, (_, index) => revealWords(text, index + 1)));+ expect(prefixes.every(prefix => completePrefixes.has(prefix))).toBe(true);+ expect(prefixes.at(-1)).toBe(text);+ });+ it("handles empty text and a single long word", () => {+ expect(revealWordProgress("", 0.5)).toBe("");+ expect(revealWordProgress("reconnection", 0.2)).toBe("reconnection");+ expect(revealWordProgress("one two", 2)).toBe("one two");+ });+});diff --git a/ui/src/components/design-sandbox/word-reveal.ts b/ui/src/components/design-sandbox/word-reveal.tsnew file mode 100644index 0000000000..59bca3591e--- /dev/null+++ b/ui/src/components/design-sandbox/word-reveal.ts@@ -0,0 +1,14 @@+/** Whole whitespace-delimited words; preserve original Markdown and whitespace. */+export function wordCount(text: string): number {+ return [...text.matchAll(/\S+/gu)].length;+}+export function revealWords(text: string, count: number): string {+ const matches = [...text.matchAll(/\S+\s*/gu)];+ if (count >= matches.length) return text;+ if (count <= 0) return "";+ const last = matches[Math.floor(count) - 1];+ return last ? text.slice(0, last.index + last[0].length) : "";+}+export function revealWordProgress(text: string, progress: number): string {+ return revealWords(text, Math.max(1, Math.ceil(wordCount(text) * Math.min(1, Math.max(0, progress)))));+}diff --git a/ui/src/components/issue-properties/primitives.tsx b/ui/src/components/issue-properties/primitives.tsxindex ce2a7666a7..dcc1c8aef7 100644--- a/ui/src/components/issue-properties/primitives.tsx+++ b/ui/src/components/issue-properties/primitives.tsx@@ -21,6 +21,8 @@ export function PropertySection({<div className={className} data-property-section="true">{title ? (<div+ data-slot="property-section-label"+ data-streamlined={streamlined || undefined}className={cn(streamlined? "pb-1 font-mono text-(length:--text-nano) font-normal uppercase tracking-wide text-muted-foreground/70"diff --git a/ui/src/components/side-panel/SidePanelFrame.tsx b/ui/src/components/side-panel/SidePanelFrame.tsxindex 320c9cde4f..7f615c2aad 100644--- a/ui/src/components/side-panel/SidePanelFrame.tsx+++ b/ui/src/components/side-panel/SidePanelFrame.tsx@@ -102,11 +102,13 @@ export function SidePanelToggleButton({onToggle,shortcut,className,+ highlightWhenOpen = true,}: {open: boolean;onToggle: () => void;shortcut?: string;className?: string;+ highlightWhenOpen?: boolean;}) {const label = "Toggle side panel";return (@@ -121,7 +123,7 @@ export function SidePanelToggleButton({onClick={onToggle}className={cn("h-(--side-panel-tab-height) w-(--side-panel-tab-height)",- open && "bg-accent text-accent-foreground",+ open && highlightWhenOpen && "bg-accent text-accent-foreground",className,)}>diff --git a/ui/src/components/side-panel/use-scrollbar-while-scrolling.ts b/ui/src/components/side-panel/use-scrollbar-while-scrolling.tsindex 013caf90be..03db8dae24 100644--- a/ui/src/components/side-panel/use-scrollbar-while-scrolling.ts+++ b/ui/src/components/side-panel/use-scrollbar-while-scrolling.ts@@ -11,11 +11,11 @@ function parseCssTimeMs(value: string): number | null {}/** Marks a scroll viewport active only while scroll events are arriving. */-export function useScrollbarWhileScrolling(): UIEventHandler<HTMLDivElement> {+export function useScrollbarWhileScrolling<T extends HTMLElement = HTMLDivElement>(): UIEventHandler<T> {const idleTimerRef = useRef<number | null>(null);- const activeElementRef = useRef<HTMLDivElement | null>(null);+ const activeElementRef = useRef<T | null>(null);- const handleScroll = useCallback<UIEventHandler<HTMLDivElement>>((event) => {+ const handleScroll = useCallback<UIEventHandler<T>>((event) => {const element = event.currentTarget;activeElementRef.current = element;element.dataset.scrollActive = "true";diff --git a/ui/src/components/skill-studio/SkillsNavigationTabs.tsx b/ui/src/components/skill-studio/SkillsNavigationTabs.tsxnew file mode 100644index 0000000000..4f98cabcbd--- /dev/null+++ b/ui/src/components/skill-studio/SkillsNavigationTabs.tsx@@ -0,0 +1,25 @@+import type { ReactNode } from "react";+import { Link } from "@/lib/router";+import { useStreamlinedUiEnabled } from "@/hooks/useStreamlinedUiEnabled";+import { SKILLS_NAVIGATION_HREFS, type SkillsNavigationView } from "@/pages/skills/skills-navigation";++const views = [+ { value: "installed", label: "Installed" },+ { value: "discover", label: "Discover" },+ { value: "authored", label: "My Skills" },+] as const;++/** Route navigation with the canonical tab appearance. Sources stays in the actions menu. */+export function SkillsNavigationTabs({ activeView }: { activeView: SkillsNavigationView }) {+ return <nav aria-label="Skills views" data-canonical-tabs="standard" className="canonical-tab-list">+ {views.map(view => <Link key={view.value} to={SKILLS_NAVIGATION_HREFS[view.value]}+ className="canonical-tab" data-state={activeView === view.value ? "active" : "inactive"}+ aria-current={activeView === view.value ? "page" : undefined}>{view.label}</Link>)}+ </nav>;+}++/** Standalone Skills pages share navigation beneath their own header controls. */+export function SkillsPageNavigation({ activeView, fallback = null }: { activeView: SkillsNavigationView; fallback?: ReactNode }) {+ const { enabled } = useStreamlinedUiEnabled();+ return enabled ? <div className="shrink-0 border-b border-border px-3 py-2"><SkillsNavigationTabs activeView={activeView} /></div> : fallback;+}diff --git a/ui/src/components/skill-studio/SkillsToolbar.tsx b/ui/src/components/skill-studio/SkillsToolbar.tsxnew file mode 100644index 0000000000..47839e34e4--- /dev/null+++ b/ui/src/components/skill-studio/SkillsToolbar.tsx@@ -0,0 +1,152 @@+import { ToolbarSearch } from "@/components/ToolbarSearch";+import type { ReactNode } from "react";+import { ChevronDown, Compass, FolderSearch, Globe, Pencil, Plus, RefreshCw } from "lucide-react";+import { Link } from "@/lib/router";+import { cn } from "@/lib/utils";+import { GithubIcon } from "@/components/icons/github-icon";+import { Button } from "@/components/ui/button";+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";++export type DiscoverySort = "agents" | "stars" | "forks" | "recent" | "alphabetical";++const DISCOVERY_SORT_LABELS: Record<DiscoverySort, string> = {+ agents: "Most agents",+ stars: "Most stars",+ forks: "Most forks",+ recent: "Recently updated",+ alphabetical: "Alphabetical",+};++const DISCOVERY_SORTS: DiscoverySort[] = ["agents", "stars", "forks", "recent", "alphabetical"];++export interface SkillsToolbarProps {+ viewTitle: string;+ viewDescription: string;+ searchLabel: string;+ search: string;+ onSearchChange: (value: string) => void;+ sort: DiscoverySort;+ onSortChange: (value: DiscoverySort) => void;+ availableSources: { value: string; label: string }[];+ sourceBadgeFilter: string;+ setSourceBadgeFilter: (value: string) => void;+ onScan: () => void;+ scanPending: boolean;+ onCreate: () => void;+ onBrowseDiscover: () => void;+ onImport: () => void;+ onImportFromProject: () => void;+ folderControl?: ReactNode;+ navigation?: ReactNode;+ onCreateFolder?: () => void;+ selectMode?: boolean;+ onToggleSelectMode?: () => void;+}++/** Shared shipped Skills controls. Canonical proposal: Components / Toolbars / Skills. */+export function SkillsToolbar({ viewTitle, viewDescription, searchLabel, search, onSearchChange, sort, onSortChange, availableSources, sourceBadgeFilter, setSourceBadgeFilter, onScan, scanPending, onCreate, onBrowseDiscover, onImport, onImportFromProject, folderControl, onCreateFolder, selectMode, onToggleSelectMode, navigation }: SkillsToolbarProps) {+ return (+ <div data-canonical-toolbar="skills" role="toolbar" aria-label="Skills controls" className="flex flex-wrap items-center gap-2 border-b border-border px-4 py-3">+ <div className="w-full">+ <h1 className="text-lg font-semibold text-foreground">{viewTitle}</h1>+ <p className="text-xs text-muted-foreground">{viewDescription}</p>+ </div>+ <ToolbarSearch query={search} onQueryChange={onSearchChange} label={searchLabel} placeholder={`${searchLabel}…`} />+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="outline" size="sm">+ <span className="text-muted-foreground">Sort</span>+ <span>{DISCOVERY_SORT_LABELS[sort]}</span>+ <ChevronDown className="ml-1 h-3.5 w-3.5" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuRadioGroup value={sort} onValueChange={(value) => onSortChange(value as DiscoverySort)}>+ {DISCOVERY_SORTS.map((option) => (+ <DropdownMenuRadioItem key={option} value={option}>+ {DISCOVERY_SORT_LABELS[option]}+ </DropdownMenuRadioItem>+ ))}+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ {availableSources.length > 1 ? (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="outline" size="sm">+ <span className="text-muted-foreground">Source</span>+ <span>+ {sourceBadgeFilter === "all"+ ? "All"+ : availableSources.find((source) => source.value === sourceBadgeFilter)?.label ?? "All"}+ </span>+ <ChevronDown className="ml-1 h-3.5 w-3.5" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuRadioGroup value={sourceBadgeFilter} onValueChange={setSourceBadgeFilter}>+ <DropdownMenuRadioItem value="all">All sources</DropdownMenuRadioItem>+ {availableSources.map((source) => (+ <DropdownMenuRadioItem key={source.value} value={source.value}>+ {source.label}+ </DropdownMenuRadioItem>+ ))}+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ ) : null}+ <Button+ variant="ghost"+ size="icon-sm"+ onClick={() => onScan()}+ disabled={scanPending}+ aria-label="Scan project workspaces for skills"+ title="Scan project workspaces for skills"+ >+ <RefreshCw className={cn("h-4 w-4", scanPending && "animate-spin")} />+ </Button>+ {folderControl}+ {onCreateFolder ? (+ <Button variant="outline" size="sm" onClick={onCreateFolder}>+ <Plus className="mr-1 h-3.5 w-3.5" />+ New folder+ </Button>+ ) : null}+ {onToggleSelectMode ? (+ <Button variant="outline" size="sm" aria-pressed={selectMode} onClick={onToggleSelectMode}>+ {selectMode ? "Done" : "Select"}+ </Button>+ ) : null}+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button size="sm" variant="default" data-toolbar-primary>+ <Plus className="mr-1 h-3.5 w-3.5" />+ New+ <ChevronDown className="ml-1 h-3.5 w-3.5" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem onSelect={onCreate}>+ <Pencil className="mr-2 h-4 w-4" />+ Create new skill+ </DropdownMenuItem>+ <DropdownMenuItem onSelect={onBrowseDiscover}>+ <Compass className="mr-2 h-4 w-4" />+ Discover skills+ </DropdownMenuItem>+ <DropdownMenuItem asChild><Link to="/skills/sources/new"><GithubIcon className="mr-2 h-4 w-4" />Import from GitHub</Link></DropdownMenuItem>+ <DropdownMenuItem asChild><Link to="/skills/sources">Manage sources</Link></DropdownMenuItem>+ <DropdownMenuItem onSelect={onImport}>+ <Globe className="mr-2 h-4 w-4" />+ Import from path or URL+ </DropdownMenuItem>+ <DropdownMenuItem onSelect={onImportFromProject}>+ <FolderSearch className="mr-2 h-4 w-4" />+ Import skills from project+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ {navigation ? <div className="w-full">{navigation}</div> : null}+ </div>+ );+}diff --git a/ui/src/components/task-chat/TaskChatActivityPhase.tsx b/ui/src/components/task-chat/TaskChatActivityPhase.tsxindex f2ebeff67e..127699ff31 100644--- a/ui/src/components/task-chat/TaskChatActivityPhase.tsx+++ b/ui/src/components/task-chat/TaskChatActivityPhase.tsx@@ -83,6 +83,7 @@ export function TaskChatActivityPhase({<divclassName="min-w-0 px-1 text-sm text-foreground/90"data-testid="task-chat-phase-interstitial"+ data-conversation-text={item.interstitial.channel === "final" ? "final" : "progress"}><MarkdownBody softBreaks linkIssueReferences>{item.interstitial.text}diff --git a/ui/src/components/task-chat/TaskChatBubble.tsx b/ui/src/components/task-chat/TaskChatBubble.tsxindex 3050a00b6e..848db884a4 100644--- a/ui/src/components/task-chat/TaskChatBubble.tsx+++ b/ui/src/components/task-chat/TaskChatBubble.tsx@@ -219,6 +219,7 @@ function TaskChatBubbleContent({: Math.max(0, mediaRefs.findIndex((ref) => ref.url === lightboxSrc));return (<div+ data-conversation-message={isHuman ? "human" : "agent"}className={cn("flex w-full flex-col gap-1",animateEntry && "tc-enter-bubble",@@ -240,6 +241,7 @@ function TaskChatBubbleContent({) : null}{bodyText.length > 0 ? (<div+ data-conversation-text={isHuman ? (isOwnMessage ? "human" : "progress") : item.channel === "progress" ? "progress" : "final"}// Stable hook so the TaskChatLab bubble-treatment explorations// (PAP-501) can scope background/border overrides to the agent// bubble body without touching the live thread.diff --git a/ui/src/components/task-chat/TaskChatComposerDock.tsx b/ui/src/components/task-chat/TaskChatComposerDock.tsxindex 2c2c14bda6..03324b36ae 100644--- a/ui/src/components/task-chat/TaskChatComposerDock.tsx+++ b/ui/src/components/task-chat/TaskChatComposerDock.tsx@@ -12,6 +12,7 @@ interface TaskChatComposerDockProps {export function TaskChatComposerDock({ children, mobile, streamlined, concealed = false }: TaskChatComposerDockProps) {return <divdata-testid="task-chat-composer-dock"+ data-conversation-typography=""inert={concealed}aria-hidden={concealed || undefined}className={cn(diff --git a/ui/src/components/task-chat/TaskChatLiveRunPill.tsx b/ui/src/components/task-chat/TaskChatLiveRunPill.tsxindex 310f47e8a1..ed5ee45955 100644--- a/ui/src/components/task-chat/TaskChatLiveRunPill.tsx+++ b/ui/src/components/task-chat/TaskChatLiveRunPill.tsx@@ -6,6 +6,7 @@ import { useSecondTick } from "@/hooks/useSecondTick";import { formatDurationWords } from "@/lib/issue-chat-messages";import { isCommandTool } from "@/lib/transcriptPresentation";import { isTerminalRunStatus } from "@/components/task-chat/transcript-adapter";+import { useTaskChatShimmer } from "./TaskChatShimmer";/*** "ran N commands, called M tools" for the live tail's status pill, counted off@@ -58,6 +59,7 @@ export function TaskChatLiveRunPill({toolSummary: string | null;}) {const active = !isTerminalRunStatus(status);+ const shimmer = useTaskChatShimmer("working");// One shared page-wide ticker drives the live elapsed readout, matching the// default view's `useLiveElapsed`.useSecondTick(active && startedAtMs != null);@@ -76,7 +78,7 @@ export function TaskChatLiveRunPill({className="flex min-w-0 items-center gap-2 py-2"data-testid="task-chat-live-run-pill">- <span className="inline-flex items-center gap-2 text-sm font-medium text-foreground/80">+ <span className={cn("inline-flex items-center gap-2 text-sm font-medium text-foreground/80", active && !shimmer && "text-muted-foreground")}>{active ? (<span className="flex size-5 shrink-0 items-center justify-center"><Loader2 className="size-4 animate-spin text-muted-foreground" />@@ -86,7 +88,7 @@ export function TaskChatLiveRunPill({<span className={cn("h-1.5 w-1.5 rounded-full", (failed || active) ? "bg-muted-foreground/40" : "bg-emerald-500/70")} /></span>)}- {active ? <span className={cn("shimmer-text")}>{verb}</span> : verb}+ {active ? <span className={cn(shimmer && "shimmer-text")}>{verb}</span> : verb}</span>{suffix ? <span className="text-xs text-muted-foreground/60">{suffix}</span> : null}{toolSummary ? <span className="text-xs text-muted-foreground/40">· {toolSummary}</span> : null}diff --git a/ui/src/components/task-chat/TaskChatLiveTail.tsx b/ui/src/components/task-chat/TaskChatLiveTail.tsxindex 28b73383c3..8c372c3600 100644--- a/ui/src/components/task-chat/TaskChatLiveTail.tsx+++ b/ui/src/components/task-chat/TaskChatLiveTail.tsx@@ -7,6 +7,7 @@ import { TaskChatRunnerActivityGroup } from "./TaskChatRunnerActivityGroup";import { TaskChatThinking } from "./TaskChatThinking";import { TaskChatProtocolCard } from "./TaskChatProtocolCard";import { buildTurnTimelineRows } from "./transcript-adapter";+import { visibleTranscriptPlaceholder } from "./TaskChatShimmer";/*** Live body for legacy runner transcripts. The adapter drops debug plumbing;@@ -42,8 +43,9 @@ export function TaskChatLiveTail({.filter((row): row is ReactElement => row != null);if (rows.length === 0) {- return emptyMessage ? (- <div className="px-1 py-1 text-xs text-muted-foreground/70">{emptyMessage}</div>+ const placeholder = visibleTranscriptPlaceholder(emptyMessage);+ return placeholder ? (+ <div className="px-1 py-1 text-xs text-muted-foreground/70">{placeholder}</div>) : null;}@@ -69,6 +71,7 @@ function renderTailRow(key={item.id}className="px-1 text-sm text-foreground/90"data-testid="task-chat-live-text"+ data-conversation-text={item.channel === "final" ? "final" : "progress"}><MarkdownBody softBreaks linkIssueReferences>{item.text}diff --git a/ui/src/components/task-chat/TaskChatPlanPreviewCard.tsx b/ui/src/components/task-chat/TaskChatPlanPreviewCard.tsxindex 99ddea242e..e65b51e49b 100644--- a/ui/src/components/task-chat/TaskChatPlanPreviewCard.tsx+++ b/ui/src/components/task-chat/TaskChatPlanPreviewCard.tsx@@ -1,6 +1,7 @@import type { IssueDocument } from "@paperclipai/shared";import { Lightbulb, Maximize2 } from "lucide-react";import { cn } from "@/lib/utils";+import { useTaskChatShimmer } from "./TaskChatShimmer";import type { TaskChatProviderActivityItem } from "./task-chat-model";const PLAN_PREVIEW_LINE_COUNT = 3;@@ -82,6 +83,7 @@ export function TaskChatPlanPreviewCard({testId = "task-chat-plan-preview",className,}: TaskChatPlanPreviewCardProps) {+ const shimmer = useTaskChatShimmer(source.kind === "live" ? source.activity.id : "saved-plan");const revision = planRevision(source);const content = source.kind === "saved" && source.document? planPreviewContent(source.document.body)@@ -99,12 +101,12 @@ export function TaskChatPlanPreviewCard({aria-hiddenclassName={cn("h-4 w-4 shrink-0", live && "text-(--status-agent-running)")}/>- <span className={cn("font-medium", live && "shimmer-text shimmer-text-muted")} data-testid={live ? "task-chat-plan-streaming-status" : undefined}>+ <span className={cn("font-medium", live && shimmer && "shimmer-text shimmer-text-muted")} data-testid={live ? "task-chat-plan-streaming-status" : undefined}>{live ? "Writing plan" : "Plan"}</span>{headerDetail ? (<span- className={cn("text-xs", live && "shimmer-text shimmer-text-muted")}+ className="text-xs">· {headerDetail}</span>diff --git a/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx b/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsxindex 9a1111a58a..db708d8f91 100644--- a/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx+++ b/ui/src/components/task-chat/TaskChatProtocolActivityRow.tsx@@ -10,6 +10,7 @@ import {import { MarkdownBody } from "@/components/MarkdownBody";import { WorkspaceFileLink } from "@/components/WorkspaceFileLink";import { cn } from "@/lib/utils";+import { useTaskChatShimmer } from "./TaskChatShimmer";import type {TaskChatProtocolDetail,TaskChatProtocolItem,@@ -276,6 +277,7 @@ function itemStatus(item: TaskChatProtocolItem): "running" | "completed" | "fail}export function TaskChatProtocolActivityRow({ item }: { item: TaskChatProtocolItem }) {+ const shimmer = useTaskChatShimmer(item.id);const [open, setOpen] = useState(false);const detailId = `task-chat-protocol-activity-${useId().replaceAll(":", "")}`;const presentation = protocolActivityPresentation(item);@@ -313,8 +315,10 @@ export function TaskChatProtocolActivityRow({ item }: { item: TaskChatProtocolIt<span className="flex w-5 shrink-0 items-center justify-center"><Icon className="h-3.5 w-3.5 shrink-0" aria-hidden data-testid="task-chat-protocol-activity-icon" /></span>- <span className={cn("shrink-0 font-medium", active && "shimmer-text shimmer-text-muted")}>{label}{active ? "…" : ""}</span>- {presentation.detail ? <span className="task-chat-collapsed-line-fade min-w-0 flex-1 font-mono text-(length:--text-micro)">{presentation.detail}</span> : null}+ <span data-conversation-tool-running={active && shimmer && item.surface === "provider_activity" && item.family === "tool_execution" ? "true" : undefined} className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">+ <span className={cn("shrink-0 font-medium", active && shimmer && "shimmer-text shimmer-text-muted")}>{label}{active ? "…" : ""}</span>+ {presentation.detail ? <span className="task-chat-collapsed-line-fade min-w-0 flex-1 font-mono text-(length:--text-micro)">{presentation.detail}</span> : null}+ </span><span className="ml-auto flex shrink-0 items-center gap-2">{expandable ? (<ChevronRightdiff --git a/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx b/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsxindex 3e07ace36b..e79ce53fda 100644--- a/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx+++ b/ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx@@ -23,6 +23,7 @@ import {} from "./TaskChatProtocolActivityRow";import { TaskChatUsageReadout } from "./TaskChatUsageReadout";import { toolActivityPresentation } from "./tool-taxonomy";+import { useTaskChatShimmer } from "./TaskChatShimmer";type Activity = TaskChatActivityPhaseItem["items"][number];@@ -110,6 +111,7 @@ function ActivityContent({active: boolean;}) {const row = presentation(item, active);+ const shimmer = useTaskChatShimmer(item.id);if (!row) return null;const Icon = row.icon;return (@@ -130,11 +132,12 @@ function ActivityContent({><Icon className="size-3.5" aria-hidden="true" /></span>- <span className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden whitespace-nowrap">+ <span data-conversation-tool-running={row.running && shimmer && (item.kind === "tool" || (item.kind === "protocol" && item.surface === "provider_activity" && item.family === "tool_execution")) ? "true" : undefined} className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden whitespace-nowrap"><spanclassName={cn("max-w-full shrink-0 truncate text-xs",row.running && "text-foreground",+ row.running && shimmer && item.kind === "thinking" && "shimmer-text",)}>{row.label}@@ -209,7 +212,7 @@ function RollingActivity({function ActivityDetails({ item }: { item: Activity }) {if (item.kind === "thinking")- return <MarkdownBody softBreaks>{item.lines.join("\n")}</MarkdownBody>;+ return <div data-conversation-text="progress"><MarkdownBody softBreaks>{item.lines.join("\n")}</MarkdownBody></div>;if (item.kind === "usage") return <TaskChatUsageReadout item={item} />;if (item.kind === "protocol")return <TaskChatProtocolActivityDetails item={item} neutral />;@@ -335,6 +338,7 @@ export function TaskChatRunnerActivityGroup({<divclassName="min-w-0 px-1 text-sm text-foreground/90"data-testid="task-chat-phase-interstitial"+ data-conversation-text={item.interstitial.channel === "final" ? "final" : "progress"}><MarkdownBody softBreaks linkIssueReferences>{item.interstitial.text}diff --git a/ui/src/components/task-chat/TaskChatRunnerTurn.tsx b/ui/src/components/task-chat/TaskChatRunnerTurn.tsxindex 30263f96cd..1e48943080 100644--- a/ui/src/components/task-chat/TaskChatRunnerTurn.tsx+++ b/ui/src/components/task-chat/TaskChatRunnerTurn.tsx@@ -14,6 +14,7 @@ import { formatTaskChatTimestamp } from "./task-chat-adapter";import { TaskChatRunnerActivityGroup } from "./TaskChatRunnerActivityGroup";import { TaskChatProtocolCard } from "./TaskChatProtocolCard";import { TaskChatPlanPreviewCard } from "./TaskChatPlanPreviewCard";+import { TaskChatShimmerScope, useTaskChatShimmer } from "./TaskChatShimmer";import {buildTurnTimelineRows,isTerminalRunStatus,@@ -87,16 +88,9 @@ function RunnerTurnStatus({const failed = terminalStatusFailed(status);const label = terminal ? (failed ? "Stopped" : "Worked") : waitingLabel ?? "Working";- const semanticLabel = terminal- ? elapsed- ? `${label} ${failed ? "after" : "for"} ${elapsed}`- : label- : waitingLabel- ? `${label}${elapsed ? ` · ${elapsed}` : ""}`- : `${label} for ${elapsed ?? "0s"}`;- const visibleLabel = continuedAfterSteering- ? `Continued after steering · ${semanticLabel}`- : semanticLabel;+ const suffix = terminal+ ? elapsed ? ` ${failed ? "after" : "for"} ${elapsed}` : ""+ : waitingLabel ? elapsed ? ` · ${elapsed}` : "" : ` for ${elapsed ?? "0s"}`;return (<span@@ -106,15 +100,17 @@ function RunnerTurnStatus({aria-live="polite"aria-atomic="true">- {visibleLabel}+ {continuedAfterSteering ? <span data-conversation-meta="">Continued after steering · </span> : null}+ {label}<span data-conversation-meta="">{suffix}</span></span>);}function RunnerCurrentActivityTail({ status, waitingLabel }: { status: string; waitingLabel?: string | null }) {+ const shimmer = useTaskChatShimmer("working");if (isTerminalRunStatus(status)) return null;return <div className="mt-2 flex min-h-8 min-w-0 items-center gap-2 px-1 py-1 text-xs text-muted-foreground" data-testid="task-chat-current-activity" data-turn-position="tail">- <span className={waitingLabel ? undefined : "shimmer-text shimmer-text-muted"} aria-live="polite" data-testid="task-chat-current-activity-label">{waitingLabel ?? "Thinking"}</span>+ <span className={cn(!waitingLabel && shimmer && "shimmer-text shimmer-text-muted")} aria-live="polite" data-testid="task-chat-current-activity-label">{waitingLabel ?? "Thinking"}</span></div>;}@@ -208,7 +204,7 @@ export function TaskChatRunnerTurn({);return (- <div+ <TaskChatShimmerScope items={items}><divclassName="flex min-w-0 flex-col"data-testid="task-chat-runner-turn"data-phase={status === "queued" ? "startup" : undefined}@@ -288,6 +284,6 @@ export function TaskChatRunnerTurn({</div>) : null}{!final && currentActivityItems.length === 0 ? <RunnerCurrentActivityTail status={status} waitingLabel={waitingLabel} /> : null}- </div>+ </div></TaskChatShimmerScope>);}diff --git a/ui/src/components/task-chat/TaskChatShimmer.test.ts b/ui/src/components/task-chat/TaskChatShimmer.test.tsnew file mode 100644index 0000000000..f888b6f6a3--- /dev/null+++ b/ui/src/components/task-chat/TaskChatShimmer.test.ts@@ -0,0 +1,34 @@+import { expect, it } from "vitest";+import { taskChatShimmerOwner, visibleTranscriptPlaceholder } from "./TaskChatShimmer";+import { THREAD_PREVIEW_CASES } from "../design-sandbox/task-thread-fixtures";+import { transcriptToTaskChatItems } from "./transcript-adapter";+import type { TaskChatItem } from "./task-chat-model";++const itemsFor = (id: string) => transcriptToTaskChatItems(THREAD_PREVIEW_CASES.find(item => item.id === id)!.build().entries, { runId: "shimmer-test", running: true });+it("hands off motion from startup to reasoning to the latest tool, then stops for final text", () => {+ expect(taskChatShimmerOwner([])).toBe("working");+ for (const [fixture, kind] of [["thinking", "thinking"], ["working", "tool"], ["tool-call", "tool"]]) {+ const items = itemsFor(fixture);+ const owner = items.find(item => item.id === taskChatShimmerOwner(items));+ expect(owner?.kind).toBe(kind);+ }+ expect(taskChatShimmerOwner(itemsFor("streaming-final"))).toBeNull();+ expect(taskChatShimmerOwner(itemsFor("permission-pending"))).toBeNull();+ expect(taskChatShimmerOwner(itemsFor("tool-completed"))).toBe("working");+});+it("never reanimates an earlier outstanding tool after the provider moves on", () => {+ const tools: TaskChatItem[] = [+ { id: "old", kind: "tool", name: "exec_command", status: "in_progress" },+ { id: "new", kind: "tool", name: "read_file", status: "in_progress" },+ ];+ expect(taskChatShimmerOwner(tools)).toBe("new");+ expect(taskChatShimmerOwner([...tools, { id: "reply", kind: "message", author: "agent", text: "Done", channel: "final", streaming: true }])).toBeNull();+});+it("omits preparation plumbing but preserves meaningful waiting, recovery and errors", () => {+ for (const message of ["Preparing the turn…", "Preparing the transcript...", "Waiting for transcript...", "Loading transcript", "run phase: prepare_turn (930ms)"]) {+ expect(visibleTranscriptPlaceholder(message)).toBeUndefined();+ }+ for (const message of ["Waiting to start…", "Waiting for permission…", "Live runner activity is temporarily unavailable. Retrying…", "Workspace setup failed before the agent started."]) {+ expect(visibleTranscriptPlaceholder(message)).toBe(message);+ }+});diff --git a/ui/src/components/task-chat/TaskChatShimmer.tsx b/ui/src/components/task-chat/TaskChatShimmer.tsxnew file mode 100644index 0000000000..ddff9d8456--- /dev/null+++ b/ui/src/components/task-chat/TaskChatShimmer.tsx@@ -0,0 +1,40 @@+import { createContext, useContext, type ReactNode } from "react";+import type { TaskChatItem } from "./task-chat-model";+import { protocolActivityIsRunning } from "./task-chat-activity-presentation";++const ShimmerOwner = createContext<string | null | undefined>(undefined);++/** One current surface owns motion. Do not revive an earlier tool merely+ * because the provider has not sent its completion frame yet. */+export function taskChatShimmerOwner(items: readonly TaskChatItem[]): string | null {+ for (let index = items.length - 1; index >= 0; index--) {+ const item = items[index];+ if (item.kind === "usage" || item.kind === "status") continue;+ if (item.kind === "thinking") return item.streaming ? item.id : "working";+ if (item.kind === "tool") return item.status === "in_progress" || item.status === "pending" ? item.id : "working";+ if (item.kind === "message") return item.streaming ? null : "working";+ if (item.kind === "protocol") {+ if (item.surface === "runtime_request" && item.status === "pending") return null;+ return protocolActivityIsRunning(item) ? item.id : "working";+ }+ }+ return "working";+}++export function TaskChatShimmerScope({ items, children }: { items: readonly TaskChatItem[]; children: ReactNode }) {+ return <ShimmerOwner.Provider value={taskChatShimmerOwner(items)}>{children}</ShimmerOwner.Provider>;+}++/** Standalone specimens retain their own state unless a turn elects an owner. */+export function useTaskChatShimmer(id: string): boolean {+ const owner = useContext(ShimmerOwner);+ return owner === undefined || owner === id;+}++/** Startup plumbing is already represented by Working, rather than appearing+ * as a fake activity. Keep actionable queues, recovery and errors visible. */+export function visibleTranscriptPlaceholder(message?: string): string | undefined {+ if (!message) return undefined;+ const text = message.trim();+ return /^(?:(?:preparing|loading|waiting for)\s+(?:the\s+)?(?:transcript|turn)(?:[.…]+)?|run phase:\s*(?:prepare_turn|prepare_transcript)\b.*)$/iu.test(text) ? undefined : message;+}diff --git a/ui/src/components/task-chat/TaskChatThinking.tsx b/ui/src/components/task-chat/TaskChatThinking.tsxindex bc611355dc..c4f674ebd3 100644--- a/ui/src/components/task-chat/TaskChatThinking.tsx+++ b/ui/src/components/task-chat/TaskChatThinking.tsx@@ -4,6 +4,7 @@ import { cn } from "@/lib/utils";import { MarkdownBody } from "@/components/MarkdownBody";import type { TaskChatThinkingItem } from "./task-chat-model";import { flattenSelfTalk } from "./transcript-adapter";+import { useTaskChatShimmer } from "./TaskChatShimmer";/** Provider-authored reasoning summaries and deltas; never reconstructed hidden reasoning. */export function TaskChatThinking({@@ -21,6 +22,7 @@ export function TaskChatThinking({active?: boolean;}) {const [open, setOpen] = useState(defaultOpen ?? false);+ const shimmer = useTaskChatShimmer(item.id);const body = item.lines.join("\n").trim();const preview = flattenSelfTalk(body);const baseLabel = item.channel === "detail" ? "Reasoning detail" : "Reasoning";@@ -45,7 +47,7 @@ export function TaskChatThinking({data-testid="task-chat-thinking-icon"/></span>- <div className="min-w-0 flex-1" data-testid="task-chat-thinking-text">+ <div className="min-w-0 flex-1" data-testid="task-chat-thinking-text" data-conversation-text="progress"><MarkdownBody softBreaks linkIssueReferences>{body}</MarkdownBody></div></div>@@ -58,7 +60,7 @@ export function TaskChatThinking({<span className="flex w-5 shrink-0 items-center justify-center"><Brain className={cn("h-3.5 w-3.5 shrink-0", active && "text-(--status-agent-running)")} aria-hidden data-testid="task-chat-thinking-icon" /></span>- <span className={cn(active && "shimmer-text shimmer-text-muted")}>{label}</span>+ <span className={cn(active && shimmer && "shimmer-text shimmer-text-muted")}>{label}</span></div>);}@@ -76,7 +78,7 @@ export function TaskChatThinking({<Brain className={cn("h-3.5 w-3.5 shrink-0", active && "text-(--status-agent-running)")} aria-hidden data-testid="task-chat-thinking-icon" /></span>{active ? (- <span className="shimmer-text shimmer-text-muted shrink-0">{label}</span>+ <span className={cn("shrink-0", shimmer && "shimmer-text shimmer-text-muted")}>{label}</span>) : null}{!open ? (<span@@ -89,7 +91,7 @@ export function TaskChatThinking({<ChevronRight className={cn("tc-hover-disclosure-caret h-3 w-3 shrink-0 transition-[opacity,transform] group-hover/thinking:opacity-80 group-focus-visible/thinking:opacity-80", open ? "rotate-90 opacity-80" : "opacity-0")} aria-hidden /></button>{open ? (- <div className="task-chat-expanded-line-wrap ml-2.5 mt-1 min-w-0 max-w-full overflow-hidden border-l-2 border-border pl-2.5 text-xs font-normal text-muted-foreground">+ <div data-conversation-text="progress" className="task-chat-expanded-line-wrap ml-2.5 mt-1 min-w-0 max-w-full overflow-hidden border-l-2 border-border pl-2.5 text-xs font-normal text-muted-foreground"><MarkdownBody className="task-chat-reasoning-markdown" softBreaks linkIssueReferences>{body}</MarkdownBody></div>) : null}diff --git a/ui/src/components/task-chat/TaskChatThreadView.tsx b/ui/src/components/task-chat/TaskChatThreadView.tsxindex fd2f66d484..82e9b4fef5 100644--- a/ui/src/components/task-chat/TaskChatThreadView.tsx+++ b/ui/src/components/task-chat/TaskChatThreadView.tsx@@ -364,6 +364,7 @@ export function TaskChatThreadView({key={item.kind === "message" ? (item.renderKey ?? item.id) : item.id}+ data-conversation-typography=""data-thread-anchor={item.kind === "message" ? (item.renderKey ?? item.id) : item.id}@@ -384,6 +385,7 @@ export function TaskChatThreadView({key={item.kind === "message" ? (item.renderKey ?? item.id) : item.id}+ data-conversation-typography=""data-thread-anchor={item.kind === "message" ? (item.renderKey ?? item.id) : item.id}@@ -440,7 +442,7 @@ export function TaskChatThreadView({</div>) : null}{history}- {tail ? streamlined ? <div className="mt-4">{tail}</div> : tail : null}+ {tail ? <div data-conversation-typography="" className={streamlined ? "mt-4" : undefined}>{tail}</div> : null}</div>);diff --git a/ui/src/components/task-chat/TaskChatToolCard.tsx b/ui/src/components/task-chat/TaskChatToolCard.tsxindex 4c28dca373..4204963561 100644--- a/ui/src/components/task-chat/TaskChatToolCard.tsx+++ b/ui/src/components/task-chat/TaskChatToolCard.tsx@@ -10,6 +10,7 @@ import {} from "lucide-react";import type { TaskChatToolItem } from "./task-chat-model";import { toolTaxonomy } from "./tool-taxonomy";+import { useTaskChatShimmer } from "./TaskChatShimmer";const STATUS_ICON = {pending: { Icon: Loader2, spin: false, tone: "text-muted-foreground" },@@ -31,6 +32,7 @@ const STATUS_ICON = {*/export function TaskChatToolCard({ item }: { item: TaskChatToolItem }) {const { Icon, spin, tone } = STATUS_ICON[item.status];+ const shimmer = useTaskChatShimmer(item.id);const RowIcon = toolTaxonomy(item.rawName ?? item.name).icon;const [showDetail, setShowDetail] = useTaskChatExpansion(item.id, false);const expandable = Boolean(item.target || item.detail || item.diff);@@ -55,7 +57,7 @@ export function TaskChatToolCard({ item }: { item: TaskChatToolItem }) {data-testid="task-chat-tool-icon"/></span>- <span className="flex min-w-0 flex-1 items-baseline gap-2 overflow-hidden">+ <span data-conversation-tool-running={item.status === "in_progress" && shimmer ? "true" : undefined} className="flex min-w-0 flex-1 items-baseline gap-2 overflow-hidden"><span className="shrink-0 font-medium leading-4">{item.name}</span>{item.target ? (<span className="task-chat-collapsed-line-fade min-w-0 flex-1 font-mono text-(length:--text-micro) leading-4">diff --git a/ui/src/components/task-chat/TaskChatTurnHandoff.tsx b/ui/src/components/task-chat/TaskChatTurnHandoff.tsxnew file mode 100644index 0000000000..39b634fe76--- /dev/null+++ b/ui/src/components/task-chat/TaskChatTurnHandoff.tsx@@ -0,0 +1,48 @@+import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from "react";+import { useReducedMotion } from "motion/react";+import { parseCssTimeMs } from "./motion-tokens";++/** Keep the answer mounted while its preceding live activity fades, then+ * releases its space. Historical mounts never replay the completion motion. */+export function TaskChatTurnHandoff({ settled, activity, children }: {+ settled: boolean;+ activity: ReactNode;+ children: (complete: boolean) => ReactNode;+}) {+ const reducedMotion = useReducedMotion();+ const previousActivity = useRef<ReactNode>(null);+ const [finished, setFinished] = useState(false);+ useLayoutEffect(() => {+ if (!settled) {+ previousActivity.current = activity;+ setFinished(false);+ }+ }, [settled, activity]);+ const transitioning = settled && Boolean(previousActivity.current) && reducedMotion === false && !finished;+ const complete = settled && !transitioning;+ useEffect(() => {+ if (!transitioning) return;+ // Transition events can be skipped in a background tab or when motion+ // tokens are set to zero. Always release the retained activity eventually.+ const styles = getComputedStyle(document.documentElement);+ const duration = ["--motion-conversation-handoff-fade", "--motion-conversation-handoff-fold", "--motion-duration-fast"]+ .reduce((sum, token) => sum + parseCssTimeMs(styles.getPropertyValue(token)), 0);+ const timer = window.setTimeout(() => setFinished(true), duration);+ return () => window.clearTimeout(timer);+ }, [transitioning]);+ return <div data-testid="task-chat-turn-handoff" data-handoff-state={transitioning ? "settling" : settled ? "settled" : "live"}>+ <div+ className="conversation-handoff-activity"+ data-testid="task-chat-handoff-activity"+ data-collapsing={settled ? "true" : "false"}+ aria-hidden={settled || undefined}+ inert={settled || undefined}+ onTransitionEnd={event => {+ if (event.target === event.currentTarget && event.propertyName === "grid-template-rows" && settled) setFinished(true);+ }}+ >+ <div className="min-h-0 overflow-hidden">{settled ? transitioning ? previousActivity.current : null : activity}</div>+ </div>+ <div data-testid="task-chat-handoff-response">{children(complete)}</div>+ </div>;+}diff --git a/ui/src/components/task-chat/motion-tokens.ts b/ui/src/components/task-chat/motion-tokens.tsindex 4a7e58dc5a..08086aca40 100644--- a/ui/src/components/task-chat/motion-tokens.ts+++ b/ui/src/components/task-chat/motion-tokens.ts@@ -30,6 +30,7 @@ export const MOTION_TOKENS: MotionTokenDef[] = [{ name: "--motion-ease-scroll-pill-in", group: "Easing", kind: "easing" },{ name: "--motion-ease-scroll-pill-out", group: "Easing", kind: "easing" },{ name: "--motion-ease-in", group: "Easing", kind: "easing" },+ { name: "--motion-ease-pane-width-reset", group: "Easing", kind: "easing" },// Duration primitives{ name: "--motion-duration-instant", group: "Durations", kind: "time", min: 0, max: 1000, step: 10 },@@ -59,6 +60,13 @@ export const MOTION_TOKENS: MotionTokenDef[] = [{ name: "--motion-count-tween", group: "States", kind: "time", min: 0, max: 1500, step: 10 },{ name: "--motion-streaming-cursor-blink", group: "States", kind: "time", min: 0, max: 3000, step: 20 },{ name: "--motion-turn-fold", group: "States", kind: "time", min: 0, max: 1500, step: 10 },+ { name: "--motion-conversation-handoff-fade", group: "States", kind: "time", min: 0, max: 1500, step: 10 },+ { name: "--motion-conversation-handoff-fold", group: "States", kind: "time", min: 0, max: 1500, step: 10 },+ { name: "--motion-conversation-word-fade", group: "States", kind: "time", min: 0, max: 1500, step: 10 },+ { name: "--motion-conversation-tool-shimmer", group: "States", kind: "time", min: 0, max: 5000, step: 50 },+ { name: "--motion-sandbox-playback-step", group: "Preview", kind: "time", min: 0, max: 10000, step: 100 },+ { name: "--motion-sandbox-stream-tick", group: "Preview", kind: "time", min: 0, max: 1000, step: 10 },+ { name: "--motion-sandbox-word-tick", group: "Preview", kind: "time", min: 0, max: 1000, step: 10 },{ name: "--motion-turn-meta", group: "States", kind: "time", min: 0, max: 1500, step: 10 },{ name: "--motion-line-scroll", group: "States", kind: "time", min: 0, max: 1500, step: 10 },{ name: "--motion-interstitial-dwell", group: "States", kind: "time", min: 0, max: 10000, step: 100 },@@ -68,6 +76,7 @@ export const MOTION_TOKENS: MotionTokenDef[] = [{ name: "--motion-mobile-nav-exit", group: "States", kind: "time", min: 0, max: 1500, step: 10 },{ name: "--motion-scrollbar-idle-delay", group: "States", kind: "time", min: 0, max: 2000, step: 10 },{ name: "--motion-pane-glide", group: "States", kind: "time", min: 0, max: 1500, step: 10 },+ { name: "--motion-pane-width-reset", group: "States", kind: "time", min: 0, max: 1500, step: 10 },{ name: "--motion-side-panel-tab", group: "States", kind: "time", min: 0, max: 1500, step: 10 },];diff --git a/ui/src/components/ui/avatar-initials.tsx b/ui/src/components/ui/avatar-initials.tsxnew file mode 100644index 0000000000..e708bc747d--- /dev/null+++ b/ui/src/components/ui/avatar-initials.tsx@@ -0,0 +1,14 @@+import { createContext, useContext, type ReactNode } from "react";++const SingleInitialContext = createContext(false);++/** Proposed fallback policy; shared avatars keep their existing default until+ * a surface explicitly adopts the single-initial design. */+export function AvatarInitialProvider({ children, singleInitial = true }: { children: ReactNode; singleInitial?: boolean }) {+ return <SingleInitialContext.Provider value={singleInitial}>{children}</SingleInitialContext.Provider>;+}++export function useAvatarInitials(initials: string) {+ const singleInitial = useContext(SingleInitialContext);+ return singleInitial ? Array.from(initials.trim().toLocaleUpperCase())[0] ?? "" : initials;+}diff --git a/ui/src/components/ui/avatar.tsx b/ui/src/components/ui/avatar.tsxindex d99ec418ae..5634d06928 100644--- a/ui/src/components/ui/avatar.tsx+++ b/ui/src/components/ui/avatar.tsx@@ -2,6 +2,7 @@ import * as React from "react"import { Avatar as AvatarPrimitive } from "radix-ui"import { cn } from "@/lib/utils"+import { useAvatarInitials } from "./avatar-initials"function Avatar({className,@@ -42,8 +43,10 @@ function AvatarImage({function AvatarFallback({className,+ children,...props}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {+ const initials = useAvatarInitials(typeof children === "string" ? children : "")return (<AvatarPrimitive.Fallbackdata-slot="avatar-fallback"@@ -52,7 +55,9 @@ function AvatarFallback({className)}{...props}- />+ >+ {typeof children === "string" ? initials : children}+ </AvatarPrimitive.Fallback>)}diff --git a/ui/src/components/ui/card.tsx b/ui/src/components/ui/card.tsxindex c4e82f8518..6b7ec9cfad 100644--- a/ui/src/components/ui/card.tsx+++ b/ui/src/components/ui/card.tsx@@ -5,6 +5,7 @@ import { cn } from "@/lib/utils"function Card({className,interactive = false,+ elevation,...props}: React.ComponentProps<"div"> & {/**@@ -13,10 +14,13 @@ function Card({* it — one Card, two modes.*/interactive?: boolean+ /** Surface level in the proposed theme; omitted keeps the default card surface. */+ elevation?: "low" | "middle" | "high"}) {return (<divdata-slot="card"+ data-elevation={elevation}className={cn("bg-card text-card-foreground flex flex-col gap-6 rounded-lg border py-6",interactive &&diff --git a/ui/src/components/ui/dropdown-menu.tsx b/ui/src/components/ui/dropdown-menu.tsxindex 2c4eed01d8..af5ec0f545 100644--- a/ui/src/components/ui/dropdown-menu.tsx+++ b/ui/src/components/ui/dropdown-menu.tsx@@ -5,6 +5,7 @@ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"import { cn } from "@/lib/utils"+import { useFlyoutAppearance } from "./flyout-appearance"function DropdownMenu({...props@@ -36,10 +37,12 @@ function DropdownMenuContent({sideOffset = 4,...props}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {+ const appearance = useFlyoutAppearance()return (<DropdownMenuPrimitive.Portal><DropdownMenuPrimitive.Contentdata-slot="dropdown-menu-content"+ data-flyout-appearance={appearance}sideOffset={sideOffset}className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-(--sz-8rem) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",@@ -124,6 +127,7 @@ function DropdownMenuRadioItem({children,...props}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {+ const appearance = useFlyoutAppearance()return (<DropdownMenuPrimitive.RadioItemdata-slot="dropdown-menu-radio-item"@@ -135,7 +139,7 @@ function DropdownMenuRadioItem({><span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center"><DropdownMenuPrimitive.ItemIndicator>- <CircleIcon className="size-2 fill-current" />+ {appearance === "refreshed" ? <CheckIcon className="size-4" /> : <CircleIcon className="size-2 fill-current" />}</DropdownMenuPrimitive.ItemIndicator></span>{children}@@ -226,9 +230,11 @@ function DropdownMenuSubContent({className,...props}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {+ const appearance = useFlyoutAppearance()return (<DropdownMenuPrimitive.SubContentdata-slot="dropdown-menu-sub-content"+ data-flyout-appearance={appearance}className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-(--sz-8rem) origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",classNamediff --git a/ui/src/components/ui/flyout-appearance.tsx b/ui/src/components/ui/flyout-appearance.tsxnew file mode 100644index 0000000000..037d682bad--- /dev/null+++ b/ui/src/components/ui/flyout-appearance.tsx@@ -0,0 +1,14 @@+import { createContext, useContext, type ReactNode } from "react";++export type FlyoutAppearance = "default" | "refreshed";+const FlyoutAppearanceContext = createContext<FlyoutAppearance>("default");++/** Opt existing dropdown and popover primitives into the proposed shared style.+ * React context follows portals, so menus retain their existing behavior. */+export function FlyoutAppearanceProvider({ children, appearance = "refreshed" }: { children: ReactNode; appearance?: FlyoutAppearance }) {+ return <FlyoutAppearanceContext.Provider value={appearance}>{children}</FlyoutAppearanceContext.Provider>;+}++export function useFlyoutAppearance() {+ return useContext(FlyoutAppearanceContext);+}diff --git a/ui/src/components/ui/flyout.tsx b/ui/src/components/ui/flyout.tsxnew file mode 100644index 0000000000..2c94b30aa7--- /dev/null+++ b/ui/src/components/ui/flyout.tsx@@ -0,0 +1,26 @@+import { forwardRef, type ComponentProps, type CSSProperties } from "react";+import { Popover, PopoverContent, PopoverTrigger } from "./popover";+import { FlyoutAppearanceProvider } from "./flyout-appearance";+import { cn } from "@/lib/utils";++export { FlyoutAppearanceProvider, useFlyoutAppearance, type FlyoutAppearance } from "./flyout-appearance";++/** Proposed popover composition. Dropdowns reuse the same header, options and+ * appearance provider while retaining their menu-specific keyboard behavior. */+export function Flyout(props: ComponentProps<typeof Popover>) {+ return <FlyoutAppearanceProvider><Popover {...props} /></FlyoutAppearanceProvider>;+}++export const FlyoutTrigger = PopoverTrigger;++export function FlyoutContent({ className, style, shadow, ...props }: ComponentProps<typeof PopoverContent> & { shadow?: CSSProperties["boxShadow"] }) {+ return <PopoverContent className={cn("w-(--flyout-width)", className)} style={{ ...style, ...(shadow ? { "--shadow-flyout": shadow } : {}) } as CSSProperties} {...props} />;+}++export const FlyoutHeader = forwardRef<HTMLDivElement, ComponentProps<"div">>(function FlyoutHeader(props, ref) {+ return <div ref={ref} data-flyout-header {...props} />;+});++export const FlyoutOptions = forwardRef<HTMLDivElement, ComponentProps<"div">>(function FlyoutOptions(props, ref) {+ return <div ref={ref} data-flyout-options {...props} />;+});diff --git a/ui/src/components/ui/popover.tsx b/ui/src/components/ui/popover.tsxindex c250a7d995..96e374bc1d 100644--- a/ui/src/components/ui/popover.tsx+++ b/ui/src/components/ui/popover.tsx@@ -2,6 +2,7 @@ import * as React from "react"import { Popover as PopoverPrimitive } from "radix-ui"import { cn } from "@/lib/utils"+import { useFlyoutAppearance } from "./flyout-appearance"function Popover({...props@@ -22,9 +23,11 @@ function PopoverContent({disablePortal = false,...props}: React.ComponentProps<typeof PopoverPrimitive.Content> & { disablePortal?: boolean }) {+ const appearance = useFlyoutAppearance()const content = (<PopoverPrimitive.Contentdata-slot="popover-content"+ data-flyout-appearance={appearance}align={align}sideOffset={sideOffset}className={cn(diff --git a/ui/src/components/ui/resizable-panels.tsx b/ui/src/components/ui/resizable-panels.tsxindex dac8d716f2..15c162a29a 100644--- a/ui/src/components/ui/resizable-panels.tsx+++ b/ui/src/components/ui/resizable-panels.tsx@@ -41,7 +41,7 @@ export function ResizableHandle({ className, orientation = "horizontal", ...propreturn (<SeparatorclassName={cn(- "group relative flex items-center justify-center bg-transparent outline-none",+ "pane-resize-handle group relative flex items-center justify-center bg-transparent outline-none","focus-visible:ring-1 focus-visible:ring-ring",vertical ? "h-2 w-full cursor-row-resize" : "w-2 h-full cursor-col-resize",className,diff --git a/ui/src/context/DesignSandboxContext.test.tsx b/ui/src/context/DesignSandboxContext.test.tsxnew file mode 100644index 0000000000..dddfb6bf27--- /dev/null+++ b/ui/src/context/DesignSandboxContext.test.tsx@@ -0,0 +1,51 @@+// @vitest-environment jsdom+import { StrictMode, act } from "react";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, beforeEach, expect, it, vi } from "vitest";+import { DesignSandboxProvider, useDesignSandbox } from "./DesignSandboxContext";+import { useFlyoutAppearance } from "@/components/ui/flyout";+import { useAvatarInitials } from "@/components/ui/avatar-initials";++(globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;+let root: Root;+let host: HTMLDivElement;+function Subject() { return <><output>{String(useDesignSandbox())}:{useFlyoutAppearance()}</output><span data-testid="avatar-initials">{useAvatarInitials("BO")}</span></>; }+function render() { act(() => root.render(<StrictMode><DesignSandboxProvider><Subject /></DesignSandboxProvider></StrictMode>)); }+beforeEach(() => {+ localStorage.clear();+ vi.stubEnv("DEV", true);+ vi.stubEnv("VITE_PAPERCLIP_DESIGN_SANDBOX", "true");+ host = document.createElement("div"); document.body.append(host); root = createRoot(host);+});+afterEach(() => { act(() => root.unmount()); host.remove(); document.body.classList.remove("design-proposal-theme"); localStorage.clear(); vi.unstubAllEnvs(); });++it("requires a dev instance opt-in; browser storage cannot activate a production build", () => {+ vi.stubEnv("DEV", false); render();+ expect(host.querySelector("output")?.textContent).toBe("false:default");+ expect(host.querySelector("button")).toBeNull();+ expect(document.body.classList.contains("design-proposal-theme")).toBe(false);+});+it("does not affect ordinary development instances", () => {+ vi.stubEnv("VITE_PAPERCLIP_DESIGN_SANDBOX", "false"); render();+ expect(host.querySelector("output")?.textContent).toBe("false:default");+ expect(document.body.classList.contains("design-proposal-theme")).toBe(false);+});+it("toggles the exact proposal theme and portaled-menu appearance together and restores defaults", () => {+ render();+ expect(host.querySelector("output")?.textContent).toBe("true:refreshed");+ expect(host.querySelector('[data-testid="avatar-initials"]')?.textContent).toBe("B");+ expect(document.body.classList.contains("design-proposal-theme")).toBe(true);+ act(() => host.querySelector("button")!.click());+ expect(host.querySelector("output")?.textContent).toBe("false:default");+ expect(host.querySelector('[data-testid="avatar-initials"]')?.textContent).toBe("BO");+ expect(document.body.classList.contains("design-proposal-theme")).toBe(false);+ expect(localStorage.getItem("paperclip.design-proposals.sandbox")).toBe("off");+});+it("honors the saved off preference and cleans up the marker when unmounted", () => {+ localStorage.setItem("paperclip.design-proposals.sandbox", "off"); render();+ expect(host.querySelector("output")?.textContent).toBe("false:default");+ act(() => host.querySelector("button")!.click());+ expect(document.body.classList.contains("design-proposal-theme")).toBe(true);+ act(() => root.render(null));+ expect(document.body.classList.contains("design-proposal-theme")).toBe(false);+});diff --git a/ui/src/context/DesignSandboxContext.tsx b/ui/src/context/DesignSandboxContext.tsxnew file mode 100644index 0000000000..0da9292f8c--- /dev/null+++ b/ui/src/context/DesignSandboxContext.tsx@@ -0,0 +1,40 @@+import { createContext, useContext, useLayoutEffect, useState, type ReactNode } from "react";+import { Button } from "@/components/ui/button";+import { FlyoutAppearanceProvider } from "@/components/ui/flyout";+import { AvatarInitialProvider } from "@/components/ui/avatar-initials";++const storageKey = "paperclip.design-proposals.sandbox";+const DesignSandboxContext = createContext(false);++export function useDesignSandbox() { return useContext(DesignSandboxContext); }++/** Local integration experiment. Neither production builds nor ordinary dev+ * instances enable this through browser storage alone. */+export function DesignSandboxProvider({ children }: { children: ReactNode }) {+ const available = import.meta.env.DEV && import.meta.env.VITE_PAPERCLIP_DESIGN_SANDBOX === "true";+ const [selected, setSelected] = useState(() => {+ try { return localStorage.getItem(storageKey) !== "off"; } catch { return true; }+ });+ const enabled = available && selected;+ useLayoutEffect(() => {+ if (!enabled) return;+ // Use the exact Storybook proposal marker, including its document-wide+ // token propagation to portals. Broad propagation is intentional here.+ const hadMarker = document.body.classList.contains("design-proposal-theme");+ document.body.classList.add("design-proposal-theme");+ return () => { if (!hadMarker) document.body.classList.remove("design-proposal-theme"); };+ }, [enabled]);++ return <DesignSandboxContext.Provider value={enabled}>+ <FlyoutAppearanceProvider appearance={enabled ? "refreshed" : "default"}>+ <AvatarInitialProvider singleInitial={enabled}>{children}</AvatarInitialProvider>+ {available ? <div className="fixed bottom-3 right-3 z-(--z-200) rounded-md border border-border bg-background p-1 shadow-md">+ <Button size="sm" variant={enabled ? "secondary" : "outline"} aria-pressed={enabled} onClick={() => {+ const next = !selected;+ setSelected(next);+ try { localStorage.setItem(storageKey, next ? "on" : "off"); } catch { /* Session-only when storage is unavailable. */ }+ }}>Design proposals: {enabled ? "On" : "Off"}</Button>+ </div> : null}+ </FlyoutAppearanceProvider>+ </DesignSandboxContext.Provider>;+}diff --git a/ui/src/hooks/useHorizontalScrollEdges.ts b/ui/src/hooks/useHorizontalScrollEdges.tsnew file mode 100644index 0000000000..258423d323--- /dev/null+++ b/ui/src/hooks/useHorizontalScrollEdges.ts@@ -0,0 +1,29 @@+import { useLayoutEffect, useRef, useState } from "react";++/** Track clipping as the viewport, content or scroll position changes. */+export function useHorizontalScrollEdges() {+ const scrollRef = useRef<HTMLDivElement>(null);+ const contentRef = useRef<HTMLDivElement>(null);+ const [edges, setEdges] = useState({ left: false, right: false });++ useLayoutEffect(() => {+ const scroller = scrollRef.current;+ if (!scroller) return;+ const measure = () => {+ const left = scroller.scrollLeft > 1;+ const right = scroller.scrollWidth - scroller.clientWidth - scroller.scrollLeft > 1;+ setEdges(current => current.left === left && current.right === right ? current : { left, right });+ };+ measure();+ scroller.addEventListener("scroll", measure, { passive: true });+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);+ observer?.observe(scroller);+ if (contentRef.current) observer?.observe(contentRef.current);+ return () => {+ scroller.removeEventListener("scroll", measure);+ observer?.disconnect();+ };+ }, []);++ return { scrollRef, contentRef, edges };+}diff --git a/ui/src/hooks/usePaneWidthReset.ts b/ui/src/hooks/usePaneWidthReset.tsnew file mode 100644index 0000000000..f272fe50ca--- /dev/null+++ b/ui/src/hooks/usePaneWidthReset.ts@@ -0,0 +1,30 @@+import { useCallback, useEffect, useRef, useState, type TransitionEvent } from "react";++/** Enables width transitions only for an explicit reset, never for dragging. */+export function usePaneWidthReset() {+ const [resetting, setResetting] = useState(false);+ const timer = useRef<number | null>(null);+ const cancelReset = useCallback(() => {+ if (timer.current !== null) window.clearTimeout(timer.current);+ timer.current = null;+ setResetting(false);+ }, []);+ const startReset = useCallback(() => {+ cancelReset();+ const value = getComputedStyle(document.documentElement).getPropertyValue("--motion-pane-width-reset").trim();+ const duration = Number.parseFloat(value) * (value.endsWith("ms") ? 1 : 1000);+ if (!Number.isFinite(duration) || duration <= 0) return;+ setResetting(true);+ // Covers a no-op reset or a transition that is canceled without an end event.+ timer.current = window.setTimeout(cancelReset, duration * 2);+ }, [cancelReset]);+ const onResetTransitionEnd = useCallback((event: TransitionEvent<HTMLElement>) => {+ if (event.target === event.currentTarget && (event.propertyName === "width" || event.propertyName === "flex-basis")) {+ cancelReset();+ }+ }, [cancelReset]);+ useEffect(() => () => {+ if (timer.current !== null) window.clearTimeout(timer.current);+ }, []);+ return { resetting, startReset, cancelReset, onResetTransitionEnd };+}diff --git a/ui/src/hooks/useTaskListCollection.test.tsx b/ui/src/hooks/useTaskListCollection.test.tsxnew file mode 100644index 0000000000..6075cd5352--- /dev/null+++ b/ui/src/hooks/useTaskListCollection.test.tsx@@ -0,0 +1,105 @@+// @vitest-environment jsdom+import { act } from "react";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, beforeEach, describe, expect, it } from "vitest";+import { createIssue } from "../../storybook/fixtures/paperclipData";+import type { TaskListItem } from "@/components/TaskList";+import { taskListViewStorageKey } from "@/lib/task-list-views";+import { useTaskListCollection } from "./useTaskListCollection";++(globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;+const items: TaskListItem[] = [+ { issue: createIssue({ id: "parent", companyId: "company", parentId: null, title: "Connector reliability", createdByAgentId: null, createdByUserId: "same", assigneeUserId: null }), createdBy: "Scott", assignee: "CodexCoder" },+ { issue: createIssue({ id: "child", companyId: "company", parentId: "parent", title: "Review connector states", status: "in_review", createdByAgentId: "same", createdByUserId: null }), createdBy: "CodexCoder", unread: true },+ { issue: createIssue({ id: "grandchild", companyId: "company", parentId: "child", title: "Recover expired credentials", status: "todo", createdByAgentId: "same", createdByUserId: null }), createdBy: "CodexCoder" },+ { issue: createIssue({ id: "foreign", companyId: "other-company", parentId: null, createdByUserId: "foreign-user", createdByAgentId: null }), createdBy: "Another organization" },+];+const key = taskListViewStorageKey("collection-hook-test", "same");+type Options = Parameters<typeof useTaskListCollection>[0];+let collection: ReturnType<typeof useTaskListCollection>;+let root: Root;+let host: HTMLDivElement;+function Harness(props: Options) { collection = useTaskListCollection(props); return null; }+function render(overrides: Partial<Options> = {}) {+ act(() => root.render(<Harness items={items} companyId="company" userId="same" viewStorageKey={key} {...overrides} />));+}+beforeEach(() => {+ localStorage.clear();+ host = document.createElement("div");+ document.body.append(host);+ root = createRoot(host);+ render();+});+afterEach(() => { act(() => root.unmount()); host.remove(); localStorage.clear(); });++describe("shared task-list collection behavior", () => {+ it("distinguishes human and agent creators with the same raw ID and excludes other companies", () => {+ expect(collection.creators).toEqual([+ { id: "user:same", label: "Scott", kind: "user" },+ { id: "agent:same", label: "CodexCoder", kind: "agent" },+ ]);+ act(() => collection.updateFilters({ creators: ["user:same"] }));+ expect(collection.matchingItems.map(item => item.issue.id)).toEqual(["parent"]);+ act(() => collection.updateFilters({ creators: ["agent:same"] }));+ expect(collection.matchingItems.map(item => item.issue.id)).toEqual(["child", "grandchild"]);+ expect(collection.visibleItems.map(item => item.issue.id)).toEqual(["parent", "child", "grandchild"]);+ act(() => collection.updateFilters({ creators: ["user:same", "agent:same"] }));+ expect(collection.matchingItems).toHaveLength(3);+ });++ it("reveals a searched descendant after its ancestors were collapsed", () => {+ act(() => collection.toggleExpanded());+ expect(collection.collapsedIds.has("parent")).toBe(true);+ act(() => collection.setQuery("expired credentials"));+ expect(collection.matchingItems.map(item => item.issue.id)).toEqual(["grandchild"]);+ expect(collection.visibleItems.map(item => item.issue.id)).toEqual(["parent", "child", "grandchild"]);+ expect(collection.collapsedIds.size).toBe(0);+ });++ it("expands matching families when filters or views change, and distinguishes matches from contextual parents", () => {+ act(() => collection.toggleExpanded());+ act(() => collection.updateFilters({ statuses: ["in_review"] }));+ expect(collection.collapsedIds.size).toBe(0);+ expect(collection.matchingItems.map(item => item.issue.id)).toEqual(["child"]);+ expect(collection.visibleItems.map(item => item.issue.id)).toEqual(["parent", "child"]);+ act(() => { collection.clear(); });+ act(() => collection.toggleExpanded());+ act(() => collection.setView("unread"));+ expect(collection.collapsedIds.size).toBe(0);+ expect(collection.matchingItems.map(item => item.issue.id)).toEqual(["child"]);+ });++ it("searches metadata as well as titles, and ignores whitespace-only queries", () => {+ act(() => collection.setQuery("Scott"));+ expect(collection.matchingItems.map(item => item.issue.id)).toEqual(["parent"]);+ act(() => collection.setQuery("CodexCoder"));+ expect(collection.matchingItems).toHaveLength(3);+ act(() => collection.setQuery(" "));+ expect(collection.narrowed).toBe(false);+ expect(collection.matchingItems).toHaveLength(3);+ });++ it("keeps view preferences isolated and clears the active collection without losing layout", () => {+ act(() => collection.setView("unread"));+ act(() => collection.setLayout("board"));+ render({ viewStorageKey: taskListViewStorageKey("another-trial", "same") });+ expect(collection.view).toBe("all");+ render();+ expect(collection.view).toBe("unread");+ act(() => collection.clear());+ expect(collection.view).toBe("all");+ expect(collection.query).toBe("");+ expect(collection.narrowed).toBe(false);+ expect(collection.layout).toBe("board");+ expect(localStorage.getItem(key)).toBe("all");+ });++ it("never includes foreign tasks or ancestor context when the company changes", () => {+ act(() => collection.toggleExpanded());+ render({ companyId: "other-company" });+ expect(collection.companyItems.map(item => item.issue.id)).toEqual(["foreign"]);+ expect(collection.visibleItems.map(item => item.issue.id)).toEqual(["foreign"]);+ expect(collection.creators.map(creator => creator.id)).toEqual(["user:foreign-user"]);+ expect(collection.collapsedIds.size).toBe(0);+ });+});diff --git a/ui/src/hooks/useTaskListCollection.ts b/ui/src/hooks/useTaskListCollection.tsnew file mode 100644index 0000000000..36ba701739--- /dev/null+++ b/ui/src/hooks/useTaskListCollection.ts@@ -0,0 +1,68 @@+import { useState } from "react";+import { includeTaskListAncestors, type TaskListItem } from "@/components/TaskList";+import { applyIssueFilters, countActiveIssueFilters, defaultIssueFilterState, type IssueFilterState } from "@/lib/issue-filters";+import { loadTaskListView, matchesTaskListView, saveTaskListView, type TaskListView } from "@/lib/task-list-views";++type CreatorOption = { id: string; label: string; kind: "agent" | "user" };+const expanded: ReadonlySet<string> = new Set();++/** Shared collection behavior for the proposed task UI. Supply accessible data;+ * this hook scopes presentation, and does not replace server authorization. */+export function useTaskListCollection({ items, companyId, userId, viewStorageKey, initialQuery = "" }: {+ items: readonly TaskListItem[];+ companyId: string | null;+ userId: string | null;+ viewStorageKey: string;+ initialQuery?: string;+}) {+ const [query, setQueryState] = useState(initialQuery);+ const [preference, setPreference] = useState(() => ({ key: viewStorageKey, view: loadTaskListView(viewStorageKey) }));+ const view = preference.key === viewStorageKey ? preference.view : loadTaskListView(viewStorageKey);+ const [layout, setLayout] = useState<"list" | "board">("list");+ const [filters, setFilters] = useState<IssueFilterState>(defaultIssueFilterState);+ const [collapse, setCollapse] = useState({ companyId, ids: expanded });+ const collapsedIds = collapse.companyId === companyId ? collapse.ids : expanded;+ const setCollapsedIds = (ids: ReadonlySet<string>) => setCollapse({ companyId, ids });+ const resetExpansion = () => setCollapsedIds(expanded);++ const companyItems = items.filter(item => item.issue.companyId === companyId);+ const creatorsById = new Map<string, CreatorOption>();+ for (const item of companyItems) {+ const { createdByAgentId, createdByUserId } = item.issue;+ const rawId = createdByAgentId ?? createdByUserId;+ if (!rawId) continue;+ const kind = createdByAgentId ? "agent" : "user";+ const id = `${kind}:${rawId}`;+ creatorsById.set(id, { id, kind, label: item.createdBy || rawId });+ }+ const filteredIds = new Set(applyIssueFilters(companyItems.map(item => item.issue), filters, userId).map(issue => issue.id));+ const normalizedQuery = query.trim().toLocaleLowerCase();+ const matchingItems = companyItems.filter(item => filteredIds.has(item.issue.id)+ && matchesTaskListView(view, item.issue, Boolean(item.unread), userId)+ && [item.issue.title, item.issue.identifier, item.createdBy, item.assignee, item.issue.project?.name,+ ...(item.issue.labels ?? []).map(label => label.name)].some(value => value?.toLocaleLowerCase().includes(normalizedQuery)));+ const visibleItems = includeTaskListAncestors(companyItems, matchingItems);+ const parentIds = new Set(companyItems.flatMap(item => item.issue.parentId ? [item.issue.parentId] : []));+ const allExpanded = ![...parentIds].some(id => collapsedIds.has(id));+ const activeFilterCount = countActiveIssueFilters(filters);++ const setQuery = (next: string) => { setQueryState(next); resetExpansion(); };+ const setView = (next: TaskListView) => {+ setPreference({ key: viewStorageKey, view: next });+ saveTaskListView(viewStorageKey, next);+ resetExpansion();+ };+ const updateFilters = (patch: Partial<IssueFilterState>) => {+ setFilters(current => ({ ...current, ...patch }));+ resetExpansion();+ };+ const clear = () => { setQuery(""); setFilters(defaultIssueFilterState); setView("all"); };++ return {+ query, setQuery, view, setView, layout, setLayout, filters, updateFilters, clear,+ companyItems, matchingItems, visibleItems, creators: [...creatorsById.values()],+ collapsedIds, setCollapsedIds, allExpanded,+ toggleExpanded: () => setCollapsedIds(allExpanded ? parentIds : expanded),+ activeFilterCount, narrowed: Boolean(normalizedQuery || activeFilterCount || view !== "all"),+ };+}diff --git a/ui/src/index.css b/ui/src/index.cssindex b5b9c816f7..7b3abdbfed 100644--- a/ui/src/index.css+++ b/ui/src/index.css@@ -123,6 +123,14 @@font-weight: 100 900;}+@font-face {+ font-family: "Paper Mono";+ src: url("/fonts/PaperMono-Variable.woff2") format("woff2");+ font-display: swap;+ font-style: normal;+ font-weight: 100 800;+}+@custom-variant dark (&:is(.dark *));/* Shared file tree: preserve desktop indentation and leave room for labels on@@ -147,7 +155,6 @@@theme inline {--font-sans: "InterVariable", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;- --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-background: var(--background);--color-foreground: var(--foreground);--color-card: var(--card);@@ -159,6 +166,7 @@--color-secondary: var(--secondary);--color-secondary-foreground: var(--secondary-foreground);--color-muted: var(--muted);+ --color-muted-highlight: var(--muted-highlight);--color-muted-foreground: var(--muted-foreground);--color-accent: var(--accent);--color-accent-foreground: var(--accent-foreground);@@ -195,8 +203,15 @@--radius-4xl: calc(var(--radius) * 2.6);}+/* Keep this font runtime-resolved: the proposal/sandbox theme substitutes+ Paper Mono for every shared font-mono consumer, including portaled content. */+@theme {+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;+}+:root {color-scheme: light;+ --font-paper-mono: "Paper Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--file-tree-indent-base: calc(var(--spacing) * 2);--file-tree-indent-step: calc(var(--spacing) * 6);--file-tree-indent-max: 40%;@@ -211,6 +226,7 @@--composer-effort-halo: 0 0 0 calc(var(--spacing) * 1.5) color-mix(in oklab, var(--tc-mode-ask) 14%, transparent);--radius: 0.5rem;--background: oklch(1 0 0);+ --background-alt: var(--muted);--foreground: oklch(0.145 0 0);--card: oklch(1 0 0);--card-foreground: oklch(0.145 0 0);@@ -221,6 +237,7 @@--secondary: oklch(0.97 0 0);--secondary-foreground: oklch(0.205 0 0);--muted: oklch(0.97 0 0);+ --muted-highlight: var(--muted);--muted-foreground: oklch(0.556 0 0);--accent: oklch(0.97 0 0);--accent-foreground: oklch(0.205 0 0);@@ -229,6 +246,10 @@--border: oklch(0.922 0 0);--input: oklch(0.922 0 0);--ring: oklch(0.708 0 0);+ --focus-ring-stroke-width: 1px;+ --focus-ring-halo-width: 3px;+ --focus-ring-halo: color-mix(in srgb, var(--ring) 20%, transparent);+ --focus-ring-shadow: 0 0 0 var(--focus-ring-halo-width) var(--focus-ring-halo);--scrollbar-thumb: oklch(0.7 0 0);--scrollbar-thumb-hover: oklch(0.6 0 0);--scrollbar-size: 8px;@@ -239,6 +260,7 @@--chart-4: oklch(0.371 0 0);--chart-5: oklch(0.269 0 0);--sidebar: oklch(0.985 0 0);+ --primary-sidebar-background: color-mix(in srgb, var(--border) 50%, var(--background));--sidebar-foreground: oklch(0.145 0 0);--sidebar-primary: oklch(0.205 0 0);--sidebar-primary-foreground: oklch(0.985 0 0);@@ -417,7 +439,16 @@--motion-question-page-enter: var(--motion-duration-instant);--motion-count-tween: var(--motion-duration-slow);--motion-streaming-cursor-blink: 1.1s;+ /* Synthetic thread playback cadence; no provider or runtime is involved. */+ --motion-sandbox-stream-tick: 40ms;+ --motion-sandbox-word-tick: 60ms;+ --motion-conversation-word-fade: 320ms;+ --conversation-word-start-opacity: 0.08;+ --motion-conversation-tool-shimmer: 2.5s;+ --motion-sandbox-playback-step: 4s;--motion-turn-fold: 380ms; /* finished-turn activity folding into its summary line */+ --motion-conversation-handoff-fade: 180ms;+ --motion-conversation-handoff-fold: 480ms;--motion-turn-meta: var(--motion-duration-fast); /* finished-turn hover metadata reveal */--motion-line-scroll: 240ms; /* completed interstitial line sliding out of the 1lh live-line viewport */--motion-interstitial-dwell: 4000ms; /* interstitial update hold: minimum before the next swaps in, and how long a finished update sits before sliding away */@@ -427,6 +458,8 @@--motion-ease-scroll-pill-in: cubic-bezier(0.23, 1, 0.32, 1);--motion-ease-scroll-pill-out: cubic-bezier(0.7, 0, 0.84, 0);--motion-pane-glide: 320ms; /* properties-pane maximize/restore glide */+ --motion-pane-width-reset: 200ms;+ --motion-ease-pane-width-reset: ease-in-out;--motion-side-panel-tab: var(--motion-duration-fast);/* Portable side-panel geometry and hierarchy. These stay centralized so@@ -526,6 +559,8 @@--secondary: oklch(0.269 0 0);--secondary-foreground: oklch(0.985 0 0);--muted: oklch(0.269 0 0);+ --muted-highlight: #333333; /* Paper: --dark-color-muted-highlight. */+ --background-alt: oklch(0.145 0 0); /* Paper: --dark-color-background-alt. */--muted-foreground: oklch(0.708 0 0);--accent: oklch(0.269 0 0);--accent-foreground: oklch(0.985 0 0);@@ -542,6 +577,7 @@--chart-4: oklch(0.371 0 0);--chart-5: oklch(0.269 0 0);--sidebar: oklch(0.205 0 0);+ --primary-sidebar-background: var(--muted);--sidebar-foreground: oklch(0.985 0 0);--sidebar-primary: oklch(0.488 0.243 264.376);--sidebar-primary-foreground: oklch(0.985 0 0);@@ -1072,6 +1108,7 @@ select:where(:not([multiple]):not(.appearance-none)):where(:not([size]), [size="--motion-scroll-pill-enter: 0ms;--motion-scroll-pill-exit: 0ms;--motion-pane-glide: 0ms;+ --motion-pane-width-reset: 0ms;}}@@ -1213,6 +1250,9 @@ select:where(:not([multiple]):not(.appearance-none)):where(:not([size]), [size="/* Properties-pane maximize/restore glide (left animates between docked andsidebar-flush while the pane is position:fixed). */.tc-pane-glide { transition: left var(--motion-pane-glide) var(--motion-ease-standard); }+.sidebar-shell[data-width-resetting="true"],+.sidebar-shell[data-width-resetting="true"] > .sidebar-shell-panel { transition: width var(--motion-pane-width-reset) var(--motion-ease-pane-width-reset); }+.design-page-aside[data-width-resetting="true"] { transition: flex-basis var(--motion-pane-width-reset) var(--motion-ease-pane-width-reset); }.side-panel-tab-motion {transition-property: color, background-color, border-color, opacity, box-shadow, transform;transition-duration: var(--motion-side-panel-tab);@@ -1226,12 +1266,9 @@ select:where(:not([multiple]):not(.appearance-none)):where(:not([size]), [size="/* Sidebar actions cover the trailing live label without moving row content,fading into the row surface like the task-detail tab close control. */.primary-sidebar-surface {- --sidebar-action-rest-surface: color-mix(in srgb, var(--border) 50%, var(--background));+ --sidebar-action-rest-surface: var(--primary-sidebar-background);background-color: var(--sidebar-action-rest-surface);}-.dark .primary-sidebar-surface {- --sidebar-action-rest-surface: var(--muted);-}.sidebar-action-row {--sidebar-action-surface: var(--sidebar-action-rest-surface, var(--background));}@@ -1568,7 +1605,6 @@ select:where(:not([multiple]):not(.appearance-none)):where(:not([size]), [size="/* Shimmer text effect for active "Working" state — Cursor-style sweep */@keyframes shimmer-text-slide {0% { background-position: 100% center; }- 60% { background-position: 0% center; }100% { background-position: 0% center; }}@@ -1993,14 +2029,14 @@ a.paperclip-mention-chip[data-mention-kind="agent"]::before {.paperclip-mdxeditor-content h1 {margin: 1.4em 0 0.9em;font-size: 1.75em;- font-weight: 700;+ font-weight: var(--font-weight-bold);line-height: 1.2;}.paperclip-mdxeditor-content h2 {margin: 1.3em 0 0.85em;font-size: 1.35em;- font-weight: 700;+ font-weight: var(--font-weight-bold);line-height: 1.3;}@@ -2199,7 +2235,7 @@ a.paperclip-mention-chip[data-mention-kind="agent"]::before {}.paperclip-markdown-codeblock-action-label {- font-weight: 500;+ font-weight: var(--font-weight-medium);}/* Remove backtick pseudo-elements from inline code (prose default adds them) */@@ -2213,7 +2249,7 @@ a.paperclip-mention-chip[data-mention-kind="agent"]::before {background-color: color-mix(in oklab, var(--accent) 60%, transparent);padding: 0.15em 0.35em;border-radius: 3px;- font-weight: 500;+ font-weight: var(--font-weight-medium);}.dark .prose :not(pre) > code {@@ -3508,3 +3544,1153 @@ span.paperclip-mention-chip[data-mention-kind="external-object"] {@media (max-height: 420px) {.agent-setup-popover { overflow-y: auto; }}++/* Task-row design specimen. Opt-in until visual review; production defaults stay+ unchanged. Values live here so both densities and every story share one kit. */+:root, .dark {+ --task-row-height-comfortable: calc(var(--spacing) * 11);+ --task-row-height-compact: calc(var(--spacing) * 8);+ --task-row-padding-inline: calc(var(--spacing) * 4);+ --task-row-gap: calc(var(--spacing) * 2);+ --task-row-indent-step: calc(var(--spacing) * 6);+ --task-row-control-size: calc(var(--spacing) * 4);+ --task-row-caret-size: calc(var(--spacing) * 3.5);+ --task-row-title-size: var(--text-sm);+ --task-row-title-leading: calc(var(--spacing) * 4);+ --task-row-font-mono: var(--font-paper-mono);+ --task-row-title-weight-read: var(--font-weight-normal);+ --task-row-title-weight-unread: var(--font-weight-semibold);+ --task-row-title-color-read: var(--muted-foreground);+ --task-row-title-color-active: var(--foreground);+ --task-row-surface: transparent;+ --task-row-surface-hover: var(--accent);+ --task-row-surface-selected: color-mix(in oklab, var(--accent) 50%, transparent);+ --task-row-surface-current: color-mix(in oklab, var(--primary) 5%, transparent);+ --task-row-rule-color: var(--border);+ --task-row-rule-width: 1px;+ --task-row-radius: 0px;+ --task-row-focus-width: 2px;+ --task-row-focus-color: var(--ring);+ --task-row-guide-offset: calc(var(--task-row-indent-step) + var(--task-row-control-size) / 2);+ --task-row-identifier-width: calc(var(--spacing) * 20);+ --task-row-time-width: calc(var(--spacing) * 24);+ --task-row-title-marquee-delay: var(--motion-duration-fast);+ --task-row-title-marquee-step-duration: 25ms;+ --task-row-title-marquee-ease: linear;+ --cell-marquee-fade-width: calc(var(--spacing) * 3);+ --cell-marquee-mask-solid: #000; /* Alpha mask only; reveals the actual surface beneath the cell. */+}++.task-row-group {+ background: var(--task-list-surface);+ border-block: var(--task-row-rule-width) solid var(--task-row-rule-color);+}+.task-row-group + .task-row-group { border-top: 0; }++.task-row-refreshed {+ --task-row-height: var(--task-row-height-comfortable);+ --task-row-guide-end-gap: calc((var(--task-row-height) - var(--task-row-control-size)) / 2);+ height: var(--task-row-height);+ min-height: var(--task-row-height);+ align-items: center;+ gap: var(--task-row-gap);+ padding: 0 var(--task-row-padding-inline);+ border: 0;+ border-radius: var(--task-row-radius);+ background: var(--task-row-surface);+ font-family: var(--font-sans);+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+}+.task-row-refreshed[data-density="compact"] {+ --task-row-height: var(--task-row-height-compact);+}+.task-row-refreshed * {+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+}+.task-row-status-tooltip {+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+}+.task-row-refreshed:hover { background: var(--task-row-surface-hover); }+.task-row-refreshed[data-selected="true"] { background: var(--task-row-surface-selected); }+.task-row-refreshed[data-current-step="true"] { background: var(--task-row-surface-current); }+.task-row-refreshed .task-row-link { border-radius: var(--task-row-radius); }+.task-row-refreshed .task-row-link:focus-visible {+ outline: var(--task-row-focus-width) solid var(--task-row-focus-color);+ outline-offset: calc(var(--task-row-focus-width) * -1);+ box-shadow: none;+}+.task-row-refreshed [data-slot="task-row-leading"] {+ align-items: center;+ gap: var(--task-row-gap);+ padding-top: 0;+}+.task-row-status-link {+ position: relative;+ z-index: 10;+ display: inline-flex;+ flex-shrink: 0;+ align-items: center;+ justify-content: center;+ width: var(--task-row-control-size);+ height: var(--task-row-control-size);+}+.task-row-status-link svg { pointer-events: none; }+.task-row-status-link:focus-visible {+ outline: var(--task-row-focus-width) solid var(--task-row-focus-color);+ outline-offset: var(--task-row-rule-width);+ border-radius: var(--radius-sm);+}+.task-row-refreshed [data-slot="task-row-leading-control"] {+ display: flex;+ flex-shrink: 0;+ align-items: center;+ justify-content: center;+ width: var(--task-row-control-size);+ height: var(--task-row-control-size);+}+.task-row-refreshed .task-row-disclosure {+ width: var(--task-row-control-size);+ height: var(--task-row-control-size);+ min-height: 0;+ padding: 0;+ color: var(--task-row-title-color-read);+}+.task-row-refreshed .task-row-disclosure svg {+ width: var(--task-row-caret-size);+ height: var(--task-row-caret-size);+}+.task-row-refreshed [data-slot="task-row-tree-guide"] {+ width: calc(var(--task-row-indent-step) - var(--task-row-gap));+}+.task-row-refreshed [data-slot="task-row-tree-connector"] {+ inset-block: 0;+ left: var(--task-row-guide-offset);+ width: var(--task-row-rule-width);+ background: transparent;+ pointer-events: none;+}+/* Match the space below the parent status glyph at the group's lower boundary.+ Clip the paint so any disclosure gap stays centered within its original row. */+.task-row-group > .task-row-refreshed:last-child [data-slot="task-row-tree-guide"]:first-child [data-slot="task-row-tree-connector"] {+ clip-path: inset(0 0 var(--task-row-guide-end-gap) 0);+}+.task-row-refreshed [data-slot="task-row-tree-line"] {+ background: var(--task-row-rule-color);+}+.task-row-refreshed [data-slot="task-row-tree-gap"] {+ height: var(--task-row-control-size);+}+.task-row-refreshed [data-slot="task-row-content"] {+ flex-direction: row;+ align-items: center;+ gap: var(--task-row-gap);+}+.task-row-refreshed [data-slot="task-row-title-cluster"] { align-items: center; }+.task-row-refreshed [data-slot="task-row-title"] {+ display: block;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ -webkit-line-clamp: unset;+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+ font-weight: var(--task-row-title-weight-read);+ color: var(--task-row-title-color-read);+}+.task-row-refreshed[data-unread="true"] [data-slot="task-row-title"] {+ font-weight: var(--task-row-title-weight-unread);+ color: var(--task-row-title-color-active);+}+/* Each cell measures its own overflow. Row overlay links retain navigation;+ only the cell under the pointer (or keyboard focus) reveals its contents. */+.cell-marquee {+ display: block;+ min-width: 0;+ width: 100%;+ max-width: 100%;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}+.cell-marquee-content {+ display: block;+ pointer-events: none;+ width: 100%;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ transform: translateX(0);+ transition: none;+}+.cell-marquee-viewport { display: block; width: 100%; overflow: hidden; pointer-events: none; }+/* Mask content rather than painting a background-colored overlay, so text and+ chips fade into every real row surface, including hover and selection. */+.cell-marquee[data-truncated="true"] > .cell-marquee-viewport {+ mask-image: linear-gradient(to right, var(--cell-marquee-mask-solid) calc(100% - var(--cell-marquee-fade-width)), transparent);+}+.cell-marquee[data-revealing="true"] > .cell-marquee-viewport {+ mask-image: linear-gradient(to right, transparent, var(--cell-marquee-mask-solid) var(--cell-marquee-fade-width), var(--cell-marquee-mask-solid) calc(100% - var(--cell-marquee-fade-width)), transparent);+}+.cell-marquee[data-reveal-complete="true"] > .cell-marquee-viewport {+ mask-image: linear-gradient(to right, transparent, var(--cell-marquee-mask-solid) var(--cell-marquee-fade-width));+}+.cell-marquee[data-revealing="true"] { text-overflow: clip; }+.cell-marquee[data-revealing="true"] > .cell-marquee-viewport > .cell-marquee-content {+ width: max-content;+ overflow: visible;+ transform: translateX(calc(var(--cell-marquee-overflow) * -1px));+ transition: transform calc(var(--cell-marquee-overflow) * var(--task-row-title-marquee-step-duration)) var(--task-row-title-marquee-ease) var(--task-row-title-marquee-delay);+}+.cell-marquee:focus-visible { outline: var(--task-row-focus-width) solid var(--task-row-focus-color); outline-offset: calc(var(--task-row-focus-width) * -1); }+@media (prefers-reduced-motion: reduce) {+ .cell-marquee[data-revealing="true"] > .cell-marquee-viewport > .cell-marquee-content { transition: none; }+ .cell-marquee[data-revealing="true"] > .cell-marquee-viewport {+ mask-image: linear-gradient(to right, transparent, var(--cell-marquee-mask-solid) var(--cell-marquee-fade-width));+ }+}+.task-row-refreshed:is(:hover, :focus-within) [data-slot="task-row-title"] {+ color: var(--task-row-title-color-active);+}+.task-row-refreshed [data-slot="task-row-trailing"] { gap: var(--task-row-gap); }+.task-row-refreshed [data-slot="task-row-identifier"] {+ width: var(--task-row-identifier-width);+ font-family: var(--task-row-font-mono, var(--font-mono));+}+.task-row-refreshed [data-slot="task-row-timestamp"] { width: var(--task-row-time-width); }++/* A narrow summary reuses the standalone row anatomy without a disclosure+ gutter. Container breakpoints live here in the token/style layer: hide the+ identifier below 28rem, then time below 20rem; never change type or row density. */+.task-summary-list {+ container: task-summary / inline-size;+ min-width: 0;+ margin: 0;+ padding: 0;+ list-style: none;+}+.task-summary-list > li + li { border-top: var(--task-row-rule-width) solid var(--task-row-rule-color); }+.task-summary-row [data-slot="task-row-leading-control"] { display: none; }+.task-summary-row [data-slot="task-row-trailing"] { display: flex; }+.task-summary-row [data-slot="task-row-title-cluster"] { min-width: 0; }+.activity-row-refreshed { display: flex; min-width: 0; text-decoration: none; }+.activity-row-refreshed:focus-visible { outline: var(--task-row-focus-width) solid var(--task-row-focus-color); outline-offset: calc(var(--task-row-focus-width) * -1); }+.activity-row-details:empty { display: none; }+.activity-row-details:not(:empty) { padding: 0 var(--task-row-padding-inline) var(--task-row-gap); }+.task-row-responsive-container { container: task-summary / inline-size; }+.task-row-responsive-container [data-slot="task-row-trailing"] { display: flex; }+@container task-summary (width < 28rem) {+ .task-summary-row [data-slot="task-row-identifier"],+ .task-row-responsive-container [data-slot="task-row-identifier"],+ .task-row-responsive-container [data-slot="task-row-metadata"] { display: none; }+}+@container task-summary (width < 20rem) {+ .task-summary-row [data-slot="task-row-timestamp"],+ .task-row-responsive-container [data-slot="task-row-timestamp"] { display: none; }+}++/* Complete task-list column contract. Header and row cells share the same+ dimensions; horizontal scrolling preserves every field and title legibility. */+:root, .dark {+ --task-list-surface: var(--background);+ --task-list-header-height: var(--task-row-height-comfortable);+ --task-list-edge-fade-width: calc(var(--spacing) * 6);+ --task-list-edge-fade-surface: var(--task-list-surface);+ --task-list-controls-width: var(--task-row-height-comfortable);+ --task-list-no-controls-space: 0px;+ --task-list-controls-space: var(--task-list-no-controls-space);+ --task-list-sort-icon-size: calc(var(--spacing) * 3);+ --task-list-sort-gap: var(--spacing);+ --task-list-sort-padding: var(--spacing);+ --task-list-sort-padding-inline: calc(var(--spacing) * 2);+ --task-list-sort-radius: calc(infinity * 1px);+ --task-list-options-width: calc(var(--spacing) * 50);+ --task-list-options-padding: var(--flyout-padding);+ --task-list-options-heading-padding: var(--flyout-header-padding-inline);+ --task-list-options-gap: var(--flyout-option-gap);+ --task-list-options-item-height: var(--flyout-option-height);+ --task-list-options-item-radius: var(--flyout-option-radius);+ --task-list-options-check-size: var(--flyout-check-size);+ --task-list-options-heading-size: var(--flyout-type-size);+ --task-list-options-leading: var(--flyout-type-leading);+ --task-list-options-surface: var(--task-list-surface);+ --task-list-options-highlight: var(--muted-highlight);+ --task-row-tag-background: var(--muted-highlight);+ --task-row-tag-foreground: var(--muted-foreground);+ --task-list-column-status: calc(var(--task-row-control-size) * 2 + var(--task-row-gap));+ --task-list-column-title-min: calc(var(--spacing) * 80);+ --task-list-column-task: calc(var(--task-list-column-status) + var(--task-row-gap) + var(--task-list-column-title-min));+ --task-list-column-task-id: calc(var(--spacing) * 20);+ --task-list-column-created-by: calc(var(--spacing) * 28);+ --task-list-column-assignee: calc(var(--spacing) * 28);+ --task-list-column-project: calc(var(--spacing) * 32);+ --task-list-column-parent: calc(var(--spacing) * 36);+ --task-list-column-tags: calc(var(--spacing) * 32);+ --task-list-column-updated: calc(var(--spacing) * 26);+ --task-list-column-worktree: calc(var(--spacing) * 38);+ --task-list-detail-columns: var(--task-list-column-task-id) var(--task-list-column-created-by) var(--task-list-column-assignee) var(--task-list-column-project) var(--task-list-column-parent) var(--task-list-column-tags) var(--task-list-column-worktree) var(--task-list-column-updated);+ --task-list-columns: var(--task-list-column-status) minmax(var(--task-list-column-title-min), 1fr) var(--task-list-detail-columns);+ --task-list-min-width: calc(var(--task-list-column-status) + var(--task-list-column-title-min) + var(--task-list-column-task-id) + var(--task-list-column-created-by) + var(--task-list-column-assignee) + var(--task-list-column-project) + var(--task-list-column-parent) + var(--task-list-column-tags) + var(--task-list-column-updated) + var(--task-list-column-worktree) + var(--task-row-gap) * 9 + var(--task-row-padding-inline) * 2);+}+.task-row-design-preview { background: var(--task-list-surface); }+/* Proposal typography is shared by Storybook and the opt-in sandbox. Aliases+ migrate existing production-component recipes without restyling the ordinary+ app or stories outside the proposal theme. */+html:has(.design-proposal-theme) {+ --font-mono: var(--font-paper-mono);+ --default-mono-font-family: var(--font-paper-mono);+ --font-weight-medium: var(--font-weight-normal);+ --font-weight-bold: var(--font-weight-semibold);+ --text-micro: var(--text-xs);+ --profile-popover-meta-line-height: calc(var(--text-xs) * var(--text-xs--line-height));+}+/* Legacy micro utilities get the full xs size/leading recipe. New proposal+ code uses text-xs directly; shared component defaults stay compatible. */+html:has(.design-proposal-theme) [class~="text-(length:--text-micro)"] {+ font-size: var(--text-xs);+ line-height: var(--text-xs--line-height);+}+/* Tailwind prose and preflight also contain literal medium/bolder weights.+ Preserve explicit strong-heading rules and compact reasoning inheritance. */+html:has(.design-proposal-theme) :where(b, strong) { font-weight: var(--font-weight-semibold); }+html:has(.design-proposal-theme) .paperclip-markdown :where(a, code, blockquote) { font-weight: var(--font-weight-normal); }++/* Conversation proposal: two size/leading recipes, shared by saved threads,+ synthetic previews and the composer. Page headers and other prose are outside+ these explicit regions. Removing the proposal theme restores ordinary UI. */+html:has(.design-proposal-theme) [data-conversation-typography] {+ --conversation-human-foreground: #fff;+ --conversation-body-size: var(--text-sm);+ --conversation-body-leading: calc(var(--text-sm) * var(--text-sm--line-height));+ --conversation-meta-size: var(--text-xs);+ --conversation-meta-leading: calc(var(--text-xs) * var(--text-xs--line-height));+ font-size: var(--conversation-body-size);+ line-height: var(--conversation-body-leading);+ color: var(--muted-foreground);+}+/* Collapse inherited contrast tiers without changing semantic status colors,+ SVG icons, action-button variants or keyboard-focus treatments. */+html:has(.design-proposal-theme) [data-conversation-typography] :where([class*="text-muted-foreground"], [class*="text-foreground"]):where(:not(svg, [data-slot="button"])) {+ color: inherit;+}+html:has(.design-proposal-theme) [data-conversation-typography] :is(+ [data-conversation-meta], [data-conversation-message], [data-testid="task-chat-agent-identity"],+ [data-testid="task-chat-turn-summary"], [data-testid="task-chat-activity-phase"],+ [data-testid="task-chat-tool-card"], [data-testid="task-chat-protocol-activity-row"],+ [data-testid="task-chat-live-run-pill"], [data-testid="task-chat-current-activity"],+ [data-testid="task-chat-activity-unavailable"], [data-testid="task-chat-collapsible-marker"],+ [data-testid="task-chat-system-notice"], [data-testid="task-chat-runner-activity-detail"],+ [data-testid="task-chat-composer-actions"]+) {+ font-size: var(--conversation-meta-size);+ line-height: var(--conversation-meta-leading);+ color: var(--muted-foreground);+}+html:has(.design-proposal-theme) [data-conversation-typography] :is(+ [data-testid="task-chat-agent-identity"], [data-testid="task-chat-human-identity"]+) { font-weight: var(--font-weight-normal); }+/* Nested text utilities and tool output share their owning role's rhythm. */+html:has(.design-proposal-theme) [data-conversation-typography] :where(+ [class~="text-xs"], [class~="text-sm"], [class~="text-(length:--text-micro)"],+ [class~="leading-relaxed"], [class~="leading-4"], [class~="leading-none"]+):where(:not([data-slot="button"])) {+ font-size: inherit;+ line-height: inherit;+}+html:has(.design-proposal-theme) [data-conversation-typography] :where(+ [data-conversation-text], [data-testid="task-chat-thinking"] .paperclip-markdown,+ [data-testid="task-chat-composer-input"],+ [data-testid="task-chat-live-run-pill"] > span:first-child,+ [data-testid="task-chat-turn-status-header"]+) {+ font-size: var(--conversation-body-size);+ line-height: var(--conversation-body-leading);+ color: var(--muted-foreground);+}+html:has(.design-proposal-theme) [data-conversation-typography] [data-conversation-text="final"] { color: var(--foreground); }+html:has(.design-proposal-theme) [data-conversation-typography] [data-conversation-text="human"] { color: var(--conversation-human-foreground); }+html:has(.design-proposal-theme) [data-conversation-typography] .paperclip-markdown {+ font-size: inherit;+ line-height: inherit;+ color: inherit;+}+html:has(.design-proposal-theme) [data-conversation-typography] .paperclip-markdown :is(h1, h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, a, code, strong, b, em, th, td) {+ font-size: inherit;+ line-height: inherit;+ color: inherit;+ letter-spacing: normal;+}+html:has(.design-proposal-theme) [data-conversation-typography] .paperclip-markdown :is(h1, h2, h3, h4, h5, h6) { font-weight: var(--font-weight-normal); }+html:has(.design-proposal-theme) [data-conversation-typography] .paperclip-markdown :is(strong, b) { font-weight: var(--font-weight-semibold); }+/* Existing shared code-block rules use !important; retain their layout while+ allowing authored message and diagnostic roles to own size and contrast. */+html:has(.design-proposal-theme) [data-conversation-typography] .paperclip-markdown pre {+ font-size: inherit !important;+ line-height: inherit;+ color: inherit !important;+}+html:has(.design-proposal-theme) [data-conversation-typography] .paperclip-markdown :is(a, a:hover, a:focus-visible) { color: inherit; }+html:has(.design-proposal-theme) [data-conversation-typography] .shimmer-text {+ --shimmer-base: var(--foreground);+ --shimmer-highlight: color-mix(in oklch, var(--foreground) 35%, transparent);+ /* Two identical waves make the endpoints coincide without a blank dwell. */+ background-image: linear-gradient(90deg, var(--shimmer-base) 0%, var(--shimmer-highlight) 25%, var(--shimmer-base) 50%, var(--shimmer-highlight) 75%, var(--shimmer-base) 100%);+ animation-duration: var(--motion-conversation-tool-shimmer);+}+/* One text-clipped background spans both Inter and Paper Mono. Descendants+ inherit its text fill, rather than starting a separate sweep for each font.+ Removing the lifecycle hook restores ordinary muted metadata and hover. */+html:has(.design-proposal-theme) [data-conversation-typography] [data-conversation-tool-running="true"] {+ color: var(--foreground);+ --shimmer-base: var(--foreground);+ --shimmer-highlight: color-mix(in oklch, var(--foreground) 35%, transparent);+ background-image: linear-gradient(90deg, var(--shimmer-base) 0%, var(--shimmer-highlight) 25%, var(--shimmer-base) 50%, var(--shimmer-highlight) 75%, var(--shimmer-base) 100%);+ background-size: 200% 100%;+ background-clip: text;+ -webkit-background-clip: text;+ -webkit-text-fill-color: transparent;+ animation: shimmer-text-slide var(--motion-conversation-tool-shimmer) linear infinite;+}+html:has(.design-proposal-theme) [data-conversation-typography] [data-conversation-tool-running="true"] > span {+ background: none;+ animation: none;+ -webkit-text-fill-color: inherit;+}+++/* Agent identity uses the body size with foreground semibold emphasis. */+html:has(.design-proposal-theme) [data-conversation-typography] :is([data-testid="task-chat-agent-identity"], [data-testid="task-chat-agent-identity"] > span:last-child) {+ font-size: var(--conversation-body-size);+ line-height: var(--conversation-body-leading);+ font-weight: var(--font-weight-semibold);+ color: var(--foreground);+}+/* Restore the neutral interactive metadata treatment suppressed by contrast+ normalization. Preserve semantic status accents and action-button variants. */+html:has(.design-proposal-theme) [data-conversation-typography] :is(+ button[data-testid="task-chat-turn-summary"],+ button[data-testid="task-chat-activity-phase-toggle"],+ [data-activity-item-id] > button,+ [data-testid="task-chat-tool-card"] > button,+ [data-testid="task-chat-thinking"] > button,+ [data-testid="task-chat-protocol-activity-row"] button[aria-expanded],+ [data-testid="task-chat-system-notice"] button[aria-expanded],+ [data-testid="task-chat-collapsible-marker"] button[aria-expanded]+):is(:hover, :focus-visible):not(:disabled) {+ color: var(--foreground);+ background-color: color-mix(in srgb, var(--muted) 40%, transparent);+ border-radius: var(--radius-sm);+}+@keyframes conversation-word-in {+ from { opacity: var(--conversation-word-start-opacity); }+ to { opacity: 1; }+}+.conversation-handoff-activity {+ display: grid;+ grid-template-rows: 1fr;+ opacity: 1;+ transition: opacity var(--motion-conversation-handoff-fade) var(--motion-ease-out),+ grid-template-rows var(--motion-conversation-handoff-fold) var(--motion-ease-standard) var(--motion-conversation-handoff-fade);+}+.conversation-handoff-activity[data-collapsing="true"] {+ grid-template-rows: 0fr;+ opacity: 0;+}+[data-handoff-state="settled"] [data-testid="task-chat-bubble-attached-turn"] {+ animation: conversation-word-in var(--motion-conversation-handoff-fade) var(--motion-ease-out) both;+}+html:has(.design-proposal-theme) [data-conversation-typography] .conversation-stream-word {+ animation: conversation-word-in var(--motion-conversation-word-fade) var(--motion-ease-out) both;+}+@media (prefers-reduced-motion: reduce) {+ .conversation-handoff-activity { transition: none; }+ [data-handoff-state="settled"] [data-testid="task-chat-bubble-attached-turn"] { animation: none; }+ html:has(.design-proposal-theme) [data-conversation-typography] .conversation-stream-word { animation: none; }+ html:has(.design-proposal-theme) [data-conversation-typography] [data-conversation-tool-running="true"] {+ animation: none;+ background-image: none;+ -webkit-text-fill-color: currentColor;+ }+}++/* Paper color foundation, scoped to proposed stories. The other six semantic+ colors already match Paper's dark tokens in .dark above. Scope at html so+ Radix portals inherit the same values; removing the story marker restores+ the existing production theme. Source: Paper Dark mode frame 3LXU-2. */+html.dark:has(.design-proposal-theme) {+ --background: #1a1a1a;+ --muted-alt: #202020;+ --card: var(--background);+ --card-foreground: var(--muted-foreground);+ --popover: var(--background);+ --accent: var(--muted-highlight);+ --input: var(--border);+ /* Focus follows foreground independently of neutral pane-divider interactions. */+ --ring: var(--foreground);+ --sidebar-ring: var(--ring);+ --pane-resize-highlight: oklch(0.556 0 0);+ --task-row-surface-hover: var(--muted);+ background: var(--background);+}+/* Light proposals inherit production semantic colors. Proposal-only surface+ names alias existing production tokens rather than introducing a palette. */+html:not(.dark):has(.design-proposal-theme) {+ --muted-alt: var(--secondary);+ --design-sidebar-surface: var(--primary-sidebar-background);+ --design-sidebar-item-foreground: color-mix(in oklab, var(--foreground) 80%, transparent);+ --design-sidebar-item-highlight: var(--sidebar-accent);+ --design-sidebar-item-active-foreground: var(--sidebar-accent-foreground);+}+.design-proposal-theme { color: var(--muted-foreground); }+html.dark:has(.design-proposal-theme) .pane-resize-handle { --ring: var(--pane-resize-highlight); }+html:has(.design-proposal-theme) :is(body, #storybook-root) { background: var(--background); }+html:has(.design-proposal-theme) [data-slot="input"] { background: var(--background-alt); border-color: var(--border); color: var(--muted-foreground); }+html:has(.design-proposal-theme) [data-slot="input"]:focus-visible { border-color: var(--ring); }+/* Bright edge with a softer outer halo, matching the production focus treatment.+ Trigger wrappers replace Button's slot, so include those identities too.+ Resize controls keep their separate neutral interaction color. */+html:has(.design-proposal-theme) :where([data-slot="input"], [data-slot="textarea"], [data-slot="button"], [data-slot="tooltip-trigger"], [data-slot="dropdown-menu-trigger"], [data-slot="popover-trigger"], [data-slot="select-trigger"], [data-slot="checkbox"], [data-slot="tabs-trigger"], [role="tab"], select):focus-visible:where(:not([aria-invalid="true"], [data-variant="destructive"], .pane-resize-handle, .pane-resize-handle *, .design-task-search input)) {+ --tw-ring-color: var(--focus-ring-halo);+ --tw-ring-shadow: var(--focus-ring-shadow);+ outline: var(--focus-ring-stroke-width) solid var(--ring);+ outline-offset: calc(-1 * var(--focus-ring-stroke-width));+ box-shadow: var(--focus-ring-shadow);+}+html:has(.design-proposal-theme) :where(.task-row-link, .task-row-status-link, .cell-marquee, .activity-row-refreshed, .task-list-sort-button, .design-page-content, .design-sidebar-recent-list, .design-sidebar a, .task-filter-search input):focus-visible {+ outline: var(--focus-ring-stroke-width) solid var(--ring);+ outline-offset: calc(-1 * var(--focus-ring-stroke-width));+ box-shadow: var(--focus-ring-shadow);+}+html:has(.design-proposal-theme) [data-slot="card"] { border-color: var(--border); }+html:has(.design-proposal-theme) [data-slot="card"][data-elevation="middle"] { background: var(--muted-alt); }+html:has(.design-proposal-theme) [data-slot="card"][data-elevation="high"] { background: var(--muted); }+html:has(.design-proposal-theme) [data-slot="card-title"] { color: var(--foreground); }+.task-list-columns-scroll { overflow-x: auto; isolation: isolate; }+.task-list-viewport,+.horizontal-scroll-viewport { position: relative; min-width: 0; background: var(--task-list-surface); }+.horizontal-scroll-area { overflow-x: auto; }+.horizontal-scroll-content { width: max-content; min-width: 100%; }+.task-list-viewport::before,+.task-list-viewport::after,+.horizontal-scroll-viewport::before,+.horizontal-scroll-viewport::after {+ content: "";+ position: absolute;+ inset-block: 0;+ width: var(--task-list-edge-fade-width);+ pointer-events: none;+ z-index: 1;+ opacity: 0;+}+.task-list-viewport::before,+.horizontal-scroll-viewport::before {+ left: 0;+ background: linear-gradient(to right, var(--task-list-edge-fade-surface), transparent);+}+.task-list-viewport::after,+.horizontal-scroll-viewport::after {+ right: 0;+ background: linear-gradient(to left, var(--task-list-edge-fade-surface), transparent);+}+.task-list-viewport[data-overflow-left="true"]::before,+.task-list-viewport[data-overflow-right="true"]::after,+.horizontal-scroll-viewport[data-overflow-left="true"]::before,+.horizontal-scroll-viewport[data-overflow-right="true"]::after { opacity: 1; }+.task-list-columns-content { min-width: var(--task-list-min-width); }+.task-list-column-header {+ display: grid;+ grid-template-columns: var(--task-list-columns);+ align-items: center;+ gap: var(--task-row-gap);+ height: var(--task-list-header-height);+ padding-inline: var(--task-row-padding-inline) calc(var(--task-row-padding-inline) + var(--task-list-controls-space));+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+ font-weight: var(--font-weight-medium);+ color: var(--muted-foreground);+}+.task-row-refreshed[data-columns="all"] [data-slot="task-row-trailing"] { display: contents; }+.task-row-refreshed[data-columns="all"] {+ display: grid;+ grid-template-columns: var(--task-list-columns);+ grid-template-rows: minmax(0, 1fr);+ padding-inline-end: calc(var(--task-row-padding-inline) + var(--task-list-controls-space));+}+.task-row-refreshed[data-columns="all"] [data-slot="task-row-leading"] { grid-column: var(--task-list-task-start); grid-row: 1; }+.task-row-refreshed[data-columns="all"] [data-slot="task-row-content"] {+ grid-column: calc(var(--task-list-task-start) + 1);+ grid-row: 1;+ padding-inline-start: calc(var(--task-row-depth) * var(--task-row-indent-step));+}+.task-row-refreshed[data-title-hidden="true"] [data-slot="task-row-content"] { display: none; }+.task-row-refreshed[data-title-hidden="true"] [data-slot="task-row-leading"] { flex: 1; }+.task-row-refreshed[data-columns="all"] [data-slot="task-row-trailing"]:empty { display: none; }+.task-row-columns {+ display: contents;+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+ color: var(--muted-foreground);+}+.task-row-column {+ grid-row: 1;+ align-self: center;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}+.task-row-column > * { max-width: 100%; }+.task-row-columns [data-column="tags"] [data-slot="badge"] {+ color: var(--task-row-tag-foreground);+ background-color: var(--task-row-tag-background);+ border-color: var(--task-row-tag-background);+}+.task-row-columns :is([data-column="taskId"], [data-column="worktree"]),+.task-row-columns [data-column="parentTask"] .font-mono {+ font-family: var(--task-row-font-mono);+}++.task-list-column-header [role="columnheader"] { min-width: 0; }+.task-list-column-header [data-dragging="true"] { position: relative; z-index: 10; }+.task-list-column-header .task-list-sort-button {+ display: inline-flex;+ align-items: center;+ gap: var(--task-list-sort-gap);+ margin-inline-start: calc(var(--task-list-sort-padding-inline) * -1);+ padding: var(--task-list-sort-padding) var(--task-list-sort-padding-inline);+ height: calc(var(--task-row-title-leading) + var(--task-list-sort-padding) * 2);+ border-radius: var(--task-list-sort-radius);+ font-size: var(--task-row-title-size);+ line-height: var(--task-row-title-leading);+ color: var(--muted-foreground);+ white-space: nowrap;+ cursor: pointer;+}+.task-list-sort-button svg { width: var(--task-list-sort-icon-size); height: var(--task-list-sort-icon-size); flex-shrink: 0; }+.task-list-column-header [data-column="task"] {+ padding-inline-start: calc(var(--task-list-column-status) + var(--task-row-gap));+}+.task-list-sort-button[data-active="true"] { background: var(--muted-highlight); color: var(--foreground); }+.task-list-sort-button:hover { background: var(--muted-highlight); color: var(--foreground); }+.task-list-sort-button[data-reorderable="true"] { cursor: grab; touch-action: pan-y; }+.task-list-column-header [data-dragging="true"] .task-list-sort-button { cursor: grabbing; }+.task-list-sort-button:focus-visible {+ outline: var(--task-row-focus-width) solid var(--task-row-focus-color);+ outline-offset: var(--task-row-rule-width);+ box-shadow: none;+}+.task-list-header-controls {+ position: absolute;+ inset-block-start: 0;+ inset-inline-end: 0;+ z-index: 2;+ display: flex;+ align-items: center;+ justify-content: center;+ width: var(--task-list-controls-width);+ height: var(--task-list-header-height);+ background: var(--task-list-surface);+}+.task-list-settings-trigger { color: var(--muted-foreground); }+.task-list-settings-trigger:is(:hover, [data-state="open"]) { background: var(--muted-highlight); color: var(--foreground); }+.task-list-options {+ width: var(--task-list-options-width);+ padding: 0;+ border: var(--task-row-rule-width) solid var(--border);+ border-radius: var(--radius-lg);+ background: var(--task-list-options-surface);+ box-shadow: none;+ font-size: var(--task-row-title-size);+ line-height: var(--task-list-options-leading);+}+.task-list-options-heading {+ padding: var(--task-list-options-padding) var(--task-list-options-heading-padding);+ border-bottom: var(--task-row-rule-width) solid var(--border);+ font-size: var(--task-list-options-heading-size);+ line-height: var(--task-list-options-leading);+ font-weight: var(--font-weight-semibold);+ color: var(--foreground);+}+.task-list-options-items { display: flex; flex-direction: column; gap: var(--task-list-options-gap); padding: var(--task-list-options-padding); }+.task-list-options-item {+ height: var(--task-list-options-item-height);+ flex-shrink: 0;+ padding: var(--task-list-options-gap) var(--task-list-options-padding);+ padding-inline-end: calc(var(--task-list-options-padding) + var(--task-list-options-check-size) + var(--task-row-gap));+ border-radius: var(--task-list-options-item-radius);+ font-size: var(--task-row-title-size);+ line-height: var(--task-list-options-leading);+ font-weight: var(--font-weight-normal);+ color: var(--muted-foreground);+}+.task-list-options-item > span { left: auto; right: var(--task-list-options-padding); }+.task-list-options-item svg { width: var(--task-list-options-check-size); height: var(--task-list-options-check-size); }+.task-list-options-item[data-highlighted] { background: var(--task-list-options-highlight); color: var(--foreground); }+.task-list-options-reset {+ height: var(--task-list-options-item-height);+ flex-shrink: 0;+ justify-content: center;+ padding: var(--task-list-options-gap) var(--task-list-options-padding);+ border: 0;+ outline: var(--task-row-rule-width) solid var(--task-list-options-highlight);+ border-radius: var(--task-list-options-item-radius);+ background: var(--muted);+ color: var(--foreground);+ font-size: var(--task-list-options-heading-size);+ line-height: var(--task-list-options-leading);+ font-weight: var(--font-weight-semibold);+}+.task-list-options-reset[data-highlighted] { background: var(--task-list-options-highlight); }++/* One opt-in appearance for the existing Radix dropdown and popover primitives.+ Context follows portals; default production surfaces retain their styling. */+:root, .dark {+ --flyout-surface: var(--background);+ --flyout-border: var(--border);+ --flyout-highlight: var(--muted-highlight);+ --flyout-foreground: var(--foreground);+ --flyout-item-foreground: var(--muted-foreground);+ --flyout-radius: var(--radius-lg);+ --flyout-width: calc(var(--spacing) * 50);+ --flyout-padding: calc(var(--spacing) * 3);+ --flyout-header-padding-inline: calc(var(--spacing) * 6);+ --flyout-option-gap: var(--spacing);+ --flyout-option-height: var(--task-row-height-compact);+ --flyout-option-radius: var(--spacing);+ --flyout-check-size: var(--task-row-caret-size);+ --flyout-type-size: var(--text-sm);+ --flyout-type-leading: calc(var(--spacing) * 5);+ --shadow-flyout: 0 4px 16px rgb(0 0 0 / 20%);+ --task-preview-width: calc(var(--spacing) * 70);+ --task-preview-padding: calc(var(--spacing) * 4);+ --task-preview-gap: calc(var(--spacing) * 3);+ --task-preview-meta-gap: calc(var(--spacing) * 2);+ --task-preview-meta-size: var(--text-xs);+ --task-preview-meta-leading: calc(var(--spacing) * 4);+ --task-preview-title-size: var(--text-sm);+ --task-preview-content-leading: calc(var(--spacing) * 4.5);+ --task-preview-title-lines: 2;+ --task-preview-description-lines: 3;+}+[data-flyout-appearance="refreshed"] {+ min-height: 0;+ padding: 0;+ border: var(--task-row-rule-width) solid var(--flyout-border);+ border-radius: var(--flyout-radius);+ background: var(--flyout-surface);+ color: var(--flyout-item-foreground);+ box-shadow: var(--shadow-flyout);+ font-size: var(--flyout-type-size);+ line-height: var(--flyout-type-leading);+}+/* Task previews share the popover surface and shadow, but their content is a+ single padded card rather than a menu with separately padded sections. */+[data-quicklook][data-flyout-appearance="refreshed"] {+ width: var(--task-preview-width);+ max-width: var(--radix-popover-content-available-width, 100vw);+ padding: var(--task-preview-padding);+}+.task-hover-card { display: flex; flex-direction: column; gap: var(--task-preview-gap); }+.task-hover-card [data-slot="task-preview-meta"],+.task-hover-card [data-slot="task-preview-identity"] { gap: var(--task-preview-meta-gap); }+.task-hover-card [data-slot="task-preview-id"],+.task-hover-card [data-slot="task-preview-time"] {+ color: var(--muted-foreground);+ font-size: var(--task-preview-meta-size);+ line-height: var(--task-preview-meta-leading);+}+.task-hover-card [data-slot="task-preview-title"] {+ color: var(--foreground);+ font-size: var(--task-preview-title-size);+ font-weight: var(--font-weight-semibold);+ line-height: var(--task-preview-content-leading);+ -webkit-line-clamp: var(--task-preview-title-lines);+}+.task-hover-card [data-slot="task-preview-description"] {+ color: var(--muted-foreground);+ font-size: var(--task-preview-meta-size);+ line-height: var(--task-preview-content-leading);+ -webkit-line-clamp: var(--task-preview-description-lines);+}+[data-flyout-appearance="refreshed"] [data-flyout-header] {+ height: auto;+ padding: var(--flyout-padding) var(--flyout-header-padding-inline);+ border: 0;+ border-bottom: var(--task-row-rule-width) solid var(--flyout-border);+ color: var(--flyout-foreground);+ font-size: var(--flyout-type-size);+ line-height: var(--flyout-type-leading);+ font-weight: var(--font-weight-semibold);+}+[data-flyout-appearance="refreshed"] [data-flyout-header] [data-slot="dropdown-menu-label"] { padding: 0; font: inherit; color: inherit; }+[data-flyout-appearance="refreshed"] [data-flyout-header] > button { color: var(--flyout-item-foreground); }+[data-flyout-appearance="refreshed"] [data-flyout-header] > button:hover { background: var(--flyout-highlight); color: var(--flyout-foreground); }+[data-flyout-appearance="refreshed"] [data-flyout-profile] { padding: var(--flyout-header-padding-inline); }+[data-flyout-appearance="refreshed"] [data-flyout-profile] > a:hover { background: var(--flyout-highlight); }+[data-flyout-appearance="refreshed"] [data-flyout-options] {+ display: flex;+ flex: none;+ flex-direction: column;+ gap: var(--flyout-option-gap);+ padding: var(--flyout-padding);+ border-top: 0;+}+[data-flyout-appearance="refreshed"] [data-flyout-options] + [data-flyout-options] { border-top: var(--task-row-rule-width) solid var(--flyout-border); }+[data-flyout-appearance="refreshed"] :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-checkbox-item"], [data-slot="dropdown-menu-radio-item"], [data-flyout-options] > a, [data-flyout-options] > button) {+ min-height: var(--flyout-option-height);+ border-radius: var(--flyout-option-radius);+ padding-inline: var(--flyout-padding);+ color: var(--flyout-item-foreground);+ font-size: var(--flyout-type-size);+ line-height: var(--flyout-type-leading);+ font-weight: var(--font-weight-normal);+}+[data-flyout-appearance="refreshed"] :is([data-slot="dropdown-menu-checkbox-item"], [data-slot="dropdown-menu-radio-item"]) { padding-inline-end: calc(var(--flyout-padding) + var(--flyout-check-size) + var(--flyout-option-gap) * 2); }+[data-flyout-appearance="refreshed"] [data-flyout-options] > :is(a, button) { height: var(--flyout-option-height); }+[data-flyout-appearance="refreshed"] :is([data-slot="dropdown-menu-checkbox-item"], [data-slot="dropdown-menu-radio-item"]) > span { left: auto; right: var(--flyout-padding); }+[data-flyout-appearance="refreshed"] :is([data-slot="dropdown-menu-checkbox-item"], [data-slot="dropdown-menu-radio-item"]) svg { width: var(--flyout-check-size); height: var(--flyout-check-size); }+[data-flyout-appearance="refreshed"] :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-checkbox-item"], [data-slot="dropdown-menu-radio-item"], [data-flyout-options] > a, [data-flyout-options] > button) :is(.text-muted-foreground, .text-foreground, svg) { color: inherit; }+[data-flyout-appearance="refreshed"] :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-checkbox-item"], [data-slot="dropdown-menu-radio-item"], [data-flyout-options] > a, [data-flyout-options] > button):is([data-highlighted], :hover, :focus-visible) {+ background: var(--flyout-highlight);+ color: var(--flyout-foreground);+}+[data-flyout-appearance="refreshed"] [data-flyout-options] .task-list-options-reset { font-weight: var(--font-weight-semibold); }++/* Full-page proposal: compose the reviewed collection with the shared sidebar+ shell and controls. These values stay opt-in until page-level approval. */+:root, .dark {+ --design-page-height: 100dvh;+ --design-page-header-height: calc(var(--spacing) * 15);+ --design-page-aside-width: var(--sz-320px);+ --design-page-aside-max-width: 30%;+ --design-page-aside-min-width: var(--sz-260px);+ --design-page-main-min-width: var(--sz-320px);+ --design-page-aside-resize-step: 16px;+ --design-page-aside-resize-hit-width: calc(var(--spacing) * 2);+ --design-page-inset: calc(var(--spacing) * 6);+ --design-page-section-gap: calc(var(--spacing) * 8);+ --design-page-toolbar-gap: calc(var(--spacing) * 4);+ --design-page-control-height: var(--task-row-height-comfortable);+ --design-page-control-padding: calc(var(--spacing) * 3);+ --design-page-control-radius: var(--radius-md);+ --design-page-search-width: calc(var(--spacing) * 68);+ --design-page-search-min: calc(var(--spacing) * 40);+ --design-page-search-surface: var(--background-alt);+ --design-sidebar-surface: var(--muted); /* Paper: --dark-color-muted. */+ --design-sidebar-border: var(--border); /* Paper: --dark-color-border. */+ --design-sidebar-item-foreground: var(--muted-foreground);+ --design-sidebar-item-highlight: var(--muted-highlight);+ --design-sidebar-item-active-foreground: var(--foreground);+ --design-page-control-surface: color-mix(in oklab, var(--foreground) 4%, var(--task-list-surface));+ /* Opaque so the search field's darker fill doesn't change the visible border. */+ --design-page-control-border: color-mix(in srgb, var(--foreground) 15%, var(--design-page-control-surface));+ --design-page-icon-size: calc(var(--spacing) * 4);+ --design-page-control-gap: calc(var(--spacing) * 2);+ --design-page-action-gap: var(--spacing);+ --design-page-type-size: var(--text-sm);+ --design-page-type-leading: calc(var(--spacing) * 5);+ --design-page-heading-tracking: 0.05em;+ --design-sidebar-inset: calc(var(--spacing) * 3);+ --design-sidebar-item-inset: calc(var(--spacing) * 2);+ --design-sidebar-label-leading: 1.5;+ --design-sidebar-item-height: calc(var(--text-sm) * var(--design-sidebar-label-leading) + var(--spacing) * 3);+ --design-sidebar-item-gap: calc(var(--spacing) * 0.5);+ --design-sidebar-heading-tracking: 0.1em;+ --design-sidebar-label-size: var(--text-sm);+ --design-page-focus-width: var(--task-row-focus-width);+}+.design-page-shell { display: flex; position: relative; height: var(--design-page-height); overflow: hidden; color: var(--foreground); }+.design-page-main { display: flex; flex: 1; flex-direction: column; min-width: 0; background: var(--task-list-surface); }+.design-page-aside { position: relative; display: flex; flex-direction: column; flex: 0 0 clamp(var(--design-page-aside-min-width), var(--design-page-aside-user-width, min(var(--design-page-aside-width), var(--design-page-aside-max-width))), var(--design-page-aside-available-width, 100%)); min-width: 0; background: var(--background); border-inline-start: var(--task-row-rule-width) solid var(--border); }+.design-page-aside-resize { left: calc(var(--design-page-aside-resize-hit-width) / -2); width: var(--design-page-aside-resize-hit-width); }+.design-page-shell[data-aside-maximized="true"] > .design-page-main { display: none; }+.design-page-shell[data-aside-maximized="true"] > .design-page-aside { flex: 1; }+.design-page-header-actions { display: flex; align-items: center; margin-inline-start: auto; }+.design-page-header.design-page-aside-header { min-width: 0; gap: var(--spacing); padding-inline: calc(var(--spacing) * 2); }+.design-page-aside-tabs { display: flex; flex: 1; align-self: stretch; min-width: 0; }+.design-page-aside-controls { display: flex; flex-shrink: 0; align-items: center; gap: var(--spacing); }+.design-page-header { display: flex; align-items: center; height: var(--design-page-header-height); flex-shrink: 0; padding-inline: var(--design-page-inset); border-bottom: var(--task-row-rule-width) solid var(--border); }+.design-page-header :is(h1, h2) { font-size: var(--design-page-type-size); line-height: var(--design-page-type-leading); font-weight: var(--font-weight-semibold); text-transform: uppercase; letter-spacing: var(--design-page-heading-tracking); }+.design-page-content { display: flex; flex: 1; flex-direction: column; gap: var(--design-page-section-gap); min-height: 0; overflow-y: auto; padding: var(--design-page-inset); outline: none; }+.design-page-aside .design-page-content { overscroll-behavior-y: contain; }+.design-page-aside .design-page-content:focus-visible { outline: var(--design-page-focus-width) solid var(--ring); outline-offset: calc(-1 * var(--design-page-focus-width)); }+.design-page-skip-link { position: absolute; z-index: var(--z-60); top: var(--design-page-inset); left: var(--design-page-inset); padding: var(--design-page-control-padding); border-radius: var(--design-page-control-radius); background: var(--foreground); color: var(--background); transform: translateY(calc(-1 * var(--design-page-header-height) * 2)); }+.design-page-skip-link:focus { transform: none; }+/* Keep the muted fill out of the translucent divider. The divider composites+ over the app background, matching the main-pane header and pane boundaries. */+.design-sidebar { display: flex; flex-direction: column; height: 100%; min-height: 0; border-inline-end: var(--task-row-rule-width) solid var(--design-sidebar-border); background: var(--design-sidebar-surface); background-clip: padding-box; }+.design-sidebar-brand { display: flex; align-items: center; gap: var(--design-page-control-gap); flex-shrink: 0; height: var(--design-page-header-height); padding-inline: var(--design-sidebar-inset); font-size: var(--design-page-type-size); font-weight: var(--font-weight-semibold); }+.design-sidebar-search { flex-shrink: 0; color: var(--muted-foreground); }+.design-sidebar-search svg { width: var(--design-page-icon-size); height: var(--design-page-icon-size); }+.design-sidebar-search:hover { background: var(--muted-highlight); color: var(--foreground); }+.design-sidebar-navigation { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: var(--design-page-toolbar-gap); overflow-y: auto; padding: var(--design-sidebar-item-inset) var(--design-sidebar-inset); }+.design-sidebar-primary { display: flex; flex-direction: column; gap: var(--design-sidebar-item-gap); }+.design-sidebar-navigation [class~="group/sidebar-section"] > div { min-height: 0; }+/* Navigation and streamlined properties intentionally share this exact label+ recipe: sans, nano, normal, uppercase, 150% leading and 0.1em tracking. */+html:has(.design-proposal-theme) :is([data-slot="sidebar-group-label"], [data-slot="property-section-label"][data-streamlined="true"]),+html:has(.design-proposal-theme) .design-navigation-group-label {+ font-family: var(--font-sans);+ font-size: var(--text-nano);+ font-weight: var(--font-weight-normal);+ line-height: var(--design-sidebar-label-leading);+ letter-spacing: var(--design-sidebar-heading-tracking);+ text-transform: uppercase;+ color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);+}+.design-sidebar .design-sidebar-item { min-height: var(--design-sidebar-item-height); margin-inline: var(--design-sidebar-item-inset); padding-inline: var(--design-sidebar-item-inset); color: var(--design-sidebar-item-foreground); font-size: var(--design-sidebar-label-size); line-height: var(--design-sidebar-label-leading); }+.design-sidebar .design-sidebar-item:is(:hover, [aria-current="page"]) { background: var(--design-sidebar-item-highlight); color: var(--design-sidebar-item-active-foreground); }+.design-sidebar-new-task { display: flex; justify-content: flex-start; width: calc(100% - var(--design-sidebar-item-inset) * 2); height: var(--design-sidebar-item-height); margin-inline: var(--design-sidebar-item-inset); padding-inline: var(--design-sidebar-item-inset); gap: calc(var(--spacing) * 2.5); font-size: var(--design-sidebar-label-size); line-height: var(--design-sidebar-label-leading); font-weight: var(--font-weight-medium); color: var(--design-sidebar-item-foreground); }+.design-sidebar-new-task svg { width: var(--design-page-icon-size); height: var(--design-page-icon-size); }+.design-sidebar-new-task:hover { background: var(--design-sidebar-item-highlight); color: var(--design-sidebar-item-active-foreground); }+.design-sidebar-recents .design-sidebar-item { font-weight: var(--font-weight-normal); }+.design-sidebar-navigation > :not(.design-sidebar-recents) { flex-shrink: 0; }+.design-sidebar-recents { display: flex; flex: 1; min-height: 0; }+.design-sidebar-recents > div { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }+.design-sidebar-recents > div > :first-child { flex-shrink: 0; }+.design-sidebar-recents > div > :last-child { flex: 1; min-height: 0; }+.design-sidebar-recent-list { display: flex; flex-direction: column; gap: var(--design-sidebar-item-gap); min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }+.design-sidebar-recent-list:focus-visible { outline: var(--design-page-focus-width) solid var(--ring); outline-offset: calc(-1 * var(--design-page-focus-width)); }+.design-sidebar-recent-list .design-sidebar-item { flex-shrink: 0; }+.design-sidebar-account { flex-shrink: 0; }+.design-sidebar-account [aria-label="Open account menu"] { font-size: var(--design-sidebar-label-size); line-height: var(--design-sidebar-label-leading); color: var(--foreground); }+.design-sidebar-account [data-slot="avatar-fallback"] { background: var(--muted-highlight); color: var(--muted-foreground); }+.design-page-toolbar { display: flex; align-items: center; flex-wrap: wrap; flex-shrink: 0; gap: var(--design-page-toolbar-gap); }+.design-page-toolbar .design-toolbar-button,+.design-toolbar-filter > button { height: var(--design-page-control-height); border-radius: var(--design-page-control-radius); padding-inline: var(--design-page-control-padding); gap: var(--design-page-control-gap); font-size: var(--design-page-type-size); line-height: var(--design-page-type-leading); box-shadow: none; }+.design-page-toolbar .design-toolbar-button:not(.design-new-task),+.design-toolbar-filter > button { background: var(--design-page-control-surface); border-color: var(--design-page-control-border); color: var(--muted-foreground); }+.design-page-toolbar .design-toolbar-button:is(:hover, [aria-pressed="true"], [data-active="true"], [data-state="open"]),+.design-toolbar-filter > button:hover { background: var(--muted-highlight); color: var(--foreground); }+.design-page-toolbar .design-toolbar-button svg,+.design-toolbar-filter > button svg,+.design-task-search > svg { width: var(--design-page-icon-size); height: var(--design-page-icon-size); flex-shrink: 0; }+.design-page-toolbar .design-toolbar-icon,+.design-toolbar-filter > button { width: var(--design-page-control-height); padding: 0; }+.design-page-toolbar .design-view-trigger { justify-content: space-between; min-width: calc(var(--spacing) * 28); }+.design-task-search { display: flex; align-items: center; gap: var(--design-page-control-gap); width: var(--design-page-search-width); min-width: var(--design-page-search-min); height: var(--design-page-control-height); padding-inline: var(--design-page-control-padding); border: var(--task-row-rule-width) solid var(--design-page-control-border); border-radius: var(--design-page-control-radius); color: var(--muted-foreground); background: var(--design-page-search-surface); }+.design-task-search:focus-within { border-color: var(--ring); outline: none; box-shadow: var(--focus-ring-shadow); }+.design-task-search input { min-width: 0; height: 100%; padding: 0; border: none; border-radius: 0; background: transparent; color: var(--foreground); box-shadow: none; font-size: var(--design-page-type-size); line-height: var(--design-page-type-leading); }+.design-task-search input:focus-visible { outline: none; box-shadow: none; }+.design-task-search input::-webkit-search-cancel-button { display: none; }+.design-view-toggle { display: flex; border: var(--task-row-rule-width) solid var(--design-page-control-border); border-radius: var(--design-page-control-radius); }+.design-view-toggle .design-toolbar-button { height: calc(var(--design-page-control-height) - var(--task-row-rule-width) * 2); border-radius: 0; background: transparent; }+.design-view-toggle .design-toolbar-button:first-child { border-start-start-radius: var(--design-page-control-radius); border-end-start-radius: var(--design-page-control-radius); }+.design-view-toggle .design-toolbar-button:last-child { border-start-end-radius: var(--design-page-control-radius); border-end-end-radius: var(--design-page-control-radius); }+.design-view-toggle .design-toolbar-button:focus-visible { position: relative; z-index: var(--z-1); }+.design-toolbar-actions { display: flex; align-items: center; gap: var(--design-page-action-gap); margin-inline-start: auto; }+.design-page-toolbar .design-new-task { margin-inline-start: var(--design-page-toolbar-gap); background: var(--foreground); color: var(--background); font-weight: var(--font-weight-semibold); }+.design-page-toolbar .design-new-task:hover { background: color-mix(in oklab, var(--foreground) 90%, var(--task-list-surface)); color: var(--background); }+.design-task-results { margin-block-end: calc(-1 * var(--design-page-toolbar-gap)); font-size: var(--design-page-type-size); line-height: var(--design-page-type-leading); color: var(--muted-foreground); }+.design-task-list-panel { min-width: 0; }+.design-task-list-panel[hidden] { display: none; }+.design-task-board { min-width: 0; }++/* Paper filter IA: five peer groups, with searchable option lists. Surface,+ highlight and shadow inherit the shared refreshed popover appearance. */+:root, .dark {+ --task-filter-column-width: calc(var(--spacing) * 50);+ --task-filter-column-gap: calc(var(--spacing) * 4);+ --task-filter-panel-width: calc(var(--task-filter-column-width) * 5 + var(--task-filter-column-gap) * 4 + var(--flyout-padding) * 2 + var(--task-row-rule-width) * 2);+ --task-filter-row-height: calc(var(--spacing) * 7);+ --task-filter-row-gap: calc(var(--spacing) * 0.5);+ --task-filter-row-padding: var(--spacing);+ --task-filter-row-padding-inline: calc(var(--spacing) * 2);+ --task-filter-icon-size: var(--task-row-control-size);+ --task-filter-search-height: var(--task-row-height-compact);+ --task-filter-search-icon-size: calc(var(--spacing) * 3);+ --task-filter-search-inset: calc(var(--spacing) * 7);+ --task-filter-label-dot-size: calc(var(--spacing) * 2.5);+ --task-filter-checkbox-surface: color-mix(in srgb, var(--flyout-foreground) 4%, var(--flyout-surface));+}+.task-filters-popover {+ display: flex;+ flex-direction: column;+ width: var(--task-filter-panel-width);+ max-width: calc(100vw - var(--flyout-padding) * 2);+ max-height: min(var(--radix-popover-content-available-height, 100dvh), var(--sz-calc-9));+ overflow: hidden;+}+.task-filters-popover [data-flyout-header] { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: var(--flyout-padding); }+.task-filters-popover [data-flyout-header] > button { height: var(--flyout-type-leading); padding-inline: var(--task-filter-row-padding-inline); font-size: var(--flyout-type-size); font-weight: var(--font-weight-normal); }+.task-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--task-filter-column-width)), 1fr)); align-items: start; gap: var(--task-filter-column-gap); min-height: 0; padding: var(--flyout-padding); overflow-y: auto; overscroll-behavior: contain; }+.task-filter-group { display: flex; flex-direction: column; min-width: 0; gap: var(--task-filter-column-gap); }+.task-filter-group h3 { margin: 0; color: var(--flyout-foreground); font-size: var(--flyout-type-size); line-height: var(--flyout-type-leading); font-weight: var(--font-weight-semibold); }+.task-filter-group-body { display: flex; flex-direction: column; min-width: 0; gap: var(--flyout-padding); }+.task-filter-options { display: flex; flex-direction: column; gap: var(--task-filter-row-gap); }+.task-filter-option { display: flex; align-items: center; min-width: 0; min-height: var(--task-filter-row-height); padding: var(--task-filter-row-padding) var(--task-filter-row-padding-inline); gap: var(--task-filter-row-padding-inline); border-radius: var(--flyout-option-radius); color: var(--flyout-item-foreground); cursor: pointer; font-size: var(--flyout-type-size); line-height: var(--flyout-type-leading); }+.task-filter-option:is(:hover, :focus-within) { background: var(--flyout-highlight); color: var(--flyout-foreground); }+.task-filter-option-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.task-filter-option [data-slot="checkbox"] { width: var(--task-filter-icon-size); height: var(--task-filter-icon-size); border-color: var(--flyout-border); background: var(--task-filter-checkbox-surface); color: inherit; box-shadow: none; }+.task-filter-option [data-slot="checkbox"][data-state="checked"] { background: var(--flyout-highlight); }+.task-filter-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: var(--task-filter-icon-size); height: var(--task-filter-icon-size); }+.task-filter-icon > svg { width: var(--task-filter-icon-size); height: var(--task-filter-icon-size); }+.task-filter-label-dot { flex-shrink: 0; width: var(--task-filter-label-dot-size); height: var(--task-filter-label-dot-size); border-radius: calc(var(--task-filter-label-dot-size) / 2); background: var(--task-filter-label-color); }+.task-filter-search { position: relative; }+.task-filter-search > svg { position: absolute; left: var(--task-filter-row-padding-inline); top: 50%; transform: translateY(-50%); width: var(--task-filter-search-icon-size); height: var(--task-filter-search-icon-size); color: var(--flyout-item-foreground); pointer-events: none; }+.task-filter-search input { height: var(--task-filter-search-height); min-width: 0; padding-inline: var(--task-filter-search-inset) var(--flyout-padding); border: var(--task-row-rule-width) solid var(--flyout-border); border-radius: var(--radius-md); background: var(--background-alt); color: var(--flyout-foreground); font-size: var(--flyout-type-size); line-height: var(--flyout-type-leading); box-shadow: none; }+.task-filter-search input:focus-visible { outline: var(--task-row-focus-width) solid var(--ring); outline-offset: var(--task-row-rule-width); }+@media (pointer: coarse) {+ .task-filter-search input { font-size: var(--text-base); }+}+.task-filter-empty { padding: var(--task-filter-row-padding) var(--task-filter-row-padding-inline); color: var(--flyout-item-foreground); font-size: var(--flyout-type-size); line-height: var(--flyout-type-leading); }+.task-list-group-heading { margin-block: var(--design-page-toolbar-gap) var(--design-page-control-gap); }++/* Canonical collection toolbars: shared geometry, opt-in proposal styling.+ Search uses ToolbarSearch; only Tasks puts its view/heading before search. */+:root {+ --collection-toolbar-height: var(--design-page-control-height);+ --collection-toolbar-gap: calc(var(--spacing) * 2);+ --collection-toolbar-radius: var(--design-page-control-radius);+ --collection-toolbar-border: var(--design-page-control-border);+ --collection-toolbar-padding: var(--design-page-control-padding);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] {+ display: flex;+ flex-direction: row;+ flex-wrap: wrap;+ align-items: center;+ justify-content: flex-start;+ column-gap: var(--collection-toolbar-gap);+ row-gap: var(--design-page-toolbar-gap);+ min-width: 0;+}+html:has(.design-proposal-theme) [data-canonical-toolbar] :is(.design-toolbar-controls, .design-toolbar-actions, [role="tablist"]:not([data-canonical-tabs])) {+ display: flex;+ flex-wrap: wrap;+ gap: var(--collection-toolbar-gap);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] :is(button:not([data-toolbar-clear], .canonical-tab), [data-toolbar-control]) {+ height: var(--collection-toolbar-height);+ border: var(--task-row-rule-width) solid var(--collection-toolbar-border);+ border-radius: var(--collection-toolbar-radius);+ padding-inline: var(--collection-toolbar-padding);+ gap: var(--design-page-control-gap);+ font-size: var(--design-page-type-size);+ line-height: var(--design-page-type-leading);+ font-weight: var(--font-weight-normal);+ background: var(--design-page-control-surface);+ color: var(--muted-foreground);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] button:is([data-size="icon"], [data-size="icon-sm"], .design-toolbar-icon) {+ width: var(--collection-toolbar-height);+ padding-inline: 0;+}+html:has(.design-proposal-theme) [data-canonical-toolbar] :is(button:not([data-toolbar-clear], .canonical-tab), [data-toolbar-control]):is(:hover, [aria-pressed="true"], [aria-selected="true"], [data-active="true"], [data-state="open"]) {+ color: var(--foreground);+ background: var(--muted-highlight);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] button:is([data-toolbar-primary], .design-new-task) {+ margin-inline-start: 0;+ background: var(--foreground);+ color: var(--background);+ font-weight: var(--font-weight-semibold);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] button:is([data-toolbar-primary], .design-new-task):hover {+ background: color-mix(in oklab, var(--foreground) 90%, var(--task-list-surface));+ color: var(--background);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] button > svg {+ width: var(--design-page-icon-size);+ height: var(--design-page-icon-size);+ margin-inline: 0;+}+html:has(.design-proposal-theme) [data-canonical-toolbar] .design-view-toggle {+ height: var(--collection-toolbar-height);+ overflow: visible;+}+html:has(.design-proposal-theme) [data-canonical-toolbar] .design-view-toggle button {+ height: calc(var(--collection-toolbar-height) - var(--task-row-rule-width) * 2);+ border: 0;+ border-radius: 0;+}+html:has(.design-proposal-theme) [data-canonical-toolbar] .design-view-toggle button:first-child {+ border-start-start-radius: var(--collection-toolbar-radius);+ border-end-start-radius: var(--collection-toolbar-radius);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] .design-view-toggle button:last-child {+ border-start-end-radius: var(--collection-toolbar-radius);+ border-end-end-radius: var(--collection-toolbar-radius);+}+html:has(.design-proposal-theme) [data-canonical-toolbar] [data-toolbar-search] {+ flex-shrink: 1;+ max-width: 100%;+}+html:has(.design-proposal-theme) [data-canonical-toolbar] [data-toolbar-search] input {+ background: transparent;+}++/* Canonical pill tabs: Compact (12px) and Standard (14px).+ Shared geometry applies to Radix content tabs and exclusive collection filters. */+:root {+ --canonical-tab-compact-height: calc(var(--spacing) * 6);+ --canonical-tab-standard-height: calc(var(--spacing) * 8);+ --canonical-tab-padding: calc(var(--spacing) * 2.5);+ --canonical-tab-radius: var(--radius-md);+ --canonical-tab-compact-gap: calc(var(--spacing) * 1.5);+ --canonical-tab-standard-gap: calc(var(--spacing) * 2);+ --canonical-tab-disabled-opacity: 0.5;+ --canonical-tab-standard-leading: calc(var(--spacing) * 4.5);+}+[data-canonical-tabs].canonical-tab-list {+ display: flex;+ flex-wrap: wrap;+ width: fit-content;+ max-width: 100%;+ height: auto;+ justify-content: flex-start;+ align-items: center;+ padding: var(--spacing);+ gap: var(--canonical-tab-standard-gap);+ background: transparent;+ color: var(--muted-foreground);+}+[data-canonical-tabs="compact"].canonical-tab-list { gap: var(--canonical-tab-compact-gap); }+[data-canonical-tabs] .canonical-tab {+ position: relative;+ display: inline-flex;+ flex: none;+ align-items: center;+ justify-content: center;+ height: var(--canonical-tab-standard-height);+ padding: 0 var(--canonical-tab-padding);+ border: 0;+ border-radius: var(--canonical-tab-radius);+ background: transparent;+ color: var(--muted-foreground);+ font-family: var(--font-sans);+ font-size: var(--text-sm);+ line-height: var(--canonical-tab-standard-leading);+ font-weight: var(--font-weight-normal);+ white-space: nowrap;+ box-shadow: none;+ transition: background-color var(--default-transition-duration) var(--default-transition-timing-function), color var(--default-transition-duration) var(--default-transition-timing-function);+}+[data-canonical-tabs="compact"] .canonical-tab {+ height: var(--canonical-tab-compact-height);+ font-size: var(--text-xs);+ line-height: calc(var(--text-xs) * var(--text-xs--line-height));+}+[data-canonical-tabs] .canonical-tab::after { display: none; }+[data-canonical-tabs] .canonical-tab:is([data-state="active"], [aria-checked="true"]) {+ background: var(--muted-highlight);+ color: var(--foreground);+ box-shadow: none;+}+[data-canonical-tabs] .canonical-tab:hover:not(:disabled) {+ background: var(--muted-highlight);+ color: var(--foreground);+}+[data-canonical-tabs] .canonical-tab:focus-visible {+ outline: var(--focus-ring-stroke-width) solid var(--ring);+ outline-offset: var(--focus-ring-stroke-width);+ box-shadow: var(--focus-ring-shadow);+}+[data-canonical-tabs] .canonical-tab:disabled { opacity: var(--canonical-tab-disabled-opacity); pointer-events: none; }+html:has(.design-proposal-theme) [data-canonical-toolbar] .collection-toolbar-tabs select {+ height: var(--collection-toolbar-height);+ border-radius: var(--collection-toolbar-radius);+ border-color: var(--collection-toolbar-border);+}diff --git a/ui/src/lib/attention.test.ts b/ui/src/lib/attention.test.tsindex 3b7469466d..9147f8b3a7 100644--- a/ui/src/lib/attention.test.ts+++ b/ui/src/lib/attention.test.ts@@ -543,6 +543,21 @@ describe("filterAttentionItems", () => {expect(countActiveAttentionFilters(defaultAttentionFilterState)).toBe(0);});+ it("searches visible decision context case-insensitively and combines it with filters", () => {+ const decision = buildItem({+ subject: { ...approval.subject, title: "Review connector recovery", identifier: "DES-3" },+ whyNow: "Verification complete", originAgentName: "Connector engineer",+ project: approval.project, workspace: { id: "ws", name: "Sandbox" },+ detail: { kind: "generic", summaryExcerpt: "Reconnect safely", images: [] },+ });+ for (const query of [" REVIEW connector ", "des-3", "verification", "engineer", "ALPHA", "sandbox", "reconnect"]) {+ expect(filterAttentionItems([decision, join], defaultAttentionFilterState, query)).toEqual([decision]);+ }+ expect(filterAttentionItems([decision], defaultAttentionFilterState, "review nonexistent")).toEqual([]);+ expect(filterAttentionItems([decision], { ...defaultAttentionFilterState, severities: ["low"] }, "connector")).toEqual([]);+ expect(filterAttentionItems(items, defaultAttentionFilterState, " ")).toBe(items);+ });+it("filters by source kind", () => {const result = filterAttentionItems(items, { ...defaultAttentionFilterState, sourceKinds: ["approval"] });expect(result.map((i) => i.id)).toEqual(["ap"]);diff --git a/ui/src/lib/attention.ts b/ui/src/lib/attention.tsindex 331fd7c754..9caf77556e 100644--- a/ui/src/lib/attention.ts+++ b/ui/src/lib/attention.ts@@ -732,9 +732,17 @@ export function attentionItemMatchesFilters(item: AttentionItem, filters: Attentreturn true;}-export function filterAttentionItems(items: AttentionItem[], filters: AttentionFilterState): AttentionItem[] {- if (countActiveAttentionFilters(filters) === 0) return items;- return items.filter((item) => attentionItemMatchesFilters(item, filters));+export function filterAttentionItems(items: AttentionItem[], filters: AttentionFilterState, query = ""): AttentionItem[] {+ const terms = query.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);+ if (countActiveAttentionFilters(filters) === 0 && terms.length === 0) return items;+ return items.filter((item) => {+ if (!attentionItemMatchesFilters(item, filters)) return false;+ if (terms.length === 0) return true;+ const text = [item.subject.title, item.subject.identifier, item.relatedIssue?.title,+ item.relatedIssue?.identifier, item.whyNow, attentionDetailLine(item),+ item.originAgentName, item.project?.name, item.workspace?.name].filter(Boolean).join(" ").toLocaleLowerCase();+ return terms.every(term => text.includes(term));+ });}/** Distinct filterable dimensions present in the current feed, for the picker. */diff --git a/ui/src/lib/task-list-views.test.ts b/ui/src/lib/task-list-views.test.tsnew file mode 100644index 0000000000..7807299a2c--- /dev/null+++ b/ui/src/lib/task-list-views.test.ts@@ -0,0 +1,49 @@+// @vitest-environment node+import { describe, expect, it } from "vitest";+import { loadTaskListView, matchesTaskListView, saveTaskListView, taskListViewStorageKey } from "./task-list-views";++const task = { createdByUserId: null, assigneeUserId: null, status: "todo" } as const;++describe("task list views", () => {+ it("includes self-created OR self-assigned tasks in Inbox, without treating missing identities as a match", () => {+ expect(matchesTaskListView("inbox", { ...task, createdByUserId: "me" }, false, "me")).toBe(true);+ expect(matchesTaskListView("inbox", { ...task, createdByUserId: "other", assigneeUserId: "me" }, false, "me")).toBe(true);+ expect(matchesTaskListView("inbox", { ...task, createdByUserId: "other", assigneeUserId: "other" }, true, "me")).toBe(false);+ expect(matchesTaskListView("inbox", task, true, "me")).toBe(false);+ expect(matchesTaskListView("inbox", task, true, null)).toBe(false);+ });++ it("includes blocked and in-review tasks and excludes other statuses", () => {+ for (const status of ["blocked", "in_review", "todo", "backlog", "in_progress", "done", "cancelled"] as const) {+ expect(matchesTaskListView("blocked", { ...task, status }, false, "me")).toBe(["blocked", "in_review"].includes(status));+ }+ });++ it("uses unread state independently of ownership and status; All tasks includes both", () => {+ expect(matchesTaskListView("unread", task, true, "me")).toBe(true);+ expect(matchesTaskListView("unread", task, false, "me")).toBe(false);+ expect(matchesTaskListView("all", task, false, null)).toBe(true);+ expect(matchesTaskListView("all", { ...task, status: "done" }, true, "me")).toBe(true);+ });++ it("defaults new users to All tasks and remembers each user's choice in its own scope", () => {+ const values = new Map<string, string>();+ const storage = { getItem: (key: string) => values.get(key) ?? null, setItem: (key: string, value: string) => { values.set(key, value); } };+ const first = taskListViewStorageKey("design-proposals", "first");+ const second = taskListViewStorageKey("design-proposals", "second");+ expect(loadTaskListView(first, storage)).toBe("all");+ saveTaskListView(first, "blocked", storage);+ expect(loadTaskListView(first, storage)).toBe("blocked");+ expect(loadTaskListView(second, storage)).toBe("all");+ expect(loadTaskListView(taskListViewStorageKey("production", "first"), storage)).toBe("all");+ storage.setItem(first, "completed");+ expect(loadTaskListView(first, storage)).toBe("all");+ });++ it("tolerates unavailable and denied storage", () => {+ const denied = { getItem: () => { throw new Error("denied"); }, setItem: () => { throw new Error("denied"); } };+ expect(loadTaskListView("key", null)).toBe("all");+ expect(loadTaskListView("key", denied)).toBe("all");+ expect(() => saveTaskListView("key", "inbox", denied)).not.toThrow();+ });+});diff --git a/ui/src/lib/task-list-views.ts b/ui/src/lib/task-list-views.tsnew file mode 100644index 0000000000..18818e46d0--- /dev/null+++ b/ui/src/lib/task-list-views.ts@@ -0,0 +1,51 @@+import type { Issue } from "@paperclipai/shared";++export const taskListViews = [+ { value: "inbox", label: "Inbox" },+ { value: "unread", label: "Unread" },+ { value: "blocked", label: "Needs attention" },+ { value: "all", label: "All tasks" },+] as const;++export type TaskListView = typeof taskListViews[number]["value"];+type ViewIssue = Pick<Issue, "createdByUserId" | "assigneeUserId" | "status">;++/** Apply within the current company's accessible tasks; ancestors are added separately. */+export function matchesTaskListView(view: TaskListView, issue: ViewIssue, unread: boolean, userId: string | null): boolean {+ switch (view) {+ case "inbox": return Boolean(userId && (issue.createdByUserId === userId || issue.assigneeUserId === userId));+ case "unread": return unread;+ case "blocked": return issue.status === "blocked" || issue.status === "in_review";+ case "all": return true;+ }+}++export function taskListViewStorageKey(scope: string, userId: string): string {+ return `paperclip:task-list-view:v1:${encodeURIComponent(scope)}:${encodeURIComponent(userId)}`;+}++type ViewStorage = Pick<Storage, "getItem" | "setItem">;+function browserStorage(): ViewStorage | null {+ try {+ return typeof localStorage === "undefined" ? null : localStorage;+ } catch {+ return null;+ }+}++export function loadTaskListView(key: string, storage: ViewStorage | null = browserStorage()): TaskListView {+ try {+ const value = storage?.getItem(key);+ return taskListViews.find(option => option.value === value)?.value ?? "all";+ } catch {+ return "all";+ }+}++export function saveTaskListView(key: string, view: TaskListView, storage: ViewStorage | null = browserStorage()): void {+ try {+ storage?.setItem(key, view);+ } catch {+ // Storage denial must not prevent changing the current view.+ }+}diff --git a/ui/src/lib/task-list.test.ts b/ui/src/lib/task-list.test.tsnew file mode 100644index 0000000000..ee2a99baf7--- /dev/null+++ b/ui/src/lib/task-list.test.ts@@ -0,0 +1,40 @@+import { describe, expect, it } from "vitest";+import { buildIssueTree } from "./issue-tree";+import { sortTaskListItems, type TaskListSort } from "./task-list";+import type { Issue } from "@paperclipai/shared";++describe("task-list sorting", () => {+ it("sorts identifiers naturally and names case-insensitively without mutating the input", () => {+ const items = ["PAP-10", "pap-2", "PAP-1"];+ expect(sortTaskListItems(items, { column: "taskId", direction: "ascending" }, item => item)).toEqual(["PAP-1", "pap-2", "PAP-10"]);+ expect(items).toEqual(["PAP-10", "pap-2", "PAP-1"]);+ expect(sortTaskListItems(["beta", "ALPHA", "alpha"], { column: "task", direction: "descending" }, item => item)).toEqual(["beta", "ALPHA", "alpha"]);+ });++ it.each<TaskListSort["direction"]>(["ascending", "descending"])("puts missing values last for %s and retains ties", direction => {+ const items = [{ id: "missing", value: null }, { id: "second", value: 2 }, { id: "empty", value: "" }, { id: "first", value: 1 }, { id: "tie", value: 2 }, { id: "invalid", value: NaN }];+ const sorted = sortTaskListItems(items, { column: "lastUpdated", direction }, item => item.value);+ expect(sorted.map(item => item.id)).toEqual(direction === "ascending"+ ? ["first", "second", "tie", "missing", "empty", "invalid"]+ : ["second", "tie", "first", "missing", "empty", "invalid"]);+ });++ it("orders raw timestamps numerically rather than sorting relative date labels", () => {+ const dates = [Date.parse("2026-10-14T17:00:00Z"), Date.parse("2026-10-13T17:00:00Z"), Date.parse("2026-10-14T18:00:00Z")];+ expect(sortTaskListItems(dates, { column: "lastUpdated", direction: "descending" }, date => date)).toEqual([dates[2], dates[0], dates[1]]);+ });++ it("preserves parent groups and sorts every sibling level through the existing tree builder", () => {+ const items = [+ { id: "parent", parentId: null, issueNumber: 2 },+ { id: "child-a", parentId: "parent", issueNumber: 3 },+ { id: "grandchild", parentId: "child-a", issueNumber: 6 },+ { id: "child-b", parentId: "parent", issueNumber: 4 },+ { id: "root", parentId: null, issueNumber: 5 },+ ] as Issue[];+ const { roots, childMap } = buildIssueTree(sortTaskListItems(items, { column: "taskId", direction: "descending" }, item => item.issueNumber));+ expect(roots.map(item => item.id)).toEqual(["root", "parent"]);+ expect(childMap.get("parent")?.map(item => item.id)).toEqual(["child-b", "child-a"]);+ expect(childMap.get("child-a")?.map(item => item.id)).toEqual(["grandchild"]);+ });+});diff --git a/ui/src/lib/task-list.ts b/ui/src/lib/task-list.tsnew file mode 100644index 0000000000..542378c2d2--- /dev/null+++ b/ui/src/lib/task-list.ts@@ -0,0 +1,55 @@+/** Ordered columns and token references shared by the proposed header and rows. */+export const taskListColumns = [+ { id: "task", label: "Task", width: "var(--task-list-column-task)" },+ { id: "taskId", label: "Task ID", width: "var(--task-list-column-task-id)" },+ { id: "createdBy", label: "Created by", width: "var(--task-list-column-created-by)" },+ { id: "assignee", label: "Assignee", width: "var(--task-list-column-assignee)" },+ { id: "project", label: "Project", width: "var(--task-list-column-project)" },+ { id: "parentTask", label: "Parent Task", width: "var(--task-list-column-parent)" },+ { id: "tags", label: "Tags", width: "var(--task-list-column-tags)" },+ { id: "worktree", label: "Worktree", width: "var(--task-list-column-worktree)" },+ { id: "lastUpdated", label: "Last updated", width: "var(--task-list-column-updated)" },+] as const;++export type TaskListColumnId = (typeof taskListColumns)[number]["id"];+export type TaskListSort = { column: TaskListColumnId; direction: "ascending" | "descending" };+export type TaskListSortValue = string | number | null | undefined;+export const allTaskListColumns: readonly TaskListColumnId[] = taskListColumns.map(column => column.id);+export const defaultTaskListColumns: readonly TaskListColumnId[] = ["task", "taskId", "lastUpdated"];+export const defaultTaskListSort: TaskListSort = { column: "taskId", direction: "ascending" };++/** Task occupies two adjacent physical tracks: status/disclosure, then title. */+export function taskListColumnStart(columns: readonly TaskListColumnId[], id: TaskListColumnId): number {+ const index = columns.indexOf(id);+ return index + 1 + (columns.includes("task") ? (columns.indexOf("task") < index ? 1 : 0) : 1);+}++export function reorderTaskListColumns(columns: readonly TaskListColumnId[], from: TaskListColumnId, to: TaskListColumnId): readonly TaskListColumnId[] {+ const start = columns.indexOf(from);+ const end = columns.indexOf(to);+ if (start < 0 || end < 0 || start === end) return columns;+ const next = [...columns];+ next.splice(end, 0, next.splice(start, 1)[0]);+ return next;+}++const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" });++/** Sort raw values before building the tree, so only sibling order changes.+ * Empty values stay last in either direction; equal values retain input order.+ * Callers supply timestamps, task titles, names and sorted tag names,+ * never formatted relative dates or rendered React nodes.+ */+export function sortTaskListItems<T>(items: readonly T[], sort: TaskListSort, value: (item: T, column: TaskListColumnId) => TaskListSortValue): T[] {+ return [...items].sort((a, b) => {+ const left = value(a, sort.column);+ const right = value(b, sort.column);+ const leftMissing = left == null || left === "" || (typeof left === "number" && !Number.isFinite(left));+ const rightMissing = right == null || right === "" || (typeof right === "number" && !Number.isFinite(right));+ if (leftMissing || rightMissing) return Number(leftMissing) - Number(rightMissing);+ const result = typeof left === "number" && typeof right === "number"+ ? left - right+ : collator.compare(String(left), String(right));+ return sort.direction === "ascending" ? result : -result;+ });+}diff --git a/ui/src/main.tsx b/ui/src/main.tsxindex 430401639b..239bc82829 100644--- a/ui/src/main.tsx+++ b/ui/src/main.tsx@@ -18,6 +18,7 @@ import { EditorAutocompleteProvider } from "./context/EditorAutocompleteContext"import { PrimaryAgentProvider } from "./context/PrimaryAgentProvider";import { ToastProvider } from "./context/ToastContext";import { ThemeProvider } from "./context/ThemeContext";+import { DesignSandboxProvider } from "./context/DesignSandboxContext";import { TooltipProvider } from "@/components/ui/tooltip";import { initPluginBridge } from "./plugins/bridge-init";import { PluginLauncherProvider } from "./plugins/launchers";@@ -87,7 +88,7 @@ getOrCreatePaperclipReactRoot(window, rootElement).render(<PanelProvider><PluginLauncherProvider><DialogProvider>- <CompanyVoiceCalls><App /></CompanyVoiceCalls>+ <DesignSandboxProvider><CompanyVoiceCalls><App /></CompanyVoiceCalls></DesignSandboxProvider></DialogProvider></PluginLauncherProvider></PanelProvider>diff --git a/ui/src/pages/AgentDetail.tsx b/ui/src/pages/AgentDetail.tsxindex 50368f5653..f659386cc1 100644--- a/ui/src/pages/AgentDetail.tsx+++ b/ui/src/pages/AgentDetail.tsx@@ -51,6 +51,8 @@ import { AgentLifecycleStatus, useAgentLifecycleStatus } from "../components/Ageimport { MarkdownBody } from "../components/MarkdownBody";import { CopyText } from "../components/CopyText";import { IssueRow } from "../components/IssueRow";+import { TaskSummaryList } from "../components/TaskSummaryList";+import { useDesignSandbox } from "../context/DesignSandboxContext";import { StatusGlyph } from "../components/StatusGlyph";import { MembershipAction } from "../components/MembershipAction";import { StarToggle } from "../components/StarToggle";@@ -1735,6 +1737,7 @@ export function AgentOverview({skillNames: string[];agentRouteId: string;}) {+ const designSandbox = useDesignSandbox();const issuesById = useMemo(() => {const map = new Map<string, (typeof assignedIssues)[number]>();for (const issue of assignedIssues) map.set(issue.id, issue);@@ -1857,7 +1860,7 @@ export function AgentOverview({<p className="text-sm text-muted-foreground">No recent tasks.</p>) : (<div className="overflow-hidden rounded-lg border border-border">- {assignedIssues.slice(0, 6).map((issue) => (+ {designSandbox ? <TaskSummaryList issues={assignedIssues.slice(0, 6)} /> : assignedIssues.slice(0, 6).map((issue) => (<IssueRowkey={issue.id}issue={issue}diff --git a/ui/src/pages/Agents.test.tsx b/ui/src/pages/Agents.test.tsxindex aad8e4ae4f..4d307e5a2c 100644--- a/ui/src/pages/Agents.test.tsx+++ b/ui/src/pages/Agents.test.tsx@@ -8,7 +8,7 @@ import type { Agent, Environment, EnvironmentCapabilities } from "@paperclipai/simport { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { ToastProvider } from "../context/ToastContext";import type { BuiltInAgentState } from "../api/builtInAgents";-import { Agents } from "./Agents";+import { Agents, filterAgents, filterOrgTree } from "./Agents";import { Agents as ProductionAgents } from "./Agents.production";import type { AgentOrgChainHealth } from "@paperclipai/shared";@@ -294,6 +294,27 @@ function findAgentRow(container: HTMLElement, agentName: string): HTMLElement |return Array.from(container.querySelectorAll("a")).find((row) => row.textContent?.includes(agentName)) ?? null;}+describe("agent search", () => {+ it("combines case-insensitive name, title and role words with status and built-in filters", () => {+ const alpha = makeAgent({ id: "alpha", name: "Alpha", role: "engineer", status: "active", title: "Connector engineer" });+ const beta = makeAgent({ id: "beta", name: "Beta", role: "designer", status: "paused", title: "Design reviewer" });+ const hidden = makeAgent({ id: "hidden", name: "Beta", status: "terminated" });+ const agents = [alpha, beta, hidden];+ expect(filterAgents(agents, "all", new Set(), " BETA design ")).toEqual([beta]);+ expect(filterAgents(agents, "active", new Set(), "beta")).toEqual([]);+ expect(filterAgents(agents, "paused", new Set(), "reviewer")).toEqual([beta]);+ expect(filterAgents(agents, "builtin", new Set([alpha.id]), "connector")).toEqual([alpha]);+ expect(filterAgents(agents, "all", new Set(), " ")).toEqual([alpha, beta]);+ });++ it("retains the hierarchy above a matching report and promotes reports of hidden agents", () => {+ const child = { id: "child", name: "Designer", role: "designer", status: "paused", reports: [] };+ const root = { id: "root", name: "CEO", role: "ceo", status: "active", reports: [child] };+ expect(filterOrgTree([root], "all", new Set(), new Set([child.id]))).toEqual([root]);+ expect(filterOrgTree([root], "all", new Set(), new Set())).toEqual([]);+ expect(filterOrgTree([{ ...root, status: "terminated" }], "all", new Set(), new Set([child.id]))).toEqual([child]);+ });+});function renderAgentsView(root: ReturnType<typeof createRoot> | null, queryClient: QueryClient) {root!.render(<QueryClientProvider client={queryClient}>@@ -369,6 +390,27 @@ describe("Agents", () => {vi.clearAllMocks();});+ it("filters the rendered roster and clears search without changing its status route", async () => {+ mockAgentsApi.list.mockResolvedValue([+ makeAgent({ id: "alpha", name: "Alpha", role: "engineer" }),+ makeAgent({ id: "beta", name: "Beta", role: "designer" }),+ ]);+ root = createRoot(container);+ await act(async () => root!.render(<QueryClientProvider client={queryClient}><ToastProvider><Agents /></ToastProvider></QueryClientProvider>));+ await flushReact();+ await flushReact();+ const input = container.querySelector<HTMLInputElement>('input[aria-label="Search agents"]')!;+ await act(() => {+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, "beta");+ input.dispatchEvent(new Event("input", { bubbles: true }));+ });+ expect(findAgentRow(container, "Beta")).not.toBeNull();+ expect(findAgentRow(container, "Alpha")).toBeNull();+ await act(() => container.querySelector<HTMLButtonElement>('button[aria-label="Clear search"]')!.click());+ expect(findAgentRow(container, "Alpha")).not.toBeNull();+ expect(mockRouterState.navigate).not.toHaveBeenCalled();+ });+it.each([["streamlined", Agents],["production", ProductionAgents],@@ -449,7 +491,8 @@ describe("Agents", () => {expect(orgViewport?.parentElement?.classList.contains("flex-1")).toBe(true);expect(orgViewport?.parentElement?.classList.contains("md:min-h-0")).toBe(true);expect(orgViewport?.parentElement?.classList.contains("h-(--sz-calc-38)")).toBe(false);- expect(orgViewport?.parentElement?.parentElement?.classList.contains("h-full")).toBe(true);+ expect(orgViewport?.closest('[data-slot="tabs"]')?.classList.contains("h-full")).toBe(true);+ expect(orgViewport?.closest('[role="tabpanel"]')?.classList.contains("flex-1")).toBe(true);expect(orgViewport?.parentElement?.parentElement?.classList.contains("min-h-0")).toBe(true);expect(container.querySelector('[aria-label="Zoom in"]')).not.toBeNull();expect(container.querySelector('[aria-label="Zoom out"]')).not.toBeNull();@@ -515,7 +558,6 @@ describe("Agents", () => {});-it("shows effective environment and sandbox provider beside agents", async () => {mockAgentsApi.list.mockResolvedValue([makeAgent({@@ -842,7 +884,7 @@ describe("Agents", () => {await flushReact();await flushReact();- expect(container.textContent).toContain("1 agent");+ expect(container.textContent).not.toContain("1 agent");expect(mockBuiltInAgentsApi.list).toHaveBeenCalledWith("company-1");expect(container.textContent).toContain("Built-in");expect(container.textContent).toContain("Briefs Agent");diff --git a/ui/src/pages/Agents.tsx b/ui/src/pages/Agents.tsxindex f1fa0e5375..1ef594f04a 100644--- a/ui/src/pages/Agents.tsx+++ b/ui/src/pages/Agents.tsx@@ -23,10 +23,10 @@ import { EmptyState } from "../components/EmptyState";import { PageSkeleton } from "../components/PageSkeleton";import { OrgChart } from "./OrgChart";import { relativeTime, cn, agentRouteRef, agentUrl } from "../lib/utils";-import { PageTabBar } from "../components/PageTabBar";-import { Tabs } from "@/components/ui/tabs";+import { Tabs, TabsContent } from "@/components/ui/tabs";+import { AgentsToolbar } from "../components/AgentsToolbar";import { Button } from "@/components/ui/button";-import { AlertTriangle, Bot, Plus, List, Network } from "lucide-react";+import { AlertTriangle, Bot } from "lucide-react";import { AGENT_ROLE_LABELS, type Agent, type Environment, type EnvironmentCapabilities } from "@paperclipai/shared";import {resourceMembershipState,@@ -93,10 +93,16 @@ function matchesFilter(status: string, tab: FilterTab): boolean {return true;}-function filterAgents(agents: Agent[], tab: FilterTab, builtInAgentIds: Set<string>): Agent[] {+function matchesSearch(agent: Pick<Agent, "name" | "role" | "title">, query: string): boolean {+ const words = query.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);+ const text = [agent.name, agent.role, roleLabels[agent.role], agent.title].filter(Boolean).join(" ").toLocaleLowerCase();+ return words.every(word => text.includes(word));+}++export function filterAgents(agents: Agent[], tab: FilterTab, builtInAgentIds: Set<string>, query = ""): Agent[] {return agents.filter((a) => {- if (HIDDEN_AGENT_STATUSES.has(a.status)) return false;+ if (HIDDEN_AGENT_STATUSES.has(a.status) || !matchesSearch(a, query)) return false;// The `builtin` filter keys on the built-in marker, not agent status.if (tab === "builtin") return builtInAgentIds.has(a.id);return matchesFilter(a.status, tab);@@ -168,10 +174,10 @@ function resolveAgentEnvironment(: describeMissingEnvironment(environmentId);}-function filterOrgTree(nodes: OrgNode[], tab: FilterTab, builtInAgentIds: Set<string>): OrgNode[] {+export function filterOrgTree(nodes: OrgNode[], tab: FilterTab, builtInAgentIds: Set<string>, matchingIds?: Set<string>): OrgNode[] {return nodes.reduce<OrgNode[]>((acc, node) => {- const filteredReports = filterOrgTree(node.reports, tab, builtInAgentIds);+ const filteredReports = filterOrgTree(node.reports, tab, builtInAgentIds, matchingIds);// Hidden agents (terminated / pending_approval) never render as a row, but// any visible reports are promoted so the tree doesn't lose live agents.if (HIDDEN_AGENT_STATUSES.has(node.status)) {@@ -181,7 +187,7 @@ function filterOrgTree(nodes: OrgNode[], tab: FilterTab, builtInAgentIds: Set<stconst nodeMatches = tab === "builtin"? builtInAgentIds.has(node.id): matchesFilter(node.status, tab);- if (nodeMatches || filteredReports.length > 0) {+ if ((nodeMatches && (!matchingIds || matchingIds.has(node.id))) || filteredReports.length > 0) {acc.push({ ...node, reports: filteredReports });}return acc;@@ -192,6 +198,7 @@ function filterOrgTree(nodes: OrgNode[], tab: FilterTab, builtInAgentIds: Set<stexport type AgentsView = "list" | "org";export function Agents({ initialView = "list" }: { initialView?: AgentsView } = {}) {+ const [query, setQuery] = useState("");const agentChat = useAgentChatEnabled();const { selectedCompanyId } = useCompany();const { openNewAgent } = useDialogActions();@@ -337,8 +344,8 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } =return <PageSkeleton variant="list" />;}- const filtered = filterAgents(agents ?? [], tab, builtInAgentIds);- const filteredOrg = filterOrgTree(orgTree ?? [], tab, builtInAgentIds);+ const filtered = filterAgents(agents ?? [], tab, builtInAgentIds, query);+ const filteredOrg = filterOrgTree(orgTree ?? [], tab, builtInAgentIds, query.trim() ? new Set(filtered.map(agent => agent.id)) : undefined);const environmentDataLoading = environmentsEnabled && environments === undefined;const showEnvironmentColumn = environmentsEnabled && (environments === undefined || environments.length > 1);const resolveRenderedEnvironment = (agentId: string) => (@@ -438,58 +445,17 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } =};return (- <div className={cn(+ <Tabs value={tab} onValueChange={value => navigate(`/agents/${value}`)} className={cn("@container",effectiveView === "org"? "flex h-full min-h-0 flex-col gap-4"- : "space-y-4",+ : "gap-4",)}>- <div className="flex flex-wrap items-center justify-between gap-3">- <Tabs value={tab} onValueChange={(v) => navigate(`/agents/${v}`)}>- <PageTabBar- items={visibleTabItems}- value={tab}- onValueChange={(v) => navigate(`/agents/${v}`)}- />- </Tabs>- <div className="flex items-center gap-2">- {!forceListView ? <div className="flex items-center overflow-hidden rounded-md border border-border" role="group" aria-label="Agent view">- <Button- type="button"- size="icon-sm"- variant={effectiveView === "list" ? "secondary" : "ghost"}- className="rounded-none"- onClick={() => setView("list")}- title="List view"- aria-label="List view"- aria-pressed={effectiveView === "list"}- >- <List className="h-3.5 w-3.5" />- </Button>- <Button- type="button"- size="icon-sm"- variant={effectiveView === "org" ? "secondary" : "ghost"}- className="rounded-none border-l border-border"- onClick={() => setView("org")}- title="Org chart view"- aria-label="Org chart view"- aria-pressed={effectiveView === "org"}- >- <Network className="h-3.5 w-3.5" />- </Button>- </div> : null}- <Button size="sm" variant="outline" onClick={openNewAgent}>- <Plus className="h-3.5 w-3.5 mr-1.5" />- New Agent- </Button>- </div>- </div>-- {filtered.length > 0 && (- <p className="text-xs text-muted-foreground">{filtered.length} agent{filtered.length !== 1 ? "s" : ""}</p>- )}+ <AgentsToolbar query={query} onQueryChange={setQuery} tab={tab} items={visibleTabItems}+ onTabChange={value => navigate(`/agents/${value}`)} view={effectiveView} onViewChange={setView}+ hideViewToggle={forceListView} onNewAgent={openNewAgent} />+ <TabsContent value={tab} className={cn("min-h-0 space-y-4", effectiveView === "org" && "flex flex-1 flex-col")}>{error && <p className="text-sm text-destructive">{error.message}</p>}{agents && agents.length === 0 && (@@ -510,7 +476,7 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } ={effectiveView === "list" && agents && agents.length > 0 && filtered.length === 0 && (<p className="text-sm text-muted-foreground text-center py-8">- No agents match the selected status.+ No agents match your search and selected status.</p>)}@@ -521,7 +487,7 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } ={effectiveView === "org" && orgTree && orgTree.length > 0 && filteredOrg.length === 0 && (<p className="text-sm text-muted-foreground text-center py-8">- No agents match the selected status.+ No agents match your search and selected status.</p>)}@@ -542,7 +508,8 @@ export function Agents({ initialView = "list" }: { initialView?: AgentsView } =/></Suspense>)}- </div>+ </TabsContent>+ </Tabs>);}diff --git a/ui/src/pages/Artifacts.test.tsx b/ui/src/pages/Artifacts.test.tsxindex b01d66ca32..73f27e3a97 100644--- a/ui/src/pages/Artifacts.test.tsx+++ b/ui/src/pages/Artifacts.test.tsx@@ -186,7 +186,7 @@ describe("Artifacts page", () => {cursor: undefined,});const groupControl = container.querySelector('[data-testid="artifact-group-control"]') as HTMLButtonElement;- const allFilter = [...container.querySelectorAll('[role="tab"]')]+ const allFilter = [...container.querySelectorAll('[aria-label="Filter artifacts by type"] button')].find((element) => element.textContent === "All") as HTMLButtonElement;expect(groupControl).not.toBeNull();expect(groupControl.textContent).toBe("");diff --git a/ui/src/pages/Artifacts.tsx b/ui/src/pages/Artifacts.tsxindex 4bb04e8cda..c1dd952f02 100644--- a/ui/src/pages/Artifacts.tsx+++ b/ui/src/pages/Artifacts.tsx@@ -1,6 +1,6 @@import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useInfiniteQuery } from "@tanstack/react-query";-import { ArrowLeft, Check, Layers, Package, Search, X } from "lucide-react";+import { ArrowLeft, Layers, Package } from "lucide-react";import type { To } from "react-router-dom";import {artifactsApi,@@ -15,35 +15,12 @@ import { PageSkeleton } from "../components/PageSkeleton";import { ArtifactCard } from "../components/artifacts/ArtifactCard";import { ArtifactGroupCard } from "../components/artifacts/ArtifactGroupCard";import { useSearchParams, Link } from "@/lib/router";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuLabel,- DropdownMenuTrigger,-} from "@/components/ui/dropdown-menu";-import { cn } from "@/lib/utils";-import { Input } from "@/components/ui/input";-import { Button } from "@/components/ui/button";+import { ArtifactsToolbar, ARTIFACT_KIND_FILTERS } from "@/components/artifacts/ArtifactsToolbar";+export { ARTIFACT_KIND_FILTERS, ARTIFACT_GROUP_OPTIONS, artifactGroupByLabel } from "@/components/artifacts/ArtifactsToolbar";const ARTIFACTS_PAGE_SIZE = 30;const SEARCH_DEBOUNCE_MS = 250;-export const ARTIFACT_KIND_FILTERS: { value: ArtifactKindFilter; label: string }[] = [- { value: "all", label: "All" },- { value: "image", label: "Images" },- { value: "video", label: "Videos" },- { value: "document", label: "Documents" },- { value: "text", label: "Text" },- { value: "file", label: "Files" },-];--export const ARTIFACT_GROUP_OPTIONS: { value: ArtifactGroupBy; label: string }[] = [- { value: "none", label: "None" },- { value: "task", label: "Task" },- { value: "parent_task", label: "Parent task" },-];-const KIND_VALUES = new Set(ARTIFACT_KIND_FILTERS.map((filter) => filter.value));function parseGroupBy(value: string | null): ArtifactGroupBy {@@ -57,10 +34,6 @@ function parseKind(value: string | null): ArtifactKindFilter {: "all";}-export function artifactGroupByLabel(value: ArtifactGroupBy): string {- return ARTIFACT_GROUP_OPTIONS.find((option) => option.value === value)?.label ?? "None";-}-export function Artifacts() {const { selectedCompanyId } = useCompany();const { setBreadcrumbs } = useBreadcrumbs();@@ -247,82 +220,7 @@ export function Artifacts() {return (<div className="w-full max-w-6xl space-y-5">- <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">- <div className="relative w-full sm:max-w-sm">- <Search className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />- <Input- value={draftQuery}- onChange={(event) => setDraftQuery(event.currentTarget.value)}- placeholder="Search artifacts..."- aria-label="Search artifacts"- className="h-9 pl-9 pr-9 text-sm"- />- {draftQuery.length > 0 ? (- <button- type="button"- onClick={() => setDraftQuery("")}- aria-label="Clear artifact search"- className="absolute right-2 top-1/2 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"- >- <X className="h-3.5 w-3.5" />- </button>- ) : null}- </div>-- <div className="flex flex-wrap items-center gap-1.5">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button- type="button"- variant="outline"- size="icon"- aria-label={`Group artifacts (currently ${artifactGroupByLabel(groupBy)})`}- title="Group artifacts"- data-testid="artifact-group-control"- data-group-by={groupBy}- className={cn("h-8 w-8 shrink-0", grouping && "bg-accent")}- >- <Layers className="h-3.5 w-3.5" aria-hidden="true" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="w-44">- <DropdownMenuLabel>Group by</DropdownMenuLabel>- {ARTIFACT_GROUP_OPTIONS.map((option) => (- <DropdownMenuItem- key={option.value}- data-testid={`artifact-group-option-${option.value}`}- aria-selected={groupBy === option.value}- onSelect={() => selectGroupBy(option.value)}- className="justify-between"- >- {option.label}- {groupBy === option.value ? <Check className="h-3.5 w-3.5" /> : null}- </DropdownMenuItem>- ))}- </DropdownMenuContent>- </DropdownMenu>-- <div className="flex flex-wrap items-center gap-1.5" role="tablist" aria-label="Filter artifacts by type">- {ARTIFACT_KIND_FILTERS.map((filter) => (- <button- key={filter.value}- type="button"- role="tab"- aria-selected={kind === filter.value}- onClick={() => selectKind(filter.value)}- className={cn(- "rounded-md px-2.5 py-1 text-xs font-medium transition-colors",- kind === filter.value- ? "bg-accent text-foreground"- : "text-muted-foreground hover:bg-accent/50 hover:text-foreground",- )}- >- {filter.label}- </button>- ))}- </div>- </div>- </div>+ <ArtifactsToolbar query={draftQuery} onQueryChange={setDraftQuery} groupBy={groupBy} onGroupByChange={selectGroupBy} kind={kind} onKindChange={selectKind} />{viewingSelectedStack ? (<div className="flex flex-wrap items-center gap-2 text-sm">diff --git a/ui/src/pages/CompanySkills.test.tsx b/ui/src/pages/CompanySkills.test.tsxindex 3f52af4354..6a88e8268a 100644--- a/ui/src/pages/CompanySkills.test.tsx+++ b/ui/src/pages/CompanySkills.test.tsx@@ -334,7 +334,7 @@ function buttonsNamed(node: ParentNode, name: string) {return Array.from(node.querySelectorAll("button")).filter((button) => button.textContent?.trim() === name);}-async function click(button: HTMLButtonElement) {+async function click(button: HTMLElement) {await act(async () => {button.dispatchEvent(new MouseEvent("click", { bubbles: true }));});@@ -373,6 +373,26 @@ describe("getSkillVersionDiffSelection", () => {});describe("DiscoveryGrid IA presentation", () => {+ it("uses the shared cards and toolbar for My Skills and preserves opening and creation actions", async () => {+ const onOpenCard = vi.fn();+ const onCreate = vi.fn();+ const skill: CompanySkillListItem = {+ ...makeDetail(makeVersion(1, "# My Review Skill"), { id: "my-skill", name: "My Review Skill" }),+ catalogKind: null, originHash: null, packageName: null, packageVersion: null,+ };+ const card = buildDiscoveryCards([skill], [])[0]!;+ const node = await renderDiscoveryGrid({ collectionView: "authored", cards: [card], totalCount: 1, onOpenCard, onCreate, showBrowseRails: false });+ expect(node.querySelector('input[aria-label="Search my skills"]')).not.toBeNull();+ expect(node.querySelector('h1')?.textContent).toBe("My Skills");+ const skillButton = Array.from(node.querySelectorAll<HTMLElement>('[role="button"]')).find(button => button.textContent?.includes("My Review Skill"))!;+ await click(skillButton);+ expect(onOpenCard).toHaveBeenCalledWith(card);+ const create = buttonsNamed(node, "Create new skill")[0]!;+ await click(create);+ expect(onCreate).toHaveBeenCalledOnce();+ expect(node.textContent).not.toContain("Recently visited");+ });+it("makes the search scope explicit for Installed and Discover", async () => {let node = await renderDiscoveryGrid({ tab: "installed" });expect(node.querySelector('input[aria-label="Search installed skills"]')).not.toBeNull();diff --git a/ui/src/pages/CompanySkills.tsx b/ui/src/pages/CompanySkills.tsxindex d9a5c8c471..94ba466754 100644--- a/ui/src/pages/CompanySkills.tsx+++ b/ui/src/pages/CompanySkills.tsx@@ -1,3 +1,5 @@+import { SkillsNavigationTabs } from "@/components/skill-studio/SkillsNavigationTabs";+import { SkillsToolbar, type DiscoverySort } from "@/components/skill-studio/SkillsToolbar";import { SkillBinaryFile } from "../components/SkillBinaryFile";import { skillFileLinkHref } from "@/lib/skill-file-links";import { SkillSourceProvenance } from "../components/SkillSourceProvenance";@@ -590,18 +592,6 @@ export function skillDetailBreadcrumbs(];}-type DiscoverySort = "agents" | "stars" | "forks" | "recent" | "alphabetical";--const DISCOVERY_SORT_LABELS: Record<DiscoverySort, string> = {- agents: "Most agents",- stars: "Most stars",- forks: "Most forks",- recent: "Recently updated",- alphabetical: "Alphabetical",-};--const DISCOVERY_SORTS: DiscoverySort[] = ["agents", "stars", "forks", "recent", "alphabetical"];-export type DiscoveryCard = {key: string;skillId: string | null;@@ -1037,6 +1027,8 @@ function CategoryNav({}export function DiscoveryGrid({+ collectionView,+ navigation,tab,categories,categoryTotal,@@ -1083,6 +1075,8 @@ export function DiscoveryGrid({folderNudgeStorageKey,showBrowseRails = true,}: {+ collectionView?: "authored";+ navigation?: React.ReactNode;tab: DiscoveryTab;categories: DiscoveryCategory[];categoryTotal: number;@@ -1135,11 +1129,14 @@ export function DiscoveryGrid({showBrowseRails?: boolean;}) {const installedView = tab === "installed";- const viewTitle = installedView ? "Installed skills" : "Discover skills";- const viewDescription = installedView+ const authoredView = collectionView === "authored";+ const viewTitle = authoredView ? "My Skills" : installedView ? "Installed skills" : "Discover skills";+ const viewDescription = authoredView+ ? "Skills you can open, edit and test in Studio."+ : installedView? "Skills available to this organization.": "Browse skills from every available source.";- const searchLabel = installedView ? "Search installed skills" : "Search discoverable skills";+ const searchLabel = authoredView ? "Search my skills" : installedView ? "Search installed skills" : "Search discoverable skills";// Source filter (github / skills.sh / local / …) lives in the grid so it// narrows whatever the parent already filtered by tab/category/search (PAP-10907 E).const [sourceBadgeFilter, setSourceBadgeFilter] = useState<string>("all");@@ -1234,125 +1231,21 @@ export function DiscoveryGrid({<div className="flex min-w-0 flex-1 flex-col overflow-hidden">{/* Search + sort + actions */}- <div className="flex flex-wrap items-center gap-2 border-b border-border px-4 py-3">- <div className="w-full">- <h1 className="text-lg font-semibold text-foreground">{viewTitle}</h1>- <p className="text-xs text-muted-foreground">{viewDescription}</p>- </div>- <div className="flex h-9 min-w-(--sz-12rem) flex-1 items-center gap-2 rounded-md border border-border px-2.5">- <Search className="h-4 w-4 shrink-0 text-muted-foreground" aria-hidden="true" />- <input- value={search}- onChange={(event) => onSearchChange(event.target.value)}- aria-label={searchLabel}- placeholder={`${searchLabel}…`}- className="h-full w-full bg-transparent text-base outline-none placeholder:text-muted-foreground sm:text-sm"- />- </div>- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="outline" size="sm">- <span className="text-muted-foreground">Sort</span>- <span className="ml-1.5">{DISCOVERY_SORT_LABELS[sort]}</span>- <ChevronDown className="ml-1 h-3.5 w-3.5" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuRadioGroup value={sort} onValueChange={(value) => onSortChange(value as DiscoverySort)}>- {DISCOVERY_SORTS.map((option) => (- <DropdownMenuRadioItem key={option} value={option}>- {DISCOVERY_SORT_LABELS[option]}- </DropdownMenuRadioItem>- ))}- </DropdownMenuRadioGroup>- </DropdownMenuContent>- </DropdownMenu>- {availableSources.length > 1 ? (- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="outline" size="sm">- <span className="text-muted-foreground">Source</span>- <span className="ml-1.5">- {sourceBadgeFilter === "all"- ? "All"- : availableSources.find((source) => source.value === sourceBadgeFilter)?.label ?? "All"}- </span>- <ChevronDown className="ml-1 h-3.5 w-3.5" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuRadioGroup value={sourceBadgeFilter} onValueChange={setSourceBadgeFilter}>- <DropdownMenuRadioItem value="all">All sources</DropdownMenuRadioItem>- {availableSources.map((source) => (- <DropdownMenuRadioItem key={source.value} value={source.value}>- {source.label}- </DropdownMenuRadioItem>- ))}- </DropdownMenuRadioGroup>- </DropdownMenuContent>- </DropdownMenu>- ) : null}- <Button- variant="ghost"- size="icon-sm"- onClick={() => onScan()}- disabled={scanPending}- aria-label="Scan project workspaces for skills"- title="Scan project workspaces for skills"- >- <RefreshCw className={cn("h-4 w-4", scanPending && "animate-spin")} />- </Button>- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button size="sm" variant="default">- <Plus className="mr-1 h-3.5 w-3.5" />- New- <ChevronDown className="ml-1 h-3.5 w-3.5" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuItem onSelect={onCreate}>- <Pencil className="mr-2 h-4 w-4" />- Create new skill- </DropdownMenuItem>- <DropdownMenuItem onSelect={onBrowseDiscover}>- <Compass className="mr-2 h-4 w-4" />- Discover skills- </DropdownMenuItem>- <DropdownMenuItem asChild><Link to="/skills/sources/new"><GithubIcon className="mr-2 h-4 w-4" />Import from GitHub</Link></DropdownMenuItem>- <DropdownMenuItem asChild><Link to="/skills/sources">Manage sources</Link></DropdownMenuItem>- <DropdownMenuItem onSelect={onImport}>- <Globe className="mr-2 h-4 w-4" />- Import from path or URL- </DropdownMenuItem>- <DropdownMenuItem onSelect={onImportFromProject}>- <FolderSearch className="mr-2 h-4 w-4" />- Import skills from project- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- {showBrowseRails && folderResult && onFolderSelect ? (+ <SkillsToolbar+ navigation={navigation}+ viewTitle={viewTitle} viewDescription={viewDescription} searchLabel={searchLabel}+ search={search} onSearchChange={onSearchChange} sort={sort} onSortChange={onSortChange}+ availableSources={availableSources} sourceBadgeFilter={sourceBadgeFilter} setSourceBadgeFilter={setSourceBadgeFilter}+ onScan={onScan} scanPending={scanPending} onCreate={onCreate} onBrowseDiscover={onBrowseDiscover}+ onImport={onImport} onImportFromProject={onImportFromProject}+ onCreateFolder={!showFolderRail ? onCreateFolder : undefined}+ selectMode={selectMode} onToggleSelectMode={onToggleSelectMode}+ folderControl={showBrowseRails && folderResult && onFolderSelect ? (<div className="w-full md:hidden">- <FolderChip- result={folderResult}- selection={folderSelection}- allLabel="All skills"- onClick={onOpenMobileFolders ?? (() => undefined)}- />+ <FolderChip result={folderResult} selection={folderSelection} allLabel="All skills" onClick={onOpenMobileFolders ?? (() => undefined)} /></div>- ) : null}- {onCreateFolder && !showFolderRail ? (- <Button variant="outline" size="sm" onClick={onCreateFolder}>- <Plus className="mr-1 h-3.5 w-3.5" />- New folder- </Button>- ) : null}- {onToggleSelectMode ? (- <Button variant="ghost" size="sm" onClick={onToggleSelectMode}>- {selectMode ? "Done" : "Select"}- </Button>- ) : null}- </div>+ ) : undefined}+ />{/* Mobile category selector (sidebar is hidden below md) */}{showBrowseRails && categories.length > 0 ? (@@ -1432,7 +1325,7 @@ export function DiscoveryGrid({message={totalCount === 0? installedView- ? "No installed skills yet. Discover a skill or create one."+ ? authoredView ? "No skills yet. Create a skill to start working in Studio." : "No installed skills yet. Discover a skill or create one.": "No skills are available to discover yet.": search || activeCategory || sourceFilterActive? "No skills match your filters."@@ -4027,7 +3920,7 @@ function SkillPane({);}-export function CompanySkills() {+export function CompanySkills({ collectionView }: { collectionView?: "authored" } = {}) {const { "*": routePath } = useParams<{ "*": string }>();const navigate = useNavigate();const queryClient = useQueryClient();@@ -4080,7 +3973,7 @@ export function CompanySkills() {error: string | null;}>({ open: false, catalogSkill: null, conflict: null, defaultSlug: null, defaultForce: false, defaultAction: "install", error: null });const [discoverySearch, setDiscoverySearch] = useState("");- const [discoverySort, setDiscoverySort] = useState<DiscoverySort>("agents");+ const [discoverySort, setDiscoverySort] = useState<DiscoverySort>(collectionView === "authored" ? "recent" : "agents");const [createError, setCreateError] = useState<string | null>(null);const [importDialogOpen, setImportDialogOpen] = useState(false);const [importFromProjectOpen, setImportFromProjectOpen] = useState(false);@@ -4114,7 +4007,7 @@ export function CompanySkills() {)? (tabParam as "all" | "installed" | "catalog" | "bundled"): "installed";- const effectiveDiscoveryTab: DiscoveryTab = streamlinedUiEnabled+ const effectiveDiscoveryTab: DiscoveryTab = collectionView === "authored" ? "installed" : streamlinedUiEnabled? discoveryTab: legacyDiscoveryTab === "installed"? "installed"@@ -4380,7 +4273,7 @@ export function CompanySkills() {useEffect(() => {setBreadcrumbs([{ label: "Skills", href: "/skills" },- ...(isStudioNew+ ...(collectionView === "authored" ? [{ label: "My Skills" }] : isStudioNew? [{ label: studioForkFromId ? "Fork skill" : "New skill" }]: activeDetail? skillDetailBreadcrumbs(activeDetail, skillFoldersQuery.data).slice(1)@@ -4388,7 +4281,7 @@ export function CompanySkills() {? [{ label: "Detail" }]: []),]);- }, [activeDetail, isStudioNew, routeSkillToken, setBreadcrumbs, skillFoldersQuery.data, studioForkFromId]);+ }, [activeDetail, collectionView, isStudioNew, routeSkillToken, setBreadcrumbs, skillFoldersQuery.data, studioForkFromId]);const activeFile = fileQuery.data ?? displayedFile;function routeForSkill(skill: CompanySkillRouteSubject, path?: string | null) {@@ -4643,13 +4536,14 @@ export function CompanySkills() {);const discoveryTabCards = useMemo(() => {+ if (collectionView === "authored") return cardsForTab(discoveryCards, "installed");if (streamlinedUiEnabled) return cardsForTab(discoveryCards, discoveryTab);if (legacyDiscoveryTab === "installed") return discoveryCards.filter((card) => card.installed);if (legacyDiscoveryTab === "catalog") return discoveryCards.filter((card) => card.catalogRef != null);if (legacyDiscoveryTab === "bundled") return discoveryCards.filter((card) => card.required);return discoveryCards;},- [discoveryCards, discoveryTab, legacyDiscoveryTab, streamlinedUiEnabled],+ [collectionView, discoveryCards, discoveryTab, legacyDiscoveryTab, streamlinedUiEnabled],);const discoveryCategoryCounts = useMemo<DiscoveryCategory[]>(() => {const counts = new Map<string, number>();@@ -5197,7 +5091,7 @@ export function CompanySkills() {// skills open the standalone catalog page (no modal, no legacy split view).function openDiscoveryCard(card: DiscoveryCard) {if (card.skillId) {- navigate(routeForSkillId(card.skillId));+ navigate(collectionView === "authored" ? skillStudioRoute(card.skillId) : routeForSkillId(card.skillId));return;}if (card.catalogRef) {@@ -5497,6 +5391,8 @@ export function CompanySkills() {</div>) : null}<DiscoveryGrid+ collectionView={collectionView}+ navigation={streamlinedUiEnabled ? <SkillsNavigationTabs activeView={collectionView ?? effectiveDiscoveryTab} /> : undefined}tab={effectiveDiscoveryTab}categories={discoveryCategoryCounts}categoryTotal={discoveryTabCards.length}@@ -5514,7 +5410,7 @@ export function CompanySkills() {onCreate={() => void openNewSkill()}onImport={() => setImportDialogOpen(true)}onImportFromProject={() => setImportFromProjectOpen(true)}- onBrowseDiscover={() => streamlinedUiEnabled ? setDiscoveryTab("discover") : setLegacyDiscoveryTab("catalog")}+ onBrowseDiscover={() => collectionView === "authored" ? navigate("/skills?tab=discover") : streamlinedUiEnabled ? setDiscoveryTab("discover") : setLegacyDiscoveryTab("catalog")}onScan={(projectId) => scanProjects.mutate(projectId)}scanPending={scanProjects.isPending}scanStatus={scanStatusMessage}diff --git a/ui/src/pages/Dashboard.tsx b/ui/src/pages/Dashboard.tsxindex 38bf9e51ef..cb55908b45 100644--- a/ui/src/pages/Dashboard.tsx+++ b/ui/src/pages/Dashboard.tsx@@ -1,4 +1,6 @@import { AgentIdentity } from "../components/AgentIdentity";+import { TaskSummaryList } from "../components/TaskSummaryList";+import { useDesignSandbox } from "../context/DesignSandboxContext";import { useEffect, useMemo, useRef, useState } from "react";import { useLocation } from "@/lib/router";import {@@ -25,6 +27,7 @@ import { StatusIcon } from "../components/StatusIcon";import { usePublishSharedQueryData, useSharedPollingQuery } from "../hooks/useSharedPolling";import { ActivityRow } from "../components/ActivityRow";+import { ActivityList } from "../components/ActivityList";import { timeAgo } from "../lib/timeAgo";import { cn, formatCents } from "../lib/utils";import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";@@ -71,6 +74,7 @@ export function derivePausedAgentBanner(agents: Agent[] | undefined): PausedAgen}export function Dashboard() {+ const designSandbox = useDesignSandbox();const { selectedCompanyId, companies } = useCompany();const { openOnboarding } = useDialogActions();const location = useLocation();@@ -397,8 +401,9 @@ export function Dashboard() {</div>) : null}- <div className="grid grid-cols-2 xl:grid-cols-4 gap-1 sm:gap-2">+ <div className={cn("grid grid-cols-2 xl:grid-cols-4", designSandbox ? "gap-4" : "gap-1 sm:gap-2")}><MetricCard+ appearance={designSandbox ? "card" : "plain"}icon={Bot}value={data.agents.active + data.agents.running + data.agents.paused + data.agents.error}label="Agents Enabled"@@ -412,6 +417,7 @@ export function Dashboard() {}/><MetricCard+ appearance={designSandbox ? "card" : "plain"}icon={CircleDot}value={data.tasks.inProgress}label="Tasks In Progress"@@ -424,6 +430,7 @@ export function Dashboard() {}/><MetricCard+ appearance={designSandbox ? "card" : "plain"}icon={DollarSign}value={formatCents(data.costs.monthSpendCents)}label="Month Spend"@@ -437,6 +444,7 @@ export function Dashboard() {}/><MetricCard+ appearance={designSandbox ? "card" : "plain"}icon={ShieldCheck}value={data.pendingApprovals + data.budgets.pendingApprovals}label="Pending Approvals"@@ -487,7 +495,7 @@ export function Dashboard() {Recent Activity</h3><Card className="@container block py-0 divide-y divide-border overflow-hidden">- {recentActivity.map((event) => (+ {designSandbox ? <ActivityList events={recentActivity} agentMap={agentMap} userProfileMap={userProfileMap} entityNameMap={entityNameMap} entityTitleMap={entityTitleMap} rowClassName={event => animatedActivityIds.has(event.id) ? "activity-row-enter" : undefined} /> : recentActivity.map((event) => (<ActivityRowkey={event.id}event={event}@@ -512,7 +520,9 @@ export function Dashboard() {<p className="text-sm text-muted-foreground">No tasks yet.</p></Card>) : (- <Card className="@container block py-0 divide-y divide-border overflow-hidden">+ designSandbox ? <Card className="block overflow-hidden py-0">+ <TaskSummaryList issues={recentIssues.slice(0, 10)} />+ </Card> : <Card className="@container block py-0 divide-y divide-border overflow-hidden">{recentIssues.slice(0, 10).map((issue) => (<Linkkey={issue.id}diff --git a/ui/src/pages/DecisionQueuePage.tsx b/ui/src/pages/DecisionQueuePage.tsxindex b442fd02bf..bcc7e4c25e 100644--- a/ui/src/pages/DecisionQueuePage.tsx+++ b/ui/src/pages/DecisionQueuePage.tsx@@ -68,6 +68,8 @@ export function DecisionQueuePage() {const [expandedId, setExpandedId] = useState<string | null>(null);const { dismiss, snooze } = useInboxDismissals(selectedCompanyId);+ const [searchQuery, setSearchQuery] = useState("");+// Toolbar preferences (persisted to localStorage, shared with the desk).const [groupBy, setGroupBy] = useState<AttentionGroupBy>(() => loadAttentionGroupBy());const [sortOrder, setSortOrder] = useState<AttentionSortOrder>(() => loadAttentionSortOrder());@@ -159,13 +161,13 @@ export function DecisionQueuePage() {// when something carries an explicit due decide-by); any explicit group-by keeps// the Inbox-style activity grouping.const groups = useMemo<AttentionGroup[]>(() => {- const filtered = filterAttentionItems(listItems, filters);+ const filtered = filterAttentionItems(listItems, filters, searchQuery);if (groupBy === "none") {return buildDeskShelves(filtered, now);}const sorted = sortAttentionItems(filtered, sortOrder);return groupAttentionItems(sorted, groupBy);- }, [listItems, filters, sortOrder, groupBy, now]);+ }, [listItems, filters, searchQuery, sortOrder, groupBy, now]);const visibleCount = useMemo(() => groups.reduce((sum, group) => sum + group.items.length, 0), [groups]);@@ -222,12 +224,14 @@ export function DecisionQueuePage() {return (<div className="max-w-3xl space-y-4">- <div className="flex flex-wrap items-center justify-between gap-2">+ <div className="space-y-4"><div className="min-w-0"><h1 className="text-xl font-bold">{queue?.title ?? queueKey}</h1>{queue?.description && <p className="mt-0.5 text-sm text-muted-foreground">{queue.description}</p>}</div><DecisionsToolbar+ query={searchQuery}+ onQueryChange={setSearchQuery}visibleCount={visibleCount}filterOptions={filterOptions}filters={filters}@@ -273,8 +277,8 @@ export function DecisionQueuePage() {<div className="space-y-4">{visibleCount === 0 ? (<div className="rounded-xl border border-dashed border-border py-10 text-center">- <p className="text-sm font-medium text-foreground">No decisions match your filters.</p>- <p className="mt-1 text-xs text-muted-foreground">Adjust or clear the filters to see the rest.</p>+ <p className="text-sm font-medium text-foreground">No decisions match your search or filters.</p>+ <p className="mt-1 text-xs text-muted-foreground">Adjust or clear your search and filters to see the rest.</p></div>) : (groups.map((group) => {diff --git a/ui/src/pages/DesignSandboxTasks.tsx b/ui/src/pages/DesignSandboxTasks.tsxnew file mode 100644index 0000000000..657a40b462--- /dev/null+++ b/ui/src/pages/DesignSandboxTasks.tsx@@ -0,0 +1,104 @@+import { useEffect } from "react";+import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { ListChecks, SearchX } from "lucide-react";+import { accessApi } from "@/api/access";+import { agentsApi } from "@/api/agents";+import { useAccountIdentity } from "@/api/companies-query";+import { issuesApi } from "@/api/issues";+import { projectsApi } from "@/api/projects";+import { EmptyState } from "@/components/EmptyState";+import { KanbanBoard } from "@/components/KanbanBoard";+import { TaskList, type TaskListItem } from "@/components/TaskList";+import { TaskListToolbar } from "@/components/TaskListToolbar";+import { TruncatedTextMarqueeProvider } from "@/components/TruncatedText";+import { Button } from "@/components/ui/button";+import { useBreadcrumbs } from "@/context/BreadcrumbContext";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { useTaskListCollection } from "@/hooks/useTaskListCollection";+import { buildCompanyUserLabelMap } from "@/lib/company-members";+import { queryKeys } from "@/lib/queryKeys";+import { taskListViewStorageKey } from "@/lib/task-list-views";+import type { Issue } from "@paperclipai/shared";++const pageSize = 200;++/** Real API adapter for the Design proposals / Pages / Tasks composition.+ * All visual and collection behavior comes from the reviewed shared subjects. */+export function DesignSandboxTasks() {+ const { selectedCompanyId: companyId } = useCompany();+ const { userId } = useAccountIdentity();+ const { openNewIssue } = useDialogActions();+ const { setBreadcrumbs } = useBreadcrumbs();+ const client = useQueryClient();+ useEffect(() => { setBreadcrumbs([{ label: "Tasks" }]); }, [setBreadcrumbs]);++ const tasks = useInfiniteQuery({+ queryKey: [...queryKeys.issues.list(companyId!), "design-sandbox", userId],+ queryFn: ({ pageParam, signal }) => issuesApi.list(companyId!, {+ limit: pageSize, offset: pageParam, includeAgentCreatedTasks: true,+ includeRoutineExecutions: true, sortField: "id", sortDir: "asc",+ }, { signal }),+ initialPageParam: 0,+ getNextPageParam: (last, _pages, offset) => last.length === pageSize ? offset + pageSize : undefined,+ enabled: !!companyId,+ });+ const agents = useQuery({ queryKey: queryKeys.agents.list(companyId!), queryFn: () => agentsApi.list(companyId!), enabled: !!companyId });+ const projects = useQuery({ queryKey: queryKeys.projects.list(companyId!, { includeArchived: true }), queryFn: () => projectsApi.list(companyId!, { includeArchived: true }), enabled: !!companyId });+ const directory = useQuery({ queryKey: queryKeys.access.companyUserDirectory(companyId!), queryFn: () => accessApi.listUserDirectory(companyId!), enabled: !!companyId });+ const labels = useQuery({ queryKey: queryKeys.issues.labels(companyId!), queryFn: () => issuesApi.listLabels(companyId!), enabled: !!companyId });+ // The ordinary organization list does not include viewer read context.+ // Ask the server for the signed-in user's unread set instead of guessing+ // unread state from dates or reusing Storybook fixture flags.+ const unread = useQuery({+ queryKey: [...queryKeys.issues.list(companyId!), "design-sandbox-unread", userId],+ queryFn: async ({ signal }) => {+ const ids = new Set<string>();+ let page: Issue[];+ let offset = 0;+ do {+ page = await issuesApi.list(companyId!, { unreadForUserId: "me", includeAgentCreatedTasks: true,+ includeRoutineExecutions: true, limit: pageSize, offset, sortField: "id", sortDir: "asc" }, { signal });+ for (const issue of page) ids.add(issue.id);+ offset += pageSize;+ } while (page.length === pageSize);+ return ids;+ },+ enabled: !!companyId && !!userId,+ });+ const users = buildCompanyUserLabelMap(directory.data?.users);+ const agentNames = new Map(agents.data?.map(agent => [agent.id, agent.name]));+ const projectById = new Map(projects.data?.map(project => [project.id, project]));+ const items: TaskListItem[] = [...new Map((tasks.data?.pages.flat() ?? []).map(issue => [issue.id, issue])).values()].map(issue => ({+ issue: { ...issue, project: issue.project ?? projectById.get(issue.projectId ?? "") },+ unread: unread.data?.has(issue.id) ?? false,+ createdBy: issue.createdByAgentId ? agentNames.get(issue.createdByAgentId) ?? "Unknown agent" : users.get(issue.createdByUserId ?? "") ?? (issue.createdByUserId === "local-board" ? "Board" : "Unknown user"),+ assignee: issue.assigneeAgentId ? agentNames.get(issue.assigneeAgentId) ?? "Unknown agent" : users.get(issue.assigneeUserId ?? "") ?? (issue.assigneeUserId === "local-board" ? "Board" : null),+ }));+ const collection = useTaskListCollection({ items, companyId, userId,+ viewStorageKey: taskListViewStorageKey("design-integration-sandbox", userId ?? "local-board"),+ });+ const update = useMutation({+ mutationFn: ({ id, data }: { id: string; data: Record<string, unknown> }) => issuesApi.update(id, data),+ onSuccess: () => { void client.invalidateQueries({ queryKey: queryKeys.issues.list(companyId!) }); },+ });+ const error = tasks.error ?? agents.error ?? projects.error ?? directory.error ?? labels.error ?? unread.error ?? update.error;+ const empty = collection.companyItems.length === 0+ ? <EmptyState icon={ListChecks} message="No tasks in this organization" action="New Task" onAction={() => openNewIssue()} />+ : <EmptyState icon={SearchX} message="No tasks match this view" action="Clear filters" hideActionIcon onAction={collection.clear} />;++ if (!companyId) return <EmptyState icon={ListChecks} message="Select an organization to view tasks." />;+ return <TruncatedTextMarqueeProvider><div className="task-row-design-preview flex flex-col gap-8" data-testid="design-sandbox-tasks">+ <TaskListToolbar view={collection.view} onViewChange={collection.setView} query={collection.query} onQueryChange={collection.setQuery}+ layout={collection.layout} onLayoutChange={collection.setLayout} allExpanded={collection.allExpanded} onToggleExpanded={collection.toggleExpanded}+ onNewTask={() => openNewIssue()} filters={{ state: collection.filters, onChange: collection.updateFilters, activeFilterCount: collection.activeFilterCount,+ agents: agents.data ?? [], projects: projects.data ?? [], labels: labels.data ?? [], currentUserId: userId, creators: collection.creators }} />+ {error ? <div role="alert" className="flex items-center gap-2 text-sm text-destructive"><span>{error instanceof Error ? error.message : "Could not load tasks"}</span><Button variant="outline" size="sm" onClick={() => { update.reset(); void client.invalidateQueries({ queryKey: queryKeys.issues.list(companyId) }); void agents.refetch(); void projects.refetch(); void directory.refetch(); void labels.refetch(); }}>Retry</Button></div> : null}+ {tasks.isPending ? <p role="status" className="text-sm text-muted-foreground">Loading tasks…</p> : <>+ {collection.narrowed ? <p role="status" className="design-task-results">{collection.matchingItems.length} matching tasks{collection.layout === "list" && collection.visibleItems.length > collection.matchingItems.length ? " · Parent tasks included for context" : ""}</p> : null}+ <div hidden={collection.layout !== "list"} className="design-task-list-panel"><TaskList key={companyId} items={collection.visibleItems} allItems={collection.companyItems} collapsedIds={collection.collapsedIds} onCollapsedIdsChange={collection.setCollapsedIds} emptyState={empty} /></div>+ {collection.layout === "board" ? collection.matchingItems.length ? <KanbanBoard showOverflowFades issues={collection.matchingItems.map(item => item.issue)} agents={agents.data} onUpdateIssue={(id, data) => update.mutate({ id, data })} /> : empty : null}+ {tasks.hasNextPage ? <div className="flex items-center gap-3 text-sm text-muted-foreground"><span>Search, views and filters cover the {items.length} loaded tasks.</span><Button variant="outline" size="sm" disabled={tasks.isFetchingNextPage} onClick={() => void tasks.fetchNextPage()}>{tasks.isFetchingNextPage ? "Loading…" : "Load more tasks"}</Button></div> : null}+ </>}+ </div></TruncatedTextMarqueeProvider>;+}diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsxindex 254588259c..12f6e34acb 100644--- a/ui/src/pages/IssueDetail.tsx+++ b/ui/src/pages/IssueDetail.tsx@@ -22,7 +22,9 @@ import { EmailThreadProvider } from "../components/EmailMessageCard";import { EmailTaskActivity } from "../components/EmailTaskActivity";import { TaskChatScrollNavigation, taskChatScrollEntry } from "@/components/task-chat/scroll-navigation";import {+ lazy,memo,+ Suspense,useCallback,useEffect,useLayoutEffect,@@ -187,6 +189,7 @@ import { liveBlueBadge } from "../lib/status-colors";import { ApprovalCard } from "../components/ApprovalCard";import { ProjectTile } from "../components/ProjectTile";import { InlineEditor } from "../components/InlineEditor";+import { useDesignSandbox } from "../context/DesignSandboxContext";import {IssueChatThread,type IssueChatComposerHandle,@@ -1348,6 +1351,8 @@ type IssueDetailChatTabProps = {linkCaseReferences?: boolean;};+const DesignSandboxTaskThread = lazy(() => import("../components/design-sandbox/DesignSandboxTaskThread"));+const IssueDetailChatTab = memo(function IssueDetailChatTab({queryIssueId,browsers,@@ -1456,6 +1461,7 @@ const IssueDetailChatTab = memo(function IssueDetailChatTab({const ThreadComponent = classicTaskInterfaceEnabled? IssueChatThread: TaskChatThread;+ const designSandbox = useDesignSandbox();const queryClient = useQueryClient();const issueQueryRef = queryIssueId ?? issueId;const scrollLocation = useLocation();@@ -2475,7 +2481,7 @@ const IssueDetailChatTab = memo(function IssueDetailChatTab({</div>) : null;- return (+ const savedThread = (<divclassName={classicTaskInterfaceEnabled@@ -2685,6 +2691,21 @@ const IssueDetailChatTab = memo(function IssueDetailChatTab({)}</div>);++ return import.meta.env.DEV && designSandbox && !classicTaskInterfaceEnabled && !conversationMode ? (+ <Suspense fallback={savedThread}>+ <DesignSandboxTaskThread+ previewMode="playback"+ key={issueId}+ header={threadHeader}+ agentName={agentMap.get(issueAssigneeAgentId ?? "")?.name ?? "Preview agent"}+ agent={agentMap.get(issueAssigneeAgentId ?? "")}+ defaultConversation={issueQueryRef === "DES-1" || issueQueryRef === "DES-7"}+ >+ {savedThread}+ </DesignSandboxTaskThread>+ </Suspense>+ ) : savedThread;});type IssueDetailActivityTabProps = {@@ -3075,6 +3096,8 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskSstreamlinedUiEnabled,loaded: taskInterfaceSettingsLoaded,} = useTaskDetailInterfaceMode(!!conversation);+ const designSandbox = useDesignSandbox();+ const proposedTaskHeader = designSandbox && streamlinedTaskDetailEnabled;// Chat-style: the page wrapper spans the full center pane so the thread's// scroll viewport (and its scrollbar) reaches the properties-pane border;// every non-thread section re-centers itself at the 60rem shell cap instead.@@ -7184,7 +7207,7 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskSconst issueStatusControl = (<StatusIconstatus={issue.status} externalConversationState={issue.externalConversationState}- size="lg"+ size={proposedTaskHeader ? "md" : "lg"}blockerAttention={issue.blockerAttention}onChange={(status) => updateIssue.mutate({ status })}/>@@ -7200,7 +7223,9 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS>{streamlinedTaskDetailEnabled ? (<div className="flex min-w-0 items-start gap-2 md:items-center md:pr-8">- <div className="hidden md:block">{issueStatusControl}</div>+ {!proposedTaskHeader ? (+ <div className="hidden md:block">{issueStatusControl}</div>+ ) : null}<divdata-slot="task-detail-title"className="flex min-w-0 flex-1 items-baseline gap-2"@@ -7209,14 +7234,20 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskSvalue={issue.title}onSave={(title) => updateIssue.mutateAsync({ title })}as="h2"- className="min-w-0 text-xl font-semibold leading-normal text-balance"+ className={cn(+ "min-w-0 text-balance",+ proposedTaskHeader ? "text-2xl font-normal text-foreground" : "text-xl font-semibold",+ "leading-normal",+ )}/>- <span- data-slot="task-title-identifier"- className="hidden shrink-0 font-mono text-sm text-muted-foreground md:inline"- >- {issue.identifier ?? issue.id.slice(0, 8)}- </span>+ {!proposedTaskHeader ? (+ <span+ data-slot="task-title-identifier"+ className="hidden shrink-0 font-mono text-sm text-muted-foreground md:inline"+ >+ {issue.identifier ?? issue.id.slice(0, 8)}+ </span>+ ) : null}</div></div>) : null}@@ -7224,13 +7255,22 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS<divclassName={cn("flex min-w-0 flex-wrap items-center gap-2",- streamlinedTaskDetailEnabled && "gap-x-3 gap-y-2 md:gap-x-6 md:pl-7",+ streamlinedTaskDetailEnabled &&+ (proposedTaskHeader ? "gap-x-6 gap-y-2" : "gap-x-3 gap-y-2 md:gap-x-6 md:pl-7"),)}>- {streamlinedTaskDetailEnabled ? (+ {proposedTaskHeader ? (+ <div className="flex shrink-0 items-center gap-2">+ {issueStatusControl}+ <span data-slot="task-title-identifier" className="font-mono text-sm text-muted-foreground">+ {issue.identifier ?? issue.id.slice(0, 8)}+ </span>+ </div>+ ) : null}+ {streamlinedTaskDetailEnabled && !proposedTaskHeader ? (<div className="md:hidden">{issueStatusControl}</div>) : null}- {streamlinedTaskDetailEnabled ? (+ {streamlinedTaskDetailEnabled && !proposedTaskHeader ? (<span className="shrink-0 font-mono text-sm text-muted-foreground md:hidden">{issue.identifier ?? issue.id.slice(0, 8)}</span>@@ -7488,7 +7528,7 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS}}}>- <MoreHorizontal className="h-4 w-4" />+ <MoreHorizontal className={proposedTaskHeader ? "h-3 w-3" : "h-4 w-4"} /></Button></PopoverTrigger><PopoverContent className="w-52 p-1" align="end">diff --git a/ui/src/pages/Issues.tsx b/ui/src/pages/Issues.tsxindex ac11e1ba02..9686be17c4 100644--- a/ui/src/pages/Issues.tsx+++ b/ui/src/pages/Issues.tsx@@ -1,4 +1,6 @@import { useShowAgentCreatedTasks } from "../hooks/useShowAgentCreatedTasks";+import { useDesignSandbox } from "../context/DesignSandboxContext";+import { DesignSandboxTasks } from "./DesignSandboxTasks";import { useEffect, useMemo, useCallback, useRef, useState } from "react";import type { ReactNode } from "react";import { useLocation, useNavigate, useSearchParams } from "@/lib/router";@@ -91,11 +93,12 @@ export function buildIssuesSearchUrl(currentHref: string, search: string): strin* get the same Views control in their toolbar, so the switch reads as one page.*/export function Issues() {+ const designSandbox = useDesignSandbox();const { enabled: streamlinedUiEnabled } = useStreamlinedUiEnabled();const { enabled: combinedInboxTasksEnabled } = useCombinedInboxTasksEnabled();// The merged surface is Combined Inbox + Task List only. With the flag off, and always in// the legacy shell, Tasks is the plain task list and Inbox keeps its pages.- return streamlinedUiEnabled && combinedInboxTasksEnabled ? <StreamlinedTasks /> : <OrganizationIssues />;+ return designSandbox ? <DesignSandboxTasks /> : streamlinedUiEnabled && combinedInboxTasksEnabled ? <StreamlinedTasks /> : <OrganizationIssues />;}function StreamlinedTasks() {diff --git a/ui/src/pages/Projects.test.tsx b/ui/src/pages/Projects.test.tsxindex 53a417f19a..f45329db3a 100644--- a/ui/src/pages/Projects.test.tsx+++ b/ui/src/pages/Projects.test.tsx@@ -219,6 +219,21 @@ describe("Projects", () => {expect(content).toContain("in progress");});+ it("searches projects and clears back to the grouped list", async () => {+ await renderProjects();+ const input = container.querySelector<HTMLInputElement>('input[aria-label="Search projects"]')!;+ await act(() => {+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, "charlie");+ input.dispatchEvent(new Event("input", { bubbles: true }));+ });+ expect(container.textContent).toContain("Charlie");+ expect(container.textContent).not.toContain("Alpha");+ expect(container.textContent).not.toContain("Bravo");+ await act(() => container.querySelector<HTMLButtonElement>('button[aria-label="Clear search"]')!.click());+ expect(container.textContent).toContain("Alpha");+ expect(container.textContent).toContain("Bravo");+ });+it("sorts grouped projects by the selected field", async () => {await renderProjects();await openSortMenu();diff --git a/ui/src/pages/Projects.tsx b/ui/src/pages/Projects.tsxindex 796efa180d..d9b2c22b52 100644--- a/ui/src/pages/Projects.tsx+++ b/ui/src/pages/Projects.tsx@@ -20,22 +20,11 @@ import {useResourceMembershipMutation,useResourceMemberships,} from "../hooks/useResourceMemberships";-import { Button } from "@/components/ui/button";-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";-import { ArrowUpDown, Check, Hexagon, Plus } from "lucide-react";+import { ProjectsToolbar, type ProjectSortField, type ProjectSortDir } from "@/components/ProjectsToolbar";+import { Hexagon } from "lucide-react";import { Lock } from "lucide-react";import { Card } from "@/components/ui/card";-type ProjectSortField = "name" | "updated" | "created" | "targetDate";-type ProjectSortDir = "asc" | "desc";--const PROJECT_SORT_OPTIONS: Array<{ field: ProjectSortField; label: string }> = [- { field: "name", label: "Name" },- { field: "updated", label: "Updated" },- { field: "created", label: "Created" },- { field: "targetDate", label: "Target date" },-];-function compareProjectNames(left: Project, right: Project) {const nameDiff = left.name.localeCompare(right.name, undefined, { sensitivity: "base" });return nameDiff !== 0 ? nameDiff : left.id.localeCompare(right.id);@@ -81,6 +70,7 @@ export function Projects() {const { selectedCompanyId } = useCompany();const { openNewProject } = useDialogActions();const { setBreadcrumbs } = useBreadcrumbs();+ const [query, setQuery] = useState("");const [sortField, setSortField] = useState<ProjectSortField>("name");const [sortDir, setSortDir] = useState<ProjectSortDir>("asc");@@ -100,8 +90,15 @@ export function Projects() {[allProjects],);const sortedProjects = useMemo(- () => sortProjects(projects, sortField, sortDir),- [projects, sortDir, sortField],+ () => {+ const words = query.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);+ const matching = projects.filter(project => {+ const text = `${project.name} ${project.description ?? ""}`.toLocaleLowerCase();+ return words.every(word => text.includes(word));+ });+ return sortProjects(matching, sortField, sortDir);+ },+ [projects, query, sortDir, sortField],);const groupedProjects = useMemo(() => {const groups = {@@ -117,7 +114,6 @@ export function Projects() {return groups;}, [membershipsQuery.data, sortedProjects]);- const sortLabel = PROJECT_SORT_OPTIONS.find((option) => option.field === sortField)?.label ?? "Name";if (!selectedCompanyId) {return <EmptyState icon={Hexagon} message="Select an organization to view projects." />;@@ -129,51 +125,8 @@ export function Projects() {return (<div className="space-y-4">- <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">- <Popover>- <PopoverTrigger asChild>- <Button variant="ghost" size="sm" className="w-fit text-xs" title="Sort">- <ArrowUpDown className="h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1" />- <span>Sort: {sortLabel}</span>- </Button>- </PopoverTrigger>- <PopoverContent align="start" className="w-44 p-0">- <div className="p-2 space-y-0.5">- {PROJECT_SORT_OPTIONS.map((option) => (- <button- key={option.field}- type="button"- className={`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${- sortField === option.field- ? "bg-accent/50 text-foreground"- : "text-muted-foreground hover:bg-accent/50"- }`}- onClick={() => {- if (sortField === option.field) {- setSortDir((current) => (current === "asc" ? "desc" : "asc"));- return;- }- setSortField(option.field);- setSortDir(option.field === "name" || option.field === "targetDate" ? "asc" : "desc");- }}- >- <span>{option.label}</span>- {sortField === option.field ? (- <span className="flex items-center gap-1 text-xs text-muted-foreground">- <Check className="h-3 w-3" />- {sortDir === "asc" ? "Asc" : "Desc"}- </span>- ) : null}- </button>- ))}- </div>- </PopoverContent>- </Popover>- <Button size="sm" variant="outline" onClick={openNewProject}>- <Plus className="h-4 w-4 mr-1" />- Add Project- </Button>- </div>+ <ProjectsToolbar query={query} onQueryChange={setQuery} sortField={sortField} sortDir={sortDir}+ onSortChange={(field, direction) => { setSortField(field); setSortDir(direction); }} onNewProject={openNewProject} />{error && <p className="text-sm text-destructive">{error.message}</p>}@@ -186,7 +139,9 @@ export function Projects() {/>)}- {projects.length > 0 && (+ {projects.length > 0 && sortedProjects.length === 0 && <p className="text-sm text-muted-foreground">No projects match your search.</p>}++ {sortedProjects.length > 0 && (<div className="space-y-6">{([["My Projects", groupedProjects.mine],diff --git a/ui/src/pages/Routines.test.tsx b/ui/src/pages/Routines.test.tsxindex 199839b13c..7364fb250e 100644--- a/ui/src/pages/Routines.test.tsx+++ b/ui/src/pages/Routines.test.tsx@@ -871,7 +871,6 @@ describe("Routines page", () => {}const text = container.textContent ?? "";- expect(text).toContain("1 routine");expect(text).toContain("Morning sync");expect(text).not.toContain("Archived cleanup");@@ -880,6 +879,57 @@ describe("Routines page", () => {});});+ it("searches routine titles and descriptions and restores results when cleared", async () => {+ routinesListMock.mockResolvedValue([+ createRoutine({ id: "routine-1", title: "Morning sync", status: "active" }),+ createRoutine({ id: "routine-2", title: "Weekly digest", description: "Review company activity", status: "active" }),+ ]);+ issuesListMock.mockResolvedValue([]);++ const root = createRoot(container);+ const queryClient = new QueryClient({+ defaultOptions: {+ queries: { retry: false },+ },+ });++ await act(async () => {+ root.render(+ <QueryClientProvider client={queryClient}>+ <Routines />+ </QueryClientProvider>,+ );+ await flush();+ });++ for (let attempts = 0; attempts < 5 && !container.textContent?.includes("Morning sync"); attempts += 1) {+ await act(async () => {+ await flush();+ });+ }++ const input = container.querySelector<HTMLInputElement>('input[aria-label="Search routines"]')!;+ const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!;+ async function search(value: string) {+ await act(async () => {+ setValue.call(input, value);+ input.dispatchEvent(new Event("input", { bubbles: true }));+ });+ }+ await search("company review");+ expect(container.textContent).toContain("Weekly digest");+ expect(container.textContent).not.toContain("Morning sync");+ await search("missing");+ expect(container.textContent).toContain("No routines match your search.");+ await search("");+ expect(container.textContent).toContain("Weekly digest");+ expect(container.textContent).toContain("Morning sync");++ await act(async () => {+ root.unmount();+ });+ });+it("shows an outlined row-level run now button on the routines table", async () => {routinesListMock.mockResolvedValue([createRoutine({ id: "routine-1", title: "Morning sync" })]);issuesListMock.mockResolvedValue([]);diff --git a/ui/src/pages/Routines.tsx b/ui/src/pages/Routines.tsxindex 978a7e78ea..8db47ee914 100644--- a/ui/src/pages/Routines.tsx+++ b/ui/src/pages/Routines.tsx@@ -2,7 +2,7 @@ import { AgentAvatar } from "@/components/AgentAvatar";import { startTransition, useEffect, useMemo, useRef, useState } from "react";import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";import { Link, Navigate, useNavigate, useSearchParams } from "@/lib/router";-import { ArrowUpDown, Check, ChevronDown, ChevronRight, Layers, Plus, Repeat } from "lucide-react";+import { ChevronDown, ChevronRight, Plus, Repeat } from "lucide-react";import { routinesApi } from "../api/routines";import { foldersApi } from "../api/folders";import { agentsApi } from "../api/agents";@@ -37,7 +37,7 @@ import { Button } from "@/components/ui/button";import { Card, CardContent } from "@/components/ui/card";import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";import { Dialog, DialogContent } from "@/components/ui/dialog";-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";+import { RoutinesToolbar, type RoutineGroupBy, type RoutineSortField, type RoutineSortDir } from "@/components/RoutinesToolbar";import {Select,SelectContent,@@ -86,10 +86,7 @@ function autoResizeTextarea(element: HTMLTextAreaElement | null) {element.style.height = `${element.scrollHeight}px`;}-type RoutineGroupBy = "folder" | "none" | "project" | "assignee";type RoutinesTab = "routines" | "runs";-type RoutineSortField = "updated" | "created" | "title" | "lastRun";-type RoutineSortDir = "asc" | "desc";type RoutineViewState = {sortField: RoutineSortField;@@ -361,6 +358,7 @@ export function Routines() {const routineViewStateKey = selectedCompanyId? `paperclip:routines-view:${selectedCompanyId}`: "paperclip:routines-view";+ const [query, setQuery] = useState("");const [routineViewState, setRoutineViewState] = useState<RoutineViewState>(() => getRoutineViewState(routineViewStateKey));const folderSelection = normalizeFolderSelection(searchParams.get("folder"));@@ -696,8 +694,15 @@ export function Routines() {};}, [routineFolders, visibleRoutines]);const sortedRoutines = useMemo(- () => sortRoutines(folderFilteredRoutines, routineViewState.sortField, routineViewState.sortDir),- [folderFilteredRoutines, routineViewState.sortDir, routineViewState.sortField],+ () => {+ const terms = query.toLowerCase().trim().split(/\s+/).filter(Boolean);+ const matches = folderFilteredRoutines.filter(routine => {+ const text = `${routine.title} ${routine.description ?? ""}`.toLowerCase();+ return terms.every(term => text.includes(term));+ });+ return sortRoutines(matches, routineViewState.sortField, routineViewState.sortDir);+ },+ [folderFilteredRoutines, query, routineViewState.sortDir, routineViewState.sortField],);const routineSections = useMemo(() => buildRoutineSections(sortedRoutines, routineViewState.groupBy, projectById, agentById, folderById),@@ -843,25 +848,16 @@ export function Routines() {return (<div className="space-y-6">- <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">- <div className="space-y-1">- <h1 className="text-xl font-bold">Routines</h1>- <p className="text-sm text-muted-foreground">- Recurring work definitions that materialize into auditable execution tasks.- </p>- </div>- <div className="flex items-center gap-2">- {streamlinedUiEnabled ? (- <Button variant="outline" asChild>- <Link to={auditSectionHref("runs", {})}>View all runs</Link>- </Button>- ) : null}- <Button onClick={openCreateRoutine}>- <Plus className="mr-2 h-4 w-4" />- Create routine- </Button>- </div>- </div>+ <RoutinesToolbar+ query={query} onQueryChange={setQuery}+ sortField={routineViewState.sortField} sortDir={routineViewState.sortDir} groupBy={routineViewState.groupBy}+ onSortChange={(sortField, sortDir) => updateRoutineView({ sortField, sortDir })}+ onGroupChange={groupBy => updateRoutineView({ groupBy, collapsedGroups: [] })}+ onNewFolder={routineViewState.groupBy === "folder" && !hasRoutineFolders ? () => openCreateFolder() : undefined}+ onCreateRoutine={openCreateRoutine}+ runsHref={streamlinedUiEnabled ? auditSectionHref("runs", {}) : undefined}+ selectMode={selectMode} onToggleSelect={showFolderRail ? () => setSelectMode(current => !current) : undefined}+ />{!streamlinedUiEnabled ? (<Tabs value={activeTab} onValueChange={handleLegacyTabChange}>@@ -878,96 +874,6 @@ export function Routines() {) : null}<div className="flex flex-col gap-4">- <div className="flex items-center justify-between gap-3">- <p className="text-sm text-muted-foreground">- {visibleRoutines.length} routine{visibleRoutines.length === 1 ? "" : "s"}- </p>- <div className="flex items-center gap-1">- <Popover>- <PopoverTrigger asChild>- <Button variant="ghost" size="sm" className="text-xs" title="Sort">- <ArrowUpDown className="h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1" />- <span className="hidden sm:inline">Sort</span>- </Button>- </PopoverTrigger>- <PopoverContent align="end" className="w-44 p-0">- <div className="p-2 space-y-0.5">- {([- ["updated", "Updated"],- ["created", "Created"],- ["lastRun", "Last run"],- ["title", "Title"],- ] as const).map(([field, label]) => (- <button- key={field}- className={`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${- routineViewState.sortField === field- ? "bg-accent/50 text-foreground"- : "text-muted-foreground hover:bg-accent/50"- }`}- onClick={() => {- updateRoutineView(- routineViewState.sortField === field- ? { sortDir: routineViewState.sortDir === "asc" ? "desc" : "asc" }- : { sortField: field, sortDir: field === "title" ? "asc" : "desc" },- );- }}- >- <span>{label}</span>- {routineViewState.sortField === field ? (- <span className="text-xs text-muted-foreground">- {routineViewState.sortDir === "asc" ? "Asc" : "Desc"}- </span>- ) : null}- </button>- ))}- </div>- </PopoverContent>- </Popover>- <Popover>- <PopoverTrigger asChild>- <Button variant="ghost" size="sm" className="text-xs" title="Group">- <Layers className="h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1" />- <span className="hidden sm:inline">Group</span>- </Button>- </PopoverTrigger>- <PopoverContent align="end" className="w-44 p-0">- <div className="p-2 space-y-0.5">- {([- ["folder", "Folder"],- ["project", "Project"],- ["assignee", "Agent"],- ["none", "None"],- ] as const).map(([value, label]) => (- <button- key={value}- className={`flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm ${- routineViewState.groupBy === value- ? "bg-accent/50 text-foreground"- : "text-muted-foreground hover:bg-accent/50"- }`}- onClick={() => updateRoutineView({ groupBy: value, collapsedGroups: [] })}- >- <span>{label}</span>- {routineViewState.groupBy === value ? <Check className="h-3.5 w-3.5" /> : null}- </button>- ))}- </div>- </PopoverContent>- </Popover>- {routineViewState.groupBy === "folder" && !hasRoutineFolders ? (- <Button variant="outline" size="sm" onClick={() => openCreateFolder()}>- <Plus className="mr-2 h-3.5 w-3.5" />- New folder- </Button>- ) : null}- {showFolderRail ? (- <Button variant="ghost" size="sm" className="text-xs" onClick={() => setSelectMode((current) => !current)}>- {selectMode ? "Done" : "Select"}- </Button>- ) : null}- </div>- </div>{routineViewState.groupBy === "folder" ? (<div className="md:hidden"><FolderChip@@ -1324,7 +1230,7 @@ export function Routines() {<div className="py-12"><EmptyStateicon={Repeat}- message={folderSelection === "all" ? "No routines match this view." : "This folder is empty."}+ message={query.trim() ? "No routines match your search." : folderSelection === "all" ? "No routines match this view." : "This folder is empty."}/>{folderSelection !== "all" ? (<div className="mt-3 flex justify-center">diff --git a/ui/src/pages/SkillSources.test.tsx b/ui/src/pages/SkillSources.test.tsxindex 7cd9b8a88d..60e683c9e7 100644--- a/ui/src/pages/SkillSources.test.tsx+++ b/ui/src/pages/SkillSources.test.tsx@@ -8,7 +8,7 @@ import { skillSourcesApi } from '@/api/skillSources';import { ApiError } from '@/api/client';import { sourceFixture } from '../../storybook/fixtures/githubSkillSources';-const context = vi.hoisted(() => ({ navigate: vi.fn(), breadcrumbs: vi.fn(), sourceId: 'new' }));+const context = vi.hoisted(() => ({ navigate: vi.fn(), breadcrumbs: vi.fn(), sourceId: 'new', streamlinedEnabled: true }));vi.mock('@/context/CompanyContext', () => ({ useCompany: () => ({ selectedCompanyId: 'company-1', selectedCompany: { name: 'Acme' } }) }));vi.mock('@/context/BreadcrumbContext', () => ({ useBreadcrumbs: () => ({ setBreadcrumbs: context.breadcrumbs }) }));vi.mock('@/lib/router', () => ({@@ -17,6 +17,7 @@ vi.mock('@/lib/router', () => ({useParams: () => ({ sourceId: context.sourceId }),}));vi.mock('@/api/skillSources', () => ({ skillSourcesApi: { list: vi.fn(), projectRepositories: vi.fn(), adoptProject: vi.fn(), settings: vi.fn(), branches: vi.fn(), repositories: vi.fn(), discoverStream: vi.fn(), create: vi.fn(), select: vi.fn(), refresh: vi.fn(), disconnect: vi.fn() } }));+vi.mock('@/hooks/useStreamlinedUiEnabled', () => ({ useStreamlinedUiEnabled: () => ({ enabled: context.streamlinedEnabled, loaded: true }) }));const repos = {connections: [{ id: 'personal', name: 'Personal' }, { id: 'shared', name: 'Engineering' }],@@ -55,6 +56,7 @@ beforeEach(() => {vi.mocked(skillSourcesApi.branches).mockResolvedValue({ defaultBranch: 'master', branches: [{ name: 'master', isDefault: true }], truncated: false });vi.mocked(skillSourcesApi.discoverStream).mockResolvedValue(discovery);context.sourceId = 'new';+ context.streamlinedEnabled = true;sessionStorage.clear();});afterEach(async () => {@@ -63,6 +65,18 @@ afterEach(async () => {});describe('GitHub skill source import', () => {+ it('keeps the Skills views available while managing Sources', async () => {+ context.sourceId = '';+ await mount();+ const navigation = document.querySelector('nav[aria-label="Skills views"]');+ expect([...navigation!.querySelectorAll('a')].map(link => [link.textContent, link.getAttribute('href')])).toEqual([+ ['Installed', '/skills'],+ ['Discover', '/skills?tab=discover'],+ ['My Skills', '/skills/studio'],+ ]);+ expect(navigation!.querySelector('[aria-current="page"]')).toBeNull();+ });+it('groups the same repository and ref across projects and shows import progress until it is installed', async () => {context.sourceId = '';const repository = { projectId: 'one', projectName: 'Paperclip', projectVisibility: 'open' as const,@@ -131,7 +145,7 @@ describe('GitHub skill source import', () => {expect(document.body.textContent).not.toContain('Other projects with this repo');expect(document.body.textContent).not.toContain('Sentry');expect(document.body.textContent).not.toContain('Paperclip');- expect(document.querySelector('a[href="/skills"]')).toBeNull();+ expect(document.querySelector('section a[href="/skills"]')).toBeNull();expect(document.querySelector('[role="status"]')?.textContent).toContain('Importing skills');});diff --git a/ui/src/pages/SkillSources.tsx b/ui/src/pages/SkillSources.tsxindex 4e7d115f85..3f5f81b0a9 100644--- a/ui/src/pages/SkillSources.tsx+++ b/ui/src/pages/SkillSources.tsx@@ -2,6 +2,7 @@ import { ProjectSkillRepositoryRow } from "@/components/skill-studio/ProjectSkilimport { SkillSourceConnectionRepair } from "@/components/skill-studio/SkillSourceConnectionRepair";import { SkillSourceBranchRepair } from "@/components/skill-studio/SkillSourceBranchRepair";import { SkillSourceSyncControls } from "@/components/skill-studio/SkillSourceSyncControls";+import { SkillsPageNavigation } from "@/components/skill-studio/SkillsNavigationTabs";import { GithubIcon } from "@/components/icons/github-icon";import { useEffect, useRef, useState, type ReactNode } from 'react';import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';@@ -97,6 +98,7 @@ export function SkillSources() {</DropdownMenu></div></header>+ <SkillsPageNavigation activeView="sources" />{query.isPending && <p role="status" className="text-sm text-muted-foreground">Loading sources…</p>}{query.error && <p role="alert" className="text-sm text-destructive">{query.error.message} <Button variant="ghost" size="sm" onClick={() => void query.refetch()}>Try again</Button></p>}{query.data?.length === 0 && availableProjects.length === 0 && <div className="flex flex-col items-start gap-3 py-8"><p className="text-sm text-muted-foreground">No repositories added yet. Import your skills to make them available in {selectedCompany?.name ?? 'this company'}.</p><Button variant="outline" onClick={() => navigate('/skills/sources/new')}>Import from GitHub</Button></div>}diff --git a/ui/src/pages/SkillStudio.tsx b/ui/src/pages/SkillStudio.tsxindex 32a3f2ea06..91fa0707dd 100644--- a/ui/src/pages/SkillStudio.tsx+++ b/ui/src/pages/SkillStudio.tsx@@ -1,3 +1,4 @@+import { SkillsPageNavigation } from "@/components/skill-studio/SkillsNavigationTabs";import { interactionReadinessRefetchInterval } from "@/lib/issue-thread-interactions";import { SkillBinaryFile } from "../components/SkillBinaryFile";import { SkillSourceProvenance } from "../components/SkillSourceProvenance";@@ -411,6 +412,7 @@ function StudioCreateMode({emptyLabel="New skill"/></header>+ <SkillsPageNavigation activeView="authored" /><div className="min-h-0 flex-1 overflow-y-auto"><StudioNewSkillPanelcompanyId={companyId}@@ -732,6 +734,7 @@ function StudioEmptyState({emptyLabel="Select skill"/></header>+ <SkillsPageNavigation activeView="authored" /><div className="flex flex-1 items-center justify-center"><EmptyStateicon={FileCode}@@ -809,6 +812,7 @@ function StudioLanding({New skill</Button></header>+ <SkillsPageNavigation activeView="authored" /><div className="min-h-0 flex-1 overflow-auto"><div className="mx-auto w-full max-w-3xl space-y-8 px-4 py-8">{visited.length > 0 ? (@@ -1055,6 +1059,7 @@ function StudioShell({onSelectSkill={(nextSkillId) => navigate(skillStudioRoute(nextSkillId))}onOpenVersions={() => setVersionSheetOpen(true)}/>+ <SkillsPageNavigation activeView="authored" />{projectScan ? (<ProjectScanNotice skill={skill} onEditACopy={() => setForkDialogOpen(true)} />) : null}diff --git a/ui/src/pages/WhatNeedsMe.tsx b/ui/src/pages/WhatNeedsMe.tsxindex 05ce04e3ac..b4f50cbf49 100644--- a/ui/src/pages/WhatNeedsMe.tsx+++ b/ui/src/pages/WhatNeedsMe.tsx@@ -98,6 +98,8 @@ export function WhatNeedsMe() {// still follows a click, so keyboard actions target the row you just used.const [selectionFromKeyboard, setSelectionFromKeyboard] = useState(false);const [autoExpandDone, setAutoExpandDone] = useState(false);+ const [searchQuery, setSearchQuery] = useState("");+// Toolbar preferences (persisted to localStorage, Inbox pattern).const [groupBy, setGroupBy] = useState<AttentionGroupBy>(() => loadAttentionGroupBy());const [sortOrder, setSortOrder] = useState<AttentionSortOrder>(() => loadAttentionSortOrder());@@ -253,13 +255,13 @@ export function WhatNeedsMe() {// carries an explicit, due decide-by. Any explicit// group-by keeps the Inbox-style activity grouping.const groups = useMemo<AttentionGroup[]>(() => {- const filtered = filterAttentionItems(deskItems, filters);+ const filtered = filterAttentionItems(deskItems, filters, searchQuery);if (groupBy === "none") {return buildDeskShelves(filtered, now);}const sorted = sortAttentionItems(filtered, sortOrder);return groupAttentionItems(sorted, groupBy);- }, [deskItems, filters, sortOrder, groupBy, now]);+ }, [deskItems, filters, searchQuery, sortOrder, groupBy, now]);const visibleCount = useMemo(() => groups.reduce((sum, group) => sum + group.items.length, 0), [groups]);const keyboardItems = useMemo(@@ -518,9 +520,11 @@ export function WhatNeedsMe() {return (<div ref={rootRef} className="max-w-3xl space-y-4">- <div className="flex items-center justify-between gap-2">+ <div className="space-y-4"><h1 className="text-xl font-bold">Decisions</h1><DecisionsToolbar+ query={searchQuery}+ onQueryChange={setSearchQuery}visibleCount={visibleCount}filterOptions={filterOptions}filters={filters}@@ -804,10 +808,10 @@ function CaughtUpNote({ filtered }: { filtered: boolean }) {return (<div className="rounded-xl border border-dashed border-border py-10 text-center"><p className="text-sm font-medium text-foreground">- {filtered ? "No decisions match your filters." : "You're all caught up."}+ {filtered ? "No decisions match your search or filters." : "You're all caught up."}</p>{filtered && (- <p className="mt-1 text-xs text-muted-foreground">Adjust or clear the filters to see the rest.</p>+ <p className="mt-1 text-xs text-muted-foreground">Adjust or clear your search and filters to see the rest.</p>)}</div>);diff --git a/ui/src/pages/apps/Browse.test.tsx b/ui/src/pages/apps/Browse.test.tsxindex 693fc8a962..27770725a3 100644--- a/ui/src/pages/apps/Browse.test.tsx+++ b/ui/src/pages/apps/Browse.test.tsx@@ -414,16 +414,16 @@ describe("Connectors landing page", () => {expect(container.querySelector('[aria-label="App filters"]')?.textContent).toBe("PaperclipComposioArcadeInstalledAll");expect(container.querySelector('[data-app-slug="remote-app"]')).toBeNull();await search("Remote App");- expect(container.querySelector('[aria-pressed="true"]')?.textContent).toBe("All");+ expect(container.querySelector('[aria-checked="true"]')?.textContent).toBe("All");expect(container.querySelector('[data-app-slug="remote-app"]')).toBeTruthy();await search("");- expect(container.querySelector('[aria-pressed="true"]')?.textContent).toBe("Paperclip");+ expect(container.querySelector('[aria-checked="true"]')?.textContent).toBe("Paperclip");await clickButton("Arcade", container);await search("Remote App");- expect(container.querySelector('[aria-pressed="true"]')?.textContent).toBe("Arcade");+ expect(container.querySelector('[aria-checked="true"]')?.textContent).toBe("Arcade");expect(container.textContent).toContain("No connectors match");await clickButton("Clear search", container);- expect(container.querySelector('[aria-pressed="true"]')?.textContent).toBe("Arcade");+ expect(container.querySelector('[aria-checked="true"]')?.textContent).toBe("Arcade");});it.each(["composio", "arcade"] as const)("scopes %s to its catalog and accounts without native catalog overlaps", async (provider) => {@@ -445,7 +445,7 @@ describe("Connectors landing page", () => {expect(container.querySelector('[data-app-slug="other-app"]')).toBeNull();await search("Notion");- expect(container.querySelector('[aria-pressed="true"]')?.textContent).toBe(providerName);+ expect(container.querySelector('[aria-checked="true"]')?.textContent).toBe(providerName);expect(container.textContent).toContain("No connectors match");await clickButton("All", container);expect(container.querySelector('[data-app-slug="notion"]')?.textContent).toContain("Native Notion");@@ -1068,7 +1068,7 @@ describe("Connectors landing page", () => {container.querySelector('header input[aria-label="Search connectors"]'),).toBeTruthy();expect(container.querySelector("header")?.classList).toContain(- "items-start",+ "items-center",);expect(container.querySelector("header")?.classList).not.toContain("justify-end",diff --git a/ui/src/pages/apps/Browse.tsx b/ui/src/pages/apps/Browse.tsxindex eb1096b1e8..9f6c214c0c 100644--- a/ui/src/pages/apps/Browse.tsx+++ b/ui/src/pages/apps/Browse.tsx@@ -1,5 +1,6 @@import { AGGREGATOR_NAMES, aggregatorManagementUrl, isAppAggregator, type AggregatorAppSnapshot, type AggregatorAppsResponse } from "@paperclipai/shared/aggregator-apps";-import { CatalogSourceFilters, type CatalogSource } from "./CatalogSourceFilters";+import type { CatalogSource } from "./CatalogSourceFilters";+import { ConnectorsToolbar } from "./ConnectorsToolbar";import { ExecutorManagementSetup } from "./ExecutorManagementSetup";import { ArcadeDiscoverySetup } from "./ArcadeDiscoverySetup";import { AggregatorAppManager } from "./AggregatorAppManager";@@ -25,7 +26,6 @@ import {Loader2,MoreHorizontal,PauseCircle,- Search,ServerCog,Trash2,} from "lucide-react";@@ -79,7 +79,6 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,} from "@/components/ui/dropdown-menu";-import { Input } from "@/components/ui/input";import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";import { AGGREGATOR_APP_CATALOG, aggregatorAppIdentity, findComposioCatalogApp, type AggregatorAppCatalogEntry } from "@paperclipai/shared/aggregator-app-catalog";import { AggregatorConnectDialog, aggregatorAppConnectHref } from "./AggregatorConnectDialog";@@ -898,20 +897,8 @@ export function Browse({ renderAccountDetails = (connection) => connection.connereturn (<div ref={catalogTop} className="max-w-5xl space-y-5 pb-12">- <header className="flex flex-col items-start gap-3">- <div className="relative w-full max-w-md">- <Search className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />- <Input- type="search"- value={query}- onChange={(event) => changeQuery(event.target.value)}- placeholder="Search connectors…"- aria-label="Search connectors"- className="pl-9"- />- </div>- <CatalogSourceFilters source={source} onChange={value => { setSource(value); setExpandedSearch(false); setPage(1); }} />- </header>+ <ConnectorsToolbar query={query} onQueryChange={changeQuery} source={source}+ onSourceChange={value => { setSource(value); setExpandedSearch(false); setPage(1); }} />{loadFailed ? (<divdiff --git a/ui/src/pages/apps/CatalogSourceFilters.tsx b/ui/src/pages/apps/CatalogSourceFilters.tsxindex 2d4d56dab0..79bcea8d8f 100644--- a/ui/src/pages/apps/CatalogSourceFilters.tsx+++ b/ui/src/pages/apps/CatalogSourceFilters.tsx@@ -1,15 +1,9 @@-import { Button } from "@/components/ui/button";-import { cn } from "@/lib/utils";+import { TabFilters } from "@/components/TabBar";export const CATALOG_SOURCES = ["paperclip", "composio", "arcade", "installed", "all"] as const;export type CatalogSource = typeof CATALOG_SOURCES[number];export const CATALOG_SOURCE_NAMES = { paperclip: "Paperclip", composio: "Composio", arcade: "Arcade", executor: "Executor", installed: "Installed", all: "All" };export function CatalogSourceFilters({ source, onChange }: { source: CatalogSource; onChange: (source: CatalogSource) => void }) {- return <nav aria-label="App filters" className="flex flex-wrap gap-1">- {CATALOG_SOURCES.map(value => <Button key={value} variant="ghost" size="sm" aria-pressed={value === source}- onClick={() => onChange(value)} className={cn("rounded-full px-4 font-normal", value === source ? "bg-accent text-foreground" : "text-muted-foreground")}>- {CATALOG_SOURCE_NAMES[value]}- </Button>)}- </nav>;+ return <TabFilters label="App filters" size="standard" items={CATALOG_SOURCES.map(value => ({ value, label: CATALOG_SOURCE_NAMES[value] }))} value={source} onValueChange={onChange} />;}diff --git a/ui/src/pages/apps/ConnectorsToolbar.tsx b/ui/src/pages/apps/ConnectorsToolbar.tsxnew file mode 100644index 0000000000..a97ead147f--- /dev/null+++ b/ui/src/pages/apps/ConnectorsToolbar.tsx@@ -0,0 +1,17 @@+import { ToolbarSearch } from "@/components/ToolbarSearch";+import { CatalogSourceFilters, type CatalogSource } from "./CatalogSourceFilters";++/** Shared catalog search and source filters; data and scope changes stay in Browse. */+export function ConnectorsToolbar({ query, onQueryChange, source, onSourceChange }: {+ query: string;+ onQueryChange: (value: string) => void;+ source: CatalogSource;+ onSourceChange: (value: CatalogSource) => void;+}) {+ return <header data-canonical-toolbar="connectors" role="toolbar" aria-label="Connectors controls" className="flex flex-wrap items-center gap-3">+ <div className="w-full">+ <ToolbarSearch query={query} onQueryChange={onQueryChange} label="Search connectors" placeholder="Search connectors…" inputType="search" />+ </div>+ <CatalogSourceFilters source={source} onChange={onSourceChange} />+ </header>;+}diff --git a/ui/storybook/.storybook/main.ts b/ui/storybook/.storybook/main.tsindex 9fa6044d51..daaf0d960e 100644--- a/ui/storybook/.storybook/main.ts+++ b/ui/storybook/.storybook/main.ts@@ -5,6 +5,7 @@ import tailwindcss from "@tailwindcss/vite";import { mergeConfig } from "vite";import { storybookAgentAvatarAssets } from "../../../scripts/storybook-agent-avatar-assets.mjs";import { generateStorybook } from "../../../scripts/storybook-catalog.mjs";+import { storybookButtonUsage } from "../../../scripts/storybook-button-usage.mjs";generateStorybook();@@ -34,7 +35,7 @@ const config: StorybookConfig = {define: {"import.meta.env.VITE_PAPERCLIP_INSTANCE_URL": JSON.stringify(paperclipInstanceOrigin),},- plugins: [tailwindcss(), storybookAgentAvatarAssets()],+ plugins: [tailwindcss(), storybookAgentAvatarAssets(), storybookButtonUsage()],server: { proxy: { "/api/agent-avatars": { target: process.env.PAPERCLIP_STORYBOOK_API_URL ?? "http://localhost:3100", changeOrigin: true } } },optimizeDeps: { include: ["motion/react", "react", "react-dom"] },resolve: {diff --git a/ui/storybook/.storybook/preview-base.tsx b/ui/storybook/.storybook/preview-base.tsxindex e59e6e8220..18c8658087 100644--- a/ui/storybook/.storybook/preview-base.tsx+++ b/ui/storybook/.storybook/preview-base.tsx@@ -29,6 +29,7 @@ import { SidebarProvider } from "@/context/SidebarContext";import { ThemeProvider } from "@/context/ThemeContext";import { ToastProvider } from "@/context/ToastContext";import { TooltipProvider } from "@/components/ui/tooltip";+import { AvatarInitialProvider } from "@/components/ui/avatar-initials";import {storybookAgents,storybookApprovals,@@ -849,7 +850,7 @@ const preview: Preview = {? Number.parseInt(width, 10) : undefined;return (<StorybookProviders key={`${context.id}:${theme}`} theme={theme} initialViewportWidth={initialViewportWidth} initialEntries={context.parameters.initialEntries}>- <Story />+ {context.parameters.paperclip?.home === "design-proposals" && context.parameters.designProposalTheme !== false ? <AvatarInitialProvider><div className="design-proposal-theme"><Story /></div></AvatarInitialProvider> : <Story />}</StorybookProviders>);},diff --git a/ui/storybook/stories/design-proposals/activity-list.stories.tsx b/ui/storybook/stories/design-proposals/activity-list.stories.tsxnew file mode 100644index 0000000000..5b5f9ac1ec--- /dev/null+++ b/ui/storybook/stories/design-proposals/activity-list.stories.tsx@@ -0,0 +1,37 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { ActivityListPreview, type ActivityListPreviewProps } from "../../support/design-proposals/ActivityListPreview";++const meta = {+ id: "design-activity-list",+ title: "Design proposals/Components/Activity list",+ component: ActivityListPreview,+ args: { density: "comfortable", containerWidth: "standard", withReferences: false },+ argTypes: {+ density: { control: "inline-radio", options: ["comfortable", "compact"] },+ containerWidth: { control: "inline-radio", options: ["standard", "narrow", "smallest"] },+ withReferences: { control: "boolean" },+ onDensityChange: { control: false, table: { disable: true } },+ onWidthChange: { control: false, table: { disable: true } },+ },+ render: function Preview(args) {+ const [, updateArgs] = useArgs<ActivityListPreviewProps>();+ return <ActivityListPreview {...args} onDensityChange={density => updateArgs({ density })} onWidthChange={containerWidth => updateArgs({ containerWidth })} />;+ },+ parameters: {+ layout: "fullscreen", initialEntries: ["/PAP/dashboard"],+ paperclip: {+ capabilities: ["activity/overview", "activity/activity", "tasks/organize"],+ status: "proposed", home: "design-proposals", implementation: "production", boundary: "fixtures",+ exception: "Reusable activity composition staged for dashboard integration in the local design sandbox.",+ notes: "Mounts ActivityList and the refreshed ActivityRow. Playground controls density and container width; mixed fixtures cover task, agent, project, approval, run and unlinked system events. Reuses task-row tokens, responsive metadata and CellMarquee hit testing. Task entries retain IssueLinkQuicklook, non-task events keep their entity destinations and never show a fabricated task ID. Fallback avatars use one initial through the proposal provider. Reference Changes retains added/removed issue references below the fixed-height row. Task preview data is seeded; fixture navigation does not establish production access checks or live backend acceptance. Sandbox toggle restores original dashboard rows and avatar policy.",+ },+ },+} satisfies Meta<typeof ActivityListPreview>;+export default meta;+type Story = StoryObj<typeof meta>;+export const Playground: Story = {};+export const Narrow: Story = { args: { containerWidth: "narrow" } };+export const Smallest: Story = { args: { containerWidth: "smallest" } };+export const Compact: Story = { args: { density: "compact" } };+export const ReferenceChanges: Story = { args: { withReferences: true } };diff --git a/ui/storybook/stories/design-proposals/agent-workload-trial.stories.tsx b/ui/storybook/stories/design-proposals/agent-workload-trial.stories.tsxnew file mode 100644index 0000000000..89d910d4ac--- /dev/null+++ b/ui/storybook/stories/design-proposals/agent-workload-trial.stories.tsx@@ -0,0 +1,115 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { expect, userEvent, waitFor, within } from "storybook/test";+import { AgentWorkloadTrial } from "../../support/design-proposals/AgentWorkloadTrial";+import { workloadAgentIds } from "../../support/design-proposals/agent-workload-trial-data";++const meta = {+ id: "design-agent-workload-trial",+ title: "Design proposals/AI Generated Test Pages/Agent workload trial",+ component: AgentWorkloadTrial,+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/agents"],+ docs: { description: { component: "Independent desktop workload composition using Design Proposals foundations, shell, sidebar, collection controls and narrow task summaries. Working means running; active tasks are in_progress and queued tasks are todo/backlog. Recent history excludes active and queued tasks to avoid duplication. Summary counts describe the full selected organization. Search matches every entered word across name, role and title and intersects the state filter. Selection opens a resizable contextual pane; Escape or Close dismisses it and restores card focus. Shared controls support maximize/restore. Six synthetic agents and 24 synthetic tasks include long names, busy/idle/paused states, an agent with no tasks and empty results. No agents are run, and no backend state changes are made." } },+ paperclip: {+ capabilities: ["agents/organization", "agents/lifecycle"],+ home: "design-proposals", status: "proposed",+ exception: "Independent Agent workload reuse trial staged for desktop dark-mode review with synthetic workload data.",+ implementation: "prototype", boundary: "fixtures",+ notes: "Composes DesignPageShell/DesignPageAside, DesignSidebar, MetricCard, AgentAvatar, AgentStatusCapsule, Card/Button, CollectionToolbar, ToolbarSearch, TabFilters, SidePanelWindowControls, TaskSummaryList/TaskRowGroup and EmptyState. Local code owns card layout, search/state predicates, task aggregation, selection, dismissal and focus handoff. The route-backed AgentsToolbar requires an unused creation action, so this single collection uses canonical search and radio-filter components directly through CollectionToolbar slots. Trial-local CSS enables the shared toolbar row to wrap when its pane narrows independently of the viewport; all geometry references existing tokens. Task rows retain shared status, navigation, timeAgo, marquee and container-query behavior without copied row markup. DESIGN.md names an Agents toolbar specimen that the current toolbar stories do not expose. Fixtures simulate all data; task destinations, agent execution, authorization and backend persistence are outside this trial. Pane widths use isolated trial keys.",+ },+ },+} satisfies Meta<typeof AgentWorkloadTrial>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Default: Story = {};+export const SelectedAgent: Story = { args: { initialAgentId: workloadAgentIds.mira } };+export const LongNames: Story = { args: { initialAgentId: workloadAgentIds.atlas } };+export const Paused: Story = { args: { initialFilter: "paused", initialAgentId: workloadAgentIds.rowan } };+export const NoTasks: Story = { args: { initialAgentId: workloadAgentIds.quinn } };+export const NoResults: Story = { args: { initialQuery: "lunar botanist" } };+export const EmptyOrganization: Story = { args: { emptyOrganization: true } };++export const Interactions: Story = {+ play: async ({ canvasElement, step }) => {+ const canvas = within(canvasElement);+ const cards = () => within(canvas.getByRole("list", { name: "Agent cards" })).getAllByRole("button");+ const choose = (name: string) => canvas.getByRole("button", { name: `View workload for ${name}` });+ const state = (name: string) => canvas.getByRole("radio", { name });++ await step("Search words match name and role; all state filters intersect search", async () => {+ await expect(await canvas.findByRole("list", { name: "Agent cards" })).toBeVisible();+ await expect(cards()).toHaveLength(6);+ await userEvent.type(canvas.getByRole("textbox", { name: "Search agents" }), "MIRA product");+ await expect(cards()).toHaveLength(1);+ await expect(choose("Mira")).toBeVisible();+ await userEvent.click(state("Idle"));+ await expect(canvas.getByText("No agents match this view")).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Clear filters" }));+ await expect(state("All")).toHaveAttribute("aria-checked", "true");+ await expect(canvas.getByRole("textbox", { name: "Search agents" })).toHaveFocus();+ for (const [label, count] of [["Working", 3], ["Idle", 2], ["Paused", 1]] as const) {+ await userEvent.click(state(label));+ await expect(cards()).toHaveLength(count);+ }+ await userEvent.click(state("All"));+ });+ await step("Keyboard filter navigation keeps a single selection", async () => {+ state("All").focus();+ await userEvent.keyboard("{ArrowRight}");+ await expect(state("Working")).toHaveFocus();+ await userEvent.keyboard(" ");+ await expect(state("Working")).toHaveAttribute("aria-checked", "true");+ await expect(cards()).toHaveLength(3);+ await userEvent.click(state("Working"));+ await expect(state("Working")).toHaveAttribute("aria-checked", "true");+ await userEvent.click(state("All"));+ });+ await step("Keyboard selection opens active and recent tasks; Escape restores focus", async () => {+ choose("Mira").focus();+ await userEvent.keyboard("{Enter}");+ await expect(canvas.getByRole("region", { name: "Agent tasks content" })).toHaveFocus();+ await expect(within(canvas.getByRole("list", { name: "Active tasks for Mira" })).getAllByRole("listitem")).toHaveLength(2);+ await expect(within(canvas.getByRole("list", { name: "Recent tasks for Mira" })).getAllByRole("listitem")).toHaveLength(3);+ await userEvent.keyboard("{Escape}");+ await expect(canvas.queryByRole("region", { name: "Agent tasks content" })).not.toBeInTheDocument();+ await expect(choose("Mira")).toHaveFocus();+ });+ await step("Pane resizing preserves shared narrow and wide row metadata", async () => {+ await userEvent.click(choose("Mira"));+ const handle = canvas.getByRole("separator", { name: "Resize right sidebar" });+ handle.focus();+ await userEvent.keyboard("{Home}");+ await waitFor(() => expect(Number(handle.getAttribute("aria-valuenow"))).toBe(Number(handle.getAttribute("aria-valuemin"))));+ const row = canvas.getByRole("list", { name: "Active tasks for Mira" }).querySelector("li")!;+ await expect(row.querySelector('[data-slot="task-row-identifier"]')).not.toBeVisible();+ await expect(row.querySelector('[data-slot="task-row-timestamp"]')).not.toBeVisible();+ const minimum = Number(handle.getAttribute("aria-valuemin"));+ const increment = parseFloat(getComputedStyle(handle).getPropertyValue("--design-page-aside-resize-step"));+ await userEvent.keyboard("{ArrowLeft}");+ await waitFor(() => expect(Number(handle.getAttribute("aria-valuenow"))).toBe(minimum + increment));+ await userEvent.keyboard("{End}");+ await waitFor(() => expect(Number(handle.getAttribute("aria-valuenow"))).toBe(Number(handle.getAttribute("aria-valuemax"))));+ await userEvent.dblClick(handle);+ await userEvent.click(canvas.getByRole("button", { name: "Maximize side panel" }));+ await expect(row.querySelector('[data-slot="task-row-timestamp"]')).toBeVisible();+ await expect(row.querySelector('[data-slot="task-row-identifier"]')).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Restore side panel" }));+ await userEvent.click(canvas.getByRole("button", { name: "Close side panel" }));+ await expect(choose("Mira")).toHaveFocus();+ });+ await step("Taskless agent and unmatched search have recoverable empty states", async () => {+ await userEvent.click(choose("Quinn"));+ await expect(canvas.getByText("No tasks yet")).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Back to agents" }));+ await expect(choose("Quinn")).toHaveFocus();+ await userEvent.type(canvas.getByRole("textbox", { name: "Search agents" }), "lunar botanist");+ await expect(canvas.getByText("No agents match this view")).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Clear filters" }));+ await expect(cards()).toHaveLength(6);+ await userEvent.click(choose("Mira"));+ });+ },+};diff --git a/ui/storybook/stories/design-proposals/app-shell.stories.tsx b/ui/storybook/stories/design-proposals/app-shell.stories.tsxnew file mode 100644index 0000000000..94a0afdece--- /dev/null+++ b/ui/storybook/stories/design-proposals/app-shell.stories.tsx@@ -0,0 +1,34 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { AppShellPreview } from "../../support/design-proposals/AppShellPreview";++const meta = {+ id: "design-app-shell",+ title: "Design proposals/Layouts/App shell",+ component: AppShellPreview,+ args: { rightSidebar: false, overflowingContent: false },+ argTypes: {+ rightSidebar: { control: "boolean", description: "Include the optional right pane." },+ overflowingContent: { control: "boolean", description: "Add enough placeholder content to review independent pane scrolling." },+ },+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ docs: { description: { component: "Shared proposed desktop layout, also used by Pages/Tasks. Import DesignPageShell from @/components/DesignPageShell and supply sidebar, title and children. Add rightSidebar and rightSidebarTitle for three panes; rightSidebarHeader and rightSidebarControls accept the production tab strip and window controls. rightSidebarMaximized expands the panel across the workspace; headerActions can supply a reopen button. These stories use the task-detail page's SidePanelTabs, SidePanelLauncher, SidePanelWindowControls and useSidePanelTabs for adding, selecting, closing and reordering tabs. Closing the last tab reveals the launcher. Sidebar width uses the existing resize shell; pass sidebarStorageKey to isolate preferences. The right pane defaults to 320px, capped at 30% on narrower desktops. Drag its highlighted divider or use the arrow keys to resize; double-click animates back to default using the shared 200ms reset motion (instant with reduced motion). Widths persist separately from the left sidebar and survive maximize/restore. Resizing preserves space for the main pane. Main and right content scroll independently beneath fixed headers; scrollbars hide after scrolling stops using the shared idle-delay token. Colors come from the proposed dark foundation. Tab bodies and placeholder blocks are fixture content. Mobile navigation and panel overlay behavior are not defined by these desktop specimens." } },+ paperclip: {+ capabilities: ["navigation-preferences/navigation"],+ home: "design-proposals",+ status: "proposed",+ exception: "Shared desktop app-shell layouts staged with the design refresh before adoption in production routes.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Mounts the shared DesignPageShell, SidebarShell and DesignSidebar with neutral content slots. Two Panes is the same shell composition as Pages/Tasks. Three Panes adds production task-detail SidePanelTabs, SidePanelLauncher, SidePanelWindowControls and useSidePanelTabs through the shell's optional slots: add/select/close/reorder tabs, maximize/restore, close/reopen the pane, and recover from closing all tabs. Tab content is placeholder data, without task-detail API behavior. Independent Scrolling supplies overflowing content to both panes and uses the shared scrollbar-while-scrolling behavior. Both sidebars resize by dragging or keyboard, highlight their divider on hover/focus/drag, persist widths separately, and animate back to default on double-click. Reset timing matches the task-detail right pane; reduced motion resets instantly while dragging and keyboard resizing stay immediate. The right pane defaults to 320px capped at 30% on narrower desktops; custom widths retain space for the main pane and survive maximize/restore. Main and right surfaces use background, left uses muted, and dividers use border. Organization/account access, recent tasks and navigation destinations are fixtures. These dark desktop examples do not establish production routing, backend behavior, mobile layout or approved light-mode styling.",+ },+ },+} satisfies Meta<typeof AppShellPreview>;++export default meta;+type Story = StoryObj<typeof meta>;++export const TwoPanes: Story = {};+export const ThreePanes: Story = { args: { rightSidebar: true } };+export const IndependentScrolling: Story = { args: { rightSidebar: true, overflowingContent: true } };diff --git a/ui/storybook/stories/design-proposals/buttons.stories.tsx b/ui/storybook/stories/design-proposals/buttons.stories.tsxnew file mode 100644index 0000000000..02734e7703--- /dev/null+++ b/ui/storybook/stories/design-proposals/buttons.stories.tsx@@ -0,0 +1,42 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { ButtonsPlayground, type ButtonsPlaygroundProps } from "../../support/design-proposals/ButtonsPlayground";+import { buttonSizes, buttonStates, buttonSurfaces, buttonVariants, defaultButtonSettings } from "../../support/design-proposals/ButtonSamples";++const meta = {+ id: "design-buttons",+ title: "Design proposals/Components/Buttons",+ component: ButtonsPlayground,+ args: { ...defaultButtonSettings },+ argTypes: {+ label: { control: "text" },+ variant: { control: "select", options: Object.keys(buttonVariants) },+ size: { control: "select", options: Object.keys(buttonSizes) },+ icon: { control: "inline-radio", options: ["none", "leading", "trailing"] },+ state: { control: "select", options: Object.keys(buttonStates) },+ surface: { control: "select", options: Object.keys(buttonSurfaces) },+ onSettingsChange: { control: false },+ },+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ docs: { story: { inline: false }, description: { component: "Sandbox button styling workbench. Visible controls and Storybook args select label, style, measured size, icon placement, default/hover/keyboard-focus/pressed/disabled/loading state and semantic surface. All examples use the same proposed theme as the local design sandbox. Specimens report computed pixel dimensions, typography, padding, radius, icon size and colors. Forced states derive from compiled component CSS and remain preview-only. Contextual controls use real shared components with local fixture actions. No production comparison or repository-wide usage counts are shown." } },+ paperclip: {+ capabilities: ["developer-labs/design"],+ home: "design-proposals",+ status: "proposed",+ exception: "Button styling workbench for the proposed design system used by the local sandbox; not a production feature acceptance story.",+ implementation: "mixed",+ boundary: "fixtures",+ notes: "Uses shared Button variants/sizes and sandbox task toolbar/list/sidebar, side-panel, agent action, conversation feedback, favorite, file display, switch, task status, attachment and relation-expansion controls. All samples inherit proposal foundations, including portaled menus. The workbench layout and controls are preview scaffolding. Mutation callbacks use local fixtures; no agents run or uploads persist. Legacy-only sidebar/filter/archive examples, feature-gated priority, setup-prompt catalog, isolated production iframe and repository-wide usage audit are excluded. Does not enumerate every page-specific override or establish backend acceptance.",+ },+ },+ render: function Render(args) {+ const [, updateArgs] = useArgs<ButtonsPlaygroundProps>();+ return <ButtonsPlayground {...args} onSettingsChange={updateArgs} />;+ },+} satisfies Meta<typeof ButtonsPlayground>;+export default meta;+type Story = StoryObj<typeof meta>;++export const Playground: Story = {};diff --git a/ui/storybook/stories/design-proposals/colors.stories.tsx b/ui/storybook/stories/design-proposals/colors.stories.tsxnew file mode 100644index 0000000000..08d8f46e67--- /dev/null+++ b/ui/storybook/stories/design-proposals/colors.stories.tsx@@ -0,0 +1,30 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { ColorsPreview } from "../../support/design-proposals/ColorsPreview";++const meta = {+ id: "design-foundations-colors",+ title: "Design proposals/Foundations/Colors",+ component: ColorsPreview,+ args: { section: "tokens" },+ argTypes: { section: { control: false } },+ parameters: {+ layout: "fullscreen",+ docs: { description: { component: "Light mode inherits the production palette; dark mode retains the Paper proposal palette. Use the theme toolbar to compare. The neutral palette comes from Paper’s Dark mode frame; the focus ring derives from dark-color-foreground. Token reference reads current CSS theme values; Surfaces & elevation uses shared Card and Input primitives; Text & interaction uses TaskList and its real Columns menu. The proposal decorator scopes the dark semantic theme, including portals, without changing production stories. This palette is staged for design review; task-status colors are outside this reference." } },+ paperclip: {+ capabilities: [],+ home: "design-proposals",+ status: "proposed",+ exception: "Shared color foundation: production light palette and proposed Paper dark palette. This does not establish production feature coverage.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Demonstrates the actual semantic CSS tokens and shared Card, Input, TaskList and dropdown components. Focus indicators use a foreground edge and a soft foreground halo at 20% opacity; their color and width tokens are shared. Pane resize controls retain their neutral gray highlight. Task data and menu preferences are local fixtures. Cards expose low, middle and high surface levels only in the proposal theme. Light mode reuses production semantic tokens; proposal-only surface names alias existing production colors. No status-color refresh, backend behavior or production adoption is implied.",+ },+ },+} satisfies Meta<typeof ColorsPreview>;++export default meta;+type Story = StoryObj<typeof meta>;++export const TokenReference: Story = { name: "Token reference" };+export const SurfacesAndElevation: Story = { name: "Surfaces & elevation", args: { section: "surfaces" } };+export const TextAndInteraction: Story = { name: "Text & interaction", args: { section: "interaction" } };diff --git a/ui/storybook/stories/design-proposals/flyout.stories.tsx b/ui/storybook/stories/design-proposals/flyout.stories.tsxnew file mode 100644index 0000000000..efb1fbfc07--- /dev/null+++ b/ui/storybook/stories/design-proposals/flyout.stories.tsx@@ -0,0 +1,34 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { FlyoutPreview } from "../../support/design-proposals/FlyoutPreview";++const meta = {+ id: "design-flyout",+ title: "Design proposals/Components/Popover",+ component: FlyoutPreview,+ args: { mode: "columns", shadow: "" },+ argTypes: {+ mode: { control: "select", options: ["columns", "views", "account-menu"] },+ shadow: { name: "Shadow", control: "text", description: "Local CSS box-shadow override. Clear to inherit --shadow-flyout. Save the approved default in ui/src/index.css to apply it to every refreshed flyout." },+ },+ parameters: {+ layout: "fullscreen",+ docs: { description: { component: "Reusable Flyout, FlyoutContent, FlyoutHeader and FlyoutOptions composed from the existing Popover and Button primitives. Dropdown menus share the same sections and appearance while preserving menu-specific keyboard behavior. Muted-foreground labels and checkmarks become foreground on muted-highlight during hover or focus. The Shadow control is a local preview; --shadow-flyout in the shared token layer owns the saved default." } },+ paperclip: {+ capabilities: ["tasks/organize"],+ status: "proposed",+ home: "design-proposals",+ exception: "Shared flyout component and shadow tuning reference staged with the task-list design refresh.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Isolates the shared flyout composition used by the proposed page menus. Columns demonstrates toggle buttons and inherited-color checks; Views shares the page choices Inbox, Unread, Needs attention and All tasks, using existing radio-menu semantics with checkmarks; Account Menu mounts the canonical SidebarAccountMenu with the same DesignProposalAccess fixture boundary as Sidebar/Account Menu. Its profile link, Settings, Invite, Documentation, theme action, dismissal and focus behavior come directly from that component. Router and owner-access fixtures do not prove backend behavior or permission enforcement. Shadow controls affect this preview only; approved values belong in the shared --shadow-flyout token.",+ },+ },+} satisfies Meta<typeof FlyoutPreview>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Columns: Story = {};+export const Views: Story = { args: { mode: "views" } };+// Keep the original story ID so existing review links remain valid.+export const Profile: Story = { name: "Account Menu", args: { mode: "account-menu" } };diff --git a/ui/storybook/stories/design-proposals/project-health-trial.stories.tsx b/ui/storybook/stories/design-proposals/project-health-trial.stories.tsxnew file mode 100644index 0000000000..04fadad31d--- /dev/null+++ b/ui/storybook/stories/design-proposals/project-health-trial.stories.tsx@@ -0,0 +1,79 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { expect, userEvent, within } from "storybook/test";+import { ProjectHealthTrial } from "../../support/design-proposals/ProjectHealthTrial";+import { projectHealthProjectIds } from "../../support/design-proposals/project-health-trial-data";++const meta = {+ id: "design-project-health-trial",+ title: "Design proposals/AI Generated Test Pages/Project health trial",+ component: ProjectHealthTrial,+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/projects"],+ docs: { description: { component: "Independent desktop reuse trial using only Design Proposals references. Shared shell, sidebar, metrics, cards, flyouts, inputs, task summaries and empty states; local project aggregation, name/description search and selection. Active means in progress. Needs attention uses the shared task-view predicate: blocked or in review. Summary totals always describe the selected organization, independent of filters. Selecting a card shows its six most recently updated tasks. Changing search, view or organization clears selection. Fixtures include long names, an empty project and an empty organization. No production route, API, permission or persistence coverage." } },+ paperclip: {+ capabilities: ["projects/lifecycle", "projects/task-context"],+ home: "design-proposals",+ status: "proposed",+ exception: "Independent Project health composition trial staged under Design Proposals; existing references and shared implementations are preserved.",+ implementation: "prototype",+ boundary: "fixtures",+ notes: "Uses DesignPageShell, DesignSidebar, MetricCard, Card, Button, Badge, Input, shared flyout primitives, TaskSummaryList/TaskRowGroup and EmptyState. Project search/filter/selection and counts are local; attention reuses matchesTaskListView. TaskListToolbar/useTaskListCollection cannot express project views, so only their primitive composition is repeated. Project status uses neutral Badge text because no proposed project-health status component is defined. Sidebar menus, command palette and New Task mount existing fixture-backed components; destination pages and real project creation are outside this trial. Pane preferences use isolated trial keys. Desktop dark-mode scope only.",+ },+ },+} satisfies Meta<typeof ProjectHealthTrial>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Default: Story = {};+export const SelectedProject: Story = { args: { initialProjectId: projectHealthProjectIds.onboarding } };+export const LongProjectName: Story = { args: { initialProjectId: projectHealthProjectIds.international } };+export const NeedsAttention: Story = { args: { initialView: "attention" } };+export const EmptyProject: Story = { args: { initialProjectId: projectHealthProjectIds.partners } };+export const NoResults: Story = { args: { initialQuery: "lunar greenhouse" } };+export const EmptyOrganization: Story = { args: { emptyOrganization: true } };++export const Interactions: Story = {+ play: async ({ canvasElement, step }) => {+ const canvas = within(canvasElement);+ const page = within(canvasElement.ownerDocument.body);+ await step("Project selection shows only its recent tasks", async () => {+ await userEvent.click(await canvas.findByRole("button", { name: "View recent tasks for Customer onboarding" }));+ await expect(canvas.getByRole("list", { name: "Recent tasks for Customer onboarding" })).toBeVisible();+ await expect(canvas.getByRole("button", { name: "View recent tasks for Customer onboarding" })).toHaveAttribute("aria-pressed", "true");+ });+ await step("Search is case insensitive and clears stale selection", async () => {+ await userEvent.type(canvas.getByRole("textbox", { name: "Search projects" }), "INTERNATIONAL");+ await expect(within(canvas.getByRole("list", { name: "Project cards" })).getAllByRole("button")).toHaveLength(1);+ await expect(canvas.queryByRole("list", { name: "Recent tasks for Customer onboarding" })).not.toBeInTheDocument();+ await userEvent.click(canvas.getByRole("button", { name: "Clear search" }));+ });+ await step("Attention filter uses blocked and review tasks and composes with search", async () => {+ await userEvent.click(canvas.getByRole("button", { name: "Project view: All projects" }));+ await userEvent.click(await page.findByRole("menuitemradio", { name: "Needs attention" }));+ await expect(within(canvas.getByRole("list", { name: "Project cards" })).getAllByRole("button")).toHaveLength(2);+ await userEvent.type(canvas.getByRole("textbox", { name: "Search projects" }), "Knowledge");+ await expect(canvas.getByText("No projects match this view")).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Clear filters" }));+ await expect(canvas.getByRole("button", { name: "Project view: All projects" })).toBeVisible();+ await expect(within(canvas.getByRole("list", { name: "Project cards" })).getAllByRole("button")).toHaveLength(6);+ });+ await step("Empty projects offer a next step and closing restores focus", async () => {+ const emptyProject = canvas.getByRole("button", { name: "View recent tasks for Partner integrations" });+ emptyProject.focus();+ await userEvent.keyboard("{Enter}");+ await expect(canvas.getByText("No tasks yet")).toBeVisible();+ await userEvent.click(within(canvas.getByRole("region", { name: "Recent tasks content" })).getByRole("button", { name: "Browse projects" }));+ await expect(emptyProject).toHaveFocus();+ await expect(canvas.getByText("Select a project")).toBeVisible();+ });+ await step("An unmatched search recovers to all projects", async () => {+ await userEvent.type(canvas.getByRole("textbox", { name: "Search projects" }), "lunar greenhouse");+ await expect(canvas.getByText("No projects match this view")).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Clear filters" }));+ await expect(canvas.getByRole("textbox", { name: "Search projects" })).toHaveFocus();+ await userEvent.click(canvas.getByRole("button", { name: "View recent tasks for Customer onboarding" }));+ });+ },+};diff --git a/ui/storybook/stories/design-proposals/segmented-controllers.stories.tsx b/ui/storybook/stories/design-proposals/segmented-controllers.stories.tsxnew file mode 100644index 0000000000..cf12e08c41--- /dev/null+++ b/ui/storybook/stories/design-proposals/segmented-controllers.stories.tsx@@ -0,0 +1,33 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { SegmentedControllersPreview, type SegmentedControllersPreviewProps } from "../../support/design-proposals/SegmentedControllersPreview";++const meta = {+ id: "design-segmented-controllers",+ title: "Design proposals/Components/Segmented controllers",+ component: SegmentedControllersPreview,+ args: { width: "full", disableAgentActions: false },+ argTypes: {+ width: { control: "inline-radio", options: ["full", "narrow"] },+ disableAgentActions: { control: "boolean" },+ onWidthChange: { control: false },+ },+ parameters: {+ layout: "fullscreen",+ paperclip: {+ capabilities: [], home: "design-proposals", status: "proposed",+ exception: "Cross-cutting comparison of segmented controller patterns from proposal and production surfaces.",+ implementation: "mixed", boundary: "fixtures",+ notes: "Mounts FilePreviewModeToggle directly and isolates existing TabsList/Button/native-button compositions from AuditFeed, TaskListToolbar, IssuesList, Agents, AgentDetail, Secrets, GoalDetail and IssueProperties. Local selection, disabled audit choice and narrow width are inspectable. No queries or mutations. Inline compositions are not page mounts; model lane retains existing incomplete radio keyboard behavior. Existing application controls are unchanged.",+ },+ },+ render: function Render(args) {+ const [, updateArgs] = useArgs<SegmentedControllersPreviewProps>();+ return <SegmentedControllersPreview {...args} onWidthChange={width => updateArgs({ width })} />;+ },+} satisfies Meta<typeof SegmentedControllersPreview>;+export default meta;+type Story = StoryObj<typeof meta>;+export const Playground: Story = {};+export const Disabled: Story = { args: { disableAgentActions: true } };+export const Narrow: Story = { args: { width: "narrow" } };diff --git a/ui/storybook/stories/design-proposals/sidebar.stories.tsx b/ui/storybook/stories/design-proposals/sidebar.stories.tsxnew file mode 100644index 0000000000..6d5a07e45d--- /dev/null+++ b/ui/storybook/stories/design-proposals/sidebar.stories.tsx@@ -0,0 +1,53 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { userEvent, within } from "storybook/test";+import { SidebarPreview } from "../../support/design-proposals/SidebarPreview";++const meta = {+ id: "design-sidebar",+ title: "Design proposals/Components/Sidebar",+ component: SidebarPreview,+ args: { scenario: "default" },+ argTypes: { scenario: { control: false } },+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ docs: { description: { component: "Shared proposed DesignSidebar, also mounted by Pages/Tasks. Uses the production organization/account menus, navigation primitives, resize shell, task composer and command palette. Review resizing, selected/hover/focus states, truncated label motion, scrolling recents and menus here; check the Tasks page for the full composition. Story widths persist separately from the page. Fixture navigation and owner access do not establish production routes or permissions." } },+ paperclip: {+ capabilities: ["tasks/organize", "inbox-search/search"],+ status: "proposed",+ home: "design-proposals",+ exception: "Shared navigation component staged for refinement with the proposed task-list page.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Renders the same DesignSidebar as Pages/Tasks inside DesignPageShell and SidebarShell. Default supports hover, focus, resizing and dialogs; Narrow uses the real resize handle's Home key. Long Labels, Many Recent Tasks and Empty Recent Tasks vary supplied fixtures without replacing navigation markup. Organization Menu and Account Menu open existing production menus with shared owner-access fixtures and proposed Popover appearance. Recents remain company scoped and scroll independently beneath their fixed heading; the shared scrollbar is visible only during scrolling and its short token-defined idle interval. Story-specific width storage isolates review from the page. Company data, recent tasks, router destinations and owner identity are simulated; production backend, permission enforcement and mobile composition are outside this review.",+ },+ },+} satisfies Meta<typeof SidebarPreview>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Default: Story = {};+export const Narrow: Story = {+ args: { scenario: "narrow" },+ play: async ({ canvasElement }) => {+ const handle = await within(canvasElement).findByRole("separator", { name: "Resize sidebar" });+ handle.focus();+ await userEvent.keyboard("{Home}");+ },+};+export const LongLabels: Story = { args: { scenario: "long-labels" } };+export const ManyRecentTasks: Story = { args: { scenario: "many-recents" } };+export const EmptyRecentTasks: Story = { args: { scenario: "empty-recents" } };+export const OrganizationMenu: Story = {+ args: { scenario: "organization-menu" },+ play: async ({ canvasElement }) => {+ await userEvent.click(await within(canvasElement).findByRole("button", { name: /organization switcher/ }));+ },+};+export const AccountMenu: Story = {+ args: { scenario: "account-menu" },+ play: async ({ canvasElement }) => {+ await userEvent.click(await within(canvasElement).findByRole("button", { name: "Open account menu" }));+ },+};diff --git a/ui/storybook/stories/design-proposals/tabs.stories.tsx b/ui/storybook/stories/design-proposals/tabs.stories.tsxnew file mode 100644index 0000000000..286173a2a9--- /dev/null+++ b/ui/storybook/stories/design-proposals/tabs.stories.tsx@@ -0,0 +1,34 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { TabsPreview, type TabsPreviewProps } from "../../support/design-proposals/TabsPreview";++const meta = {+ id: "design-tabs",+ title: "Design proposals/Components/Tabs",+ component: TabsPreview,+ args: { pattern: "all", width: "full" },+ argTypes: {+ pattern: { control: "select", options: ["all", "standard", "compact"] },+ width: { control: "inline-radio", options: ["full", "narrow"] },+ onWidthChange: { control: false },+ },+ parameters: {+ layout: "fullscreen",+ docs: { description: { component: "Two canonical filled tab sizes: Compact (12px) and Standard (14px), based on the supplied artifact selector and Paper tab bar. TabBar retains Radix content-panel semantics; TabFilters provides exclusive collection choices with roving focus. Agents, Audit, Connectors and Artifacts compose the same shared types." } },+ paperclip: {+ capabilities: [], home: "design-proposals", status: "proposed",+ exception: "Cross-cutting tab and collection-filter comparison staged for design consolidation rather than acceptance coverage of any whole feature.",+ implementation: "mixed", boundary: "fixtures",+ notes: "Mounts canonical TabBar and TabFilters with local panels/filter state. Compact and Standard share filled selection, hover and focus styling. PageTabBar adopts Standard; CatalogSourceFilters adopts Standard radio choices; ArtifactKindFilters supports both sizes; ArtifactsToolbar explicitly uses Standard. Only Playground, Standard and Compact are exposed in this grouping. Narrow wrapping and a disabled choice are inspectable. Full page routing, authorization and queries are outside this specimen.",+ },+ },+ render: function Render(args) {+ const [, updateArgs] = useArgs<TabsPreviewProps>();+ return <TabsPreview {...args} onWidthChange={width => updateArgs({ width })} />;+ },+} satisfies Meta<typeof TabsPreview>;+export default meta;+type Story = StoryObj<typeof meta>;+export const Playground: Story = {};+export const Standard: Story = { args: { pattern: "standard" } };+export const Compact: Story = { args: { pattern: "compact" } };diff --git a/ui/storybook/stories/design-proposals/task-hover-card.stories.tsx b/ui/storybook/stories/design-proposals/task-hover-card.stories.tsxnew file mode 100644index 0000000000..21be669625--- /dev/null+++ b/ui/storybook/stories/design-proposals/task-hover-card.stories.tsx@@ -0,0 +1,35 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { TaskHoverCardPreview } from "../../support/design-proposals/TaskHoverCardPreview";++const meta = {+ id: "design-task-hover-card",+ title: "Design proposals/Components/Task hover card",+ component: TaskHoverCardPreview,+ args: { enabled: true, showDescription: true },+ argTypes: {+ enabled: { control: "boolean", description: "Enable the text link's existing optional hover preview. Activity keeps its preview; task summaries keep it off." },+ showDescription: { control: "boolean" },+ onEnabledChange: { control: false, table: { disable: true } },+ },+ render: function Preview(args) {+ const [, updateArgs] = useArgs();+ return <TaskHoverCardPreview {...args} onEnabledChange={enabled => updateArgs({ enabled })} />;+ },+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ paperclip: {+ capabilities: ["tasks/organize", "activity/overview"],+ status: "proposed", home: "design-proposals", implementation: "production", boundary: "fixtures",+ exception: "Proposed task preview appearance staged alongside the task list and shared popover tokens.",+ notes: "Mounts the shared IssueQuicklookCard, real task Link/IssueLinkQuicklook, ActivityRow and TaskSummaryList. The static specimen exposes styling; interactive examples retain production hover-intent, focus, dismissal and link behavior. The text-link control maps to disableIssueQuicklook; recent-task summaries remain opted out. The refreshed card follows the Paper reference: 280px width, 16px padding, status/ID/time metadata, 14px semibold two-line title and 12px three-line description; it omits project metadata and shares --shadow-flyout. Task details are seeded into the query cache; fixtures do not prove server access checks, navigation acceptance or live fetching.",+ },+ },+} satisfies Meta<typeof TaskHoverCardPreview>;++export default meta;+type Story = StoryObj<typeof meta>;+export const Playground: Story = {};+export const NoDescription: Story = { args: { showDescription: false } };+export const PreviewOff: Story = { args: { enabled: false } };diff --git a/ui/storybook/stories/design-proposals/task-list-page.stories.tsx b/ui/storybook/stories/design-proposals/task-list-page.stories.tsxnew file mode 100644index 0000000000..a31eccd3a7--- /dev/null+++ b/ui/storybook/stories/design-proposals/task-list-page.stories.tsx@@ -0,0 +1,29 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { TaskListPagePreview } from "../../support/design-proposals/TaskListPagePreview";++const meta = {+ id: "tasks-list-page-design",+ title: "Design proposals/Pages/Tasks",+ component: TaskListPagePreview,+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ docs: { description: { component: "Full-page design proposal composed from the reviewed task rows and columns, production sidebar organization/account menus, task filters, Kanban board and task composer. Default opens with Task, Task ID and Last updated; headers remain inactive until the user sorts. Search, filters, views, expand/collapse, sorting and column configuration run against local fixture state. Sidebar labels use sm and icons match Paper. Organization selection uses the production switcher with company-scoped task fixtures. Views are Inbox, Unread, Needs attention and All tasks. New users start on All tasks; the last view persists per user in isolated proposal browser storage. Navigation, task creation, cross-device preferences and backend behavior require app integration." } },+ paperclip: {+ capabilities: ["tasks/organize", "inbox-search/search"],+ status: "proposed",+ home: "design-proposals",+ exception: "Full-page design refresh staged for visual approval before agent reproduction and production adoption.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Composes DesignPageShell, DesignSidebar, TaskListToolbar and TaskList from shared components, with useTaskListCollection supplying the shared search, view, creator-filter and expansion behavior. DesignSidebar is the same component reviewed separately under Components/Sidebar. SidebarCompanyMenu and SidebarAccountMenu preserve production behavior with the shared proposed flyout appearance. The organization, account, Views and Columns menus share background, highlight, text and shadow tokens. The account menu fits its contents and shows Invite using owner-access and loaded-policy fixtures; production invitation gates remain intact. The sidebar uses muted and border; the task search field uses background-alt. The organization control omits its caret and has a separate global-search button that opens the production CommandPalette. Truncated sidebar and menu labels opt into the same CellMarquee motion and fade as table cells. Navigation labels use sm and icons match Paper. The grouping icon is omitted. Headers have no active sort until the user chooses one. Organization selection scopes the fixture tasks and recent links. Search and filters keep ancestors for context. The filter popover follows the Paper five-group layout: Status, Project, Creator, Assignee and Label, with per-group searches, checkboxes and the shared popover shadow. Its refreshed presentation is opt-in; legacy filter layouts remain unchanged. Views appear as Inbox, Unread, Needs attention and All tasks. Inbox matches tasks created by or assigned to the current user; Needs attention matches blocked and in-review statuses. The last view persists per user in isolated proposal browser storage across reloads and organizations, defaulting to All tasks for new users. List/board and expansion use local fixture state. The proposed board has one horizontal scroll viewport with the table's shared clipping indicators and fade tokens; fades update on scroll and resize. Board and New Task reuse existing components; their appearance is not a new approved design. Sidebar links are router fixtures, not destination-page coverage. No production route, API or production preferences change. Visual review is required before this becomes the reference for a fresh-agent reproduction test.",+ },+ },+} satisfies Meta<typeof TaskListPagePreview>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Default: Story = {};+export const AllColumns: Story = { args: { allColumns: true } };+export const NoResults: Story = { args: { initialQuery: "unmatched search" } };diff --git a/ui/storybook/stories/design-proposals/task-row-design.stories.tsx b/ui/storybook/stories/design-proposals/task-row-design.stories.tsxnew file mode 100644index 0000000000..7c1b1309c5--- /dev/null+++ b/ui/storybook/stories/design-proposals/task-row-design.stories.tsx@@ -0,0 +1,354 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { Fragment, useState, type ReactNode } from "react";+import { ChevronDown, ChevronRight, GitBranch } from "lucide-react";+import { expect, userEvent, waitFor, within } from "storybook/test";+import type { Issue } from "@paperclipai/shared";+import { IssueRow } from "@/components/IssueRow";+import { TaskRowGroup } from "@/components/TaskRowGroup";+import { TaskList } from "@/components/TaskList";+import { TaskSummaryList } from "@/components/TaskSummaryList";+import { allTaskListColumns, defaultTaskListSort, sortTaskListItems, type TaskListSort } from "@/lib/task-list";+import { buildIssueTree } from "@/lib/issue-tree";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { useLocation } from "@/lib/router";+import { timeAgo } from "@/lib/timeAgo";+import { chatTask, columnData, connectorParent, healthTask, longTitle, ownerFor, readTask, recoveryChild, reviewTaskItems, sortValue, treeTasks, unreadTask } from "../../support/design-proposals/task-list-data";++type Density = "comfortable" | "compact";+type ContainerWidth = "standard" | "narrow" | "smallest";+type PlaygroundProps = {+ density: Density;+ containerWidth: ContainerWidth;+ onDensityChange?: (density: Density) => void;+ onWidthChange?: (width: ContainerWidth) => void;+};++function ReviewFrame({ title, detail, children, wide = false }: { title: string; detail: string; children: ReactNode; wide?: boolean }) {+ const location = useLocation();+ return (+ <main data-testid="task-row-design-preview" className="task-row-design-preview min-h-screen px-6 py-10 text-foreground sm:px-10">+ <output hidden data-testid="task-row-design-route">{location.pathname}</output>+ <div className={`mx-auto flex flex-col gap-8 ${wide ? "max-w-none" : "max-w-6xl"}`}>+ <header className="flex flex-col gap-3">+ <p className="text-xs font-normal text-muted-foreground">Paperclip · Design system · Proposed</p>+ <h1 className="text-3xl font-semibold tracking-tight">{title}</h1>+ <p className="max-w-3xl text-sm leading-relaxed text-muted-foreground">{detail}</p>+ </header>+ {children}+ </div>+ </main>+ );+}++function Row({+ issue,+ density = "comfortable",+ unread = false,+ depth = 0,+ expanded,+ onToggle,+ owner = "Codex",+ allColumns = false,+}: {+ issue: Issue;+ density?: Density;+ unread?: boolean;+ depth?: number;+ expanded?: boolean;+ onToggle?: () => void;+ owner?: string;+ allColumns?: boolean;+}) {+ const data = columnData(issue, owner);+ const { parent } = data;+ const rowIssue = allColumns ? data.issue : issue;+ const rowLabels = rowIssue.labels ?? [];+ return (+ <IssueRow+ issue={rowIssue}+ presentation="task"+ appearance="refreshed"+ density={density}+ unreadState={unread ? "visible" : "hidden"}+ treeGuides={depth}+ chevronInGuide={depth > 0 && Boolean(onToggle)}+ leadingControl={onToggle ? (+ <Button+ variant="ghost"+ size="icon-xs"+ className="task-row-disclosure"+ aria-label={`${expanded ? "Collapse" : "Expand"} ${issue.title}`}+ aria-expanded={expanded}+ onClick={onToggle}+ >+ {expanded ? <ChevronDown aria-hidden /> : <ChevronRight aria-hidden />}+ </Button>+ ) : undefined}+ metadata={<span className="block w-24 truncate text-xs text-muted-foreground">{owner}</span>}+ trailingMeta="2h ago"+ columnValues={allColumns ? {+ createdBy: data.creator,+ assignee: data.assignee ?? "Unassigned",+ project: rowIssue.project?.name,+ parentTask: parent ? <span><span className="font-mono">{parent.identifier}</span> {parent.title}</span> : undefined,+ tags: rowLabels.length ? <span className="inline-flex items-center gap-1">{rowLabels.map(label => <Badge key={label.id} variant="secondary" className="shrink-0 px-1.5 py-0">{label.name}</Badge>)}</span> : undefined,+ lastUpdated: timeAgo(rowIssue.updatedAt),+ worktree: rowIssue.currentExecutionWorkspace?.branchName ? <span className="inline-flex items-center gap-1.5"><GitBranch className="size-3 shrink-0" aria-hidden />{rowIssue.currentExecutionWorkspace.branchName}</span> : undefined,+ } : undefined}+ />+ );+}++function TaskTree({ density = "comfortable", allColumns = false, sort = defaultTaskListSort }: { density?: Density; allColumns?: boolean; sort?: TaskListSort }) {+ const [collapsed, setCollapsed] = useState<ReadonlySet<string>>(new Set());+ const { roots, childMap } = buildIssueTree(sortTaskListItems(treeTasks, sort, sortValue));+ const renderBranch = (issue: Issue, depth: number): ReactNode => {+ const children = childMap.get(issue.id) ?? [];+ const expanded = !collapsed.has(issue.id);+ return (+ <Fragment key={issue.id}>+ <Row issue={issue} density={density} allColumns={allColumns} depth={depth} unread={issue === connectorParent || issue === healthTask} owner={ownerFor(issue)} expanded={expanded} onToggle={children.length ? () => setCollapsed(current => {+ const next = new Set(current);+ if (next.has(issue.id)) next.delete(issue.id); else next.add(issue.id);+ return next;+ }) : undefined} />+ {expanded ? children.map(child => renderBranch(child, depth + 1)) : null}+ </Fragment>+ );+ };+ return (+ <div aria-label={`${density} task list`}>+ {roots.map(issue => (+ <TaskRowGroup key={issue.id} role={allColumns ? "rowgroup" : "group"} aria-label={issue === connectorParent ? "Connector reliability task group" : issue === chatTask ? "Chat style task group" : "Empty-state task group"}>+ {renderBranch(issue, 0)}+ </TaskRowGroup>+ ))}+ </div>+ );+}++function InteractiveColumns() {+ return (+ <ReviewFrame wide title="Task-list columns" detail="Click a header to sort, or drag it left or right to rearrange columns. Alt + Left/Right also reorders a focused header. Tasks stay with their parents. Use Columns to show or hide columns.">+ <section className="min-w-0 space-y-4" aria-label="Complete task-list column specimen">+ <TaskList items={reviewTaskItems} initialColumns={allTaskListColumns} />+ <p className="text-xs text-muted-foreground">An em dash means no value. Column choices and sorting are local to this preview. Task includes status and title. Reset defaults shows Task, Task ID, and Last updated.</p>+ </section>+ </ReviewFrame>+ );+}++function StateSamples({ density = "comfortable" }: { density?: Density }) {+ return (+ <section className="flex flex-col gap-4" aria-label="Title states">+ <div className="flex flex-col gap-1">+ <h2 className="text-sm font-normal">Read and unread</h2>+ <p className="text-xs leading-relaxed text-muted-foreground">Hover either row: the title becomes foreground and the row background changes. Weight continues to indicate unread status.</p>+ </div>+ <div className="grid gap-6">+ <div className="flex min-w-0 flex-col gap-2">+ <p className="text-xs text-muted-foreground">Read · Regular</p>+ <TaskRowGroup><Row issue={readTask} density={density} /></TaskRowGroup>+ </div>+ <div className="flex min-w-0 flex-col gap-2">+ <p className="text-xs text-muted-foreground">Unread · Semibold</p>+ <TaskRowGroup><Row issue={unreadTask} density={density} unread /></TaskRowGroup>+ </div>+ </div>+ </section>+ );+}++function TaskRowSpecimen({ density = "comfortable", containerWidth = "standard", onDensityChange, onWidthChange }: PlaygroundProps) {+ const widthClass = { standard: "w-full", narrow: "w-96", smallest: "w-64" }[containerWidth];+ return (+ <ReviewFrame+ title="Task rows"+ detail="Change row density and container width to explore title states and nesting. Truncated text reveals on hover or keyboard focus and resets on exit."+ >+ <div className="flex flex-wrap gap-6" aria-label="Playground controls">+ <div role="group" aria-label="Row density" className="flex flex-wrap items-center gap-2">+ <span className="text-sm text-muted-foreground">Row density</span>+ {(["comfortable", "compact"] as const).map(value => <Button key={value} size="sm" variant={density === value ? "secondary" : "outline"} aria-pressed={density === value} onClick={() => onDensityChange?.(value)}>+ {value === "comfortable" ? "Comfortable (44px)" : "Compact (32px)"}+ </Button>)}+ </div>+ <div role="group" aria-label="Container width" className="flex flex-wrap items-center gap-2">+ <span className="text-sm text-muted-foreground">Container width</span>+ {(["standard", "narrow", "smallest"] as const).map(value => <Button key={value} size="sm" variant={containerWidth === value ? "secondary" : "outline"} aria-pressed={containerWidth === value} onClick={() => onWidthChange?.(value)}>+ {value === "standard" ? "Standard" : value === "narrow" ? "Narrow" : "Smallest"}+ </Button>)}+ </div>+ </div>+ <div data-testid="task-row-playground-container" className={`task-row-responsive-container flex max-w-full flex-col gap-8 ${widthClass}`}>+ <section className="flex flex-col gap-4" aria-label={`${density === "comfortable" ? "Comfortable" : "Compact"} density specimen`}>+ <div className="flex items-baseline justify-between gap-4">+ <h2 className="text-sm font-normal">{density === "comfortable" ? "Comfortable" : "Compact"}</h2>+ <p className="font-mono text-xs text-muted-foreground">{density === "comfortable" ? "44px" : "32px"} rows · 24px nesting</p>+ </div>+ <TaskTree density={density} />+ <p className="text-xs leading-relaxed text-muted-foreground">Vertical guides connect nested tasks. One boundary encloses each parent and all its visible descendants; child rows have no horizontal separators.</p>+ </section>+ <StateSamples density={density} />+ </div>+ <footer className="text-xs leading-relaxed text-muted-foreground">This playground uses the shared task-row component with fixture data. Narrow containers show status, title and timestamp; the smallest containers show status and title. Fixed stories remain available as review references. Review the full composition under Design proposals → Pages → Tasks.</footer>+ </ReviewFrame>+ );+}++const meta = {+ id: "tasks-row-design",+ title: "Design proposals/Components/Task list",+ component: TaskRowSpecimen,+ args: { density: "comfortable", containerWidth: "standard" },+ argTypes: {+ density: { control: "inline-radio", options: ["comfortable", "compact"] },+ containerWidth: { control: "inline-radio", options: ["standard", "narrow", "smallest"] },+ onDensityChange: { control: false, table: { disable: true } },+ onWidthChange: { control: false, table: { disable: true } },+ },+ parameters: {+ layout: "fullscreen",+ controls: { include: [] },+ docs: {+ description: {+ component: "Proposed task-row design using production IssueRow and TaskRowGroup. Comfortable and compact share one component. Read/unread typography is independent of hover; nested guides and group boundaries follow the parent hierarchy. Use real pointer hover to inspect the four visual combinations. Play assertions cover typography, disclosure, and full-title access; fixtures do not establish production navigation or persistence.",+ },+ },+ paperclip: {+ capabilities: ["tasks/organize"],+ status: "proposed",+ home: "design-proposals",+ exception: "Staged design-system refresh awaiting visual review and app adoption; kept separate from production references.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Library specimen of refreshed IssueRow, TaskRowGroup, and TaskListColumnHeader. Task combines status and title under one header and visibility choice; Task sorting uses titles, with no status sort. All Columns starts with every column and demonstrates sibling hierarchy, sorting, pointer/keyboard column reordering, pinned column settings, visibility and reset using local fixture state. Last updated is last by default; the flyout follows the current column order. Reset restores that order and shows only Task, Task ID, and Last updated. The Columns flyout follows the Paper reference with compact 32px items, regular labels, and right-aligned checks. Sorted headers retain their background. Table typography uses sm with a 16px line height; every truncated cell uses a local marquee. The entire proposal canvas uses Paper's background token. Status tooltips use shared labels. The composition is under review and does not establish production API, preference persistence, or full accessibility acceptance.",+ },+ },+} satisfies Meta<typeof TaskRowSpecimen>;++export default meta;+type Story = StoryObj<typeof meta>;++/** Keep the export stable so existing specimen links continue to work. */+export const Specimen: Story = {+ name: "Playground",+ parameters: { controls: { include: ["density", "containerWidth"] } },+ render: function Playground(args) {+ const [, updateArgs] = useArgs<PlaygroundProps>();+ return <TaskRowSpecimen {...args} onDensityChange={density => updateArgs({ density })} onWidthChange={containerWidth => updateArgs({ containerWidth })} />;+ },+};++export const AllColumns: Story = {+ render: () => <InteractiveColumns />,+};++export const Summary: Story = {+ name: "Narrow",+ parameters: {+ paperclip: {+ capabilities: ["tasks/organize", "activity/overview"],+ status: "proposed", home: "design-proposals", implementation: "production", boundary: "fixtures",+ exception: "Reusable narrow summary staged with the task-list proposal; Dashboard opts in only in the local integration sandbox.",+ notes: "TaskSummaryList renders the same refreshed IssueRow in a flat, read-style list. It preserves 44px density, sm typography, hover, status tooltip, cell-local marquee and full task navigation. Task ID hides below a 28rem container; time hides below 20rem. Rendering does not mark tasks read. The caller owns ordering and data; no table headers, column controls, query controller or hierarchy are introduced. The normal Dashboard remains unchanged when the design sandbox is off.",+ },+ },+ render: () => <ReviewFrame title="Task summaries" detail="The same read-style task row in smaller containers. Row height and text size stay fixed; optional metadata yields space to the title.">+ <section aria-label="Standard task summary" className="max-w-2xl space-y-3">+ <h2 className="text-sm font-normal">Standard · Status, title, task ID, last updated</h2>+ <TaskRowGroup><TaskSummaryList label="Standard task summary" issues={[recoveryChild, healthTask, chatTask]} /></TaskRowGroup>+ </section>+ <section aria-label="Narrow task summary" className="w-96 max-w-full space-y-3">+ <h2 className="text-sm font-normal">Narrow · Status, title, timestamp</h2>+ <TaskRowGroup><TaskSummaryList label="Narrow task summary" issues={[recoveryChild, healthTask, chatTask]} /></TaskRowGroup>+ </section>+ <section aria-label="Smallest task summary" className="w-64 max-w-full space-y-3">+ <h2 className="text-sm font-normal">Smallest · Status and title</h2>+ <TaskRowGroup><TaskSummaryList label="Smallest task summary" issues={[recoveryChild, healthTask, chatTask]} /></TaskRowGroup>+ </section>+ </ReviewFrame>,+};++export const Comfortable: Story = {+ render: () => (+ <ReviewFrame title="Comfortable rows" detail="44px task rows. Expand the nested branch to inspect continuous guides and aligned metadata.">+ <TaskTree />+ </ReviewFrame>+ ),+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const rootControl = canvas.getByRole("button", { name: "Collapse Improve connector reliability" });+ await userEvent.click(rootControl);+ await expect(canvas.queryByRole("link", { name: /Open PAP-429:/ })).not.toBeInTheDocument();+ await userEvent.click(canvas.getByRole("button", { name: "Expand Improve connector reliability" }));+ await expect(canvas.getByRole("link", { name: /Open PAP-429:/ })).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Collapse Design reconnect and recovery flows" }));+ await expect(canvas.queryByRole("link", { name: /Open PAP-431:/ })).not.toBeInTheDocument();+ await expect(canvas.getByRole("link", { name: /Open PAP-432:/ })).toBeVisible();+ await userEvent.click(canvas.getByRole("button", { name: "Expand Design reconnect and recovery flows" }));+ await expect(canvas.getByRole("link", { name: /Open PAP-431:/ })).toBeVisible();+ for (const row of canvasElement.querySelectorAll<HTMLElement>('[data-slot="task-row"]')) {+ await expect(row.getBoundingClientRect().height).toBe(44);+ }+ // Restore an unfocused, unhovered specimen for subsequent visual review.+ (canvasElement.ownerDocument.activeElement as HTMLElement | null)?.blur();+ await userEvent.unhover(rootControl);+ },+};++export const Compact: Story = {+ render: () => (+ <ReviewFrame title="Compact rows" detail="32px preview of the same task row. This defines the future density option; it does not add a user setting yet.">+ <TaskTree density="compact" />+ </ReviewFrame>+ ),+ play: async ({ canvasElement }) => {+ for (const row of canvasElement.querySelectorAll<HTMLElement>('[data-slot="task-row"]')) {+ await expect(row.getBoundingClientRect().height).toBe(32);+ }+ },+};++function SingleState({ unread }: { unread: boolean }) {+ return (+ <ReviewFrame+ title={unread ? "Unread title" : "Read title"}+ detail={unread ? "Semibold foreground. Hover changes the background while preserving the title’s color and weight." : "Regular muted foreground. Hover changes the background and promotes the title to foreground without changing its weight."}+ >+ <TaskRowGroup><Row issue={recoveryChild} unread={unread} /></TaskRowGroup>+ </ReviewFrame>+ );+}++async function checkTitleAccess(canvasElement: HTMLElement, unread: boolean) {+ const canvas = within(canvasElement);+ const link = canvas.getByRole("link", { name: `Open PAP-431: ${longTitle}` });+ const row = link.closest<HTMLElement>('[data-slot="task-row"]')!;+ const title = row.querySelector<HTMLElement>('[data-slot="task-row-title"]')!;+ const text = title.querySelector<HTMLElement>('[data-slot="task-row-title-text"]')!;+ await expect(getComputedStyle(title).fontWeight).toBe(unread ? "600" : "400");+ await expect(text.scrollWidth).toBeGreaterThan(title.clientWidth);+ await userEvent.pointer({ target: link, coords: { clientX: title.getBoundingClientRect().left + title.clientWidth / 2, clientY: title.getBoundingClientRect().top + title.clientHeight / 2 } });+ await expect(title).toHaveAttribute("data-revealing", "true");+ await expect(within(canvasElement.ownerDocument.body).queryByRole("tooltip")).not.toBeInTheDocument();+ await userEvent.unhover(link);+ await expect(title).not.toHaveAttribute("data-revealing");+ link.focus();+ await expect(link).toHaveFocus();+ await waitFor(() => expect(title).toHaveAttribute("data-revealing", "true"));+ link.blur();+ await userEvent.keyboard("{Escape}");+}++export const Read: Story = {+ render: () => <SingleState unread={false} />,+ play: async ({ canvasElement }) => checkTitleAccess(canvasElement, false),+};++export const Unread: Story = {+ render: () => <SingleState unread />,+ play: async ({ canvasElement }) => checkTitleAccess(canvasElement, true),+};diff --git a/ui/storybook/stories/design-proposals/tasks-reproduction-test-2.stories.tsx b/ui/storybook/stories/design-proposals/tasks-reproduction-test-2.stories.tsxnew file mode 100644index 0000000000..087a5ff1d6--- /dev/null+++ b/ui/storybook/stories/design-proposals/tasks-reproduction-test-2.stories.tsx@@ -0,0 +1,25 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { TasksReproductionTrial2 } from "../../support/design-proposals/TasksReproductionTrial2";++const meta = {+ id: "design-agent-task-list-trial-2",+ title: "Design proposals/AI Generated Test Pages/Tasks reproduction test 2",+ component: TasksReproductionTrial2,+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ paperclip: {+ capabilities: ["tasks/organize", "inbox-search/search"],+ home: "design-proposals",+ status: "proposed",+ exception: "Independent second reproduction trial of the proposed desktop Tasks page, pending human visual approval.",+ implementation: "prototype",+ boundary: "fixtures",+ notes: "Independent page composition using DesignPageShell, DesignSidebar, TaskListToolbar, TaskList, KanbanBoard, canonical dialogs and useTaskListCollection. Reuses the shared fixed task data and owner-access fixture. Search, creator identities, filters, views and expansion are delegated to the shared controller; list columns and sorting remain owned by TaskList. View and sidebar preferences use trial-specific storage keys. Navigation and mutations are fixtures; backend behavior and mobile design are outside this trial.",+ },+ },+} satisfies Meta<typeof TasksReproductionTrial2>;++export default meta;+type Story = StoryObj<typeof meta>;+export const Default: Story = {};diff --git a/ui/storybook/stories/design-proposals/tasks-reproduction-test.stories.tsx b/ui/storybook/stories/design-proposals/tasks-reproduction-test.stories.tsxnew file mode 100644index 0000000000..3abccebc5e--- /dev/null+++ b/ui/storybook/stories/design-proposals/tasks-reproduction-test.stories.tsx@@ -0,0 +1,26 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { TasksReproductionTrial } from "../../support/design-proposals/TasksReproductionTrial";++const meta = {+ id: "design-agent-task-list-trial",+ title: "Design proposals/AI Generated Test Pages/Tasks reproduction test",+ component: TasksReproductionTrial,+ parameters: {+ layout: "fullscreen",+ initialEntries: ["/PAP/issues"],+ paperclip: {+ capabilities: ["tasks/organize", "inbox-search/search"],+ status: "proposed",+ home: "design-proposals",+ exception: "Independent reproduction trial of the provisional Tasks reference; human visual approval and production adoption remain pending.",+ implementation: "production",+ boundary: "fixtures",+ notes: "Composes shared DesignPageShell, DesignSidebar, TaskListToolbar and TaskList without page-preview imports or custom visual markup. Reuses canonical organization/account menus, filters, board, composer and command palette. Search/view/filter matching, namespaced creator options and expansion use the same useTaskListCollection hook as the reference; only fixture data updates remain local. This is a repaired regression reference, not the untouched first submission; original evidence is retained separately. Boards use matching tasks, while the list includes ancestor context. Width and view preferences use isolated trial keys. Destination routes, backend persistence, mobile layout and production adoption are outside this trial.",+ },+ },+} satisfies Meta<typeof TasksReproductionTrial>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Default: Story = { parameters: { __id: "design-agent-task-list-trial" } };diff --git a/ui/storybook/stories/design-proposals/toolbars.stories.tsx b/ui/storybook/stories/design-proposals/toolbars.stories.tsxnew file mode 100644index 0000000000..2f49322273--- /dev/null+++ b/ui/storybook/stories/design-proposals/toolbars.stories.tsx@@ -0,0 +1,44 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { useArgs } from "storybook/preview-api";+import { ToolbarsPreview, type ToolbarsPreviewProps } from "../../support/design-proposals/ToolbarsPreview";++const meta = {+ id: "design-toolbars",+ title: "Design proposals/Components/Toolbars",+ component: ToolbarsPreview,+ args: { family: "all", width: "full" },+ argTypes: {+ family: { control: "select", options: ["all", "tasks", "decisions", "skills", "artifacts", "projects", "routines"] },+ width: { control: "inline-radio", options: ["full", "medium", "narrow"] },+ onWidthChange: { control: false },+ },+ parameters: {+ layout: "fullscreen", initialEntries: ["/PAP/issues"],+ docs: { description: { component: "Canonical Design Proposals toolbar references. TaskListToolbar is the shared proposal and sandbox Tasks control surface; DecisionsToolbar is the shipped WhatNeedsMe and DecisionQueuePage search/filter/group/sort control set. SkillsToolbar, ArtifactsToolbar ProjectsToolbar and RoutinesToolbar are shared with the shipped pages. Interactive local fixtures preserve real component/menu behavior. Width controls expose wrapping. Backend actions and production adoption are not acceptance claims." } },+ paperclip: {+ capabilities: ["tasks/organize", "inbox-search/views", "inbox-search/decisions", "skills/discovery", "documents-artifacts/library", "projects/lifecycle", "routines/management"],+ home: "design-proposals", status: "proposed",+ exception: "Canonical toolbar families staged in Design Proposals for system reuse and styling before production adoption.",+ implementation: "mixed", boundary: "fixtures",+ notes: "Mounts TaskListToolbar with useTaskListCollection and DecisionsToolbar directly. All use the proposal theme and refreshed flyouts. Search, task view/layout/expansion, filters, decision grouping/sorting update local state. Task view preference uses an isolated story storage key. Create callbacks only report intent. Existing page and button stories retain their IDs and reuse the same source components. SkillsToolbar and ArtifactsToolbar also render directly; their pages consume the same extracted presentation with existing controllers unchanged. Scan busy/completed state is manually simulated. Skills mounts the shared Installed/Discover/My Skills route links below its controls, with Installed active; Sources remains in New > Manage sources. Link destinations are fixtures, not page-navigation acceptance. Canonical controls share ToolbarSearch, 44px height, opaque border, radius, padding and gap under the proposal theme. Control rows begin with search and end with the primary action when present. Tasks retains its view/heading dropdown before search with the same four persisted choices. ProjectsToolbar shares search, existing sort fields/directions and the create callback with Projects. Decisions search uses the same client-side matching helper as the desk and queue pages, with synthetic decision data. Artifact type filters retain their existing tab semantics; geometry is normalized inside the toolbar. No backend changes.",+ },+ },+ render: function Render(args) {+ const [, updateArgs] = useArgs<ToolbarsPreviewProps>();+ return <ToolbarsPreview {...args} onWidthChange={width => updateArgs({ width })} />;+ },+} satisfies Meta<typeof ToolbarsPreview>;+export default meta;+type Story = StoryObj<typeof meta>;++export const Playground: Story = {};+export const Tasks: Story = { args: { family: "tasks" } };+export const Decisions: Story = { args: { family: "decisions" } };+export const Narrow: Story = { args: { width: "narrow" } };++export const Skills: Story = { args: { family: "skills" } };+export const Artifacts: Story = { args: { family: "artifacts" } };++export const Projects: Story = { args: { family: "projects" } };++export const Routines: Story = { args: { family: "routines" } };diff --git a/ui/storybook/stories/design-proposals/typography.stories.tsx b/ui/storybook/stories/design-proposals/typography.stories.tsxnew file mode 100644index 0000000000..e2855592ff--- /dev/null+++ b/ui/storybook/stories/design-proposals/typography.stories.tsx@@ -0,0 +1,53 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { TypographyPreview } from "../../support/design-proposals/TypographyPreview";+import { ConversationTypeSpec } from "../../support/design-proposals/ConversationTypeSpec";+import { ConversationTypographyPreview } from "../../support/design-proposals/ConversationTypographyPreview";++const meta = {+ id: "design-foundations-typography",+ title: "Design proposals/Foundations/Typography",+ component: TypographyPreview,+ parameters: {+ layout: "fullscreen",+ docs: { description: { component: "Proposed type ramp and source-derived typography roles for Design Proposals and the local design sandbox. Live measurements distinguish current CSS behavior from proposed guidance. Includes shared TaskList, MetricCard and MarkdownBody examples; the shared proposal typography also applies to the opt-in sandbox." } },+ paperclip: {+ capabilities: [],+ home: "design-proposals",+ status: "proposed",+ exception: "Cross-cutting typography foundation for Design Proposals and its sandbox integration; not a production feature acceptance story.",+ implementation: "guide",+ boundary: "fixtures",+ notes: "Documents the proposed nine-step 10–30px ramp, Inter/Paper Mono families, normal/semibold weights, emphasis, overflow and source-derived roles. Recipe specimens show existing classes/tokens; integrated TaskList, MetricCard and MarkdownBody samples mount real shared components with synthetic text. Conversation styles mounts DesignSandboxTaskThread directly with its complete 72-state fixture catalog, grouped preview selector, replay, activity disclosures and local composer actions. Optional typography measurements inspect the rendered composition on demand. Browser-computed metrics are local measurements, not a production-wide runtime audit. Existing out-of-ramp Markdown, metadata sizes and muted headings remain explicit review items. Navigation and streamlined property sections share one label recipe; previous micro usages are xs. Dark desktop reference, with responsive behavior noted; no provider actions or ordinary-theme adoption. Conversation regions use shared 14px/20px body and 12px/16px metadata recipes, with muted supporting text, contrasting human bubbles and foreground final replies.",+ },+ },+} satisfies Meta<typeof TypographyPreview>;++export default meta;+type Story = StoryObj<typeof meta>;++export const TypeSpecification: Story = { name: "Type specification" };+export const ConversationStyles: Story = {+ name: "Conversation styles",+ render: () => <ConversationTypographyPreview />,+ parameters: {+ initialEntries: ["/DES/issues/DES-7?threadPreview=all"],+ docs: { description: { story: "The exact DesignSandboxTaskThread composition used by the sandbox IssueDetail page, with all 72 canonical synthetic states and the same grouped selector, replay, transcript/native renderer paths, history, activity disclosures, requests and composer. Defaults to All states. Optional measurements inspect its rendered typography; refresh after changing state or opening disclosures. Saved backend conversation data is not loaded in Storybook. Preview actions remain local. Production renderer reuse does not verify a deployed production version, and the shared proposal conversation typography is applied." } },+ },+};++export const ConversationTypeSpecification: Story = {+ name: "Conversation type spec",+ render: () => <ConversationTypeSpec />,+ parameters: {+ initialEntries: ["/DES/issues/DES-7?threadPreview=all"],+ docs: { description: { story: "A measured conversation typography specification in the same layout as Type specification. Mounts the complete shared 72-state sandbox preview and inventories currently rendered text into size, family, weight and surface/recipe rows. Includes search, surface filtering, shared-metric consolidation candidates, source classes, example-state links and explicit inventory refresh after disclosures or state changes. Isolated specimens copy browser-computed type properties; the real composition remains in context. Closed content, placeholders and absent Markdown structures are not counted. Measures the consolidated proposal conversation typography; no backend action is applied." } },+ },+};++export const ConversationPlayback: Story = {+ name: "Conversation playback",+ render: () => <ConversationTypographyPreview playback />,+ parameters: {+ docs: { description: { story: "Watch two exchanges in one continuous synthetic conversation using the shared sandbox playback controller and production transcript renderers. Play, pause, resume and replay are local. Thinking, commentary, tools and a final answer lead into a follow-up with queuing, planning, clarification, permission, a failed test and retry, a file preview, usage and another final answer. Demo answers and permission receipts advance automatically; request controls are disabled. New words fade over 320ms; running tool text shimmers white and final-channel text streams in foreground. Completed tools return to muted metadata. Reduced motion suppresses decorative motion. No provider, agent, command or backend mutation is triggered. The separate Conversation styles and type spec stories retain all 72 inspectable fixtures." } },+ },+};diff --git a/ui/storybook/support/design-proposals/ActivityListPreview.tsx b/ui/storybook/support/design-proposals/ActivityListPreview.tsxnew file mode 100644index 0000000000..d421613c4d--- /dev/null+++ b/ui/storybook/support/design-proposals/ActivityListPreview.tsx@@ -0,0 +1,75 @@+import { useLayoutEffect } from "react";+import { useQueryClient } from "@tanstack/react-query";+import type { ActivityEvent } from "@paperclipai/shared";+import { ActivityList } from "@/components/ActivityList";+import { Button } from "@/components/ui/button";+import { Card } from "@/components/ui/card";+import { FlyoutAppearanceProvider } from "@/components/ui/flyout";+import { queryKeys } from "@/lib/queryKeys";+import { storybookActivityEvents, storybookAgentMap, storybookProjects } from "../../fixtures/paperclipData";+import { recoveryChild } from "./task-list-data";++type Density = "comfortable" | "compact";+type Width = "standard" | "narrow" | "smallest";+export type ActivityListPreviewProps = {+ density?: Density;+ containerWidth?: Width;+ withReferences?: boolean;+ onDensityChange?: (density: Density) => void;+ onWidthChange?: (width: Width) => void;+};++const project = storybookProjects[0]!;+const base: ActivityEvent = { ...storybookActivityEvents[0]!, actorType: "user", actorId: "board", createdAt: new Date("2026-10-15T00:00:00Z") };+const events: ActivityEvent[] = [+ { ...base, id: "activity-task", action: "issue.updated", entityType: "issue", entityId: recoveryChild.id },+ { ...base, id: "activity-agent", action: "agent.paused", entityType: "agent", entityId: "agent-codex" },+ { ...base, id: "activity-project", actorType: "agent", actorId: "agent-codex", action: "project.updated", entityType: "project", entityId: project.id },+ { ...base, id: "activity-approval", action: "approval.revision_requested", entityType: "approval", entityId: "approval-budget", details: { type: "budget_override_required" } },+ { ...base, id: "activity-run", action: "heartbeat.invoked", entityType: "heartbeat_run", entityId: "run-storybook", details: { agentId: "agent-codex" } },+ { ...base, id: "activity-system", actorType: "system", actorId: "system", action: "company.updated", entityType: "company", entityId: "company-storybook", details: null },+];++const names = new Map([+ [`issue:${recoveryChild.id}`, recoveryChild.identifier!],+ ["agent:agent-codex", "CodexCoder"],+ [`project:${project.id}`, project.name],+ ["approval:approval-budget", "Monthly budget adjustment"],+ ["company:company-storybook", "Paperclip Storybook"],+]);+const titles = new Map([[`issue:${recoveryChild.id}`, recoveryChild.title]]);+const profiles = new Map([["board", { label: "Riley Board", image: null }]]);++export function ActivityListPreview({ density = "comfortable", containerWidth = "standard", withReferences = false, onDensityChange, onWidthChange }: ActivityListPreviewProps) {+ const client = useQueryClient();+ useLayoutEffect(() => {+ for (const ref of [recoveryChild.id, recoveryChild.identifier!]) client.setQueryData(queryKeys.issues.detail(ref), recoveryChild);+ }, [client]);+ const items = withReferences ? [{ ...events[0]!, details: { addedReferencedIssues: [{ id: recoveryChild.id, identifier: recoveryChild.identifier, title: recoveryChild.title }], removedReferencedIssues: [{ id: "old-task", identifier: "PAP-400", title: "Superseded connector plan" }] } }, ...events.slice(1)] : events;+ const widthClass = { standard: "w-full", narrow: "w-96", smallest: "w-64" }[containerWidth];+ return <FlyoutAppearanceProvider>+ <main className="task-row-design-preview min-h-screen px-6 py-10 text-foreground sm:px-10">+ <div className="mx-auto flex max-w-4xl flex-col gap-8">+ <header className="space-y-3">+ <p className="text-xs text-muted-foreground">Paperclip · Design system · Proposed</p>+ <h1 className="text-3xl font-semibold">Activity list</h1>+ <p className="text-sm text-muted-foreground">Task, agent, project, approval, run and system activity. Rows share task-list density, type, fade and cell-local marquee. Task entries retain their hover card; other entries keep their own destination.</p>+ </header>+ <div className="flex flex-wrap gap-6">+ <div role="group" aria-label="Row density" className="flex flex-wrap items-center gap-2">+ <span className="text-sm text-muted-foreground">Row density</span>+ {(["comfortable", "compact"] as const).map(value => <Button key={value} size="sm" variant={density === value ? "secondary" : "outline"} aria-pressed={density === value} onClick={() => onDensityChange?.(value)}>{value === "comfortable" ? "Comfortable (44px)" : "Compact (32px)"}</Button>)}+ </div>+ <div role="group" aria-label="Container width" className="flex flex-wrap items-center gap-2">+ <span className="text-sm text-muted-foreground">Container width</span>+ {(["standard", "narrow", "smallest"] as const).map(value => <Button key={value} size="sm" variant={containerWidth === value ? "secondary" : "outline"} aria-pressed={containerWidth === value} onClick={() => onWidthChange?.(value)}>{value === "standard" ? "Standard" : value === "narrow" ? "Narrow" : "Smallest"}</Button>)}+ </div>+ </div>+ <Card className={`block max-w-full overflow-hidden py-0 ${widthClass}`}>+ <ActivityList events={items} density={density} agentMap={storybookAgentMap} userProfileMap={profiles} entityNameMap={names} entityTitleMap={titles} />+ </Card>+ {withReferences ? <p className="text-xs text-muted-foreground">Reference changes remain below the fixed-height row. Their links keep their existing navigation and accessible labels.</p> : null}+ </div>+ </main>+ </FlyoutAppearanceProvider>;+}diff --git a/ui/storybook/support/design-proposals/AgentWorkloadTrial.tsx b/ui/storybook/support/design-proposals/AgentWorkloadTrial.tsxnew file mode 100644index 0000000000..22517f0c59--- /dev/null+++ b/ui/storybook/support/design-proposals/AgentWorkloadTrial.tsx@@ -0,0 +1,158 @@+import { useEffect, useRef, useState } from "react";+import type { Agent, Issue } from "@paperclipai/shared";+import { CirclePause, Coffee, ListChecks, SearchX, Users, Zap } from "lucide-react";+import { AgentAvatar } from "@/components/AgentAvatar";+import { CollectionToolbar } from "@/components/CollectionToolbar";+import { CommandPalette } from "@/components/CommandPalette";+import { DesignPageShell } from "@/components/DesignPageShell";+import { DesignSidebar } from "@/components/DesignSidebar";+import { EmptyState } from "@/components/EmptyState";+import { MetricCard } from "@/components/MetricCard";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { AgentStatusCapsule } from "@/components/StatusBadge";+import { TabFilters } from "@/components/TabBar";+import { TaskRowGroup } from "@/components/TaskRowGroup";+import { TaskSummaryList } from "@/components/TaskSummaryList";+import { ToolbarSearch } from "@/components/ToolbarSearch";+import { SidePanelWindowControls } from "@/components/side-panel";+import { Button } from "@/components/ui/button";+import { Card } from "@/components/ui/card";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { workloadAgents, workloadTasks } from "./agent-workload-trial-data";+import "./agent-workload-trial.css";++type WorkloadState = "working" | "idle" | "paused";+type WorkloadFilter = "all" | WorkloadState;+export type AgentWorkloadTrialProps = {+ initialQuery?: string;+ initialFilter?: WorkloadFilter;+ initialAgentId?: string;+ emptyOrganization?: boolean;+};++const filters = [+ { value: "all", label: "All" }, { value: "working", label: "Working" },+ { value: "idle", label: "Idle" }, { value: "paused", label: "Paused" },+] as const;+const stateLabels = { working: "Working", idle: "Idle", paused: "Paused" };+const workloadState = (agent: Agent): WorkloadState => agent.status === "running" ? "working" : agent.status === "paused" ? "paused" : "idle";+const activeTask = (task: Issue) => task.status === "in_progress";+const queuedTask = (task: Issue) => task.status === "todo" || task.status === "backlog";+const newestFirst = (a: Issue, b: Issue) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime();++/** The caller supplies workload membership; row presentation stays entirely shared. */+function TaskSection({ title, tasks, label, emptyMessage }: { title: string; tasks: Issue[]; label: string; emptyMessage: string }) {+ return <section className="space-y-3" aria-label={label}>+ <h3 className="text-sm font-semibold">{title} <span className="font-mono font-normal text-muted-foreground">{tasks.length}</span></h3>+ {tasks.length ? <TaskRowGroup><TaskSummaryList issues={tasks.slice(0, 6)} label={label} /></TaskRowGroup>+ : <p className="text-sm text-muted-foreground">{emptyMessage}</p>}+ {tasks.length > 6 && <p className="text-xs text-muted-foreground">Showing the six most recently updated tasks.</p>}+ </section>;+}++function AgentWorkloadContent({ initialQuery = "", initialFilter = "all", initialAgentId, emptyOrganization = false }: AgentWorkloadTrialProps) {+ const { selectedCompanyId } = useCompany();+ const { openNewIssue } = useDialogActions();+ const [query, setQuery] = useState(initialQuery);+ const [filter, setFilter] = useState<WorkloadFilter>(initialFilter);+ const [selectedId, setSelectedId] = useState<string | null>(initialAgentId ?? null);+ const [maximized, setMaximized] = useState(false);+ const searchRef = useRef<HTMLInputElement>(null);+ const cardRefs = useRef(new Map<string, HTMLButtonElement>());+ const agents = emptyOrganization ? [] : workloadAgents.filter(agent => agent.companyId === selectedCompanyId);+ const tasks = workloadTasks.filter(task => task.companyId === selectedCompanyId && agents.some(agent => agent.id === task.assigneeAgentId));+ const words = query.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);+ const visibleAgents = agents.filter(agent => (filter === "all" || workloadState(agent) === filter)+ && words.every(word => `${agent.name} ${agent.role} ${agent.title ?? ""}`.toLocaleLowerCase().includes(word)));+ const selectedAgent = visibleAgents.find(agent => agent.id === selectedId);+ const selectedTasks = tasks.filter(task => task.assigneeAgentId === selectedAgent?.id).toSorted(newestFirst);+ const active = selectedTasks.filter(activeTask);+ const recent = selectedTasks.filter(task => !activeTask(task) && !queuedTask(task));++ useEffect(() => {+ if (selectedAgent) document.getElementById("design-page-aside-content")?.focus();+ }, [selectedAgent?.id]);++ const dismiss = () => {+ const returnId = selectedId;+ setSelectedId(null);+ setMaximized(false);+ requestAnimationFrame(() => { if (returnId) cardRefs.current.get(returnId)?.focus(); });+ };+ const changeQuery = (next: string) => { setQuery(next); setSelectedId(null); setMaximized(false); };+ const changeFilter = (next: WorkloadFilter) => { setFilter(next); setSelectedId(null); setMaximized(false); };+ const clear = () => { changeQuery(""); setFilter("all"); searchRef.current?.focus(); };++ return <div className="agent-workload-trial" onKeyDown={event => {+ if (event.key === "Escape" && !event.defaultPrevented && selectedAgent) { event.preventDefault(); dismiss(); }+ }}>+ <DesignPageShell+ title="Agent workload"+ sidebarStorageKey="paperclip.design-proposal.agent-workload-trial.sidebar"+ rightSidebarStorageKey="paperclip.design-proposal.agent-workload-trial.aside"+ sidebar={<DesignSidebar recentTasks={tasks.toSorted(newestFirst).slice(0, 5)} onNewTask={() => openNewIssue()} />}+ rightSidebarTitle="Agent tasks"+ rightSidebarMaximized={maximized}+ rightSidebarControls={<SidePanelWindowControls maximized={maximized} onMaximizedChange={setMaximized} onToggle={dismiss} closeControl="close" />}+ rightSidebar={selectedAgent && <>+ <div className="space-y-3">+ <AgentAvatar agent={selectedAgent} size={48} />+ <h2 className="break-words text-lg font-semibold">{selectedAgent.name}</h2>+ <p className="text-sm text-muted-foreground">{selectedAgent.title}</p>+ <p className="flex items-center gap-2 text-sm text-muted-foreground"><AgentStatusCapsule status={selectedAgent.status} />{stateLabels[workloadState(selectedAgent)]}</p>+ {selectedAgent.status === "paused" && <p className="text-xs text-muted-foreground">Work is paused. Queued tasks stay assigned.</p>}+ </div>+ {selectedTasks.length ? <>+ <TaskSection title="Active tasks" tasks={active} label={`Active tasks for ${selectedAgent.name}`} emptyMessage="No active tasks. This agent is not working on a task right now." />+ <TaskSection title="Recent tasks" tasks={recent} label={`Recent tasks for ${selectedAgent.name}`} emptyMessage="No recent task history yet." />+ <p className="text-xs text-muted-foreground"><span className="font-mono">{selectedTasks.filter(queuedTask).length}</span> queued tasks · Todo and backlog</p>+ </> : <EmptyState icon={ListChecks} message="No tasks yet" description="This agent has no assigned task history. Select another agent to inspect its workload." action="Back to agents" hideActionIcon onAction={dismiss} />}+ </>}+ >+ <section aria-label="Workload summary" className="grid gap-4" style={{ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, var(--sz-160px)), 1fr))" }}>+ <MetricCard appearance="card" icon={Zap} value={agents.filter(agent => workloadState(agent) === "working").length} label="Working agents" description="Currently running" />+ <MetricCard appearance="card" icon={Coffee} value={agents.filter(agent => workloadState(agent) === "idle").length} label="Idle agents" description="Available for work" />+ <MetricCard appearance="card" icon={CirclePause} value={agents.filter(agent => workloadState(agent) === "paused").length} label="Paused agents" description="Work on hold" />+ </section>+ <CollectionToolbar+ ariaLabel="Agent workload controls"+ search={<ToolbarSearch query={query} onQueryChange={changeQuery} inputRef={searchRef} label="Search agents" placeholder="Search agents…" />}+ controls={<TabFilters items={filters} value={filter} onValueChange={changeFilter} label="Agent state" />}+ feedback={<p className="text-sm text-muted-foreground" role="status"><span className="font-mono">{visibleAgents.length} of {agents.length}</span> agents · {selectedAgent ? "Viewing assigned work" : "Select an agent to inspect its tasks"}</p>}+ />+ {agents.length === 0 ? <EmptyState icon={Users} message="No agents in this organization" description="There is no workload to review yet. Choose an organization with agents to inspect their work." />+ : visibleAgents.length === 0 ? <EmptyState icon={SearchX} message="No agents match this view" description="Search by name or role, or clear the current search and state filter." action="Clear filters" hideActionIcon onAction={clear} />+ : <ul aria-label="Agent cards" className="grid gap-4" style={{ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, var(--design-page-aside-min-width)), 1fr))" }}>+ {visibleAgents.map(agent => {+ const assigned = tasks.filter(task => task.assigneeAgentId === agent.id);+ return <li key={agent.id} className="min-w-0">+ <Card elevation={selectedAgent?.id === agent.id ? "middle" : "low"} className="h-full gap-0 p-0">+ <Button variant="ghost"+ ref={element => { if (element) cardRefs.current.set(agent.id, element); else cardRefs.current.delete(agent.id); }}+ className="h-full w-full min-w-0 flex-col items-stretch justify-start gap-4 whitespace-normal rounded-lg p-5 text-left"+ aria-label={`View workload for ${agent.name}`} aria-describedby={`${agent.id}-role ${agent.id}-details`}+ aria-expanded={selectedAgent?.id === agent.id} aria-controls={selectedAgent?.id === agent.id ? "design-page-aside-content" : undefined}+ onClick={() => { setSelectedId(agent.id); setMaximized(false); }}+ >+ <span className="flex items-start gap-3"><AgentAvatar agent={agent} size={48} /><span className="min-w-0 flex-1 space-y-1"><span className="block break-words text-base font-semibold text-foreground">{agent.name}</span><span id={`${agent.id}-role`} className="block text-sm font-normal text-muted-foreground">{agent.title}</span></span></span>+ <span id={`${agent.id}-details`} className="flex flex-col gap-3 text-sm font-normal text-muted-foreground">+ <span className="flex items-center gap-2"><AgentStatusCapsule status={agent.status} />{stateLabels[workloadState(agent)]}</span>+ <span className="flex flex-wrap gap-x-4 gap-y-2 text-xs"><span><span className="font-mono text-foreground">{assigned.filter(activeTask).length}</span> active tasks</span><span><span className="font-mono text-foreground">{assigned.filter(queuedTask).length}</span> queued tasks</span></span>+ </span>+ </Button>+ </Card>+ </li>;+ })}+ </ul>}+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </div>;+}++export function AgentWorkloadTrial(props: AgentWorkloadTrialProps) {+ const { selectedCompanyId } = useCompany();+ return <DesignProposalAccess><AgentWorkloadContent key={selectedCompanyId} {...props} /></DesignProposalAccess>;+}diff --git a/ui/storybook/support/design-proposals/AppShellPreview.tsx b/ui/storybook/support/design-proposals/AppShellPreview.tsxnew file mode 100644index 0000000000..d1318726ec--- /dev/null+++ b/ui/storybook/support/design-proposals/AppShellPreview.tsx@@ -0,0 +1,103 @@+import { CommandPalette } from "@/components/CommandPalette";+import { DesignPageShell } from "@/components/DesignPageShell";+import { DesignSidebar } from "@/components/DesignSidebar";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { Card, CardContent } from "@/components/ui/card";+import { Button } from "@/components/ui/button";+import {+ SidePanelLauncher, SidePanelTabs, SidePanelToggleButton, SidePanelWindowControls,+ useSidePanelTabs, type SidePanelTabRecord,+} from "@/components/side-panel";+import { useDialogActions } from "@/context/DialogContext";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { recentTasks } from "./task-page-data";++export type AppShellPreviewProps = {+ rightSidebar: boolean;+ overflowingContent: boolean;+};++const availableTabs: SidePanelTabRecord<null>[] = ["Properties", "Tasks", "Plan", "Artifacts"].map(label => ({+ id: `app-shell-${label.toLowerCase()}`, type: "placeholder", label, closable: true, payload: null,+}));++function ContentBlocks({ count, label }: { count: number; label: string }) {+ return <div className="space-y-4">+ {Array.from({ length: count }, (_, index) => <Card key={index} elevation="low">+ <CardContent className="space-y-2 text-sm text-muted-foreground">+ <h3 className="font-semibold text-foreground">{label} {index + 1}</h3>+ <p>Placeholder content supplied by the page.</p>+ </CardContent>+ </Card>)}+ </div>;+}++function AppShellContent({ rightSidebar, overflowingContent }: AppShellPreviewProps) {+ const { openNewIssue } = useDialogActions();+ const [panelOpen, setPanelOpen] = useState(true);+ const [maximized, setMaximized] = useState(false);+ const panelToggleRef = useRef<HTMLSpanElement>(null);+ const controller = useSidePanelTabs({ initialState: { tabs: availableTabs, activeTabId: availableTabs[0].id } });+ const activeTab = controller.tabs.find(tab => tab.id === controller.activeTabId);+ const launcherSections = [{+ id: "panels", label: "Panels",+ items: availableTabs.map(tab => ({ id: tab.id, label: tab.label, alreadyOpen: controller.tabs.some(openTab => openTab.id === tab.id) })),+ }];+ const openTab = ({ id }: { id: string }) => {+ const tab = availableTabs.find(candidate => candidate.id === id);+ if (tab) controller.openTab(tab);+ };+ const closePanel = () => {+ setPanelOpen(false);+ setMaximized(false);+ requestAnimationFrame(() => panelToggleRef.current?.querySelector("button")?.focus());+ };+ const variant = rightSidebar ? "three-panes" : "two-panes";+ return <>+ <DesignPageShell+ title="App shell"+ sidebarStorageKey={`paperclip.design-proposal.app-shell.${variant}.width`}+ sidebar={<DesignSidebar recentTasks={recentTasks.map(item => item.issue)} onNewTask={() => openNewIssue()} />}+ headerActions={rightSidebar && <span ref={panelToggleRef}><SidePanelToggleButton open={panelOpen} highlightWhenOpen={false} onToggle={() => panelOpen ? closePanel() : setPanelOpen(true)} /></span>}+ rightSidebarTitle="Right sidebar"+ rightSidebarMaximized={maximized}+ rightSidebarHeader={<SidePanelTabs+ tabs={controller.tabs}+ activeTabId={controller.activeTabId}+ onActiveTabChange={controller.selectTab}+ onCloseTab={controller.closeTab}+ onReorderTabs={controller.reorderTabs}+ appearance="streamlined-task"+ addControl={<SidePanelLauncher+ sections={launcherSections} onSelect={openTab} presentation="popover"+ trigger={<Button type="button" variant="ghost" size="icon-sm"+ className="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground h-(--side-panel-tab-height) w-(--side-panel-tab-height) rounded-md"+ aria-label="Open a new tab"><Plus aria-hidden /></Button>}+ />}+ />}+ rightSidebarControls={<SidePanelWindowControls maximized={maximized} onMaximizedChange={setMaximized} onToggle={closePanel} closeControl="close" />}+ rightSidebar={rightSidebar && panelOpen ? activeTab ? <div+ role="tabpanel" id={`side-panel-content-${activeTab.id}`} aria-labelledby={`side-panel-tab-${activeTab.id}`}+ className="space-y-4" tabIndex={0}+ >+ <p className="text-sm text-muted-foreground">{activeTab.label}: details, context, or tools supplied by the page. This pane scrolls independently.</p>+ <ContentBlocks count={overflowingContent ? 12 : 2} label="Supporting content" />+ </div> : <SidePanelLauncher sections={launcherSections} onSelect={openTab} /> : undefined}+ >+ <section className="max-w-xl space-y-3 text-sm text-muted-foreground">+ <h2 className="text-lg font-semibold text-foreground">Main content</h2>+ <p>{rightSidebar ? "Left sidebar, main content, and right sidebar." : "Left sidebar and main content."} The same shell is used by the Tasks page.</p>+ <p>Resize a sidebar by dragging its divider or using the arrow keys on the focused divider. Double-click a divider to smoothly restore its default width. The main pane fills the remaining space; pane headers stay fixed while their content scrolls.</p>+ </section>+ <ContentBlocks count={overflowingContent ? 20 : 3} label="Page content" />+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </>;+}++export function AppShellPreview(props: AppShellPreviewProps) {+ return <DesignProposalAccess><AppShellContent {...props} /></DesignProposalAccess>;+}+import { useRef, useState } from "react";+import { Plus } from "lucide-react";diff --git a/ui/storybook/support/design-proposals/ButtonSamples.tsx b/ui/storybook/support/design-proposals/ButtonSamples.tsxnew file mode 100644index 0000000000..d3bb22b04d--- /dev/null+++ b/ui/storybook/support/design-proposals/ButtonSamples.tsx@@ -0,0 +1,217 @@+import { useState, type ComponentProps, type ReactNode } from "react";+import type { FeedbackVoteValue } from "@paperclipai/shared";+import { Button } from "@/components/ui/button";+import { ClearErrorButton, PauseResumeButton, RunButton } from "@/components/AgentActionButtons";+import { DesignSidebar } from "@/components/DesignSidebar";+import { ArtifactUploadButton, ArtifactUploadContent } from "@/components/artifacts/ArtifactUploadControls";+import { ExpandRelationListButton } from "@/components/issue-properties/relation-controls";+import { FilePreviewModeToggle, type FilePreviewMode } from "@/components/FilePreviewModeToggle";+import { OutputFeedbackButtons } from "@/components/OutputFeedbackButtons";+import { StarToggle } from "@/components/StarToggle";+import { StatusIcon } from "@/components/StatusIcon";+import { TaskList } from "@/components/TaskList";+import { TaskListToolbar } from "@/components/TaskListToolbar";+import { ToggleSwitch } from "@/components/ui/toggle-switch";+import { FlyoutAppearanceProvider } from "@/components/ui/flyout";+import { TaskChatBubbleActions } from "@/components/task-chat/TaskChatBubbleActions";+import { SidePanelToggleButton, SidePanelWindowControls } from "@/components/side-panel/SidePanelFrame";+import { SidePanelTabs } from "@/components/side-panel/SidePanelTabs";+import { defaultIssueFilterState } from "@/lib/issue-filters";+import type { TaskListView } from "@/lib/task-list-views";+import { storybookAgents, storybookIssueLabels, storybookProjects } from "../../fixtures/paperclipData";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { reviewTaskItems } from "./task-list-data";+import { ButtonSpecimen as SampleButton } from "./ButtonSpecimen";+import { useButtonPreviewStates } from "./useButtonPreviewStates";++type ButtonProps = ComponentProps<typeof Button>;+export type ButtonVariant = NonNullable<ButtonProps["variant"]>;+export type ButtonSize = NonNullable<ButtonProps["size"]>;+// Exhaustive against the shipped Button API: adding a variant/size requires a+// label here, so the sandbox inventory includes new shared primitive options.+export const buttonVariants = {+ default: "Default", cta: "CTA", destructive: "Destructive", outline: "Outline",+ secondary: "Secondary", ghost: "Ghost", link: "Link",+} satisfies Record<ButtonVariant, string>;+export const buttonSizes = {+ default: "Default", xs: "Extra small", sm: "Small", lg: "Large",+ icon: "Icon", "icon-xs": "Icon extra small", "icon-sm": "Icon small", "icon-lg": "Icon large",+} satisfies Record<ButtonSize, string>;+export const buttonStates = { default: "Default", hover: "Hover", "focus-visible": "Keyboard focus", active: "Pressed", disabled: "Disabled", loading: "Loading" } as const;+export const buttonSurfaces = { background: "Main pane / menu", muted: "Left sidebar / raised card", "muted-alt": "Middle card", "background-alt": "Input surface" } as const;+const surfaceClasses = { background: "bg-background", muted: "bg-muted", "muted-alt": "bg-(--muted-alt)", "background-alt": "bg-(--background-alt)" };+export type ButtonPlaygroundSettings = {+ label: string;+ variant: ButtonVariant;+ size: ButtonSize;+ icon: "none" | "leading" | "trailing";+ state: keyof typeof buttonStates;+ surface: keyof typeof buttonSurfaces;+};+export const defaultButtonSettings: ButtonPlaygroundSettings = {+ label: "Create task", variant: "outline", size: "default", icon: "leading", state: "default", surface: "background",+};++function SampleGroup({ title, source, children }: { title: string; source: string; children: ReactNode }) {+ return <section className="min-w-0 space-y-4 border-t border-border pt-6" aria-label={title}>+ <div className="space-y-1">+ <h3 className="text-base font-normal text-foreground">{title}</h3>+ <p className="text-xs text-muted-foreground">{source}</p>+ </div>+ {children}+ </section>;+}++export function ButtonSamples({ settings = defaultButtonSettings }: { settings?: ButtonPlaygroundSettings }) {+ const [action, setAction] = useState("No action yet");+ useButtonPreviewStates();+ const act = (name: string) => setAction(`${name} clicked · preview only`);+ return <div data-testid="proposal-button-samples" className="space-y-8 text-foreground">+ <SampleGroup title="Live specimen" source="Shared Button · current label, variant, size, icon and state controls">+ <div className={`flex flex-wrap items-center gap-4 rounded-lg border border-border p-6 ${surfaceClasses[settings.surface]}`}>+ <SampleButton settings={settings} onClick={() => act(settings.variant)} measure />+ <output className="text-xs text-muted-foreground" aria-live="polite">{action}</output>+ </div>+ <p className="text-xs text-muted-foreground">Surface: <code>--{settings.surface}</code>. Hover, keyboard focus and pressed previews reuse the compiled component state rules. Real pointer and keyboard interactions remain available; states without dedicated styling can look identical.</p>+ {settings.size.startsWith("icon") && <p className="text-xs text-muted-foreground">Icon-only sizes always retain an icon and use the label as their accessible name.</p>}+ <details className="text-xs text-muted-foreground"><summary className="cursor-pointer">Implementation reference</summary>+ <pre className="mt-2 overflow-x-auto rounded-md bg-muted p-3"><code>{`import { Button } from "@/components/ui/button";\n\n<Button variant="${settings.variant}" size="${settings.size}"${settings.state === "disabled" || settings.state === "loading" ? " disabled" : ""}${settings.state === "loading" ? ' aria-busy="true"' : ""}${settings.size.startsWith("icon") ? ` aria-label=${JSON.stringify(settings.label)}` : ""}>\n ${settings.state === "loading" ? "<Loader2 aria-hidden className=\"animate-spin\" />" : settings.size.startsWith("icon") || settings.icon === "leading" ? "<CirclePlus aria-hidden />" : ""}${!settings.size.startsWith("icon") ? ` ${settings.label}` : ""}${settings.icon === "trailing" && !settings.size.startsWith("icon") && settings.state !== "loading" ? " <CirclePlus aria-hidden />" : ""}\n</Button>`}</code></pre>+ <p className="mt-2">Forced interaction states belong to this preview. Use pointer interaction and keyboard focus in the app.</p>+ </details>+ </SampleGroup>+ <SampleGroup title="All button variants" source="ui/src/components/ui/button.tsx · every variant, in default, disabled and loading states">+ <div className="overflow-x-auto">+ <table className="w-full text-left text-sm" data-testid="button-variant-matrix">+ <thead><tr className="border-b border-border text-xs text-muted-foreground">+ {["Variant", "Default", "Disabled", "Loading"].map(label => <th key={label} className="px-3 pb-3 font-normal">{label}</th>)}+ </tr></thead>+ <tbody>{Object.entries(buttonVariants).map(([variant, label]) => <tr key={variant} data-button-variant={variant} className="border-b border-border">+ <th className="px-3 py-4 text-xs font-normal text-muted-foreground">{label}<code className="mt-1 block">{variant}</code></th>+ {(["default", "disabled", "loading"] as const).map(state => <td key={state} className="px-3 py-4">+ <SampleButton settings={settings} variant={variant as ButtonVariant} state={state} onClick={() => act(variant)} />+ </td>)}+ </tr>)}</tbody>+ </table>+ </div>+ </SampleGroup>+ <SampleGroup title="All button sizes" source="All eight shared sizes · current variant, state and icon controls">+ <div className="flex flex-wrap items-end gap-6" data-testid="button-size-matrix">+ {Object.entries(buttonSizes).map(([size, label]) => <div key={size} data-button-size={size} className="space-y-2">+ <SampleButton settings={settings} size={size as ButtonSize} onClick={() => act(size)} measure />+ <p className="text-xs text-muted-foreground">{label}<code className="block">{size}</code></p>+ </div>)}+ </div>+ </SampleGroup>+ <SandboxContexts onAction={act} />+ </div>;+}++function SandboxContexts({ onAction }: { onAction: (label: string) => void }) {+ const [view, setView] = useState<TaskListView>("all");+ const [query, setQuery] = useState("preview");+ const [layout, setLayout] = useState<"list" | "board">("list");+ const [expanded, setExpanded] = useState(true);+ const [filters, setFilters] = useState(defaultIssueFilterState);+ return <FlyoutAppearanceProvider><DesignProposalAccess>+ <div className="space-y-8">+ <SampleGroup title="Task toolbar" source="TaskListToolbar · view menu, clear search, layout toggles, expand/collapse, filters and New Task">+ <TaskListToolbar view={view} onViewChange={setView} query={query} onQueryChange={setQuery}+ layout={layout} onLayoutChange={setLayout} allExpanded={expanded} onToggleExpanded={() => setExpanded(value => !value)}+ onNewTask={() => onAction("New Task")} filters={{ state: filters, onChange: patch => setFilters(current => ({ ...current, ...patch })), activeFilterCount: filters.statuses.length,+ agents: storybookAgents, projects: storybookProjects, labels: storybookIssueLabels }} />+ </SampleGroup>+ <SampleGroup title="Task-list header and popover actions" source="TaskList · sort controls, Columns trigger and Reset defaults inside its menu">+ <TaskList items={reviewTaskItems.slice(0, 3)} />+ </SampleGroup>+ <SampleGroup title="Sidebar controls in context" source="DesignSidebar · organization, global search, New Task, account menu and feedback">+ <div className="flex h-96 w-(--sz-240px) overflow-hidden rounded-lg border border-border bg-muted">+ <DesignSidebar onNewTask={() => onAction("Sidebar New Task")} />+ </div>+ </SampleGroup>+ <SampleGroup title="App-shell controls" source="Shared SidePanel controls · proposal toggle stays quiet until hover/focus">+ <PanelButtons onAction={onAction} />+ </SampleGroup>+ <SampleGroup title="Agent, conversation and attachment controls" source="Shared controls used by sandbox agents, task conversations, property panes and attachments">+ <SharedContexts onAction={onAction} />+ </SampleGroup>+ </div>+ </DesignProposalAccess></FlyoutAppearanceProvider>;+}++function PanelButtons({ onAction }: { onAction: (label: string) => void }) {+ const [open, setOpen] = useState(true);+ const [maximized, setMaximized] = useState(false);+ const [tabs, setTabs] = useState([{ id: "properties", type: "properties", label: "Properties", closable: true }, { id: "tasks", type: "tasks", label: "Tasks", closable: true }]);+ const [active, setActive] = useState("properties");+ return <div className="space-y-4">+ <div className="flex items-center gap-2">+ <SidePanelToggleButton open={open} onToggle={() => setOpen(value => !value)} highlightWhenOpen={false} />+ <SidePanelWindowControls maximized={maximized} onMaximizedChange={setMaximized} closeControl="close" onToggle={() => { setOpen(false); onAction("Close side panel"); }} />+ </div>+ <div className="flex min-w-0 rounded-md border border-border">+ <SidePanelTabs tabs={tabs} activeTabId={active} onActiveTabChange={setActive}+ onCloseTab={id => setTabs(current => current.filter(tab => tab.id !== id))}+ onAddTab={() => { const id = `preview-${tabs.length}`; setTabs(current => [...current, { id, type: "preview", label: `Preview ${current.length + 1}`, closable: true }]); setActive(id); }}+ appearance="streamlined-task" />+ </div>+ </div>;+}++function SharedContexts({ onAction }: { onAction: (label: string) => void }) {+ const [paused, setPaused] = useState(false);+ const [vote, setVote] = useState<FeedbackVoteValue | null>(null);+ const [starred, setStarred] = useState(false);+ const [mode, setMode] = useState<FilePreviewMode>("rendered");+ const [enabled, setEnabled] = useState(false);+ const [status, setStatus] = useState("todo");+ const [relationsExpanded, setRelationsExpanded] = useState(false);+ const [uploadVisible, setUploadVisible] = useState(true);+ return <div className="space-y-6">+ <ContextRow label="Agent actions" source="AgentActionButtons.tsx">+ <RunButton onClick={() => onAction("Run now")} />+ <PauseResumeButton isPaused={paused} onPause={() => setPaused(true)} onResume={() => setPaused(false)} />+ <PauseResumeButton isPaused={!paused} onPause={() => setPaused(true)} onResume={() => setPaused(false)} />+ <ClearErrorButton onClick={() => onAction("Clear error")} />+ <RunButton disabled onClick={() => {}} />+ </ContextRow>+ <ContextRow label="Response and output feedback" source="TaskChatBubbleActions.tsx · OutputFeedbackButtons.tsx">+ <TaskChatBubbleActions copyText="Synthetic agent response for button review." feedback={{ activeVote: vote, sharingPreference: "allowed", termsUrl: null, onVote: async value => setVote(value) }} />+ <OutputFeedbackButtons inline activeVote={vote} sharingPreference="allowed" onVote={async value => setVote(value)} />+ </ContextRow>+ <ContextRow label="Favorite · off / on / pending / error / row" source="StarToggle.tsx">+ <StarToggle size="button" resourceName="preview" starred={starred} onToggle={setStarred} />+ <StarToggle size="button" resourceName="selected preview" starred onToggle={value => onAction(`Star ${value}`)} />+ <StarToggle size="button" resourceName="pending preview" starred pending onToggle={() => {}} />+ <StarToggle size="button" resourceName="error preview" starred error onToggle={() => onAction("Retry star")} />+ <StarToggle size="row" resourceName="row preview" starred={starred} revealClassName="opacity-100" onToggle={setStarred} />+ </ContextRow>+ <ContextRow label="File display and switches" source="FilePreviewModeToggle.tsx · ui/toggle-switch.tsx">+ <FilePreviewModeToggle mode={mode} onChange={setMode} label="File display" />+ <ToggleSwitch checked={enabled} onCheckedChange={setEnabled} aria-label="Enable preview" />+ <ToggleSwitch size="lg" checked={enabled} onCheckedChange={setEnabled} aria-label="Enable large preview" />+ <ToggleSwitch checked disabled onCheckedChange={() => {}} aria-label="Disabled preview" />+ </ContextRow>+ <ContextRow label="Task status picker" source="StatusIcon.tsx · task detail and properties">+ <StatusIcon status={status} onChange={setStatus} /><StatusIcon status={status} showLabel onChange={setStatus} />+ </ContextRow>+ <ContextRow label="Upload, retry and dismiss" source="artifacts/ArtifactUploadControls.tsx">+ <ArtifactUploadButton onUpload={files => onAction(`Selected ${files.length} files`)} />+ <ArtifactUploadContent entries={uploadVisible ? [{ id: "preview-upload", filename: "preview.txt", status: "error", error: "Synthetic upload failure" }] : []}+ onRetry={() => onAction("Retry upload")} onDismiss={() => setUploadVisible(false)} />+ </ContextRow>+ <ContextRow label="Expand related tasks" source="issue-properties/relation-controls.tsx">+ <ExpandRelationListButton hiddenCount={4} expanded={relationsExpanded} onClick={() => setRelationsExpanded(value => !value)} />+ </ContextRow>+ <ContextRow label="Link rendered through Button" source="ui/button.tsx · asChild">+ <Button variant="link" asChild><a href="#button-playground-top">Back to playground</a></Button>+ </ContextRow>+ </div>;+}++function ContextRow({ label, source, children }: { label: string; source: string; children: ReactNode }) {+ return <div className="space-y-3">+ <p className="text-sm text-foreground">{label}</p>+ <div className="flex flex-wrap items-center gap-3">{children}</div>+ <p className="text-xs text-muted-foreground">{source}</p>+ </div>;+}diff --git a/ui/storybook/support/design-proposals/ButtonSpecimen.tsx b/ui/storybook/support/design-proposals/ButtonSpecimen.tsxnew file mode 100644index 0000000000..acfa10038e--- /dev/null+++ b/ui/storybook/support/design-proposals/ButtonSpecimen.tsx@@ -0,0 +1,58 @@+import { useEffect, useRef, useState } from "react";+import { CirclePlus, Loader2 } from "lucide-react";+import { Button } from "@/components/ui/button";+import type { ButtonPlaygroundSettings, ButtonSize, ButtonVariant } from "./ButtonSamples";++type Measurements = { dimensions: string; type: string; padding: string; radius: string; icon: string; colors: string };+const round = (value: number) => Math.round(value * 10) / 10;++export function ButtonSpecimen({ settings, variant = settings.variant, size = settings.size, state = settings.state, onClick, measure = false }: {+ settings: ButtonPlaygroundSettings; variant?: ButtonVariant; size?: ButtonSize;+ state?: ButtonPlaygroundSettings["state"]; onClick: () => void; measure?: boolean;+}) {+ const ref = useRef<HTMLButtonElement>(null);+ const [measurements, setMeasurements] = useState<Measurements>();+ const iconOnly = size.startsWith("icon");+ const busy = state === "loading";+ const read = () => {+ const element = ref.current;+ if (!measure || !element) return;+ const box = element.getBoundingClientRect();+ const css = getComputedStyle(element);+ const icon = element.querySelector("svg")?.getBoundingClientRect();+ const next = {+ dimensions: `${round(box.width)} × ${round(box.height)}px`,+ type: `${css.fontSize} / ${css.lineHeight} · weight ${css.fontWeight}`,+ padding: `${css.paddingLeft} left · ${css.paddingRight} right · ${css.paddingTop} top · ${css.paddingBottom} bottom`,+ radius: css.borderRadius,+ icon: icon ? `${round(icon.width)} × ${round(icon.height)}px` : "None",+ colors: `${css.color} on ${css.backgroundColor}`,+ };+ setMeasurements(previous => JSON.stringify(previous) === JSON.stringify(next) ? previous : next);+ };+ useEffect(() => {+ if (!measure || !ref.current) return;+ let frame = requestAnimationFrame(read);+ const observer = new ResizeObserver(() => { cancelAnimationFrame(frame); frame = requestAnimationFrame(read); });+ observer.observe(ref.current);+ return () => { cancelAnimationFrame(frame); observer.disconnect(); };+ }, [measure, variant, size, state, settings.icon, settings.label, settings.surface]);+ return <div className="min-w-0 space-y-3">+ <Button ref={ref} variant={variant} size={size} disabled={state === "disabled" || busy} aria-busy={busy || undefined}+ data-button-preview-state={state} aria-label={iconOnly ? settings.label : undefined} onClick={onClick}+ onMouseEnter={read} onMouseLeave={() => requestAnimationFrame(read)} onFocus={read} onBlur={() => requestAnimationFrame(read)} onTransitionEnd={read}>+ {busy ? <Loader2 aria-hidden className="animate-spin" /> : iconOnly || settings.icon === "leading" ? <CirclePlus aria-hidden /> : null}+ {!iconOnly ? settings.label : null}+ {!busy && !iconOnly && settings.icon === "trailing" ? <CirclePlus aria-hidden /> : null}+ </Button>+ {measurements && <>+ <output className="block text-xs text-muted-foreground" data-testid="button-pixel-size">{measurements.dimensions}</output>+ <details className="text-xs text-muted-foreground">+ <summary className="cursor-pointer">Computed style</summary>+ <dl className="mt-2 space-y-2" aria-label="Button measurements">+ {Object.entries({ Typography: measurements.type, Padding: measurements.padding, Radius: measurements.radius, Icon: measurements.icon, Colors: measurements.colors }).map(([label, value]) => <div key={label}><dt className="font-normal text-foreground">{label}</dt><dd className="break-words">{value}</dd></div>)}+ </dl>+ </details>+ </>}+ </div>;+}diff --git a/ui/storybook/support/design-proposals/ButtonUsage.tsx b/ui/storybook/support/design-proposals/ButtonUsage.tsxnew file mode 100644index 0000000000..4b451898ca--- /dev/null+++ b/ui/storybook/support/design-proposals/ButtonUsage.tsx@@ -0,0 +1,44 @@+import { useState } from "react";+import inventory from "virtual:paperclip-button-usage";+import { Input } from "@/components/ui/input";+import type { ButtonPlaygroundSettings } from "./ButtonSamples";++export function ButtonUsage({ settings }: { settings: ButtonPlaygroundSettings }) {+ const [filter, setFilter] = useState("");+ const [matchSpecimen, setMatchSpecimen] = useState(false);+ const scoped = inventory.entries;+ const matches = scoped.filter(entry => (!matchSpecimen || entry.variant === settings.variant && entry.size === settings.size)+ && `${entry.file} ${entry.variant} ${entry.size}`.toLowerCase().includes(filter.toLowerCase()));+ const files = new Set(scoped.map(entry => entry.file));+ const dynamic = scoped.filter(entry => entry.variant.startsWith("dynamic") || entry.size.startsWith("dynamic"));+ const locations = new Map<string, typeof matches>();+ for (const entry of matches) locations.set(entry.file, [...(locations.get(entry.file) ?? []), entry]);+ return <section className="space-y-4 rounded-lg border border-border p-6" aria-label="Button usage inventory">+ <div className="space-y-2">+ <h2 className="text-xl font-semibold">Where it is used</h2>+ <p className="text-sm text-muted-foreground">Direct references to the shared Button in production-source directory <code>ui/src</code>, scanned from this checkout when Storybook builds. Counts describe source locations; loops, wrappers, feature gates and legacy routes affect rendered totals.</p>+ </div>+ <dl className="grid gap-4 text-sm sm:grid-cols-2 lg:grid-cols-4" data-testid="button-usage-stats">+ <div><dt className="text-muted-foreground">Button call sites</dt><dd className="text-2xl font-semibold">{scoped.length}</dd></div>+ <div><dt className="text-muted-foreground">Source files</dt><dd className="text-2xl font-semibold">{files.size}</dd></div>+ <div><dt className="text-muted-foreground">Dynamic props / spreads</dt><dd className="text-2xl font-semibold">{dynamic.length}</dd></div>+ <div><dt className="text-muted-foreground">Selected style + size</dt><dd className="text-2xl font-semibold">{scoped.filter(entry => entry.variant === settings.variant && entry.size === settings.size).length}</dd></div>+ </dl>+ <div className="flex flex-wrap items-center gap-4">+ <Input className="max-w-sm" aria-label="Find button usage" placeholder="Find a page, component, style or size…" value={filter} onChange={event => setFilter(event.target.value)} />+ <label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={matchSpecimen} onChange={event => setMatchSpecimen(event.target.checked)} />Match selected style and size</label>+ </div>+ <p className="text-xs text-muted-foreground" role="status">{matches.length} matching call sites in {locations.size} files. Dynamic values are listed separately and cannot be assigned to a specific style or size.</p>+ <details>+ <summary className="cursor-pointer text-sm font-normal">Browse source locations</summary>+ <div className="mt-4 max-h-96 space-y-4 overflow-auto text-xs">+ {[...locations].map(([file, entries]) => <div key={file} className="space-y-1">+ <code className="break-all text-foreground">{file}</code>+ <p className="break-words text-muted-foreground">{entries.map(entry => `L${entry.line}: ${entry.variant} / ${entry.size}`).join(" · ")}</p>+ </div>)}+ {!matches.length && <p className="text-muted-foreground">No direct references match these filters.</p>}+ </div>+ </details>+ <p className="text-xs text-muted-foreground">App source includes staged components and alternate production implementations. Tests, Storybook files, native HTML buttons and indirect uses through wrapper components are excluded. These counts measure adoption in code, not usage analytics.</p>+ </section>;+}diff --git a/ui/storybook/support/design-proposals/ButtonsPlayground.tsx b/ui/storybook/support/design-proposals/ButtonsPlayground.tsxnew file mode 100644index 0000000000..9e40c330be--- /dev/null+++ b/ui/storybook/support/design-proposals/ButtonsPlayground.tsx@@ -0,0 +1,73 @@+import { useEffect, useState } from "react";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { NativeSelect } from "@/components/ui/select";+import { ButtonSamples, buttonSizes, buttonStates, buttonSurfaces, buttonVariants, defaultButtonSettings, type ButtonPlaygroundSettings } from "./ButtonSamples";++export type ButtonsPlaygroundProps = ButtonPlaygroundSettings & {+ onSettingsChange?: (settings: Partial<ButtonsPlaygroundProps>) => void;+};++export function ButtonsPlayground({ onSettingsChange, ...settings }: ButtonsPlaygroundProps) {+ const [sizeHeights, setSizeHeights] = useState<Record<string, number>>({});+ useEffect(() => {+ const buttons = document.querySelectorAll<HTMLElement>('[data-testid="proposal-button-samples"] [data-button-size] [data-slot="button"]');+ const measure = () => {+ const next = Object.fromEntries(Array.from(buttons, button => [button.dataset.size!, Math.round(button.getBoundingClientRect().height * 10) / 10]));+ setSizeHeights(previous => JSON.stringify(previous) === JSON.stringify(next) ? previous : next);+ };+ let frame = 0;+ const observer = new ResizeObserver(() => { cancelAnimationFrame(frame); frame = requestAnimationFrame(measure); });+ buttons.forEach(button => observer.observe(button));+ measure();+ return () => { observer.disconnect(); cancelAnimationFrame(frame); };+ }, []);+ return <main id="button-playground-top" data-testid="buttons-playground" className="min-h-screen bg-background px-6 py-10 text-foreground">+ <div className="mx-auto max-w-7xl space-y-10">+ <header className="space-y-3">+ <p className="text-xs text-muted-foreground">Paperclip · Design proposals · Components</p>+ <h1 className="text-3xl font-semibold">Buttons playground</h1>+ <p className="max-w-3xl text-sm leading-relaxed text-muted-foreground">Style the buttons and contextual controls used in the design sandbox. Every example uses its shared component with the sandbox’s proposal theme. Hover and Tab through the controls; actions use local fixture state.</p>+ </header>+ <fieldset className="sticky top-0 z-20 flex flex-wrap items-end gap-4 rounded-lg border border-border bg-background p-4" aria-label="Button playground controls">+ <label className="flex flex-col gap-2 text-xs text-muted-foreground">Label+ <Input aria-label="Button label" value={settings.label} maxLength={80} onChange={event => onSettingsChange?.({ label: event.target.value })} className="w-48" />+ </label>+ <label className="flex flex-col gap-2 text-xs text-muted-foreground">Style+ <NativeSelect aria-label="Button variant" value={settings.variant} onChange={event => onSettingsChange?.({ variant: event.target.value as ButtonsPlaygroundProps["variant"] })}>+ {Object.entries(buttonVariants).map(([value, label]) => <option key={value} value={value}>{label}</option>)}+ </NativeSelect>+ </label>+ <label className="flex flex-col gap-2 text-xs text-muted-foreground">Size+ <NativeSelect aria-label="Button size" value={settings.size} onChange={event => onSettingsChange?.({ size: event.target.value as ButtonsPlaygroundProps["size"] })}>+ {Object.entries(buttonSizes).map(([value, label]) => <option key={value} value={value}>{label}{sizeHeights[value] ? ` · ${sizeHeights[value]}px high` : ""}</option>)}+ </NativeSelect>+ </label>+ <label className="flex flex-col gap-2 text-xs text-muted-foreground">Icon+ <NativeSelect aria-label="Button icon" value={settings.icon} onChange={event => onSettingsChange?.({ icon: event.target.value as ButtonsPlaygroundProps["icon"] })}>+ <option value="none">None</option><option value="leading">Leading</option><option value="trailing">Trailing</option>+ </NativeSelect>+ </label>+ <label className="flex flex-col gap-2 text-xs text-muted-foreground">Specimen state+ <NativeSelect aria-label="Button state" value={settings.state} onChange={event => onSettingsChange?.({ state: event.target.value as ButtonsPlaygroundProps["state"] })}>+ {Object.entries(buttonStates).map(([value, label]) => <option key={value} value={value}>{label}</option>)}+ </NativeSelect>+ </label>+ <label className="flex flex-col gap-2 text-xs text-muted-foreground">Preview surface+ <NativeSelect aria-label="Button surface" value={settings.surface} onChange={event => onSettingsChange?.({ surface: event.target.value as ButtonsPlaygroundProps["surface"] })}>+ {Object.entries(buttonSurfaces).map(([value, label]) => <option key={value} value={value}>{label}</option>)}+ </NativeSelect>+ </label>+ <Button variant="outline" onClick={() => onSettingsChange?.(defaultButtonSettings)}>Reset controls</Button>+ <p className="w-full text-xs text-muted-foreground">Size labels show measured heights. Specimens report their actual width, padding, typography, icon size and colors. The inventory below uses the full available width.</p>+ </fieldset>+ <section className="min-w-0 space-y-6" aria-labelledby="sandbox-buttons-title">+ <header className="space-y-2"><h2 id="sandbox-buttons-title" className="text-2xl font-semibold">Sandbox buttons</h2>+ <p className="text-sm text-muted-foreground">Shared styles and sizes, followed by task, navigation, pane, agent, conversation and attachment controls in context.</p>+ </header>+ <ButtonSamples settings={settings} />+ </section>+ <p className="text-xs leading-relaxed text-muted-foreground">Scope: the sandbox’s shared button styles and sizes, plus the contextual controls shown here. Examples use synthetic data and local callbacks; they do not run agents, upload files or persist product changes. This is a styling workbench, not a repository-wide usage audit.</p>+ </div>+ </main>;+}diff --git a/ui/storybook/support/design-proposals/ColorsPreview.tsx b/ui/storybook/support/design-proposals/ColorsPreview.tsxnew file mode 100644index 0000000000..5fdf7b3588--- /dev/null+++ b/ui/storybook/support/design-proposals/ColorsPreview.tsx@@ -0,0 +1,122 @@+import { useLayoutEffect, useState } from "react";+import { useTheme } from "@/context/ThemeContext";+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";+import { Input } from "@/components/ui/input";+import { TaskList } from "@/components/TaskList";+import { readTask, unreadTask } from "./task-list-data";++export type ColorsPreviewProps = { section: "tokens" | "surfaces" | "interaction" };++const source = "https://app.paper.design/file/01KZ5QQTS4TG2VADP7ZVGJNQY4/p-L-0/3LXU-2";+const colors = [+ { name: "foreground", usage: "Headings, header labels, emphasized text and unread task titles." },+ { name: "background", usage: "Center and right panes; lowest card surface; popovers and menus." },+ { name: "background-alt", usage: "Text inputs and search fields." },+ { name: "muted", usage: "Left sidebar and highest card surface." },+ { name: "muted-highlight", usage: "Hover backgrounds; existing selected and sorted states keep their documented behavior." },+ { name: "muted-alt", usage: "Middle card surface." },+ { name: "muted-foreground", usage: "Default text, secondary labels, metadata and read task titles." },+ { name: "border", usage: "Shared pane dividers, field outlines and card borders. Uses the active production light border or the translucent Paper dark border." },+ { name: "ring", usage: "Production ring in light mode; foreground in dark mode. Pane resize controls retain their own highlight." },+ { name: "focus-ring-halo", usage: "Soft outer focus halo: active ring at 20% opacity, surrounding the focus edge." },+] as const;++function TokenReference() {+ const { theme } = useTheme();+ const [values, setValues] = useState<Record<string, string>>({});+ useLayoutEffect(() => {+ const styles = getComputedStyle(document.documentElement);+ setValues(Object.fromEntries(colors.map(({ name }) => [name, styles.getPropertyValue(`--${name}`).trim()])));+ }, [theme]);+ return (+ <div className="overflow-x-auto">+ <table className="w-full min-w-2xl text-left text-sm">+ <caption className="pb-6 text-left text-muted-foreground">Values come directly from the active CSS token layer. Switch Light / Dark in the Storybook toolbar to compare.</caption>+ <thead className="border-b border-border text-foreground"><tr>+ {["Swatch", "Code token", "CSS value", "Use"].map(label => <th key={label} scope="col" className="px-3 py-3 font-semibold">{label}</th>)}+ </tr></thead>+ <tbody>{colors.map(({ name, usage }) => <tr key={name} data-token={name} className="border-b border-border align-top">+ <td className="px-3 py-4"><div aria-hidden className="h-12 w-16 overflow-hidden rounded-md border border-border bg-background"><div className="h-full w-full" style={{ backgroundColor: `var(--${name})` }} /></div></td>+ <th scope="row" className="px-3 py-4 font-normal"><code className="block whitespace-nowrap text-foreground">--{name}</code><span className="mt-1 block whitespace-nowrap text-xs text-muted-foreground">{theme === "light" ? "Production light palette" : name === "ring" || name === "focus-ring-halo" ? "Derived from dark-color-foreground" : `Paper reference: dark-color-${name}`}</span></th>+ <td className="whitespace-nowrap px-3 py-4"><code data-token-value>{values[name] ?? "…"}</code></td>+ <td className="px-3 py-4 leading-relaxed">{usage}</td>+ </tr>)}</tbody>+ </table>+ </div>+ );+}++function Surfaces() {+ return (+ <div className="flex flex-col gap-10">+ <section className="flex flex-col gap-4" aria-labelledby="pane-surfaces">+ <h2 id="pane-surfaces" className="text-lg font-semibold text-foreground">Pane surfaces</h2>+ <div className="grid gap-4 md:grid-cols-3">+ {[+ { label: "Left sidebar", token: "design-sidebar-surface" },+ { label: "Center pane", token: "background" },+ { label: "Right sidebar", token: "background" },+ ].map(({ label, token }) => <div key={label} className="flex min-h-32 flex-col justify-end gap-2 rounded-lg border border-border p-6" data-pane={label} style={{ backgroundColor: `var(--${token})` }}>+ <h3 className="text-sm font-semibold text-foreground">{label}</h3><code className="text-xs">--{token}</code>+ </div>)}+ </div>+ </section>+ <section className="flex flex-col gap-4" aria-labelledby="card-surfaces">+ <h2 id="card-surfaces" className="text-lg font-semibold text-foreground">Card elevation</h2>+ <p className="text-sm leading-relaxed">These use the existing Card component and one shared border. Dark mode has three distinct fills; light mode maps middle and high to the same production neutral surface.</p>+ <div className="grid gap-4 md:grid-cols-3">+ {[+ { elevation: "low", label: "Lowest", token: "background", example: "Task summary" },+ { elevation: "middle", label: "Middle", token: "muted-alt", example: "Review details" },+ { elevation: "high", label: "Highest", token: "muted", example: "Related work" },+ ].map(({ elevation, label, token, example }) => <Card key={elevation} elevation={elevation as "low" | "middle" | "high"}>+ <CardHeader><CardTitle className="text-sm">{label} · {example}</CardTitle><CardDescription><code>--{token}</code></CardDescription></CardHeader>+ <CardContent className="text-sm leading-relaxed">Content uses the active card foreground. Each card uses <code>--border</code>.</CardContent>+ </Card>)}+ </div>+ </section>+ <section className="flex flex-col gap-4" aria-labelledby="input-surfaces">+ <h2 id="input-surfaces" className="text-lg font-semibold text-foreground">Text inputs & search</h2>+ <p className="text-sm">Both use <code>--background-alt</code> and the shared border.</p>+ <div className="grid max-w-3xl gap-6 md:grid-cols-2">+ <label className="flex flex-col gap-2 text-sm">Task name<Input defaultValue="Improve connector reliability" /></label>+ <label className="flex flex-col gap-2 text-sm">Search tasks<Input type="search" placeholder="Search tasks…" /></label>+ </div>+ </section>+ </div>+ );+}++function TextAndInteraction() {+ return (+ <div className="flex flex-col gap-10">+ <section className="flex flex-col gap-3" aria-labelledby="text-hierarchy">+ <h2 id="text-hierarchy" className="text-lg font-semibold text-foreground">Default and emphasized text</h2>+ <p className="text-sm leading-relaxed">Most text uses muted foreground. <strong className="font-semibold text-foreground">Headings, header labels and emphasized text use foreground.</strong></p>+ <p className="text-sm leading-relaxed">Read task titles are regular and muted; unread titles are semibold and foreground. Hover makes either title foreground while preserving its weight.</p>+ </section>+ <section className="flex flex-col gap-4" aria-labelledby="interaction-example">+ <h2 id="interaction-example" className="text-lg font-semibold text-foreground">Shared task list & Columns menu</h2>+ <p className="text-sm leading-relaxed">Hover a row to see muted-highlight. Open Columns to inspect the same colors in a portaled menu. Keyboard focus keeps its visible indicator.</p>+ <TaskList initialColumns={["task", "taskId"]} items={[{ issue: readTask }, { issue: unreadTask, unread: true }]} />+ </section>+ </div>+ );+}++/** Documentation composes real primitives; all swatches and samples use CSS tokens. */+export function ColorsPreview({ section }: ColorsPreviewProps) {+ return (+ <main className="min-h-screen bg-background px-6 py-10 text-muted-foreground sm:px-10" data-testid="color-foundations-preview">+ <div className="mx-auto flex max-w-6xl flex-col gap-10">+ <header className="flex flex-col gap-3">+ <p className="text-xs">Design proposals · Foundations</p>+ <h1 className="text-3xl font-semibold tracking-tight text-foreground">Colors</h1>+ <p className="max-w-3xl text-sm leading-relaxed">Light mode uses the production palette. Dark mode uses the Paper proposal palette. Both share semantic tokens, so components, menus and conversation states follow the selected theme.</p>+ <a className="w-fit text-sm underline underline-offset-4 hover:text-foreground" href={source} target="_blank" rel="noreferrer">View the Paper color reference</a>+ </header>+ {section === "tokens" ? <TokenReference /> : section === "surfaces" ? <Surfaces /> : <TextAndInteraction />}+ </div>+ </main>+ );+}diff --git a/ui/storybook/support/design-proposals/ConversationTypeSpec.tsx b/ui/storybook/support/design-proposals/ConversationTypeSpec.tsxnew file mode 100644index 0000000000..2fe6a252eb--- /dev/null+++ b/ui/storybook/support/design-proposals/ConversationTypeSpec.tsx@@ -0,0 +1,146 @@+import { useLayoutEffect, useRef, useState } from "react";+import { useSearchParams } from "react-router-dom";+import DesignSandboxTaskThread from "@/components/design-sandbox/DesignSandboxTaskThread";+import { THREAD_PREVIEW_CASES } from "@/components/design-sandbox/task-thread-fixtures";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { NativeSelect } from "@/components/ui/select";+import { storybookAgents } from "../../fixtures/paperclipData";+import { measureConversationType, type ConversationTypeInventory, type ConversationTypeRole } from "./conversation-type-inventory";++const agent = { ...storybookAgents[0]!, name: "Connector engineer" };+const empty: ConversationTypeInventory = { roles: [], states: [], capturedAt: "" };+const familyName = (family: string) => family.includes("Paper Mono") ? "Paper Mono" : family.includes("Inter") ? "Inter Variable" : family;+function Metrics({ role }: { role: ConversationTypeRole }) {+ return <div className="flex flex-col gap-1 text-xs leading-relaxed" data-conversation-type-metrics>+ <p className="font-mono text-foreground">{role.size} / {role.leading}</p>+ <p>{familyName(role.family)} · weight {role.weight}</p><p>Tracking {role.tracking} · {role.emphasis}</p>+ <p className="break-words font-mono">{role.color} · opacity {role.opacity}</p>+ </div>;+}++export function ConversationTypeSpec() {+ const root = useRef<HTMLDivElement>(null);+ const [inventory, setInventory] = useState(empty);+ const [query, setQuery] = useState("");+ const [area, setArea] = useState("All surfaces");+ const [sharedOnly, setSharedOnly] = useState(false);+ const [expanding, setExpanding] = useState(false);+ const [, setParams] = useSearchParams();+ const measure = () => { if (root.current) setInventory(measureConversationType(root.current)); };+ useLayoutEffect(() => {+ let disposed = false;+ let frame = 0;+ void document.fonts.ready.then(() => { if (!disposed) frame = requestAnimationFrame(measure); });+ return () => { disposed = true; cancelAnimationFrame(frame); };+ }, []);+ const groups = new Map<string, ConversationTypeRole[]>();+ inventory.roles.forEach(role => groups.set(role.metricKey, [...(groups.get(role.metricKey) ?? []), role]));+ const candidates = [...groups.values()].filter(roles => new Set(roles.map(role => role.area)).size > 1);+ const candidateKeys = new Set(candidates.flatMap(roles => roles.map(role => role.key)));+ const roles = inventory.roles.filter(role => (area === "All surfaces" || role.area === area) && (!sharedOnly || candidateKeys.has(role.key)) && `${role.name} ${role.text} ${role.sources.join(" ")} ${role.size} ${role.leading}`.toLowerCase().includes(query.toLowerCase()));+ const sizes = [...new Set(inventory.roles.map(role => role.size))].sort((a, b) => parseFloat(b) - parseFloat(a));+ const families = [...new Set(inventory.roles.map(role => role.family))];+ const weights = [...new Set(inventory.roles.map(role => role.weight))].sort();+ const expandDetails = async () => {+ setExpanding(true);+ // Expand only read-only conversation disclosures. Never click decision,+ // send, stop, feedback or other action controls.+ const selectors = [+ 'button[data-testid="task-chat-turn-summary"][aria-expanded="false"]',+ 'button[data-testid="task-chat-activity-phase-toggle"][aria-expanded="false"]',+ '[data-activity-item-id] > button[aria-expanded="false"]',+ '[data-testid="task-chat-thinking"] > button[aria-expanded="false"]',+ '[data-testid="task-chat-tool-card"] > button[aria-expanded="false"]',+ '[data-testid="task-chat-system-notice"] button[aria-expanded="false"]',+ '[data-testid="task-chat-collapsible-marker"] button[aria-expanded="false"]',+ ].join(",");+ for (let depth = 0; depth < 6 && root.current; depth++) {+ root.current.querySelectorAll<HTMLDetailsElement>("details:not([open])").forEach(detail => { detail.open = true; });+ const toggles = root.current.querySelectorAll<HTMLButtonElement>(selectors);+ if (!toggles.length) break;+ toggles.forEach(button => button.click());+ await new Promise<void>(resolve => requestAnimationFrame(() => resolve()));+ }+ measure();+ setExpanding(false);+ };+ const inspect = (state: string) => {+ setParams(params => { const next = new URLSearchParams(params); next.set("threadPreview", state); return next; }, { replace: true });+ root.current?.scrollIntoView({ block: "start" });+ };++ return <main data-testid="conversation-type-spec" className="min-h-screen bg-background px-6 py-10 font-sans text-muted-foreground sm:px-10">+ <div className="mx-auto flex max-w-6xl flex-col gap-12">+ <header className="flex flex-col gap-4">+ <p className="text-xs">Design proposals · Foundations · Typography</p>+ <h1 className="text-3xl font-semibold tracking-tight text-foreground">Conversation type spec</h1>+ <p className="max-w-3xl text-sm leading-relaxed">Inspect the consolidated typography in Conversation styles. This inventory measures text inside the sandbox’s actual conversation composition, across its {THREAD_PREVIEW_CASES.length} synthetic states. Specimens below copy those measured type properties; the interactive shared renderer remains available in context.</p>+ <nav aria-label="Conversation type sections" className="flex flex-wrap gap-x-6 gap-y-2 text-sm">+ {[["conversation-sizes", "Size inventory"], ["conversation-families", "Families & weights"], ["conversation-usage", "Usage inventory"], ["conversation-candidates", "Consolidation candidates"], ["conversation-context", "In context"]].map(([id, label]) => <a key={id} href={`#${id}`} className="underline underline-offset-4 hover:text-foreground">{label}</a>)}+ </nav>+ <p role="status" data-testid="conversation-type-census" className="text-xs">{inventory.states.length} states measured · {inventory.roles.length} role/style combinations · {groups.size} type recipes before color differences</p>+ </header>++ <section aria-labelledby="conversation-sizes" className="flex flex-col gap-5">+ <div><h2 id="conversation-sizes" className="text-lg font-semibold text-foreground">Observed text sizes</h2><p className="mt-2 text-sm leading-relaxed">Current browser values, not a proposed replacement ramp. One size can still have several line heights, weights or contrast treatments.</p></div>+ <div className="rounded-lg border border-border">{sizes.map(size => {+ const matches = inventory.roles.filter(role => role.size === size);+ return <div key={size} data-conversation-size={size} className="grid gap-4 border-b border-border px-5 py-5 last:border-b-0 md:grid-cols-3">+ <p style={{ fontSize: size }} className="self-center text-foreground">{size} · Aa</p>+ <div className="text-sm leading-relaxed"><p>{[...new Set(matches.map(role => role.area))].join(" · ")}</p><p className="mt-2 text-xs">{[...new Set(matches.map(role => role.leading))].join(" / ")} leading · {matches.length} role/style combinations</p></div>+ <p className="self-center text-xs leading-relaxed">{matches[0]?.text}</p>+ </div>;+ })}</div>+ </section>++ <section aria-labelledby="conversation-families" className="flex flex-col gap-5">+ <h2 id="conversation-families" className="text-lg font-semibold text-foreground">Families & weights</h2>+ <div className="grid gap-4 md:grid-cols-2">{families.map(family => <article key={family} className="flex min-w-0 flex-col gap-3 rounded-lg border border-border p-5">+ <h3 className="text-sm font-semibold text-foreground">{familyName(family)}</h3>+ <p className="break-words text-base text-foreground" style={{ fontFamily: family }}>The agent checked ui/src/components/ and prepared a reply.</p>+ <code className="break-words text-xs">{family}</code>+ <p className="text-xs leading-relaxed">{[...new Set(inventory.roles.filter(role => role.family === family).map(role => role.area))].join(" · ")}</p>+ </article>)}</div>+ <div className="flex flex-wrap gap-8 rounded-lg border border-border p-5">{weights.map(weight => <p key={weight} data-conversation-weight={weight} className="text-sm text-foreground" style={{ fontWeight: weight }}>Weight {weight} · conversation text</p>)}</div>+ </section>++ <section aria-labelledby="conversation-usage" className="flex flex-col gap-5">+ <div><h2 id="conversation-usage" className="text-lg font-semibold text-foreground">Usage inventory</h2><p className="mt-2 text-sm leading-relaxed">Each row is a surface plus a distinct measured type treatment. Compare samples, line height, weight, color and source recipes. Several rows may share metrics while keeping different semantic colors.</p></div>+ <div className="flex flex-wrap items-end gap-4">+ <label className="flex min-w-0 flex-1 flex-col gap-2 text-xs">Find a conversation text role<Input type="search" placeholder="Search roles, text, sizes or sources…" value={query} onChange={event => setQuery(event.target.value)} /></label>+ <label className="flex flex-col gap-2 text-xs">Surface<NativeSelect value={area} onChange={event => setArea(event.target.value)}><option>All surfaces</option>{[...new Set(inventory.roles.map(role => role.area))].map(value => <option key={value}>{value}</option>)}</NativeSelect></label>+ <label className="flex h-10 items-center gap-2 text-sm"><input type="checkbox" checked={sharedOnly} onChange={event => setSharedOnly(event.target.checked)} />Shared metrics only</label>+ </div>+ <p className="text-xs">{roles.length} of {inventory.roles.length} role/style combinations · captured {inventory.capturedAt || "after fonts load"}</p>+ <div className="border-t border-border">{roles.map(role => <article key={role.key} data-conversation-type-role={role.name} className="grid min-w-0 gap-5 border-b border-border py-6 md:grid-cols-3">+ <div className="min-w-0"><p className="text-xs">{role.area}</p><h3 className="mt-1 text-sm font-semibold text-foreground">{role.name}</h3><p className="mt-2 text-xs">Seen in {role.states.length} states</p>+ <details className="mt-3 text-xs"><summary className="cursor-pointer hover:text-foreground">Source & recipe</summary>{role.sources.map(source => <code key={source} className="mt-2 block break-words leading-relaxed">{source}</code>)}<p className="mt-3">Text element and ancestor classes (nearest first):</p>{role.recipes.map((recipe, index) => <code key={index} className="mt-2 block break-words leading-relaxed">{recipe}</code>)}</details>+ <details className="mt-3 text-xs"><summary className="cursor-pointer hover:text-foreground">Example states</summary><div className="mt-2 flex flex-col items-start gap-2">{role.states.map(state => <button key={state} className="text-left underline underline-offset-4 hover:text-foreground" onClick={() => inspect(state)}>{THREAD_PREVIEW_CASES.find(example => example.id === state)?.label ?? state}</button>)}</div></details>+ </div>+ <p className="min-w-0 self-center break-words" style={role.sampleStyle} data-conversation-type-sample>{role.text}</p>+ <div className="self-center"><Metrics role={role} /></div>+ </article>)}{roles.length === 0 ? <p className="py-8 text-sm">{inventory.roles.length ? "No roles match these filters." : "Measuring the shared conversation preview…"}</p> : null}</div>+ </section>++ <section aria-labelledby="conversation-candidates" className="flex flex-col gap-5">+ <div><h2 id="conversation-candidates" className="text-lg font-semibold text-foreground">Consolidation candidates</h2><p className="mt-2 text-sm leading-relaxed">These surfaces share family, size, leading, weight, tracking and italic treatment after consolidation. They may be candidates for a shared type role. Color, decoration and opacity stay separate review decisions; matching metrics alone do not mean two roles should merge.</p></div>+ <div className="grid gap-4 md:grid-cols-2">{candidates.map(matches => <article key={matches[0].metricKey} data-conversation-candidate className="flex min-w-0 flex-col gap-3 rounded-lg border border-border p-5">+ <h3 className="text-sm font-semibold text-foreground">{familyName(matches[0].family)} · {matches[0].size} / {matches[0].leading} · {matches[0].weight}</h3>+ <p className="text-xs leading-relaxed">{[...new Set(matches.map(role => role.area))].join(" · ")}</p>+ <p className="text-xs">{new Set(matches.map(role => `${role.color}:${role.opacity}`)).size} contrast treatments across {matches.length} role/style combinations</p>+ </article>)}</div>+ <div className="rounded-lg border border-border p-5 text-sm leading-relaxed"><h3 className="font-semibold text-foreground">Review the consolidated spec</h3><ul className="mt-3 list-disc space-y-2 pl-5"><li>Body text, authored code, commentary and reasoning now share 14px/20px. Review long replies and narrow layouts for readability.</li><li>Metadata, activity labels, diagnostic output and timestamps use 12px/16px. Review which distinctions still need separate roles.</li><li>Which color and opacity differences communicate useful hierarchy, status or contrast?</li><li>Keep code and paths in Paper Mono while deciding whether their sizes and rhythm can be shared.</li></ul><p className="mt-3 text-xs">The shared proposal conversation recipes are applied in Conversation styles and the opt-in sandbox. Future changes belong in those shared tokens/renderers; this inventory measures their current output.</p></div>+ </section>++ <section aria-labelledby="conversation-context" className="flex flex-col gap-4">+ <h2 id="conversation-context" className="text-lg font-semibold text-foreground">In context · shared conversation</h2>+ <p className="text-sm leading-relaxed">Starts with all {THREAD_PREVIEW_CASES.length} states. Use the real preview controls and expand disclosures to reveal more text, then refresh the inventory. “Expand details & measure” opens read-only activity, reasoning and notice disclosures for the selected states. Only currently rendered text is measured; closed disclosures, empty inputs, placeholders and absent Markdown structures are not counted. This is a fixture inventory, not every possible production style.</p>+ <div className="flex flex-wrap items-center gap-3"><Button variant="outline" size="sm" onClick={measure}>Refresh type inventory</Button><Button variant="outline" size="sm" onClick={() => void expandDetails()} disabled={expanding}>{expanding ? "Expanding details…" : "Expand details & measure"}</Button><Button variant="ghost" size="sm" onClick={() => inspect("all")}>Show all states</Button><p className="text-xs">Refreshing replaces the inventory with the current preview selection.</p></div>+ <div ref={root} id="conversation-renderer" className="flex h-screen min-h-0 scroll-mt-6 flex-col overflow-hidden rounded-lg border border-border p-4" data-testid="conversation-spec-shared-preview">+ <DesignSandboxTaskThread header={null} agentName={agent.name} agent={agent} defaultConversation><p className="py-4 text-sm">Choose a synthetic state to inspect typography. Saved backend conversations are available in the sandbox.</p></DesignSandboxTaskThread>+ </div>+ </section>+ </div>+ </main>;+}diff --git a/ui/storybook/support/design-proposals/ConversationTypographyPreview.tsx b/ui/storybook/support/design-proposals/ConversationTypographyPreview.tsxnew file mode 100644index 0000000000..56d29db6cc--- /dev/null+++ b/ui/storybook/support/design-proposals/ConversationTypographyPreview.tsx@@ -0,0 +1,68 @@+import { useRef, useState } from "react";+import DesignSandboxTaskThread from "@/components/design-sandbox/DesignSandboxTaskThread";+import { Button } from "@/components/ui/button";+import { storybookAgents } from "../../fixtures/paperclipData";++const agent = { ...storybookAgents[0]!, name: "Connector engineer" };+type ObservedStyle = { key: string; family: string; size: string; leading: string; weight: string; color: string; emphasis: string; tracking: string; opacity: string; example: string; text: string };++/** The sandbox owns the entire conversation composition, fixtures and controls.+ * This guide only frames it and optionally measures its rendered typography. */+export function ConversationTypographyPreview({ playback = false }: { playback?: boolean }) {+ const root = useRef<HTMLDivElement>(null);+ const [styles, setStyles] = useState<ObservedStyle[]>([]);+ const measure = () => {+ const recipes = new Map<string, ObservedStyle>();+ root.current?.querySelectorAll<HTMLElement>("[data-preview-case]").forEach(example => {+ const walker = document.createTreeWalker(example, NodeFilter.SHOW_TEXT);+ while (walker.nextNode()) {+ const node = walker.currentNode;+ const parent = node.parentElement;+ const text = node.textContent?.replace(/\s+/g, " ").trim();+ if (!text || !parent || parent.closest('[aria-hidden="true"], .sr-only, script, style') || !parent.getClientRects().length) continue;+ const computed = getComputedStyle(parent);+ if (computed.visibility === "hidden" || computed.display === "none" || computed.opacity === "0") continue;+ const values = {+ family: computed.fontFamily, size: computed.fontSize, leading: computed.lineHeight,+ weight: computed.fontWeight, color: computed.color,+ emphasis: `${computed.fontStyle} / ${computed.textDecorationLine}`,+ tracking: computed.letterSpacing, opacity: computed.opacity,+ };+ const key = JSON.stringify(values);+ if (!recipes.has(key)) recipes.set(key, { key, ...values, example: example.getAttribute("aria-label") ?? "", text: text.slice(0, 90) });+ }+ });+ setStyles([...recipes.values()].sort((a, b) => parseFloat(b.size) - parseFloat(a.size) || a.family.localeCompare(b.family)));+ };++ return <main data-testid="conversation-typography-preview" className="flex h-dvh min-h-0 flex-col bg-background px-6 font-sans text-muted-foreground sm:px-10">+ <header className="flex shrink-0 flex-col gap-2 py-4">+ <p className="text-xs">Design proposals · Foundations · Typography</p>+ <h1 className="text-2xl font-semibold tracking-tight text-foreground">{playback ? "Conversation playback" : "Conversation styles"}</h1>+ <p className="max-w-3xl text-sm leading-relaxed">{playback ? "Press Play to watch two exchanges: a component audit, then verification with planning, clarification, permission, a failed test and retry, a file preview, and streaming final replies. Demo answers and approvals advance automatically. Pause to inspect any moment, or replay from the beginning." : "The same 72 synthetic states, conversation composition and controls as the sandbox. Select a state to replay it, expand activity, or try its local composer actions."}</p>+ {!playback ? <details className="text-xs" onToggle={event => { if (event.currentTarget.open) measure(); }}>+ <summary className="w-fit cursor-pointer hover:text-foreground">Typography measurements</summary>+ <div className="mt-3 flex flex-col gap-3">+ <p>Measures currently rendered text in the selected states, including open disclosures. Refresh after changing a state or expanding content. Guide labels are excluded.</p>+ <Button variant="outline" size="sm" className="w-fit" onClick={measure}>Refresh measurements</Button>+ <div className="max-h-48 overflow-auto rounded-lg border border-border">+ <table data-testid="conversation-style-inventory" className="w-full text-left text-xs">+ <thead className="text-foreground"><tr>{["Text / state", "Family", "Size / leading", "Weight / emphasis", "Color / tracking / opacity"].map(label => <th key={label} className="px-3 py-2 font-semibold" scope="col">{label}</th>)}</tr></thead>+ <tbody>{styles.map(style => <tr key={style.key} className="border-t border-border align-top">+ <td className="px-3 py-2"><p className="text-foreground">{style.text}</p><p className="mt-1">{style.example}</p></td>+ <td className="px-3 py-2">{style.family}</td><td className="whitespace-nowrap px-3 py-2 font-mono">{style.size} / {style.leading}</td>+ <td className="px-3 py-2">{style.weight} · {style.emphasis}</td><td className="px-3 py-2 font-mono">{style.color} / {style.tracking} / {style.opacity}</td>+ </tr>)}</tbody>+ </table>+ </div>+ <p>{styles.length} observed styles. Shared source: ui/src/components/design-sandbox/DesignSandboxTaskThread.tsx and task-thread-fixtures.ts. These use production renderers with synthetic data; this is not verification of a deployed production version.</p>+ </div>+ </details> : null}+ </header>+ <div ref={root} className="flex min-h-0 flex-1 flex-col" data-testid="conversation-shared-preview">+ <DesignSandboxTaskThread previewMode={playback ? "playback" : "catalog"} header={null} agentName={agent.name} agent={agent} defaultConversation>+ <p className="py-4 text-sm">Saved task data is available in the sandbox. Choose a synthetic preview state here to compare conversation styles.</p>+ </DesignSandboxTaskThread>+ </div>+ </main>;+}diff --git a/ui/storybook/support/design-proposals/DesignProposalAccess.tsx b/ui/storybook/support/design-proposals/DesignProposalAccess.tsxnew file mode 100644index 0000000000..0f8549f151--- /dev/null+++ b/ui/storybook/support/design-proposals/DesignProposalAccess.tsx@@ -0,0 +1,27 @@+import { useLayoutEffect, useState, type ReactNode } from "react";+import { useQueryClient } from "@tanstack/react-query";+import type { CurrentBoardAccess } from "@/api/access";+import type { HealthStatus } from "@/api/health";+import { queryKeys } from "@/lib/queryKeys";+import { storybookAuthSession, storybookCompanies } from "../../fixtures/paperclipData";+import { installFixtureApi } from "../capability-gaps/api";++/** Supply the same owner access and loaded operator policy that production+ * menus require. This preview never bypasses their invitation gates. */+export function DesignProposalAccess({ children }: { children: ReactNode }) {+ const client = useQueryClient();+ const [ready, setReady] = useState(false);+ useLayoutEffect(() => {+ const access: CurrentBoardAccess = {+ user: storybookAuthSession.user, userId: "user-board", isInstanceAdmin: false,+ companyIds: storybookCompanies.map(company => company.id), source: "authenticated", keyId: null,+ memberships: storybookCompanies.map(company => ({ companyId: company.id, membershipRole: "owner", status: "active" })),+ };+ const fixtures = installFixtureApi([{ path: "/api/cli-auth/me", read: () => access }]);+ client.setQueryData<HealthStatus>(queryKeys.health, { status: "ok", deploymentMode: "authenticated", hiddenSettings: [] });+ client.setQueryData<CurrentBoardAccess>(queryKeys.access.currentBoardAccess, access);+ setReady(true);+ return () => fixtures.cleanup();+ }, [client]);+ return ready ? children : null;+}diff --git a/ui/storybook/support/design-proposals/FlyoutPreview.tsx b/ui/storybook/support/design-proposals/FlyoutPreview.tsxnew file mode 100644index 0000000000..6774415868--- /dev/null+++ b/ui/storybook/support/design-proposals/FlyoutPreview.tsx@@ -0,0 +1,63 @@+import { useState, type CSSProperties } from "react";+import { Check } from "lucide-react";+import { SidebarAccountMenu } from "@/components/SidebarAccountMenu";+import { TruncatedTextMarqueeProvider } from "@/components/TruncatedText";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { Button } from "@/components/ui/button";+import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";+import { Flyout, FlyoutAppearanceProvider, FlyoutContent, FlyoutHeader, FlyoutOptions, FlyoutTrigger } from "@/components/ui/flyout";+import { allTaskListColumns, defaultTaskListColumns, taskListColumns, type TaskListColumnId } from "@/lib/task-list";+import { taskListViews, type TaskListView } from "@/lib/task-list-views";++export type FlyoutPreviewProps = { mode: "columns" | "views" | "account-menu"; shadow?: string };++/** Isolated reference for the same composition used by the page's flyouts.+ * Shadow overrides stay local to this preview; the saved default is a token. */+export function FlyoutPreview({ mode, shadow }: FlyoutPreviewProps) {+ const [columns, setColumns] = useState<readonly TaskListColumnId[]>(defaultTaskListColumns);+ const [view, setView] = useState<TaskListView>("all");+ const [accountOpen, setAccountOpen] = useState(true);+ return (+ <main className="task-row-design-preview min-h-screen p-12 text-foreground" data-testid="flyout-design-preview">+ <div className="mx-auto flex max-w-3xl flex-col gap-4">+ <h1 className="text-2xl font-semibold">Popover</h1>+ <p className="text-sm text-muted-foreground">Shared title block, options, selection marks and shadow. Hover or focus an option to inspect its highlight.</p>+ <p className="text-sm text-muted-foreground">The Shadow control previews a CSS box-shadow. Clear it to inherit the shared --shadow-flyout token.</p>+ <div className="mt-6 flex justify-center">+ {mode === "account-menu" ? (+ <DesignProposalAccess><FlyoutAppearanceProvider><TruncatedTextMarqueeProvider>+ <div className="flex min-h-96 w-(--profile-popover-width) items-end">+ <div className="design-sidebar-account w-full">+ <SidebarAccountMenu forceExpanded open={accountOpen} onOpenChange={setAccountOpen} shadow={shadow} />+ </div>+ </div>+ </TruncatedTextMarqueeProvider></FlyoutAppearanceProvider></DesignProposalAccess>+ ) : mode === "views" ? (+ <FlyoutAppearanceProvider><DropdownMenu defaultOpen>+ <DropdownMenuTrigger asChild><Button variant="outline">Views</Button></DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="w-(--flyout-width)" style={shadow ? { "--shadow-flyout": shadow } as CSSProperties : undefined}>+ <DropdownMenuLabel asChild><FlyoutHeader>Views</FlyoutHeader></DropdownMenuLabel>+ <DropdownMenuRadioGroup asChild value={view} onValueChange={value => setView(value as TaskListView)}><FlyoutOptions>+ {taskListViews.map(({ value, label }) => <DropdownMenuRadioItem key={value} value={value}>{label}</DropdownMenuRadioItem>)}+ </FlyoutOptions></DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu></FlyoutAppearanceProvider>+ ) : (+ <Flyout defaultOpen>+ <FlyoutTrigger asChild><Button variant="outline">Columns</Button></FlyoutTrigger>+ <FlyoutContent align="start" aria-label="Columns" shadow={shadow}>+ <FlyoutHeader>Columns</FlyoutHeader>+ <FlyoutOptions>+ <>+ {allTaskListColumns.map(id => <Button key={id} variant="ghost" className="justify-start" aria-pressed={columns.includes(id)} onClick={() => setColumns(current => current.includes(id) ? current.filter(value => value !== id) : [...current, id])}>{taskListColumns.find(column => column.id === id)!.label}{columns.includes(id) ? <Check className="ml-auto size-3.5" aria-hidden /> : null}</Button>)}+ <Button variant="ghost" className="task-list-options-reset" onClick={() => setColumns(defaultTaskListColumns)}>Reset defaults</Button>+ </>+ </FlyoutOptions>+ </FlyoutContent>+ </Flyout>+ )}+ </div>+ </div>+ </main>+ );+}diff --git a/ui/storybook/support/design-proposals/ProjectHealthTrial.tsx b/ui/storybook/support/design-proposals/ProjectHealthTrial.tsxnew file mode 100644index 0000000000..5c3ba35e9e--- /dev/null+++ b/ui/storybook/support/design-proposals/ProjectHealthTrial.tsx@@ -0,0 +1,160 @@+import { useRef, useState } from "react";+import { CheckCheck, ChevronDown, CircleAlert, FolderOpen, ListChecks, Search, SearchX, X } from "lucide-react";+import { CommandPalette } from "@/components/CommandPalette";+import { DesignPageShell } from "@/components/DesignPageShell";+import { DesignSidebar } from "@/components/DesignSidebar";+import { EmptyState } from "@/components/EmptyState";+import { MetricCard } from "@/components/MetricCard";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { TaskRowGroup } from "@/components/TaskRowGroup";+import { TaskSummaryList } from "@/components/TaskSummaryList";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { Card } from "@/components/ui/card";+import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";+import { FlyoutHeader, FlyoutOptions } from "@/components/ui/flyout";+import { Input } from "@/components/ui/input";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { matchesTaskListView } from "@/lib/task-list-views";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { projectHealthProjects, projectHealthTasks } from "./project-health-trial-data";++type ProjectView = "all" | "attention";+export type ProjectHealthTrialProps = {+ initialQuery?: string;+ initialView?: ProjectView;+ initialProjectId?: string;+ emptyOrganization?: boolean;+};++const projectViews = [+ { value: "all", label: "All projects" },+ { value: "attention", label: "Needs attention" },+] as const;+const projectStatusLabels = {+ backlog: "Backlog", planned: "Planned", in_progress: "In progress", completed: "Completed", cancelled: "Cancelled",+};++/** Trial-only project composition. Shared task semantics and UI remain unchanged. */+function ProjectHealthContent({ initialQuery = "", initialView = "all", initialProjectId, emptyOrganization = false }: ProjectHealthTrialProps) {+ const { selectedCompanyId } = useCompany();+ const { openNewIssue } = useDialogActions();+ const [query, setQuery] = useState(initialQuery);+ const [view, setView] = useState<ProjectView>(initialView);+ const [selectedId, setSelectedId] = useState<string | null>(initialProjectId ?? null);+ const searchRef = useRef<HTMLInputElement>(null);+ const projectButtons = useRef(new Map<string, HTMLButtonElement>());++ const projects = emptyOrganization ? [] : projectHealthProjects.filter(project => project.companyId === selectedCompanyId);+ const tasks = projectHealthTasks.filter(task => task.companyId === selectedCompanyId && projects.some(project => project.id === task.projectId));+ const needsAttention = (task: typeof tasks[number]) => matchesTaskListView("blocked", task, false, null);+ const projectsWithCounts = projects.map(project => {+ const projectTasks = tasks.filter(task => task.projectId === project.id);+ return {+ ...project,+ tasks: projectTasks.toSorted((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()),+ total: projectTasks.length,+ attention: projectTasks.filter(needsAttention).length,+ completed: projectTasks.filter(task => task.status === "done").length,+ };+ });+ const normalizedQuery = query.trim().toLocaleLowerCase();+ const visibleProjects = projectsWithCounts.filter(project =>+ (view === "all" || project.attention > 0)+ && `${project.name} ${project.description ?? ""}`.toLocaleLowerCase().includes(normalizedQuery),+ );+ // A filtered-out project must never leave unrelated tasks visible in the pane.+ const selectedProject = visibleProjects.find(project => project.id === selectedId);+ const clear = () => { setQuery(""); setView("all"); setSelectedId(null); searchRef.current?.focus(); };+ const closeSelection = () => {+ if (selectedId) projectButtons.current.get(selectedId)?.focus();+ setSelectedId(null);+ };++ return <>+ <DesignPageShell+ title="Project health"+ sidebarStorageKey="paperclip.design-proposal.project-health-trial.sidebar"+ rightSidebarStorageKey="paperclip.design-proposal.project-health-trial.aside"+ sidebar={<DesignSidebar recentTasks={tasks.toSorted((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()).slice(0, 5)} onNewTask={() => openNewIssue()} />}+ rightSidebarTitle="Recent tasks"+ rightSidebarControls={selectedProject && <Button variant="ghost" size="icon-sm" aria-label="Clear project selection" onClick={closeSelection}><X aria-hidden /></Button>}+ rightSidebar={selectedProject ? <>+ <div className="space-y-3">+ <h3 className="text-base font-semibold break-words" aria-live="polite">{selectedProject.name}</h3>+ <p className="text-sm text-muted-foreground">{selectedProject.description}</p>+ <Badge variant="outline">{projectStatusLabels[selectedProject.status]}</Badge>+ </div>+ {selectedProject.tasks.length ? <section className="space-y-3" aria-label="Selected project tasks">+ <p className="text-xs text-muted-foreground">Most recently updated · <span className="font-mono">{Math.min(6, selectedProject.total)} of {selectedProject.total}</span> tasks</p>+ <TaskRowGroup><TaskSummaryList issues={selectedProject.tasks.slice(0, 6)} label={`Recent tasks for ${selectedProject.name}`} /></TaskRowGroup>+ </section> : <EmptyState icon={ListChecks} message="No tasks yet" description="This project is ready for its first task. Select another project to review recent work." action="Browse projects" hideActionIcon onAction={closeSelection} />}+ </> : <EmptyState icon={FolderOpen} message="Select a project" description="Choose a project to see its recent tasks here." />}+ >+ <div className="space-y-8">+ <section aria-label="Project summary" className="grid gap-4" style={{ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, var(--sz-160px)), 1fr))" }}>+ <MetricCard appearance="card" icon={FolderOpen} value={projects.filter(project => project.status === "in_progress").length} label="Active projects" description="Projects in progress" />+ <MetricCard appearance="card" icon={CircleAlert} value={tasks.filter(needsAttention).length} label="Tasks needing attention" description="Blocked or awaiting review" />+ <MetricCard appearance="card" icon={CheckCheck} value={tasks.filter(task => task.status === "done").length} label="Completed tasks" description="Across all projects" />+ </section>+ <section className="space-y-4" aria-label="Projects">+ <div className="design-page-toolbar" role="group" aria-label="Project controls">+ <DropdownMenu>+ <DropdownMenuTrigger asChild><Button variant="outline" className="design-toolbar-button design-view-trigger" aria-label={`Project view: ${projectViews.find(option => option.value === view)!.label}`}>+ {projectViews.find(option => option.value === view)!.label}<ChevronDown aria-hidden />+ </Button></DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="task-list-options" aria-label="Project views">+ <DropdownMenuLabel asChild><FlyoutHeader className="task-list-options-heading">Views</FlyoutHeader></DropdownMenuLabel>+ <DropdownMenuRadioGroup value={view} onValueChange={value => { setView(value as ProjectView); setSelectedId(null); }} asChild>+ <FlyoutOptions className="task-list-options-items">+ {projectViews.map(option => <DropdownMenuRadioItem key={option.value} value={option.value} className="task-list-options-item">{option.label}</DropdownMenuRadioItem>)}+ </FlyoutOptions>+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ <div className="design-task-search">+ <Search aria-hidden />+ <Input ref={searchRef} aria-label="Search projects" placeholder="Search projects…" value={query} onChange={event => { setQuery(event.target.value); setSelectedId(null); }} />+ {query && <Button variant="ghost" size="icon-xs" aria-label="Clear search" onClick={() => { setQuery(""); searchRef.current?.focus(); }}><X aria-hidden /></Button>}+ </div>+ </div>+ <p role="status" className="text-sm text-muted-foreground"><span className="font-mono">{visibleProjects.length} of {projects.length}</span> projects{view === "attention" ? " · With blocked or in-review tasks" : " · Select a project to inspect recent work"}</p>+ {projects.length === 0 ? <EmptyState icon={FolderOpen} message="No projects yet" description="Projects bring related tasks together. This organization has no projects to review." />+ : visibleProjects.length === 0 ? <EmptyState icon={SearchX} message="No projects match this view" description="Try another name or description, or clear the current filters." action="Clear filters" hideActionIcon onAction={clear} />+ : <ul className="grid gap-4" style={{ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, var(--design-page-aside-min-width)), 1fr))" }} aria-label="Project cards">+ {visibleProjects.map(project => <li key={project.id} className="min-w-0">+ <Card elevation={selectedId === project.id ? "middle" : "low"} className="h-full gap-0 p-0">+ <Button+ ref={element => { if (element) projectButtons.current.set(project.id, element); else projectButtons.current.delete(project.id); }}+ variant="ghost" className="h-full w-full min-w-0 flex-col items-stretch justify-start gap-4 whitespace-normal rounded-lg p-5 text-left"+ aria-label={`View recent tasks for ${project.name}`} aria-pressed={selectedId === project.id}+ aria-describedby={`${project.id}-status ${project.id}-description ${project.id}-counts`}+ aria-controls="design-page-aside-content" onClick={() => setSelectedId(project.id)}+ >+ <span id={`${project.id}-status`} className="flex flex-wrap items-center gap-2"><Badge variant="outline">{projectStatusLabels[project.status]}</Badge>{project.attention > 0 && <span className="inline-flex items-center gap-1.5 text-xs text-muted-foreground"><CircleAlert aria-hidden />Needs attention</span>}</span>+ <span className="flex flex-1 flex-col gap-2">+ <span className="text-base font-semibold text-foreground break-words">{project.name}</span>+ <span id={`${project.id}-description`} className="text-sm font-normal text-muted-foreground">{project.description}</span>+ </span>+ <span id={`${project.id}-counts`} className="flex flex-wrap gap-x-4 gap-y-2 text-xs font-normal text-muted-foreground">+ <span><span className="font-mono text-foreground">{project.total}</span> tasks</span>+ <span><span className="font-mono text-foreground">{project.attention}</span> attention</span>+ <span><span className="font-mono text-foreground">{project.completed}</span> completed</span>+ </span>+ </Button>+ </Card>+ </li>)}+ </ul>}+ </section>+ </div>+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </>;+}++export function ProjectHealthTrial(props: ProjectHealthTrialProps) {+ const { selectedCompanyId } = useCompany();+ return <DesignProposalAccess><ProjectHealthContent key={selectedCompanyId} {...props} /></DesignProposalAccess>;+}diff --git a/ui/storybook/support/design-proposals/SegmentedControllersPreview.tsx b/ui/storybook/support/design-proposals/SegmentedControllersPreview.tsxnew file mode 100644index 0000000000..3a84fb0a33--- /dev/null+++ b/ui/storybook/support/design-proposals/SegmentedControllersPreview.tsx@@ -0,0 +1,70 @@+import { useState, type ReactNode } from "react";+import { Columns3, List, Network, SquareKanban } from "lucide-react";+import { FilePreviewModeToggle, type FilePreviewMode } from "@/components/FilePreviewModeToggle";+import { Button } from "@/components/ui/button";+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";++export interface SegmentedControllersPreviewProps {+ width: "full" | "narrow";+ disableAgentActions: boolean;+ onWidthChange?: (width: SegmentedControllersPreviewProps["width"]) => void;+}+function Specimen({ title, source, children }: { title: string; source: string; children: ReactNode }) {+ return <section aria-label={title} className="min-w-0 space-y-4 border-t border-border pt-6">+ <div className="space-y-1"><h2 className="text-lg font-normal text-foreground">{title}</h2><p className="text-xs">{source}</p></div>+ <div className="overflow-x-auto p-2">{children}</div>+ </section>;+}+function PanelSwitch({ label, items, grid = false, disabled = false }: { label: string; items: string[]; grid?: boolean; disabled?: boolean }) {+ const [value, setValue] = useState(items[0]);+ return <Tabs value={value} onValueChange={setValue} className="gap-4">+ <TabsList aria-label={label} className={grid ? "grid w-full grid-cols-2" : undefined}>+ {items.map((item, index) => <TabsTrigger key={item} value={item} disabled={disabled && index === 1}>{item}</TabsTrigger>)}+ </TabsList>+ {items.map(item => <TabsContent key={item} value={item}><p className="text-xs">Selected panel: {item}. Fixture content only.</p></TabsContent>)}+ </Tabs>;+}+function LayoutSwitch({ kind }: { kind: "proposal" | "issues" | "agents" }) {+ const [selected, setSelected] = useState(0);+ const items = kind === "agents" ? [{ label: "List view", icon: List }, { label: "Org chart view", icon: Network }] : [{ label: "List view", icon: List }, { label: "Board view", icon: kind === "proposal" ? Columns3 : SquareKanban }];+ return <div className={kind === "proposal" ? "design-view-toggle" : "flex w-fit items-center overflow-hidden rounded-md border border-border"} role="group" aria-label={`${kind} layout`}>+ {items.map(({ label, icon: Icon }, index) => kind === "issues" ? <button key={label} aria-label={label} title={label} aria-pressed={selected === index} onClick={() => setSelected(index)} className={`flex h-8 w-8 items-center justify-center transition-colors ${selected === index ? "bg-accent text-foreground" : "text-muted-foreground hover:text-foreground"}`}><Icon className="h-3.5 w-3.5" /></button> : <Button key={label} type="button" size={kind === "agents" ? "icon-sm" : "icon"} variant={kind === "agents" && selected === index ? "secondary" : "ghost"} className={kind === "proposal" ? "design-toolbar-button design-toolbar-icon" : `rounded-none ${index === 1 ? "border-l border-border" : ""}`} aria-label={label} title={label} aria-pressed={selected === index} onClick={() => setSelected(index)}><Icon className={kind === "agents" ? "h-3.5 w-3.5" : undefined} aria-hidden /></Button>)}+ </div>;+}+function InstructionSwitch() {+ const [mode, setMode] = useState("read");+ return <div className="flex w-fit items-center rounded-md border border-border p-0.5" role="group" aria-label="Instruction file view">+ {["read", "edit", "raw"].map(value => <Button key={value} type="button" size="sm" variant={mode === value ? "secondary" : "ghost"} className="capitalize" aria-pressed={mode === value} onClick={() => setMode(value)}>{value}</Button>)}+ </div>;+}+function FileSwitch() {+ const [mode, setMode] = useState<FilePreviewMode>("rendered");+ return <FilePreviewModeToggle mode={mode} onChange={setMode} label="File preview mode" />;+}+function ModelSwitch() {+ const [lane, setLane] = useState("primary");+ return <div className="flex w-full overflow-hidden rounded-md border border-border" role="radiogroup" aria-label="Model lane">+ {["primary", "custom"].map(value => <button key={value} type="button" role="radio" aria-checked={lane === value} className={`flex-1 px-2 py-1 text-xs capitalize transition-colors hover:bg-accent/40 ${lane === value ? "bg-accent text-foreground" : ""}`} onClick={() => setLane(value)}>{value === "primary" ? "Primary" : "Override"}</button>)}+ </div>;+}+export function SegmentedControllersPreview({ width, disableAgentActions, onWidthChange }: SegmentedControllersPreviewProps) {+ return <main data-testid="segmented-controllers-preview" className="min-h-dvh space-y-8 bg-background p-6 font-sans text-muted-foreground sm:p-10">+ <header className="space-y-3"><p className="text-xs">Design proposals · Components</p><h1 className="text-2xl font-semibold text-foreground">Segmented controllers</h1>+ <p className="max-w-3xl text-sm">Compare current connected choices: panel tabs, layout switches, file modes and model lanes. Each example keeps its existing styling and semantics; interactions affect local fixture state only.</p>+ <label className="flex w-fit items-center gap-3 text-xs">Container width<select aria-label="Segmented controller container width" className="rounded-md border border-border bg-background px-3 py-2 text-sm" value={width} onChange={event => onWidthChange?.(event.target.value as SegmentedControllersPreviewProps["width"])}><option value="full">Full</option><option value="narrow">Narrow</option></select></label>+ </header>+ <div className={`space-y-8 ${width === "narrow" ? "max-w-sm" : "max-w-none"}`}>+ <Specimen title="Audit activity scope" source="AuditFeed · production TabsList/TabsTrigger composition. The Agent Actions disabled state is controlled in Storybook."><PanelSwitch label="Activity scope" items={["Activity", "Agent Actions"]} disabled={disableAgentActions} /></Specimen>+ <Specimen title="Task layout · proposal" source="TaskListToolbar · Design Proposals and sandbox composition, using the shared design-view-toggle styling."><div className="design-page-toolbar" data-canonical-toolbar><LayoutSwitch kind="proposal" /></div></Specimen>+ <Specimen title="Task layout · production" source="IssuesList and LegacyIssuesList · inline production list/board composition with native pressed buttons."><LayoutSwitch kind="issues" /></Specimen>+ <Specimen title="Agent layout" source="Agents · production List / Org chart shared Button composition."><LayoutSwitch kind="agents" /></Specimen>+ <Specimen title="Instruction file mode" source="AgentDetail · production Read / Edit / Raw Button composition."><InstructionSwitch /></Specimen>+ <Specimen title="File preview mode" source="FilePreviewModeToggle · actual shared production component, Rendered / Raw."><FileSwitch /></Specimen>+ <Specimen title="Secret ownership" source="Secrets · production two-column TabsList composition. No secrets are read or created."><PanelSwitch label="Secret ownership" items={["Organization", "Each user"]} grid /></Specimen>+ <Specimen title="Secret value source" source="Secrets · same two-column composition with Managed value / External reference choices."><PanelSwitch label="Secret value source" items={["Managed value", "External reference"]} grid /></Specimen>+ <Specimen title="Goal content" source="GoalDetail · default production TabsList composition, including count labels."><PanelSwitch label="Goal content" items={["Sub-Goals (3)", "Projects (2)"]} /></Specimen>+ <Specimen title="Model lane" source="IssueProperties · production inline radio composition. Preserves existing click behavior; keyboard arrow navigation is a consolidation gap."><ModelSwitch /></Specimen>+ </div>+ <p className="max-w-3xl text-xs">Inline page controls are isolated compositions of their production primitives, not full production-page mounts. These examples establish a comparison surface, not backend or accessibility acceptance. No existing app controls have been restyled.</p>+ </main>;+}diff --git a/ui/storybook/support/design-proposals/SidebarPreview.tsx b/ui/storybook/support/design-proposals/SidebarPreview.tsxnew file mode 100644index 0000000000..d815ed317e--- /dev/null+++ b/ui/storybook/support/design-proposals/SidebarPreview.tsx@@ -0,0 +1,46 @@+import { CommandPalette } from "@/components/CommandPalette";+import { DesignPageShell } from "@/components/DesignPageShell";+import { DesignSidebar, type DesignSidebarRecentTask } from "@/components/DesignSidebar";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { useDialogActions } from "@/context/DialogContext";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { recentTasks } from "./task-page-data";++export type SidebarPreviewProps = {+ scenario: "default" | "narrow" | "long-labels" | "many-recents" | "empty-recents" | "organization-menu" | "account-menu";+};++const defaultRecents = recentTasks.map(item => item.issue);+const longRecents = defaultRecents.map((task, index) => ({+ ...task,+ title: index === 0 ? "Review the connector recovery experience across organizations and shared workspaces" : task.title,+}));+const manyRecents: DesignSidebarRecentTask[] = Array.from({ length: 30 }, (_, index) => ({+ ...defaultRecents[index % defaultRecents.length]!,+ id: `sidebar-recent-${index}`,+ identifier: `PAP-${500 + index}`,+}));++function SidebarContent({ scenario }: SidebarPreviewProps) {+ const { openNewIssue } = useDialogActions();+ const tasks = scenario === "empty-recents" ? [] : scenario === "many-recents" ? manyRecents : scenario === "long-labels" ? longRecents : defaultRecents;+ return <>+ <DesignPageShell+ title="Sidebar"+ sidebarStorageKey={`paperclip.design-proposal.sidebar-review.${scenario}.width`}+ sidebar={<DesignSidebar recentTasks={tasks} onNewTask={() => openNewIssue()} />}+ >+ <div className="max-w-xl space-y-4 text-sm text-muted-foreground">+ <h2 className="text-lg font-semibold text-foreground">Sidebar component</h2>+ <p>This is the same sidebar used by Pages → Tasks. Resize its right edge, hover truncated labels, or use the organization, account and global-search controls.</p>+ <p>Navigation uses a fixture router. New Task and global search mount the existing dialogs; this preview does not establish backend behavior.</p>+ </div>+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </>;+}++export function SidebarPreview(props: SidebarPreviewProps) {+ return <DesignProposalAccess><SidebarContent {...props} /></DesignProposalAccess>;+}diff --git a/ui/storybook/support/design-proposals/TabsPreview.tsx b/ui/storybook/support/design-proposals/TabsPreview.tsxnew file mode 100644index 0000000000..b0e0a306c3--- /dev/null+++ b/ui/storybook/support/design-proposals/TabsPreview.tsx@@ -0,0 +1,56 @@+import { useState, type ReactNode } from "react";+import { TabBar, TabFilters, type TabSize } from "@/components/TabBar";+import { ArtifactKindFilters } from "@/components/artifacts/ArtifactsToolbar";+import { Tabs, TabsContent } from "@/components/ui/tabs";+import type { ArtifactKindFilter } from "@/api/artifacts";++export interface TabsPreviewProps {+ pattern: "all" | "standard" | "compact";+ width: "full" | "narrow";+ onWidthChange?: (width: TabsPreviewProps["width"]) => void;+}+function Specimen({ title, description, children }: { title: string; description: string; children: ReactNode }) {+ return <section aria-label={title} className="min-w-0 space-y-4 border-t border-border pt-6">+ <div className="space-y-1"><h2 className="text-lg font-normal text-foreground">{title}</h2><p className="text-xs text-muted-foreground">{description}</p></div>+ {children}+ </section>;+}++function ArtifactFilters() {+ const [kind, setKind] = useState<ArtifactKindFilter>("all");+ return <><ArtifactKindFilters kind={kind} onKindChange={setKind} /><output className="block text-xs" aria-live="polite">Artifact type: {kind}</output></>;+}++function CanonicalTabs({ size }: { size: TabSize }) {+ const [value, setValue] = useState("paperclip");+ const items = [{ value: "paperclip", label: "Paperclip" }, { value: "composio", label: "Composio" }, { value: "arcade", label: "Arcade" }, { value: "installed", label: "Installed" }];+ return <Tabs value={value} onValueChange={setValue}>+ <TabBar size={size} label={`${size} content tabs`} items={items} />+ {items.map(item => <TabsContent key={item.value} value={item.value}><p className="text-xs">Selected panel: {item.label}. Fixture content only.</p></TabsContent>)}+ </Tabs>;+}+function DisabledTabs() {+ const [value, setValue] = useState("available");+ return <TabFilters size="standard" label="Disabled choice example" value={value} onValueChange={setValue} items={[{ value: "available", label: "Available" }, { value: "restricted", label: "Restricted", disabled: true }]} />;+}++export function TabsPreview({ pattern, width, onWidthChange }: TabsPreviewProps) {+ return <main data-testid="tabs-preview" className="min-h-dvh space-y-8 bg-background p-6 font-sans text-muted-foreground sm:p-10">+ <header className="space-y-3">+ <p className="text-xs">Design proposals · Components</p><h1 className="text-2xl font-semibold text-foreground">Tabs</h1>+ <p className="max-w-3xl text-sm">Two canonical sizes with one filled selection treatment. Compact uses 12px type; Standard uses 14px type and the Paper reference geometry. Content tabs switch panels; collection filters use radio choices. Both support keyboard navigation.</p>+ <label className="flex w-fit items-center gap-3 text-xs">Container width<select aria-label="Tabs container width" className="rounded-md border border-border bg-background px-3 py-2 text-sm" value={width} onChange={event => onWidthChange?.(event.target.value as TabsPreviewProps["width"])}><option value="full">Full</option><option value="narrow">Narrow</option></select></label>+ </header>+ <div className={`w-full space-y-8 ${width === "narrow" ? "max-w-sm" : "max-w-none"}`} data-testid="tabs-specimens">+ {(pattern === "all" || pattern === "standard") && <Specimen title="Standard" description="14px · --text-sm · 32px tab height · 10px horizontal padding · 8px gap. Matches the Paper tab bar with muted inactive text and a rounded filled selection."><CanonicalTabs size="standard" /></Specimen>}+ {(pattern === "all" || pattern === "compact") && <Specimen title="Compact" description="12px · --text-xs · 24px tab height · the same filled selection behavior as Standard. Artifact filters below use the same shared styling."><CanonicalTabs size="compact" /><ArtifactFilters /></Specimen>}++ </div>+ <aside className="max-w-3xl space-y-3 border-t border-border pt-6 text-sm" aria-label="Tab usage">+ <h2 className="font-semibold text-foreground">One visual pattern, two sizes</h2>+ <p>Use Standard for page navigation and primary source choices. Use Compact for dense filters and metadata areas. TabBar composes inside Tabs with matching panels. TabFilters uses radio choices for collections; clicking an already selected choice keeps it selected.</p>+ <DisabledTabs />+ <p className="text-xs">Arrow keys, Home and End move between enabled choices. Disabled choices are skipped. Segmented controllers remain a separate component family. App examples use the same components as this reference.</p>+ </aside>+ </main>;+}diff --git a/ui/storybook/support/design-proposals/TaskHoverCardPreview.tsx b/ui/storybook/support/design-proposals/TaskHoverCardPreview.tsxnew file mode 100644index 0000000000..1d95270c6c--- /dev/null+++ b/ui/storybook/support/design-proposals/TaskHoverCardPreview.tsx@@ -0,0 +1,66 @@+import { useLayoutEffect } from "react";+import { useQueryClient } from "@tanstack/react-query";+import { ActivityRow } from "@/components/ActivityRow";+import { IssueQuicklookCard } from "@/components/IssueLinkQuicklook";+import { TaskSummaryList } from "@/components/TaskSummaryList";+import { Button } from "@/components/ui/button";+import { Card } from "@/components/ui/card";+import { FlyoutAppearanceProvider } from "@/components/ui/flyout";+import { Link } from "@/lib/router";+import { queryKeys } from "@/lib/queryKeys";+import { createIssue, storybookActivityEvents, storybookAgentMap, storybookProjects } from "../../fixtures/paperclipData";++const task = createIssue({+ id: "design-task-hover-card", identifier: "PAP-173", status: "done",+ title: "Artifact Review: Finish the remaining approved wireframe gaps",+ description: "Followup on PAP-717 (wireframes approved Oct 13, card f47824d1). Same worktree/branch as PAP-717; build on commits 11410df47 through 61c81e105. Review the remaining wireframe gaps with the team.",+ project: { ...storybookProjects[0]!, name: "Design system" },+ updatedAt: new Date("2026-10-14T17:00:00Z"),+});++export function TaskHoverCardPreview({ enabled = true, showDescription = true, onEnabledChange }: {+ enabled?: boolean;+ showDescription?: boolean;+ onEnabledChange?: (enabled: boolean) => void;+}) {+ const client = useQueryClient();+ const issue = { ...task, description: showDescription ? task.description : null };+ useLayoutEffect(() => {+ const snapshot = { ...task, description: showDescription ? task.description : null };+ for (const ref of [task.id, task.identifier!]) client.setQueryData(queryKeys.issues.detail(ref), snapshot);+ }, [client, showDescription]);+ return <FlyoutAppearanceProvider>+ <main className="task-row-design-preview min-h-screen px-6 py-10 text-foreground sm:px-10">+ <div className="mx-auto flex max-w-4xl flex-col gap-8">+ <header className="space-y-3">+ <p className="text-xs text-muted-foreground">Paperclip · Design system · Proposed</p>+ <h1 className="text-3xl font-semibold">Task hover card</h1>+ <p className="max-w-2xl text-sm text-muted-foreground">A contextual task preview for links and activity. Summary rows use their own local text reveal and keep this preview off.</p>+ </header>+ <section className="space-y-4" aria-label="Card appearance">+ <h2 className="text-sm font-normal">Appearance</h2>+ <div data-testid="task-hover-card-reference" data-quicklook data-flyout-appearance="refreshed">+ <IssueQuicklookCard issue={issue} linkTo="/PAP/issues/PAP-173" />+ </div>+ </section>+ <section className="space-y-4" aria-label="Optional hover preview">+ <div className="flex flex-wrap items-center gap-4">+ <h2 className="text-sm font-normal">Text link</h2>+ <Button size="sm" variant="outline" aria-pressed={enabled} onClick={() => onEnabledChange?.(!enabled)}>Hover preview: {enabled ? "On" : "Off"}</Button>+ </div>+ <p className="text-sm">Related work: <Link to="/issues/PAP-173" issuePrefetch={issue} disableIssueQuicklook={!enabled} className="underline" aria-label="Preview linked task PAP-173">PAP-173</Link></p>+ </section>+ <section className="space-y-4" aria-label="Activity preview example">+ <h2 className="text-sm font-normal">Recent activity · Preview on</h2>+ <Card className="block overflow-hidden py-0">+ <ActivityRow appearance="refreshed" event={{ ...storybookActivityEvents[0]!, entityId: task.id }} agentMap={storybookAgentMap} entityNameMap={new Map([[`issue:${task.id}`, task.identifier!]])} entityTitleMap={new Map([[`issue:${task.id}`, task.title]])} />+ </Card>+ </section>+ <section className="space-y-4" aria-label="Summary without hover preview">+ <h2 className="text-sm font-normal">Recent tasks · Preview off</h2>+ <Card className="block overflow-hidden py-0"><TaskSummaryList issues={[issue]} /></Card>+ </section>+ </div>+ </main>+ </FlyoutAppearanceProvider>;+}diff --git a/ui/storybook/support/design-proposals/TaskListPagePreview.tsx b/ui/storybook/support/design-proposals/TaskListPagePreview.tsxnew file mode 100644index 0000000000..549c69ccb4--- /dev/null+++ b/ui/storybook/support/design-proposals/TaskListPagePreview.tsx@@ -0,0 +1,64 @@+import { useState } from "react";+import { ListChecks, SearchX } from "lucide-react";+import { CommandPalette } from "@/components/CommandPalette";+import { DesignSidebar } from "@/components/DesignSidebar";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { initialItems, recentTasks } from "./task-page-data";+import { DesignPageShell } from "@/components/DesignPageShell";+import { EmptyState } from "@/components/EmptyState";+import { KanbanBoard } from "@/components/KanbanBoard";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { TaskList } from "@/components/TaskList";+import { TaskListToolbar } from "@/components/TaskListToolbar";+import { TruncatedTextMarqueeProvider } from "@/components/TruncatedText";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { useTaskListCollection } from "@/hooks/useTaskListCollection";+import { allTaskListColumns, defaultTaskListColumns } from "@/lib/task-list";+import { taskListViewStorageKey } from "@/lib/task-list-views";+import { storybookAgents, storybookAuthSession, storybookIssueLabels, storybookProjects } from "../../fixtures/paperclipData";++const currentUserId = storybookAuthSession.user.id;+const viewStorageKey = taskListViewStorageKey("design-proposals", currentUserId);++type PreviewProps = { allColumns?: boolean; initialQuery?: string };++export function TaskListPagePreview(props: PreviewProps) {+ return <DesignProposalAccess><TaskListPageContent {...props} /></DesignProposalAccess>;+}++/** Fixture controller only; the page consumes shared production components. */+function TaskListPageContent({ allColumns = false, initialQuery = "" }: PreviewProps) {+ const [items, setItems] = useState(initialItems);+ const { selectedCompanyId } = useCompany();+ const { openNewIssue } = useDialogActions();+ const { query, setQuery, view, setView, layout, setLayout, filters, updateFilters, clear,+ companyItems, matchingItems, visibleItems, creators, collapsedIds, setCollapsedIds,+ allExpanded, toggleExpanded, activeFilterCount, narrowed } = useTaskListCollection({+ items, companyId: selectedCompanyId, userId: currentUserId, viewStorageKey, initialQuery,+ });+ const emptyState = companyItems.length === 0+ ? <EmptyState icon={ListChecks} message="No tasks in this organization" description="This preview has task fixtures for Paperclip Storybook." />+ : <EmptyState icon={SearchX} message="No tasks match this view" description="Try another search or clear your filters." action="Clear filters" hideActionIcon onAction={clear} />;+ return (+ <TruncatedTextMarqueeProvider>+ <DesignPageShell title="Tasks" sidebar={<DesignSidebar recentTasks={recentTasks.map(item => item.issue)} onNewTask={() => openNewIssue()} />}>+ <TaskListToolbar+ view={view} onViewChange={setView}+ query={query} onQueryChange={setQuery}+ layout={layout} onLayoutChange={setLayout}+ allExpanded={allExpanded} onToggleExpanded={toggleExpanded}+ onNewTask={() => openNewIssue()}+ filters={{ state: filters, onChange: updateFilters, activeFilterCount, agents: storybookAgents, projects: storybookProjects, labels: storybookIssueLabels, currentUserId, creators }}+ />+ {narrowed ? <p className="design-task-results" role="status">{matchingItems.length} matching {matchingItems.length === 1 ? "task" : "tasks"}{visibleItems.length > matchingItems.length ? " · Parent tasks included for context" : ""}</p> : null}+ <div hidden={layout !== "list"} className="design-task-list-panel">+ <TaskList key={selectedCompanyId} items={visibleItems} allItems={companyItems} initialColumns={allColumns ? allTaskListColumns : defaultTaskListColumns} collapsedIds={collapsedIds} onCollapsedIdsChange={setCollapsedIds} emptyState={emptyState} />+ </div>+ {layout === "board" ? <div className="design-task-board">{matchingItems.length ? <KanbanBoard showOverflowFades issues={matchingItems.map(item => item.issue)} agents={storybookAgents} onUpdateIssue={(id, data) => setItems(current => current.map(item => item.issue.id === id ? { ...item, issue: { ...item.issue, ...data } } : item))} /> : emptyState}</div> : null}+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </TruncatedTextMarqueeProvider>+ );+}diff --git a/ui/storybook/support/design-proposals/TasksReproductionTrial.tsx b/ui/storybook/support/design-proposals/TasksReproductionTrial.tsxnew file mode 100644index 0000000000..1e89fc2952--- /dev/null+++ b/ui/storybook/support/design-proposals/TasksReproductionTrial.tsx@@ -0,0 +1,64 @@+import { useState } from "react";+import { ListChecks, SearchX } from "lucide-react";+import { CommandPalette } from "@/components/CommandPalette";+import { DesignPageShell } from "@/components/DesignPageShell";+import { DesignSidebar } from "@/components/DesignSidebar";+import { EmptyState } from "@/components/EmptyState";+import { KanbanBoard } from "@/components/KanbanBoard";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { TaskList, type TaskListItem } from "@/components/TaskList";+import { TaskListToolbar } from "@/components/TaskListToolbar";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { useTaskListCollection } from "@/hooks/useTaskListCollection";+import { TruncatedTextMarqueeProvider } from "@/components/TruncatedText";+import { taskListViewStorageKey } from "@/lib/task-list-views";+import { storybookAgents, storybookIssueLabels, storybookProjects } from "../../fixtures/paperclipData";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { initialItems, recentTasks } from "./task-page-data";++// Controller only: all visual composition comes from the shared proposal system.+const userId = "user-board";+const viewKey = taskListViewStorageKey("design-agent-task-list-trial", userId);++function TrialContent() {+ const { selectedCompanyId } = useCompany();+ const { openNewIssue } = useDialogActions();+ const [items, setItems] = useState<TaskListItem[]>(initialItems);+ const { query, setQuery, view, setView, layout, setLayout, filters, updateFilters, clear,+ companyItems, matchingItems: matches, visibleItems, creators, collapsedIds, setCollapsedIds,+ allExpanded, toggleExpanded, activeFilterCount, narrowed } = useTaskListCollection({+ items, companyId: selectedCompanyId, userId, viewStorageKey: viewKey,+ });+ const emptyState = companyItems.length === 0+ ? <EmptyState icon={ListChecks} message="No tasks in this organization" description="This preview has task fixtures for Paperclip Storybook." />+ : <EmptyState icon={SearchX} message="No tasks match this view" description="Try another search or clear your filters." action="Clear filters" hideActionIcon onAction={clear} />;++ return <TruncatedTextMarqueeProvider>+ <DesignPageShell title="Tasks" sidebarStorageKey="paperclip.design-agent-task-list-trial.sidebar-width"+ sidebar={<DesignSidebar recentTasks={recentTasks.map(item => item.issue)} onNewTask={() => openNewIssue()} />}>+ <TaskListToolbar view={view} onViewChange={setView}+ query={query} onQueryChange={setQuery} layout={layout} onLayoutChange={setLayout}+ allExpanded={allExpanded} onToggleExpanded={toggleExpanded}+ onNewTask={() => openNewIssue()}+ filters={{ state: filters, onChange: updateFilters, activeFilterCount,+ agents: storybookAgents, projects: storybookProjects, labels: storybookIssueLabels, currentUserId: userId,+ creators,+ }} />+ {narrowed ? <p className="design-task-results" role="status">{matches.length} matching task{matches.length === 1 ? "" : "s"}{visibleItems.length > matches.length ? " · Parent tasks included for context" : ""}</p> : null}+ <section className="design-task-list-panel" hidden={layout !== "list"} aria-label="Tasks">+ <TaskList key={selectedCompanyId} items={visibleItems} allItems={companyItems} collapsedIds={collapsedIds} onCollapsedIdsChange={setCollapsedIds} emptyState={emptyState} />+ </section>+ {layout === "board" ? <section className="design-task-board" aria-label="Task board">+ {matches.length ? <KanbanBoard issues={matches.map(item => item.issue)} agents={storybookAgents} showOverflowFades+ onUpdateIssue={(id, patch) => setItems(current => current.map(item => item.issue.id === id ? { ...item, issue: { ...item.issue, ...patch } } : item))} /> : emptyState}+ </section> : null}+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </TruncatedTextMarqueeProvider>;+}++export function TasksReproductionTrial() {+ return <DesignProposalAccess><TrialContent /></DesignProposalAccess>;+}diff --git a/ui/storybook/support/design-proposals/TasksReproductionTrial2.tsx b/ui/storybook/support/design-proposals/TasksReproductionTrial2.tsxnew file mode 100644index 0000000000..320cc57546--- /dev/null+++ b/ui/storybook/support/design-proposals/TasksReproductionTrial2.tsx@@ -0,0 +1,81 @@+import { useState } from "react";+import { ListTodo } from "lucide-react";+import { CommandPalette } from "@/components/CommandPalette";+import { DesignPageShell } from "@/components/DesignPageShell";+import { DesignSidebar } from "@/components/DesignSidebar";+import { EmptyState } from "@/components/EmptyState";+import { KanbanBoard } from "@/components/KanbanBoard";+import { NewIssueDialog } from "@/components/NewIssueDialog";+import { TaskList } from "@/components/TaskList";+import { TaskListToolbar } from "@/components/TaskListToolbar";+import { useCompany } from "@/context/CompanyContext";+import { useDialogActions } from "@/context/DialogContext";+import { useTaskListCollection } from "@/hooks/useTaskListCollection";+import { taskListViewStorageKey } from "@/lib/task-list-views";+import { storybookAgents, storybookAuthSession, storybookIssueLabels, storybookProjects } from "../../fixtures/paperclipData";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { initialItems, recentTasks } from "./task-page-data";++const scope = "design-agent-task-list-trial-2";+const sidebarRecents = recentTasks.map(item => item.issue);++function TrialContent() {+ const [items, setItems] = useState(initialItems);+ const { selectedCompanyId } = useCompany();+ const { openNewIssue } = useDialogActions();+ const userId = storybookAuthSession.user.id;+ const collection = useTaskListCollection({+ items, companyId: selectedCompanyId, userId,+ viewStorageKey: taskListViewStorageKey(scope, userId),+ });+ const newTask = () => openNewIssue();+ const emptyState = <EmptyState+ icon={ListTodo}+ message={collection.companyItems.length ? "No tasks match this view" : "No tasks in this organization"}+ action={collection.companyItems.length ? "Clear filters" : "New Task"}+ onAction={collection.companyItems.length ? collection.clear : newTask}+ />;++ return <>+ <DesignPageShell title="Tasks" sidebarStorageKey={`${scope}.sidebar-width`}+ sidebar={<DesignSidebar recentTasks={sidebarRecents} onNewTask={newTask} />}>+ <TaskListToolbar+ view={collection.view} onViewChange={collection.setView}+ query={collection.query} onQueryChange={collection.setQuery}+ layout={collection.layout} onLayoutChange={collection.setLayout}+ allExpanded={collection.allExpanded} onToggleExpanded={collection.toggleExpanded}+ onNewTask={newTask}+ filters={{+ state: collection.filters, onChange: collection.updateFilters,+ activeFilterCount: collection.activeFilterCount, creators: collection.creators,+ currentUserId: userId, agents: storybookAgents,+ projects: storybookProjects, labels: storybookIssueLabels,+ }}+ />+ {collection.narrowed ? <p className="design-task-results" role="status">+ {collection.matchingItems.length} matching {collection.matchingItems.length === 1 ? "task" : "tasks"}+ {collection.layout === "list" && collection.visibleItems.length > collection.matchingItems.length ? " · Parent tasks included for context" : ""}+ </p> : null}+ {/* Preserve the shared table's column/sort state while the board is active. */}+ <div className="design-task-list-panel" hidden={collection.layout !== "list"}>+ <TaskList items={collection.visibleItems} allItems={collection.companyItems}+ collapsedIds={collection.collapsedIds} onCollapsedIdsChange={collection.setCollapsedIds}+ emptyState={emptyState} />+ </div>+ {collection.layout === "board" ? <div className="design-task-board">+ {collection.matchingItems.length ? <KanbanBoard+ issues={collection.matchingItems.map(item => item.issue)} agents={storybookAgents} showOverflowFades+ onUpdateIssue={(id, patch) => setItems(current => current.map(item => item.issue.id === id+ ? { ...item, issue: { ...item.issue, ...patch } } : item))}+ /> : emptyState}+ </div> : null}+ </DesignPageShell>+ <NewIssueDialog />+ <CommandPalette />+ </>;+}++/** Independent composition; collection transitions remain owned by the shared hook. */+export function TasksReproductionTrial2() {+ return <DesignProposalAccess><TrialContent /></DesignProposalAccess>;+}diff --git a/ui/storybook/support/design-proposals/ToolbarsPreview.tsx b/ui/storybook/support/design-proposals/ToolbarsPreview.tsxnew file mode 100644index 0000000000..65befde48a--- /dev/null+++ b/ui/storybook/support/design-proposals/ToolbarsPreview.tsx@@ -0,0 +1,148 @@+import { SkillsNavigationTabs } from "@/components/skill-studio/SkillsNavigationTabs";+import { RoutinesToolbar, type RoutineSortField, type RoutineSortDir, type RoutineGroupBy } from "@/components/RoutinesToolbar";+import type { AttentionItem } from "@paperclipai/shared";+import { useState, type ReactNode } from "react";+import { DecisionsToolbar } from "@/components/DecisionsToolbar";+import { ProjectsToolbar, type ProjectSortField, type ProjectSortDir } from "@/components/ProjectsToolbar";+import { TaskListToolbar } from "@/components/TaskListToolbar";+import { SkillsToolbar, type DiscoverySort } from "@/components/skill-studio/SkillsToolbar";+import { ArtifactsToolbar } from "@/components/artifacts/ArtifactsToolbar";+import type { ArtifactGroupBy, ArtifactKindFilter } from "@/api/artifacts";+import { Button } from "@/components/ui/button";+import { FlyoutAppearanceProvider } from "@/components/ui/flyout";+import { useCompany } from "@/context/CompanyContext";+import { useTaskListCollection } from "@/hooks/useTaskListCollection";+import { defaultAttentionFilterState, countActiveAttentionFilters, filterAttentionItems, type AttentionFilterOptions, type AttentionGroupBy, type AttentionSortOrder } from "@/lib/attention";+import { storybookAgents, storybookAuthSession, storybookIssueLabels, storybookProjects } from "../../fixtures/paperclipData";+import { DesignProposalAccess } from "./DesignProposalAccess";+import { initialItems } from "./task-page-data";++export type ToolbarsPreviewProps = {+ family: "all" | "tasks" | "decisions" | "skills" | "artifacts" | "projects" | "routines";+ width: "full" | "medium" | "narrow";+ onWidthChange?: (width: ToolbarsPreviewProps["width"]) => void;+};+const widths = { full: "max-w-none", medium: "max-w-3xl", narrow: "max-w-sm" };+const attentionOptions: AttentionFilterOptions = {+ sourceKinds: ["approval", "review", "failed_run"], severities: ["critical", "high", "low"],+ projects: [], workspaces: [], hasNoProject: true, hasNoWorkspace: true,+};++const decisionItems = [+ { id: "review", sourceKind: "review" as const, severity: "high" as const, subject: { title: "Review connector recovery", identifier: "DES-3" }, whyNow: "Verification complete", originAgentName: "Connector engineer" },+ { id: "approval", sourceKind: "approval" as const, severity: "critical" as const, subject: { title: "Approve workspace access", identifier: "DES-8" }, whyNow: "Agent needs approval", originAgentName: "Design reviewer" },+].map((item): AttentionItem => ({+ ...item,+ companyId: "storybook-company", subject: { ...item.subject, kind: "issue", id: item.id, companyId: "storybook-company", status: "in_review", href: null },+ decisionVerbs: [], inlineResolvable: false, entryRule: "", exitRule: "", dedupKey: item.id, dismissalKey: item.id,+ dismissal: null, rank: 0, activityAt: "2026-10-16T12:00:00Z", createdAt: "2026-10-16T12:00:00Z", updatedAt: "2026-10-16T12:00:00Z",+ project: null, workspace: null, relatedIssue: null, detail: null, expiresAt: null, ruleKey: null, queues: [], shelf: false,+ retentionDays: 30, keep: false, archivedAt: null, retentionVersion: 1, decideBy: null, decideByAttribution: null, snoozedUntil: null, trainingExampleId: null,+}));++function Specimen({ title, source, children }: { title: string; source: string; children: ReactNode }) {+ return <section aria-label={title} className="min-w-0 space-y-4 border-t border-border pt-6">+ <div className="space-y-1"><h2 className="text-lg font-normal text-foreground">{title}</h2><p className="text-xs text-muted-foreground">{source}</p></div>+ {children}+ </section>;+}++function TaskToolbarSpecimen() {+ const { selectedCompanyId } = useCompany();+ const collection = useTaskListCollection({ items: initialItems, companyId: selectedCompanyId, userId: storybookAuthSession.user.id, viewStorageKey: "paperclip:design-proposals:toolbars:task-view" });+ const [action, setAction] = useState("");+ return <Specimen title="Task toolbar" source="TaskListToolbar · canonical task controls used by Pages / Tasks and the sandbox Tasks page">+ <TaskListToolbar view={collection.view} onViewChange={collection.setView} query={collection.query} onQueryChange={collection.setQuery}+ layout={collection.layout} onLayoutChange={collection.setLayout} allExpanded={collection.allExpanded} onToggleExpanded={collection.toggleExpanded}+ onNewTask={() => setAction("New Task requested · local preview only")}+ filters={{ state: collection.filters, onChange: collection.updateFilters, activeFilterCount: collection.activeFilterCount, agents: storybookAgents, projects: storybookProjects, labels: storybookIssueLabels, currentUserId: storybookAuthSession.user.id, creators: collection.creators }} />+ <output aria-live="polite" className="block text-xs text-muted-foreground">{collection.matchingItems.length} matching tasks · {collection.layout === "list" ? "List" : "Board"} · {collection.allExpanded ? "Expanded" : "Collapsed"}{action ? ` · ${action}` : ""}</output>+ </Specimen>;+}++function DecisionsToolbarSpecimen() {+ const [query, setQuery] = useState("");+ const [filters, setFilters] = useState(defaultAttentionFilterState);+ const [groupBy, setGroupBy] = useState<AttentionGroupBy>("none");+ const [sortOrder, setSortOrder] = useState<AttentionSortOrder>("newest");+ return <Specimen title="Decisions toolbar" source="DecisionsToolbar · shipped filter, group and sort controls shared by WhatNeedsMe and DecisionQueuePage">+ <DecisionsToolbar query={query} onQueryChange={setQuery} visibleCount={filterAttentionItems(decisionItems, filters, query).length} filterOptions={attentionOptions} filters={filters} onFiltersChange={setFilters} groupBy={groupBy} onGroupByChange={setGroupBy} sortOrder={sortOrder} onSortOrderChange={setSortOrder} />+ <output aria-live="polite" className="block text-xs text-muted-foreground">{countActiveAttentionFilters(filters)} active filters · Group: {groupBy} · Sort: {sortOrder} · Search: {query || "All decisions"}</output>+ </Specimen>;+}++function SkillsToolbarSpecimen() {+ const [search, setSearch] = useState("");+ const [sort, setSort] = useState<DiscoverySort>("agents");+ const [source, setSource] = useState("all");+ const [scanPending, setScanPending] = useState(false);+ const [selectMode, setSelectMode] = useState(false);+ const [action, setAction] = useState("");+ const report = (label: string) => () => setAction(`${label} requested · local preview only`);+ return <Specimen title="Skills toolbar" source="SkillsToolbar · extracted from CompanySkills and reused by the sandbox. Original search, sort, source, scan and creation controls.">+ <SkillsToolbar navigation={<SkillsNavigationTabs activeView="installed" />} viewTitle="Installed skills" viewDescription="Skills available to this organization." searchLabel="Search installed skills"+ search={search} onSearchChange={setSearch} sort={sort} onSortChange={setSort}+ availableSources={[{ value: "github", label: "GitHub" }, { value: "local", label: "Local" }]} sourceBadgeFilter={source} setSourceBadgeFilter={setSource}+ onScan={() => { setScanPending(true); setAction("Scanning project workspaces · local preview only"); }} scanPending={scanPending}+ onCreate={report("Create skill")} onBrowseDiscover={report("Discover skills")} onImport={report("Import skill")} onImportFromProject={report("Import from project")}+ onCreateFolder={report("New folder")} selectMode={selectMode} onToggleSelectMode={() => setSelectMode(value => !value)} />+ {scanPending && <Button variant="outline" size="sm" onClick={() => { setScanPending(false); setAction("Scan completed · local preview only"); }}>Complete simulated scan</Button>}+ <output aria-live="polite" className="block text-xs text-muted-foreground">Search: {search || "All skills"} · Sort: {sort} · Source: {source} · {selectMode ? "Selecting" : "Browsing"}{action ? ` · ${action}` : ""}</output>+ </Specimen>;+}++function ArtifactsToolbarSpecimen() {+ const [query, setQuery] = useState("");+ const [groupBy, setGroupBy] = useState<ArtifactGroupBy>("task");+ const [kind, setKind] = useState<ArtifactKindFilter>("all");+ return <Specimen title="Artifacts toolbar" source="ArtifactsToolbar · extracted from Artifacts and reused by the sandbox. Search, grouping and type filters use the shared toolbar control geometry. Type-filter styling outside toolbars is reviewed separately in Tabs.">+ <ArtifactsToolbar query={query} onQueryChange={setQuery} groupBy={groupBy} onGroupByChange={setGroupBy} kind={kind} onKindChange={setKind} />+ <output aria-live="polite" className="block text-xs text-muted-foreground">Search: {query || "All artifacts"} · Group: {groupBy} · Type: {kind}</output>+ </Specimen>;+}++function ProjectsToolbarSpecimen() {+ const [query, setQuery] = useState("");+ const [field, setField] = useState<ProjectSortField>("name");+ const [direction, setDirection] = useState<ProjectSortDir>("asc");+ const [action, setAction] = useState("");+ return <Specimen title="Projects toolbar" source="ProjectsToolbar · shared project search, sort direction and Add Project action used by the Projects page.">+ <ProjectsToolbar query={query} onQueryChange={setQuery} sortField={field} sortDir={direction} onSortChange={(nextField, nextDirection) => { setField(nextField); setDirection(nextDirection); }} onNewProject={() => setAction("Add Project requested · local preview only")} />+ <output className="block text-xs" aria-live="polite">Search: {query || "All projects"} · Sort: {field} · Direction: {direction}{action ? ` · ${action}` : ""}</output>+ </Specimen>;+}++function RoutinesToolbarSpecimen() {+ const [query, setQuery] = useState("");+ const [field, setField] = useState<RoutineSortField>("updated");+ const [direction, setDirection] = useState<RoutineSortDir>("desc");+ const [group, setGroup] = useState<RoutineGroupBy>("folder");+ const [action, setAction] = useState("");+ return <Specimen title="Routines toolbar" source="RoutinesToolbar · shared routine search, sorting, grouping, folder creation and run history controls used by the Routines page.">+ <RoutinesToolbar query={query} onQueryChange={setQuery} sortField={field} sortDir={direction} groupBy={group}+ onSortChange={(nextField, nextDirection) => { setField(nextField); setDirection(nextDirection); }} onGroupChange={setGroup}+ runsHref="/activity/runs" onNewFolder={group === "folder" ? () => setAction("New folder requested · local preview only") : undefined}+ onCreateRoutine={() => setAction("Create routine requested · local preview only")} />+ <output className="block text-xs" aria-live="polite">Search: {query || "All routines"} · Sort: {field} · Direction: {direction} · Group: {group}{action ? ` · ${action}` : ""}</output>+ </Specimen>;+}++export function ToolbarsPreview({ family, width, onWidthChange }: ToolbarsPreviewProps) {+ return <FlyoutAppearanceProvider><DesignProposalAccess>+ <main data-testid="toolbars-preview" className="min-h-dvh space-y-8 bg-background p-6 font-sans text-muted-foreground sm:p-10">+ <header className="space-y-3"><p className="text-xs">Design proposals · Components</p><h1 className="text-2xl font-semibold text-foreground">Toolbars</h1>+ <p className="max-w-3xl text-sm">Canonical toolbar references for Design Proposals. Reuse the component for its job; task views, decision grouping, skill discovery and artifact browsing remain distinct patterns. Shared foundations, buttons, focus states and flyouts apply to each.</p>+ <label className="flex w-fit items-center gap-3 text-xs">Container width<select className="rounded-md border border-border bg-background px-3 py-2 text-sm" aria-label="Toolbar container width" value={width} onChange={event => onWidthChange?.(event.target.value as ToolbarsPreviewProps["width"])}><option value="full">Full</option><option value="medium">Medium</option><option value="narrow">Narrow</option></select></label>+ </header>+ <div className={`w-full space-y-8 ${widths[width]}`} data-testid="toolbar-specimens" data-container-width={width}>+ {(family === "all" || family === "tasks") && <TaskToolbarSpecimen />}+ {(family === "all" || family === "decisions") && <DecisionsToolbarSpecimen />}+ {(family === "all" || family === "skills") && <SkillsToolbarSpecimen />}+ {(family === "all" || family === "artifacts") && <ArtifactsToolbarSpecimen />}+ {(family === "all" || family === "projects") && <ProjectsToolbarSpecimen />}+ {(family === "all" || family === "routines") && <RoutinesToolbarSpecimen />}+ </div>+ <p className="max-w-3xl text-xs">Local fixture state only. Search, menus, toggles and feedback can be inspected here; creation actions report an intent without changing saved data. These are canonical proposal references, with production adoption and backend verification tracked separately.</p>+ </main>+ </DesignProposalAccess></FlyoutAppearanceProvider>;+}diff --git a/ui/storybook/support/design-proposals/TypographyPreview.tsx b/ui/storybook/support/design-proposals/TypographyPreview.tsxnew file mode 100644index 0000000000..ed297c1ebe--- /dev/null+++ b/ui/storybook/support/design-proposals/TypographyPreview.tsx@@ -0,0 +1,163 @@+import { useLayoutEffect, useRef, useState, type RefObject } from "react";+import { Bot } from "lucide-react";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { MarkdownBody } from "@/components/MarkdownBody";+import { MetricCard } from "@/components/MetricCard";+import { TaskList } from "@/components/TaskList";+import { readTask, unreadTask } from "./task-list-data";+import { typeRamp, typeRoles } from "./typography-specification";++type Metrics = { size: string; leading: string; weight: string; family: string; tracking: string };+const proseRoles = [+ ["p", "Body paragraph"], ["h1", "Markdown H1"], ["h2", "Markdown H2"], ["h3", "Markdown H3"], ["h4", "Markdown H4"],+ ["strong", "Strong emphasis"], ["em", "Italic emphasis"], ["a", "Text link"], ["li", "List item"], ["blockquote p", "Quoted text"], ["li code", "Inline code"], ["pre code", "Code block"],+] as const;++function useTypeMetrics(root: RefObject<HTMLElement | null>, dependency: string) {+ const [metrics, setMetrics] = useState<Record<string, Metrics>>({});+ useLayoutEffect(() => {+ let disposed = false;+ const measure = () => {+ if (disposed || !root.current) return;+ const measured: Record<string, Metrics> = {};+ const read = (element: Element) => {+ const style = getComputedStyle(element);+ return { size: style.fontSize, leading: style.lineHeight, weight: style.fontWeight, family: style.fontFamily, tracking: style.letterSpacing };+ };+ root.current.querySelectorAll<HTMLElement>("[data-type-sample]").forEach(element => {+ measured[element.dataset.typeSample!] = read(element);+ });+ proseRoles.forEach(([selector, label]) => {+ const element = root.current?.querySelector(`[data-markdown-specimen] .paperclip-markdown ${selector}`);+ if (element) measured[label] = read(element);+ });+ setMetrics(measured);+ };+ measure();+ void document.fonts.ready.then(measure);+ window.addEventListener("resize", measure);+ return () => { disposed = true; window.removeEventListener("resize", measure); };+ }, [root, dependency]);+ return metrics;+}++function Measurement({ value, inherited = false }: { value?: Metrics; inherited?: boolean }) {+ return <span className="block text-xs leading-relaxed text-muted-foreground" data-type-metrics>+ {value ? <><span className="font-mono tabular-nums">{value.size} / {value.leading}</span><br />Weight {value.weight}{inherited ? " · leading inherited in this sample" : ""}{value.tracking !== "normal" && value.tracking !== "0px" ? <><br />Tracking {value.tracking}</> : null}</> : "Measuring…"}+ </span>;+}++const markdown = `# First-level heading+## Second-level heading+### Third-level heading+#### Fourth-level heading+This is rendered agent prose with **strong emphasis**, *italic emphasis*, and a [text link](#usage).++- A list uses the same body rhythm.+- Inline code: \`pnpm typecheck\`.++> A quoted note keeps the prose hierarchy.++\`\`\`ts+const status = "in_progress";+\`\`\``;++/** A guide to current recipes. Integrated examples below mount shared components. */+export function TypographyPreview() {+ const root = useRef<HTMLElement>(null);+ const [query, setQuery] = useState("");+ const [area, setArea] = useState("All areas");+ const [reviewOnly, setReviewOnly] = useState(false);+ const roles = typeRoles.filter(role => (area === "All areas" || area === role.area) && (!reviewOnly || role.review) && `${role.name} ${role.use} ${role.recipe} ${role.source} ${role.review ?? ""}`.toLowerCase().includes(query.toLowerCase()));+ const metrics = useTypeMetrics(root, roles.map(role => role.id).join(","));+ const areas = [...new Set(typeRoles.map(role => role.area))];++ return <main ref={root} className="min-h-screen bg-background px-6 py-10 font-sans text-muted-foreground sm:px-10" data-testid="typography-foundations-preview">+ <div className="mx-auto flex max-w-6xl flex-col gap-12">+ <header className="flex flex-col gap-4">+ <p className="text-xs">Design proposals · Foundations · Typography</p>+ <h1 className="text-3xl font-semibold tracking-tight text-foreground">Type specification</h1>+ <p className="max-w-3xl text-sm leading-relaxed">A proposed size ramp, with the text roles used by Design Proposals and the design sandbox. Samples read the active tokens. The usage inventory records current source recipes; differences from the proposed guidance remain visible for review.</p>+ <nav aria-label="Typography sections" className="flex flex-wrap gap-x-6 gap-y-2 text-sm">+ {[["ramp", "Size ramp"], ["families", "Families & weights"], ["usage", "Usage inventory"], ["examples", "In context"], ["review", "Review items"]].map(([id, label]) => <a key={id} href={`#${id}`} className="underline underline-offset-4 hover:text-foreground">{label}</a>)}+ </nav>+ </header>++ <section aria-labelledby="ramp" className="flex flex-col gap-5">+ <div><h2 id="ramp" className="text-lg font-semibold text-foreground">Text size ramp</h2><p className="mt-2 text-sm leading-relaxed">Your proposed 10–30px scale. Size and default leading below are measured in this browser; custom compact and nano sizes inherit their surrounding line height. Weights and role-specific leading are specified separately.</p></div>+ <div className="rounded-lg border border-border">+ {typeRamp.map(step => <div key={step.token} data-ramp={step.token} className="grid gap-3 border-b border-border px-5 py-5 last:border-b-0 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3">+ <div className="flex min-w-0 flex-col gap-2"><span data-type-sample={`ramp-${step.token}`} className={`${step.className} font-normal text-foreground`}>{step.token} · {step.size}px</span><code className="text-xs">--text-{step.token}</code></div>+ <div className="text-sm leading-relaxed"><p>{step.use}</p><p className="mt-1 text-xs">{step.source}</p></div>+ <div className="sm:col-span-2 lg:col-span-1"><Measurement value={metrics[`ramp-${step.token}`]} inherited={["compact", "nano"].includes(step.token)} /></div>+ </div>)}+ </div>+ <p className="text-xs leading-relaxed">The number beside each step is the proposed default pixel size at a 16px root. The measured value follows the active token and browser settings. Rendered Markdown currently contains additional sizes; see In context.</p>+ </section>++ <section aria-labelledby="families" className="flex flex-col gap-5">+ <h2 id="families" className="text-lg font-semibold text-foreground">Families & weights</h2>+ <div className="grid gap-4 md:grid-cols-2">+ {[+ { id: "sans", name: "Inter Variable", token: "--font-sans", className: "font-sans", sample: "Good UI starts with clear type.", use: "Interface labels, headings, prose and controls. Regular and italic variable font assets are bundled." },+ { id: "paper", name: "Paper Mono", token: "--font-paper-mono", className: "font-(family-name:--font-paper-mono)", sample: "DES-431 · codex/design-system", use: "The single monospace family for task IDs, worktrees, code, run metrics and diagnostics. The shared --font-mono token resolves to this same bundled font." },+ ].map(family => <article key={family.id} className="flex min-w-0 flex-col gap-4 rounded-lg border border-border p-5">+ <div><h3 className="text-sm font-semibold text-foreground">{family.name}</h3><code className="text-xs">{family.token}</code></div>+ <p data-type-sample={`family-${family.id}`} className={`${family.className} break-words text-sm text-foreground`}>{family.sample}</p>+ <p className="text-xs leading-relaxed">{family.use}</p>+ <details className="text-xs"><summary className="cursor-pointer hover:text-foreground">Active font stack</summary><code className="mt-2 block break-words leading-relaxed">{metrics[`family-${family.id}`]?.family ?? "Measuring…"}</code></details>+ </article>)}+ </div>+ <div className="grid grid-cols-2 gap-4 rounded-lg border border-border p-5">+ {[+ ["normal", "font-normal", "Read content / metadata / controls"], ["semibold", "font-semibold", "Headings / unread titles / organization trigger"],+ ].map(([name, className, use]) => <div key={name}><p className={`${className} text-sm text-foreground`} data-type-sample={`weight-${name}`}>{name} · {metrics[`weight-${name}`]?.weight ?? "…"}</p><p className="mt-1 text-xs leading-relaxed">{use}</p><code className="mt-2 block text-xs">--font-weight-{name}</code></div>)}+ </div>+ <div className="grid gap-6 text-sm leading-relaxed md:grid-cols-2">+ <div><h3 className="font-semibold text-foreground">Color & emphasis</h3><p className="mt-2">Default text uses <code>--muted-foreground</code> (Paper: dark-color-muted-foreground). Headings, emphasis and ON/selected states use <code>--foreground</code>. Hover promotes read titles without changing weight. Unread titles are semibold. Status, validation and text on a filled CTA/message surface use their semantic contrast colors.</p></div>+ <div><h3 className="font-semibold text-foreground">Rhythm & overflow</h3><p className="mt-2">Leading belongs to the role: task rows use 14/16, toolbar controls 14/20, navigation 14/21 and the task title 24/36. Density changes row height, not font size. Narrow lists hide metadata columns; they preserve readable title size, truncation and the shared marquee. Reduced motion keeps text readable without animation.</p></div>+ </div>+ </section>++ <section aria-labelledby="usage" className="flex flex-col gap-5">+ <div><h2 id="usage" className="text-lg font-semibold text-foreground">Usage inventory</h2><p className="mt-2 text-sm leading-relaxed">Source-derived roles across the proposal components and sandbox pages. These isolated recipe samples document typography; they are not replacement components. Expand a source to find the owning implementation. Actual shared components appear below.</p></div>+ <div className="flex flex-wrap items-end gap-4">+ <label className="flex min-w-0 flex-1 flex-col gap-2 text-xs">Find a text role<Input type="search" value={query} onChange={event => setQuery(event.target.value)} placeholder="Search roles, tokens or sources…" /></label>+ <label className="flex flex-col gap-2 text-xs">Area<select className="h-10 max-w-full rounded-md border border-border bg-background px-3 text-sm text-muted-foreground" value={area} onChange={event => setArea(event.target.value)}><option>All areas</option>{areas.map(value => <option key={value}>{value}</option>)}</select></label>+ <label className="flex h-10 items-center gap-2 text-sm"><input type="checkbox" checked={reviewOnly} onChange={event => setReviewOnly(event.target.checked)} />Review items only</label>+ </div>+ <p role="status" className="text-xs">{roles.length} of {typeRoles.length} text roles</p>+ <div className="border-t border-border">+ {roles.map(role => <article key={role.id} data-type-role={role.id} className="grid min-w-0 gap-5 border-b border-border py-6 md:grid-cols-3">+ <div className="min-w-0"><p className="text-xs">{role.area}</p><h3 className="mt-1 text-sm font-semibold text-foreground">{role.name}</h3><p className="mt-2 text-xs leading-relaxed">{role.use}</p><details className="mt-3 text-xs"><summary className="cursor-pointer hover:text-foreground">Source & recipe</summary><code className="mt-2 block break-words leading-relaxed">{role.source}</code><code className="mt-2 block break-words leading-relaxed">{role.recipe}</code></details></div>+ <div className="min-w-0 self-center break-words"><span data-type-sample={role.id} className={role.className} style={role.style}>{role.sample}</span></div>+ <div className="self-center"><Measurement value={metrics[role.id]} inherited={role.inheritedLeading} />{role.review ? <div className="mt-3 border-l-2 border-border pl-3 text-xs leading-relaxed"><span className="font-normal text-foreground">Review</span><p className="mt-1">{role.review}</p></div> : null}</div>+ </article>)}+ {roles.length === 0 ? <p className="py-8 text-sm">No text roles match these filters.</p> : null}+ </div>+ </section>++ <section aria-labelledby="examples" className="flex flex-col gap-5">+ <div><h2 id="examples" className="text-lg font-semibold text-foreground">In context · shared components</h2><p className="mt-2 text-sm leading-relaxed">These mount the real components with synthetic content. They stay connected to future component and token edits.</p></div>+ <div className="grid gap-5 md:grid-cols-2"><MetricCard appearance="card" icon={Bot} value={24} label="Agents Enabled" description="0 running, 1 paused, 0 errors" /><div className="flex flex-wrap items-center gap-3 rounded-lg border border-border p-5"><Button variant="cta">Continue</Button><Button variant="outline">Cancel</Button><Button size="xs" variant="ghost">Small action</Button><p className="w-full text-xs">Shared Button labels: 14px normal; extra-small 12px.</p></div></div>+ <div className="overflow-x-auto"><TaskList initialColumns={["task", "taskId", "lastUpdated"]} items={[{ issue: readTask }, { issue: unreadTask, unread: true }]} /></div>+ <div className="grid gap-6 rounded-lg border border-border p-5 lg:grid-cols-2">+ <div data-markdown-specimen><MarkdownBody>{markdown}</MarkdownBody></div>+ <div className="flex flex-col gap-4 text-sm leading-relaxed"><h3 className="font-semibold text-foreground">Standalone Markdown has its own scale</h3><p>Outside conversation regions, the shared renderer uses 15px body text at 1.6 leading. Proposed conversations override this to 14px/20px. Its H1–H4 rules resolve to 24, 20, 16.8 and 15.2px at the default root. Strong text is semibold; code uses Paper Mono. These values are outside a strict application of the proposed ramp.</p><p>In proposed conversations, final agent prose uses foreground; commentary and reasoning use muted foreground at 14px/20px. Human bubbles keep white text. Metadata and diagnostic output use 12px/16px. See Conversation type spec for the shared thread inventory.</p><p className="text-xs">Sources: <code>ui/src/components/MarkdownBody.tsx</code> and <code>ui/src/index.css</code> · <code>.paperclip-markdown</code>, <code>.task-chat-reasoning-markdown</code>.</p><div className="divide-y divide-border">{proseRoles.map(([, label]) => <div key={label} data-prose-role={label} className="flex justify-between gap-3 py-2 text-xs"><span>{label}</span><Measurement value={metrics[label]} /></div>)}</div><p className="text-xs">Measurements above come from the rendered shared MarkdownBody at left. This sample does not simulate a live runner.</p></div>+ </div>+ </section>++ <section aria-labelledby="review" className="flex flex-col gap-4 rounded-lg border border-border p-6">+ <h2 id="review" className="text-lg font-semibold text-foreground">Decisions still to make</h2>+ <ul className="list-disc space-y-3 pl-5 text-sm leading-relaxed">+ <li>Keep 14px task-row metadata as a deliberate exception, or introduce a smaller metadata role?</li>+ <li>Keep 14px right-pane values beside 12px labels, or move more of the pane to xs?</li>+ <li>Conversation Markdown is consolidated to 14px; decide separately whether standalone documents should adopt that scale.</li>+ <li>Promote muted dashboard/chart headings to foreground, or explicitly retain their quieter hierarchy?</li>+ </ul>+ <p className="text-xs leading-relaxed">The remaining differences above are still open for review. The shared proposal typography is applied to Storybook and the sandbox. Scope: Design Proposals and the sandbox’s shell, Tasks, dashboard, agent overview and task conversation/detail surfaces. Unrelated product pages and light mode are outside this reference.</p>+ </section>+ </div>+ </main>;+}diff --git a/ui/storybook/support/design-proposals/agent-workload-trial-data.ts b/ui/storybook/support/design-proposals/agent-workload-trial-data.tsnew file mode 100644index 0000000000..8c306a3469--- /dev/null+++ b/ui/storybook/support/design-proposals/agent-workload-trial-data.ts@@ -0,0 +1,84 @@+import type { Agent, Issue } from "@paperclipai/shared";+import { createIssue, storybookAgents, storybookAuthSession, storybookCompanies } from "../../fixtures/paperclipData";++export const workloadAgentIds = {+ mira: "agent-workload-trial-mira",+ atlas: "agent-workload-trial-atlas",+ sage: "agent-workload-trial-sage",+ quinn: "agent-workload-trial-quinn",+ rowan: "agent-workload-trial-rowan",+ ember: "agent-workload-trial-ember",+} as const;++const companyId = storybookCompanies[0]!.id;+const now = Date.now();+const ago = (minutes: number) => new Date(now - minutes * 60_000);++function agent(id: string, name: string, title: string, status: Agent["status"], role: Agent["role"] = "engineer"): Agent {+ return {+ ...storybookAgents[0]!, id, companyId, name, title, role,+ urlKey: id, status, reportsTo: null,+ capabilities: title, adapterConfig: {}, runtimeConfig: {},+ budgetMonthlyCents: 50_000, spentMonthlyCents: 0,+ lastHeartbeatAt: status === "paused" ? ago(180) : ago(3),+ pauseReason: status === "paused" ? "manual" : null,+ pausedAt: status === "paused" ? ago(180) : null,+ metadata: null, createdAt: ago(10_080), updatedAt: ago(3),+ };+}++export const workloadAgents: Agent[] = [+ agent(workloadAgentIds.mira, "Mira", "Product engineer", "running"),+ agent(workloadAgentIds.atlas, "Atlas — International Infrastructure and Reliability", "Infrastructure engineer", "running"),+ agent(workloadAgentIds.sage, "Sage", "Research analyst", "idle", "researcher"),+ agent(workloadAgentIds.quinn, "Quinn", "Quality engineer", "idle", "qa"),+ agent(workloadAgentIds.rowan, "Rowan", "Content strategist", "paused", "general"),+ agent(workloadAgentIds.ember, "Ember", "Release engineer", "running"),+];++function task(number: number, assigneeAgentId: string, title: string, status: Issue["status"], minutesAgo: number): Issue {+ const updatedAt = ago(minutesAgo);+ return createIssue({+ id: `agent-workload-trial-task-${number}`, companyId, assigneeAgentId,+ assigneeUserId: null, responsibleUserId: storybookAuthSession.user.id,+ identifier: `PAP-${number}`, issueNumber: number, title,+ description: `Synthetic workload example: ${title}.`, status, priority: "medium",+ projectId: null, projectWorkspaceId: null, project: null,+ goalId: null, goal: null, parentId: null,+ createdByUserId: storybookAuthSession.user.id, createdByAgentId: null,+ checkoutRunId: null, executionRunId: null, executionAgentNameKey: null, executionLockedAt: null,+ executionWorkspaceId: null, executionWorkspacePreference: null, currentExecutionWorkspace: null,+ labelIds: [], labels: [], blockedBy: [], blocks: [], billingCode: null,+ isUnreadForMe: false, myLastTouchAt: updatedAt, lastExternalCommentAt: null,+ lastActivityAt: updatedAt, startedAt: status === "todo" || status === "backlog" ? null : ago(1_440),+ completedAt: status === "done" ? updatedAt : null,+ createdAt: ago(4_320), updatedAt,+ });+}++export const workloadTasks: Issue[] = [+ task(801, workloadAgentIds.mira, "Simplify the first-run workspace setup", "in_progress", 2),+ task(802, workloadAgentIds.mira, "Resolve overlapping invitation states when a workspace owner retries an expired invitation", "in_progress", 7),+ task(803, workloadAgentIds.mira, "Add setup guidance to the welcome checklist", "todo", 18),+ task(804, workloadAgentIds.mira, "Explore a reusable workspace starter", "backlog", 190),+ task(805, workloadAgentIds.mira, "Review the onboarding copy with customer success", "in_review", 12),+ task(806, workloadAgentIds.mira, "Ship the invitation confirmation screen", "done", 55),+ task(807, workloadAgentIds.mira, "Clarify ownership of the activation milestone", "blocked", 105),+ task(808, workloadAgentIds.atlas, "Investigate intermittent replication lag across the international billing infrastructure before the next regional rollout", "in_progress", 3),+ task(809, workloadAgentIds.atlas, "Prepare region-aware health checks", "in_progress", 9),+ task(810, workloadAgentIds.atlas, "Document the failover rehearsal", "todo", 28),+ task(811, workloadAgentIds.atlas, "Add regional latency budgets", "todo", 76),+ task(812, workloadAgentIds.atlas, "Investigate read-replica capacity planning", "backlog", 220),+ task(813, workloadAgentIds.atlas, "Review the EU rollout checklist", "in_review", 31),+ task(814, workloadAgentIds.atlas, "Replace expired staging certificates", "done", 150),+ task(815, workloadAgentIds.sage, "Summarize customer interviews for the planning review", "done", 40),+ task(816, workloadAgentIds.sage, "Publish the competitor onboarding comparison", "done", 215),+ task(817, workloadAgentIds.sage, "Validate the research brief with product", "in_review", 95),+ task(818, workloadAgentIds.rowan, "Draft launch messaging for the partner pilot", "todo", 185),+ task(819, workloadAgentIds.rowan, "Prepare customer-story interview questions", "backlog", 260),+ task(820, workloadAgentIds.rowan, "Get approval for the revised campaign brief", "blocked", 181),+ task(821, workloadAgentIds.rowan, "Publish the product update digest", "done", 330),+ task(822, workloadAgentIds.ember, "Verify the release candidate against the smoke checklist", "in_progress", 5),+ task(823, workloadAgentIds.ember, "Prepare the rollback rehearsal", "todo", 66),+ task(824, workloadAgentIds.ember, "Review dependency updates for the release", "done", 130),+];diff --git a/ui/storybook/support/design-proposals/agent-workload-trial.css b/ui/storybook/support/design-proposals/agent-workload-trial.cssnew file mode 100644index 0000000000..7adddbfe07--- /dev/null+++ b/ui/storybook/support/design-proposals/agent-workload-trial.css@@ -0,0 +1,10 @@+/* Trial-local composition: the shared toolbar responds to viewport width,+ while this collection can narrow independently when its context pane opens. */+.agent-workload-trial [data-slot="collection-toolbar"] > :first-child {+ flex-wrap: wrap;+ gap: var(--design-page-toolbar-gap);+}++.agent-workload-trial [data-slot="collection-toolbar-search"] {+ flex-basis: var(--design-page-search-width);+}diff --git a/ui/storybook/support/design-proposals/button-usage.d.ts b/ui/storybook/support/design-proposals/button-usage.d.tsnew file mode 100644index 0000000000..f6ae257559--- /dev/null+++ b/ui/storybook/support/design-proposals/button-usage.d.ts@@ -0,0 +1,4 @@+declare module "virtual:paperclip-button-usage" {+ const inventory: { entries: { file: string; line: number; scope: "app" | "proposal"; variant: string; size: string }[] };+ export default inventory;+}diff --git a/ui/storybook/support/design-proposals/conversation-type-inventory.ts b/ui/storybook/support/design-proposals/conversation-type-inventory.tsnew file mode 100644index 0000000000..ded88dedca--- /dev/null+++ b/ui/storybook/support/design-proposals/conversation-type-inventory.ts@@ -0,0 +1,91 @@+import type { CSSProperties } from "react";++const sourceRoot = "ui/src/components/task-chat/";+const surfaces: Record<string, [string, string]> = {+ "task-chat-human-bubble": ["Human message", "TaskChatBubble.tsx"],+ "task-chat-agent-bubble": ["Agent reply", "TaskChatBubble.tsx"],+ "task-chat-agent-identity": ["Agent identity", "TaskChatBubble.tsx"],+ "task-chat-live-text": ["Live commentary", "TaskChatLiveTail.tsx"],+ "task-chat-phase-interstitial": ["Activity commentary", "TaskChatRunnerActivityGroup.tsx"],+ "task-chat-thinking": ["Reasoning", "TaskChatThinking.tsx"],+ "task-chat-runner-activity-detail": ["Activity detail", "TaskChatRunnerActivityGroup.tsx"],+ "task-chat-activity-phase": ["Activity group", "TaskChatRunnerActivityGroup.tsx"],+ "task-chat-tool-card": ["Tool activity", "TaskChatToolCard.tsx"],+ "task-chat-live-run-pill": ["Run progress", "TaskChatLiveRunPill.tsx"],+ "task-chat-turn-status-header": ["Native run progress", "TaskChatRunnerTurn.tsx"],+ "task-chat-current-activity": ["Native current activity", "TaskChatRunnerTurn.tsx"],+ "task-chat-final-response": ["Native final response", "TaskChatRunnerTurn.tsx"],+ "task-chat-turn-summary": ["Activity footer", "TaskChatTurn.tsx"],+ "task-chat-system-notice": ["System notice", "TaskChatSystemNotice.tsx"],+ "task-chat-runtime-request": ["Runtime request", "TaskChatProtocolCard.tsx"],+ "task-chat-runtime-request-history": ["Request receipt", "TaskChatProtocolCard.tsx"],+ "task-chat-composer-takeover": ["Composer request", "TaskChatComposer.tsx"],+ "task-chat-composer-input": ["Composer input", "TaskChatComposer.tsx"],+ "task-chat-composer-actions": ["Composer controls", "TaskChatComposer.tsx"],+ "paused-composer-takeover": ["Paused composer", "TaskChatPausedTakeover.tsx"],+ "task-chat-collapsible-marker": ["Run outcome", "TaskChatMarker.tsx"],+};+export type ConversationTypeRole = {+ key: string; name: string; area: string; text: string; sampleStyle: CSSProperties;+ family: string; size: string; leading: string; weight: string; color: string;+ tracking: string; emphasis: string; opacity: string; metricKey: string;+ states: string[]; sources: string[]; recipes: string[];+};+export type ConversationTypeInventory = { roles: ConversationTypeRole[]; states: string[]; capturedAt: string };++/** Inspect text already mounted by the shared sandbox composition. No imitation+ * renderer or hardcoded font metrics; closed disclosures stay out of the census. */+export function measureConversationType(root: HTMLElement): ConversationTypeInventory {+ const roles = new Map<string, ConversationTypeRole>();+ const cases = [...root.querySelectorAll<HTMLElement>("[data-preview-case]")];+ for (const example of cases) {+ const walker = document.createTreeWalker(example, NodeFilter.SHOW_TEXT);+ while (walker.nextNode()) {+ const node = walker.currentNode;+ const parent = node.parentElement;+ const text = node.textContent?.replace(/\s+/g, " ").trim();+ if (!text || !parent || parent.closest('[aria-hidden="true"], .sr-only, svg, script, style') || !parent.getClientRects().length) continue;+ if (parent === example.firstElementChild && parent.tagName === "H3") continue;+ const computed = getComputedStyle(parent);+ if (computed.visibility !== "visible" || computed.opacity === "0") continue;+ let area = "Conversation support";+ let source = "ui/src/components/design-sandbox/DesignSandboxTaskThread.tsx";+ const recipes: string[] = [];+ let opacity = 1;+ for (let ancestor: HTMLElement | null = parent; ancestor && ancestor !== example; ancestor = ancestor.parentElement) {+ opacity *= Number(getComputedStyle(ancestor).opacity);+ if (ancestor.classList.length) recipes.push(`${ancestor.tagName.toLowerCase()}.${[...ancestor.classList].join(".")}`);+ const id = ancestor.dataset.testid;+ if (id && surfaces[id] && area === "Conversation support") {+ [area, source] = [surfaces[id][0], sourceRoot + surfaces[id][1]];+ }+ if (id && /^(task-chat-provider-|task-chat-workspace-|task-chat-run-result|task-chat-run-terminal|task-chat-resource-)/.test(id) && area === "Conversation support") {+ [area, source] = ["Structured activity", sourceRoot + "TaskChatProtocolCard.tsx"];+ }+ }+ if (!opacity) continue;+ const semantic = parent.closest("code, pre, strong, b, em, i, a, blockquote, h1, h2, h3, h4, h5, h6, li, button, label, textarea, p");+ const tag = semantic?.tagName.toLowerCase();+ const form = parent.closest("button") ? "Control label" : tag === "code" || tag === "pre" ? "Code / command" : tag === "strong" || tag === "b" ? "Strong emphasis" : tag === "em" || tag === "i" ? "Italic emphasis" : tag === "a" ? "Link" : tag === "li" ? "List text" : tag === "p" ? "Body text" : tag?.startsWith("h") ? "Heading" : /^\d{1,2}:\d\d [AP]M$/.test(text) ? "Timestamp" : "Supporting text";+ const values = {+ family: computed.fontFamily, size: computed.fontSize, leading: computed.lineHeight,+ weight: computed.fontWeight, color: computed.color, tracking: computed.letterSpacing,+ emphasis: `${computed.fontStyle} / ${computed.textDecorationLine}`, opacity: String(Number(opacity.toFixed(3))),+ };+ const metricKey = JSON.stringify([values.family, values.size, values.leading, values.weight, values.tracking, computed.fontStyle]);+ const key = JSON.stringify([area, form, values]);+ const state = example.dataset.previewCase!;+ const role = roles.get(key) ?? {+ key, metricKey, name: `${area} · ${form.toLowerCase()}`, area, text, ...values,+ sampleStyle: { fontFamily: values.family, fontSize: values.size, lineHeight: values.leading, fontWeight: values.weight, color: values.color, letterSpacing: values.tracking, fontStyle: computed.fontStyle, textDecorationLine: computed.textDecorationLine, opacity: values.opacity },+ states: [], sources: [], recipes: [],+ };+ if (!role.states.includes(state)) role.states.push(state);+ if (!role.sources.includes(source)) role.sources.push(source);+ if (parent.closest(".paperclip-markdown") && !role.sources.includes("ui/src/index.css · .paperclip-markdown")) role.sources.push("ui/src/index.css · .paperclip-markdown");+ if (role.recipes.length === 0) role.recipes = recipes;+ roles.set(key, role);+ }+ }+ return { roles: [...roles.values()].sort((a, b) => a.area.localeCompare(b.area) || parseFloat(b.size) - parseFloat(a.size) || a.name.localeCompare(b.name)), states: cases.map(example => example.dataset.previewCase!), capturedAt: new Date().toLocaleTimeString() };+}diff --git a/ui/storybook/support/design-proposals/project-health-trial-data.ts b/ui/storybook/support/design-proposals/project-health-trial-data.tsnew file mode 100644index 0000000000..a584403900--- /dev/null+++ b/ui/storybook/support/design-proposals/project-health-trial-data.ts@@ -0,0 +1,167 @@+import type { Issue, Project } from "@paperclipai/shared";+import {+ createIssue,+ storybookAuthSession,+ storybookCompanies,+} from "../../fixtures/paperclipData";++export const projectHealthProjectIds = {+ onboarding: "project-health-trial-onboarding",+ international: "project-health-trial-international",+ knowledge: "project-health-trial-knowledge",+ partners: "project-health-trial-partners",+ developer: "project-health-trial-developer",+ launch: "project-health-trial-launch",+} as const;++const companyId = storybookCompanies[0]!.id;+const authorId = storybookAuthSession.user.id;++export const projectHealthProjects: Pick<+ Project,+ "id" | "companyId" | "name" | "description" | "status"+>[] = [+ {+ id: projectHealthProjectIds.onboarding,+ companyId,+ name: "Customer onboarding",+ description: "Help new teams reach their first successful workflow with fewer handoffs.",+ status: "in_progress",+ },+ {+ id: projectHealthProjectIds.international,+ companyId,+ name: "International expansion and multi-region billing infrastructure",+ description: "Prepare regional invoicing, local currencies and a reliable rollout for new markets.",+ status: "in_progress",+ },+ {+ id: projectHealthProjectIds.knowledge,+ companyId,+ name: "Knowledge base refresh",+ description: "Turn recurring support questions into clear, searchable product guidance.",+ status: "in_progress",+ },+ {+ id: projectHealthProjectIds.partners,+ companyId,+ name: "Partner integrations",+ description: "Scope the first partner workflows before planning the implementation.",+ status: "planned",+ },+ {+ id: projectHealthProjectIds.developer,+ companyId,+ name: "Developer experience",+ description: "Reduce setup friction and make everyday development feedback faster.",+ status: "backlog",+ },+ {+ id: projectHealthProjectIds.launch,+ companyId,+ name: "Autumn launch",+ description: "Ship the autumn release with a coordinated announcement and support handoff.",+ status: "completed",+ },+];++const fixtureNow = new Date("2026-10-16T16:00:00.000Z");++function task(+ number: number,+ projectId: string,+ title: string,+ status: Issue["status"],+ minutesAgo: number,+ description: string,+): Issue {+ const updatedAt = new Date(fixtureNow.getTime() - minutesAgo * 60_000);+ return createIssue({+ id: `project-health-trial-task-${number}`,+ companyId,+ projectId,+ projectWorkspaceId: null,+ project: null,+ goalId: null,+ goal: null,+ parentId: null,+ title,+ description,+ status,+ priority: status === "blocked" ? "high" : "medium",+ issueNumber: number,+ identifier: `PAP-${number}`,+ createdByUserId: authorId,+ createdByAgentId: null,+ assigneeAgentId: null,+ assigneeUserId: authorId,+ responsibleUserId: authorId,+ checkoutRunId: null,+ executionRunId: null,+ executionAgentNameKey: null,+ executionLockedAt: null,+ executionWorkspaceId: null,+ executionWorkspacePreference: null,+ currentExecutionWorkspace: null,+ billingCode: null,+ labelIds: [],+ labels: [],+ blockedBy: [],+ blocks: [],+ startedAt: status === "todo" || status === "backlog" ? null : new Date("2026-10-12T16:00:00.000Z"),+ completedAt: status === "done" ? updatedAt : null,+ isUnreadForMe: false,+ myLastTouchAt: updatedAt,+ lastExternalCommentAt: null,+ lastActivityAt: updatedAt,+ createdAt: new Date("2026-10-09T16:00:00.000Z"),+ updatedAt,+ });+}++export const projectHealthTasks: Issue[] = [+ task(701, projectHealthProjectIds.onboarding, "Confirm the activation milestone with customer success", "blocked", 8,+ "Resolve the ownership question before publishing the new onboarding checklist."),+ task(702, projectHealthProjectIds.onboarding, "Review the first-run checklist with the pilot team", "in_review", 24,+ "The pilot feedback is ready for review, including the two steps that still need clearer copy."),+ task(703, projectHealthProjectIds.onboarding, "Simplify workspace invitations", "in_progress", 46,+ "Keep the invitation flow understandable for teams adding their first collaborators."),+ task(704, projectHealthProjectIds.onboarding, "Draft welcome messages for new workspace owners", "todo", 78,+ "Explain the next useful action without overwhelming a new workspace owner."),+ task(705, projectHealthProjectIds.onboarding, "Add a sample workflow to the starter workspace", "done", 120,+ "Provide a complete example that a new team can inspect before creating its own workflow."),+ task(706, projectHealthProjectIds.onboarding, "Measure time to first completed task", "done", 186,+ "Document the baseline and the definition used to compare the next onboarding iteration."),+ task(707, projectHealthProjectIds.onboarding, "Document assisted onboarding handoffs", "todo", 244,+ "Capture when customer success should step in and what context should accompany the handoff."),+ task(708, projectHealthProjectIds.international, "Resolve invoice rounding differences across currencies before the multi-region billing pilot begins", "blocked", 12,+ "Reconcile line-item and invoice totals for currencies with different decimal precision."),+ task(709, projectHealthProjectIds.international, "Review regional invoice templates", "in_review", 38,+ "Check the proposed regional fields and the examples prepared for the pilot."),+ task(710, projectHealthProjectIds.international, "Implement currency selection for new subscriptions", "in_progress", 91,+ "Apply the selected billing currency consistently throughout checkout and subscription details."),+ task(711, projectHealthProjectIds.international, "Prepare the regional rollout checklist", "todo", 170,+ "List the launch owners, support coverage and rollback conditions for each region."),+ task(712, projectHealthProjectIds.international, "Inventory supported payment methods", "done", 302,+ "Record which payment methods are available to the initial regional pilot accounts."),+ task(713, projectHealthProjectIds.knowledge, "Refresh the workspace setup guide", "done", 31,+ "Update the setup guide to match the current workspace creation flow."),+ task(714, projectHealthProjectIds.knowledge, "Rewrite the task ownership examples", "todo", 116,+ "Use realistic examples to explain assignment, responsibility and review handoffs."),+ task(715, projectHealthProjectIds.knowledge, "Publish the troubleshooting index", "done", 218,+ "Make the most common setup problems easy to find from a single support entry point."),+ task(716, projectHealthProjectIds.knowledge, "Add screenshots to the project guide", "todo", 357,+ "Show the project overview and its task list using the current interface."),+ task(717, projectHealthProjectIds.developer, "Map the slowest local feedback loops", "todo", 63,+ "Collect baseline timings for the development tasks the team repeats every day."),+ task(718, projectHealthProjectIds.developer, "Explore a guided development setup", "backlog", 421,+ "Outline a setup flow that explains each missing prerequisite at the point it is needed."),+ task(719, projectHealthProjectIds.launch, "Publish the release announcement", "done", 52,+ "Publish the approved product announcement and link to the release notes."),+ task(720, projectHealthProjectIds.launch, "Complete launch readiness review", "done", 133,+ "Confirm the release checklist, support coverage and follow-up owners."),+ task(721, projectHealthProjectIds.launch, "Hand off release notes to support", "done", 266,+ "Give support the user-facing changes and answers to expected launch questions."),+ task(722, projectHealthProjectIds.launch, "Archive the launch retrospective", "done", 388,+ "Capture the rollout results and the process improvements for the next release."),+];diff --git a/ui/storybook/support/design-proposals/task-list-data.ts b/ui/storybook/support/design-proposals/task-list-data.tsnew file mode 100644index 0000000000..af5d11fb7c--- /dev/null+++ b/ui/storybook/support/design-proposals/task-list-data.ts@@ -0,0 +1,83 @@+import type { Issue } from "@paperclipai/shared";+import type { TaskListItem } from "@/components/TaskList";+import type { TaskListColumnId } from "@/lib/task-list";+import { createIssue, storybookAgentMap, storybookExecutionWorkspaces, storybookIssueLabels } from "../../fixtures/paperclipData";++export const longTitle = "Document connector recovery behavior when an expired credential interrupts an active task and requires a human to reconnect the account";++export function task(number: number, title: string, status: Issue["status"], parentId: string | null = null): Issue {+ return createIssue({+ id: `row-design-${number}`,+ identifier: `PAP-${number}`,+ issueNumber: number,+ title,+ status,+ parentId,+ labelIds: [],+ labels: [],+ checkoutRunId: null,+ executionRunId: null,+ executionLockedAt: null,+ createdAt: new Date("2026-10-14T16:00:00Z"),+ updatedAt: new Date(Date.UTC(2026, 9, 14, 17, 0, number % 60)),+ lastActivityAt: new Date("2026-10-14T17:00:00Z"),+ });+}++export const connectorParent = task(428, "Improve connector reliability", "in_progress");+export const healthTask = task(429, "Define connector health states", "in_review", connectorParent.id);+export const recoveryParent = task(430, "Design reconnect and recovery flows", "todo", connectorParent.id);+export const recoveryChild = task(431, longTitle, "todo", recoveryParent.id);+export const recoverySibling = task(432, "Review failure messages with the team", "done", connectorParent.id);+export const chatTask = task(454, "Chat style tasks v2", "done");+export const emptyTask = task(455, "Refine the empty task-list state", "backlog");+export const readTask = task(456, "Review the connector experience", "todo");+export const unreadTask = task(457, "Define connector health states", "todo");++export const treeTasks = [connectorParent, healthTask, recoveryParent, recoveryChild, recoverySibling, chatTask, emptyTask];+export const ownerFor = (issue: Issue) => [429, 430, 432, 455].includes(issue.issueNumber ?? 0) ? "Design" : "Codex";++export function columnData(issue: Issue, owner: string) {+ const agent = storybookAgentMap.get("agent-codex")!;+ const labels = issue.status === "backlog" ? [] : storybookIssueLabels.slice(0, issue.status === "in_review" ? 2 : 1);+ const branch = issue.status === "backlog" ? null : `codex/pap-${issue.issueNumber}`;+ const rowIssue = {+ ...issue,+ createdByAgentId: issue.parentId ? agent.id : null,+ createdByUserId: issue.parentId ? null : "user-board",+ assigneeAgentId: issue.status !== "backlog" && owner === "Codex" ? agent.id : null,+ assigneeUserId: issue.status !== "backlog" && owner === "Design" ? "user-design" : null,+ labels,+ labelIds: labels.map(label => label.id),+ project: issue.status === "backlog" ? null : issue.project,+ projectId: issue.status === "backlog" ? null : issue.projectId,+ executionWorkspaceId: branch ? `worktree-${issue.id}` : null,+ currentExecutionWorkspace: branch ? { ...storybookExecutionWorkspaces[0]!, id: `worktree-${issue.id}`, sourceIssueId: issue.id, branchName: branch } : null,+ };+ return {+ issue: rowIssue,+ parent: treeTasks.find(candidate => candidate.id === issue.parentId),+ creator: rowIssue.createdByAgentId ? agent.name : "Scott",+ assignee: rowIssue.assigneeAgentId ? agent.name : rowIssue.assigneeUserId ? "Design" : null,+ };+}++export function sortValue(issue: Issue, column: TaskListColumnId) {+ const data = columnData(issue, ownerFor(issue));+ switch (column) {+ case "task": return issue.title;+ case "taskId": return issue.identifier;+ case "createdBy": return data.creator;+ case "assignee": return data.assignee;+ case "project": return data.issue.project?.name;+ case "parentTask": return data.parent ? `${data.parent.identifier} ${data.parent.title}` : null;+ case "tags": return data.issue.labels.map(label => label.name).sort().join(", ");+ case "lastUpdated": return new Date(issue.updatedAt).getTime();+ case "worktree": return data.issue.currentExecutionWorkspace?.branchName;+ }+}++export const reviewTaskItems: TaskListItem[] = treeTasks.map(issue => {+ const data = columnData(issue, ownerFor(issue));+ return { issue: data.issue, createdBy: data.creator, assignee: data.assignee, unread: issue === connectorParent || issue === healthTask };+});diff --git a/ui/storybook/support/design-proposals/task-page-data.ts b/ui/storybook/support/design-proposals/task-page-data.tsnew file mode 100644index 0000000000..9b198f6f68--- /dev/null+++ b/ui/storybook/support/design-proposals/task-page-data.ts@@ -0,0 +1,16 @@+import type { TaskListItem } from "@/components/TaskList";+import { columnData, reviewTaskItems, task } from "./task-list-data";++const extraTasks: TaskListItem[] = [+ task(458, "Simplify the first company setup", "in_progress"),+ task(459, "Review budget notifications", "in_review"),+ task(460, "Collect feedback on the refreshed task list", "todo"),+].map((issue, index) => {+ const data = columnData(issue, index === 2 ? "Design" : "Codex");+ return { issue: data.issue, createdBy: data.creator, assignee: data.assignee, unread: index === 0 };+});+export const initialItems = [...reviewTaskItems, ...extraTasks];+export const recentTasks = [...initialItems]+ .filter(item => !item.issue.parentId)+ .sort((left, right) => new Date(right.issue.updatedAt).getTime() - new Date(left.issue.updatedAt).getTime())+ .slice(0, 5);diff --git a/ui/storybook/support/design-proposals/typography-specification.ts b/ui/storybook/support/design-proposals/typography-specification.tsnew file mode 100644index 0000000000..67e6247233--- /dev/null+++ b/ui/storybook/support/design-proposals/typography-specification.ts@@ -0,0 +1,81 @@+import type { CSSProperties } from "react";++export const typeRamp = [+ { token: "3xl", size: 30, className: "text-3xl", use: "Dashboard metric values on desktop.", source: "MetricCard.tsx · sm:text-3xl" },+ { token: "2xl", size: 24, className: "text-2xl", use: "Task detail title; agent name; metrics below the sm breakpoint.", source: "IssueDetail.tsx · AgentDetail.tsx · MetricCard.tsx" },+ { token: "xl", size: 20, className: "text-xl", use: "Available heading step. Rendered Markdown H2 currently also resolves to 20px, through its own rule.", source: "index.css · .paperclip-markdown h2" },+ { token: "lg", size: 18, className: "text-lg", use: "Section headings in foundation specimens. No default product role assigned here.", source: "ColorsPreview.tsx · text-lg" },+ { token: "base", size: 16, className: "text-base", use: "Mobile text-entry controls; available larger body step. Desktop body generally uses sm.", source: "ui/input.tsx · index.css mobile editable-control tokens" },+ { token: "sm", size: 14, className: "text-sm", use: "Main content, task/activity rows, navigation, buttons, menus and composer text.", source: "TaskList · SidebarShell · ui/button · TaskChat" },+ { token: "compact", size: 13, className: "text-(length:--text-compact)", use: "Compact controls and legacy navigation recipes. Proposal navigation overrides this to sm.", source: "SidebarNavItem.tsx · SidebarAccountMenu.tsx" },+ { token: "xs", size: 12, className: "text-xs", use: "Property labels, supporting copy, hover-card metadata, activity details, message times, account email and run metrics.", source: "issue-properties/primitives.tsx · IssueLinkQuicklook · TaskChat" },+ { token: "nano", size: 10, className: "text-(length:--text-nano)", use: "Navigation/streamlined property eyebrows; chart dates, legends and subtitles.", source: "SidebarSection.tsx · issue-properties/primitives.tsx · ActivityCharts.tsx" },+] as const;++export type TypeArea = "Navigation" | "Tasks & activity" | "Dashboard & agents" | "Menus & previews" | "Detail & properties" | "Conversation & forms";+export type TypeRole = {+ id: string;+ area: TypeArea;+ name: string;+ sample: string;+ className: string;+ style?: CSSProperties;+ recipe: string;+ source: string;+ use: string;+ review?: string;+ inheritedLeading?: boolean;+};++const taskType: CSSProperties = { fontSize: "var(--task-row-title-size)", lineHeight: "var(--task-row-title-leading)" };+const flyoutType: CSSProperties = { fontSize: "var(--flyout-type-size)", lineHeight: "var(--flyout-type-leading)" };+const monoTask: CSSProperties = { ...taskType, fontFamily: "var(--task-row-font-mono)" };++/** Source-derived recipes, not a second component implementation. Sources are repository-relative. */+export const typeRoles: TypeRole[] = [+ { id: "shell-heading", area: "Navigation", name: "Page / breadcrumb section", sample: "TASKS", className: "font-semibold uppercase text-foreground", style: { fontSize: "var(--design-page-type-size)", lineHeight: "var(--design-page-type-leading)", letterSpacing: "var(--design-page-heading-tracking)" }, recipe: "--design-page-type-size / leading / heading-tracking", source: "ui/src/index.css · .design-page-header :is(h1, h2)", use: "Compact section identity in the center-pane header." },+ { id: "organization", area: "Navigation", name: "Organization name", sample: "Design Sandbox", className: "text-sm font-semibold leading-normal text-foreground", recipe: "text-sm · font-semibold · leading-normal", source: "ui/src/components/SidebarCompanyMenu.tsx", use: "The organization trigger has a stronger weight than ordinary navigation." },+ { id: "nav-item", area: "Navigation", name: "Navigation item", sample: "Dashboard", className: "text-sm font-normal leading-normal text-muted-foreground", recipe: "--design-sidebar-label-size / leading · font-normal", source: "ui/src/index.css · .design-sidebar-navigation; ui/src/components/SidebarNavItem.tsx", use: "Muted by default; selected/hovered items use foreground." },+ { id: "nav-eyebrow", area: "Navigation", name: "Navigation group label", sample: "RECENT TASKS", className: "design-navigation-group-label", recipe: "--text-nano · --design-sidebar-heading-tracking", source: "ui/src/components/SidebarSection.tsx; ui/src/index.css · shared group-label rule", use: "Inter, 10px / 15px, normal, uppercase, 0.1em tracking and muted foreground at 60%. Shared with streamlined property sections." },+ { id: "nav-recent", area: "Navigation", name: "Recent link / account name", sample: "Improve connector reliability", className: "text-sm font-normal leading-normal text-muted-foreground", recipe: "--design-sidebar-label-size / leading", source: "ui/src/components/SidebarRecentTasks.tsx; ui/src/components/SidebarAccountMenu.tsx", use: "Single-line recent links; account name is foreground. Long links share the marquee behavior." },+ { id: "row-read", area: "Tasks & activity", name: "Read task title", sample: "Improve connector reliability", className: "font-normal text-muted-foreground", style: taskType, recipe: "--task-row-title-size / leading · weight-read", source: "ui/src/index.css · .task-row-refreshed; ui/src/components/IssueRow.tsx", use: "Default read state. Hover/focus promotes color while preserving regular weight." },+ { id: "row-unread", area: "Tasks & activity", name: "Unread task title", sample: "Review connector health states", className: "font-semibold text-foreground", style: taskType, recipe: "--task-row-title-weight-unread · --task-row-title-color-active", source: "ui/src/index.css · .task-row-refreshed", use: "Semibold and foreground; unread state is separate from density." },+ { id: "row-id", area: "Tasks & activity", name: "Task ID / parent / worktree", sample: "DES-431", className: "font-normal text-muted-foreground", style: monoTask, recipe: "--task-row-font-mono · --task-row-title-size / leading", source: "ui/src/components/TaskList.tsx; ui/src/index.css · .task-row-refreshed", use: "Paper Mono aligns identifiers across task tables and activity rows.", review: "Task table metadata is 14px, rather than the general 12px metadata guidance." },+ { id: "row-time", area: "Tasks & activity", name: "Row timestamp / column label", sample: "2h ago", className: "font-normal text-muted-foreground", style: taskType, recipe: "--task-row-title-size / leading", source: "ui/src/components/TaskList.tsx; ui/src/components/ActivityRow.tsx", use: "Same size as the title; column headings also keep regular weight.", review: "Timestamps stay 14px in the shared row; narrow presentation hides columns instead of shrinking type." },+ { id: "activity-text", area: "Tasks & activity", name: "Activity actor, verb & subject", sample: "Board updated Connector engineer", className: "font-normal text-muted-foreground", style: taskType, recipe: "task-row-refreshed · task-row-title", source: "ui/src/components/ActivityRow.tsx", use: "Task and non-task activity share row metrics, truncation and hover promotion." },+ { id: "toolbar", area: "Tasks & activity", name: "Toolbar control / search", sample: "Search tasks…", className: "text-sm font-normal leading-5 text-muted-foreground", recipe: "--design-page-type-size / leading · font-normal", source: "ui/src/components/TaskListToolbar.tsx; ui/src/index.css · .design-task-search", use: "Controls are normal; search input text is regular and foreground, placeholder muted. New Task is semibold." },+ { id: "result-count", area: "Tasks & activity", name: "Result count / empty state", sample: "10 matching tasks", className: "text-sm leading-5 text-muted-foreground", recipe: "text-sm · leading-5", source: "ui/src/pages/DesignSandboxTasks.tsx; ui/src/pages/Dashboard.tsx", use: "Supporting collection feedback without heading emphasis." },+ { id: "metric", area: "Dashboard & agents", name: "Metric value", sample: "$0.00", className: "text-2xl font-semibold tracking-tight tabular-nums text-foreground sm:text-3xl", recipe: "text-2xl sm:text-3xl · font-semibold · tabular-nums", source: "ui/src/components/MetricCard.tsx", use: "30px desktop; 24px below sm. Tabular numerals keep changing values aligned." },+ { id: "metric-label", area: "Dashboard & agents", name: "Metric label / description", sample: "Agents Enabled", className: "text-xs font-normal text-muted-foreground sm:text-sm", recipe: "text-xs sm:text-sm · font-normal", source: "ui/src/components/MetricCard.tsx", use: "Label: 14px desktop / 12px small. Description: 12px regular, muted at 70%, hidden on small screens." },+ { id: "dashboard-heading", area: "Dashboard & agents", name: "Dashboard section heading", sample: "RECENT ACTIVITY", className: "text-sm font-semibold uppercase tracking-wide text-muted-foreground", recipe: "text-sm · font-semibold · uppercase · tracking-wide", source: "ui/src/pages/Dashboard.tsx", use: "Labels dashboard sections above the cards.", review: "Currently muted; the general proposed heading rule calls for foreground." },+ { id: "chart-heading", area: "Dashboard & agents", name: "Chart title / empty chart", sample: "Tasks by Status", className: "text-xs font-normal text-muted-foreground", recipe: "text-xs · font-normal", source: "ui/src/components/ActivityCharts.tsx · ChartCard", use: "Chart title is 12px normal; an empty-chart message uses regular weight.", review: "Chart headings are currently muted rather than foreground." },+ { id: "chart-caption", area: "Dashboard & agents", name: "Chart date / legend / subtitle", sample: "10/15 · In Progress", className: "text-(length:--text-nano) tabular-nums text-muted-foreground", recipe: "--text-nano · tabular-nums for dates", source: "ui/src/components/ActivityCharts.tsx · DateLabels / ChartLegend", use: "10px chart captions; subtitles use muted foreground at 60%.", inheritedLeading: true },+ { id: "agent-name", area: "Dashboard & agents", name: "Agent name", sample: "Connector engineer", className: "text-2xl font-semibold tracking-tight text-foreground", recipe: "text-2xl · font-semibold · tracking-tight", source: "ui/src/pages/AgentDetail.tsx", use: "Agent overview identity. Panel headings below it use 14px normal; panel values use 14px regular." },+ { id: "menu-heading", area: "Menus & previews", name: "Popover heading", sample: "Views", className: "font-semibold text-foreground", style: flyoutType, recipe: "--flyout-type-size / leading · font-semibold", source: "ui/src/components/ui/flyout.tsx; ui/src/index.css · .design-flyout-heading", use: "The shared popover heading establishes menu hierarchy." },+ { id: "menu-option", area: "Menus & previews", name: "Popover option / checkmark", sample: "Needs attention", className: "font-normal text-muted-foreground", style: flyoutType, recipe: "--flyout-type-size / leading · muted-foreground", source: "ui/src/index.css · .design-flyout-option", use: "Unselected labels and accompanying checks are muted; hover/focus uses foreground. Action menus use normal weight." },+ { id: "account-name", area: "Menus & previews", name: "Account name", sample: "Riley Board", className: "text-sm font-semibold text-foreground", style: { lineHeight: "var(--profile-popover-label-line-height)" }, recipe: "text-sm · --profile-popover-label-line-height", source: "ui/src/components/SidebarAccountMenu.tsx", use: "14px semibold / 18px leading in the account header." },+ { id: "account-email", area: "Menus & previews", name: "Account email / ID", sample: "[email protected]", className: "text-xs text-muted-foreground", style: { lineHeight: "var(--profile-popover-meta-line-height)" }, recipe: "--text-xs · --profile-popover-meta-line-height", source: "ui/src/components/SidebarAccountMenu.tsx", use: "12px / 16px. Optional account ID uses Paper Mono." },+ { id: "hover-title", area: "Menus & previews", name: "Task hover-card title", sample: "Review task thread layouts", className: "font-semibold text-foreground", style: { fontSize: "var(--task-preview-title-size)", lineHeight: "var(--task-preview-content-leading)" }, recipe: "--task-preview-title-size / content-leading", source: "ui/src/components/IssueLinkQuicklook.tsx; ui/src/index.css", use: "14px / 18px; title wraps within the preview." },+ { id: "hover-body", area: "Menus & previews", name: "Hover-card description", sample: "Review shared components and foundations.", className: "text-muted-foreground", style: { fontSize: "var(--task-preview-meta-size)", lineHeight: "var(--task-preview-content-leading)" }, recipe: "--task-preview-meta-size / content-leading", source: "ui/src/components/IssueLinkQuicklook.tsx; ui/src/index.css", use: "12px / 18px; task ID, project and timestamp use 12px / 16px metadata tokens." },+ { id: "detail-title", area: "Detail & properties", name: "Task detail title", sample: "Improve connector reliability", className: "text-2xl font-normal leading-normal text-foreground", recipe: "text-2xl · font-normal · leading-normal", source: "ui/src/pages/IssueDetail.tsx · InlineEditor h2", use: "24px regular / 36px leading. Status, ID, project and people sit below the title." },+ { id: "detail-id", area: "Detail & properties", name: "Task detail identifier", sample: "DES-431", className: "font-mono text-sm text-muted-foreground", recipe: "font-mono · text-sm", source: "ui/src/pages/IssueDetail.tsx", use: "Paper Mono identifier in the task title metadata row, matching task tables." },+ { id: "property-label", area: "Detail & properties", name: "Property label / supporting metadata", sample: "Assignee", className: "text-xs text-muted-foreground", recipe: "text-xs · text-muted-foreground", source: "ui/src/components/issue-properties/primitives.tsx · PropertyRow", use: "12px labels and supporting copy in the right pane." },+ { id: "property-value", area: "Detail & properties", name: "Property value", sample: "Connector engineer", className: "text-sm text-foreground", recipe: "text-sm; contextual foreground / muted-foreground", source: "ui/src/components/issue-properties/IssueProperties.tsx", use: "Assignee, project, status and several relationship values currently use 14px.", review: "The right pane mixes 12px labels and 14px values; it does not yet follow a blanket 12px rule." },+ { id: "property-eyebrow", area: "Detail & properties", name: "Streamlined property section", sample: "RELATIONSHIPS", className: "design-navigation-group-label", recipe: "Same shared rule as navigation group label", source: "ui/src/components/issue-properties/primitives.tsx · PropertySection", use: "Matches navigation group labels exactly: Inter, 10px / 15px, normal, uppercase, 0.1em tracking and muted foreground at 60%.", inheritedLeading: true },+ { id: "panel-tab", area: "Detail & properties", name: "Pane tab / overview panel heading", sample: "Properties", className: "text-sm font-normal text-foreground", recipe: "text-sm · font-normal", source: "ui/src/components/side-panel/SidePanelTab.tsx; ui/src/pages/AgentDetail.tsx", use: "Active tab and compact card headings; inactive tabs use muted foreground." },+ { id: "message-author", area: "Conversation & forms", name: "Conversation author name", sample: "Connector engineer", className: "text-sm font-semibold text-foreground", recipe: "--conversation-body-size / --conversation-body-leading · font-semibold · foreground", source: "ui/src/components/task-chat/TaskChatBubble.tsx", use: "Proposed agent names use 14px/20px semibold in foreground. Final-response headings use 14px normal in foreground. Request and protocol card titles remain 14px normal." },+ { id: "markdown-body", area: "Conversation & forms", name: "Standalone rendered prose", sample: "I reviewed the shared components and their usage.", className: "paperclip-markdown", recipe: ".paperclip-markdown", source: "ui/src/components/MarkdownBody.tsx; ui/src/index.css · .paperclip-markdown", use: "Paragraphs, lists and message content use the shared Markdown renderer. See In context for measured heading, emphasis, quote and code roles.", review: "Standalone prose remains 15px / 24px. Inside proposed conversation regions, authored text and headings use 14px/20px; final replies use foreground and commentary uses muted foreground." },+ { id: "working", area: "Conversation & forms", name: "Live working status", sample: "Working", className: "text-sm font-normal text-foreground/80", recipe: "text-sm · font-normal · foreground/80", source: "ui/src/components/task-chat/TaskChatLiveRunPill.tsx", use: "Elapsed time and tool count use 12px with quieter muted opacity. State color can convey live execution." },+ { id: "activity-detail", area: "Conversation & forms", name: "Thinking / tool activity / system notice", sample: "Read files · 3 tools", className: "text-xs text-muted-foreground", recipe: "text-xs · text-muted-foreground", source: "ui/src/components/task-chat/TaskChatThinking.tsx; TaskChatRunnerActivityGroup.tsx; TaskChatSystemNotice.tsx", use: "Collapsed reasoning, tools, phase details and notice labels. Expanded prose is rendered separately." },+ { id: "message-time", area: "Conversation & forms", name: "Message timestamp / delivery state", sample: "4:05 PM · Sending…", className: "text-xs text-muted-foreground", recipe: "text-xs", source: "ui/src/components/task-chat/TaskChatBubble.tsx; TaskChatTurn.tsx", use: "12px message footer; not the shared task-row timestamp role." },+ { id: "run-metric", area: "Conversation & forms", name: "Run metrics / technical identifiers", sample: "42,000 tokens · 930ms", className: "font-mono text-xs text-muted-foreground", recipe: "font-mono (Paper Mono) · text-xs", source: "ui/src/components/task-chat/TaskChatTurn.tsx", use: "Compact technical counters, run IDs and activity diagnostics in Paper Mono at 12px / 16px." },+ { id: "question-prompt", area: "Conversation & forms", name: "Question / confirmation prompt", sample: "What should happen next?", className: "text-sm font-normal text-foreground", recipe: "text-sm · font-normal", source: "ui/src/components/task-chat/TaskChatProtocolCard.tsx", use: "Confirmation prompts and protocol interactions; field labels have a tighter leading recipe." },+ { id: "form-label", area: "Conversation & forms", name: "Field label", sample: "Task name", className: "text-sm font-normal leading-none text-foreground", recipe: "text-sm · leading-none · font-normal", source: "ui/src/components/ui/label.tsx", use: "The shared Label primitive uses a tight 14px line box, separate from prose or a question prompt." },+ { id: "input", area: "Conversation & forms", name: "Input / composer text", sample: "Message Connector engineer…", className: "text-sm text-muted-foreground", recipe: "text-sm on desktop; text-base for mobile entry", source: "ui/src/components/ui/input.tsx; ui/src/components/task-chat/TaskChatComposer.tsx", use: "14px desktop entry, muted placeholder; typed task-search text uses foreground. Mobile entry grows to 16px." },+ { id: "button", area: "Conversation & forms", name: "Button label", sample: "Continue", className: "text-sm font-normal text-foreground", recipe: "text-sm · font-normal; size=xs uses text-xs", source: "ui/src/components/ui/button.tsx", use: "Most buttons are 14px normal; extra-small buttons use 12px. CTA text uses the contrasting background token." },+ { id: "validation", area: "Conversation & forms", name: "Validation / helper copy", sample: "Choose an option to continue.", className: "text-xs text-destructive", recipe: "text-xs · destructive / muted-foreground", source: "ui/src/components/task-chat/TaskChatProtocolCard.tsx; TaskChatComposer.tsx", use: "12px. Errors use semantic destructive color; normal hints remain muted. Status color is an intentional exception." },+ { id: "compact-control", area: "Conversation & forms", name: "Compact control recipe", sample: "Documentation", className: "text-(length:--text-compact) font-normal text-muted-foreground", recipe: "--text-compact · font-normal", source: "ui/src/components/SidebarAccountMenu.tsx; SidebarNavItem.tsx", use: "13px base recipes exist; the proposal flyout and sidebar override these to 14px. This is not the current proposal menu size.", inheritedLeading: true },+ { id: "avatar", area: "Menus & previews", name: "Fallback avatar initial", sample: "R", className: "text-xs font-normal text-muted-foreground", recipe: "text-xs · single first initial", source: "ui/src/components/SidebarAccountMenu.tsx; ui/src/components/ui/avatar-initials.tsx", use: "One character for fallback identity; use the avatar component rather than constructing initials in each view." },+ { id: "badge", area: "Menus & previews", name: "Badge / chip label", sample: "Design system", className: "text-xs font-normal text-muted-foreground", recipe: "text-xs · font-normal", source: "ui/src/components/ui/badge.tsx", use: "12px normal in the shared Badge; filled/status variants use their own contrast colors. PropertyChip can override weight to regular." },+ { id: "tooltip", area: "Menus & previews", name: "Tooltip label", sample: "Toggle side panel", className: "w-fit rounded-md bg-foreground px-3 py-1.5 text-xs text-background", recipe: "text-xs · bg-foreground · text-background", source: "ui/src/components/ui/tooltip.tsx", use: "12px regular on an inverse surface. Distinct from the larger, structured task hover card." },+];diff --git a/ui/storybook/support/design-proposals/useButtonPreviewStates.ts b/ui/storybook/support/design-proposals/useButtonPreviewStates.tsnew file mode 100644index 0000000000..a3f40c3d26--- /dev/null+++ b/ui/storybook/support/design-proposals/useButtonPreviewStates.ts@@ -0,0 +1,37 @@+import { useEffect } from "react";++const pseudoState = /(?<!\\):(hover|focus-visible|active)\b/g;++/** Mirror the browser's compiled state rules under a preview attribute. Keeping+ * the original selectors, layers and media conditions avoids a second palette. */+function forcedRule(rule: CSSRule, inheritedState = false): string {+ if (rule instanceof CSSStyleRule) {+ // A negated pseudo would otherwise match ordinary, unforced elements after+ // replacement. The shared Button uses positive interaction rules only.+ if (/:not\([^)]*(?<!\\):(hover|focus-visible|active)\b/.test(rule.selectorText)) return "";+ const hasState = /(?<!\\):(hover|focus-visible|active)\b/.test(rule.selectorText);+ const declarations = hasState || inheritedState ? rule.style.cssText : "";+ const children = Array.from(rule.cssRules ?? []).map(child => forcedRule(child, inheritedState || hasState)).join("");+ if (!declarations && !children) return "";+ return `${rule.selectorText.replace(pseudoState, '[data-button-preview-state="$1"]')}{${declarations}${children}}`;+ }+ if ("cssRules" in rule) {+ const children = Array.from((rule as CSSGroupingRule).cssRules).map(child => forcedRule(child, inheritedState)).join("");+ return children ? `${rule.cssText.slice(0, rule.cssText.indexOf("{") + 1)}${children}}` : "";+ }+ // Nested declarations inside an already selected state (modern CSS nesting).+ return inheritedState && rule.constructor.name === "CSSNestedDeclarations" ? rule.cssText : "";+}++export function useButtonPreviewStates() {+ useEffect(() => {+ const style = document.createElement("style");+ style.dataset.buttonPreviewStates = "";+ style.textContent = Array.from(document.styleSheets).flatMap(sheet => {+ try { return Array.from(sheet.cssRules).map(rule => forcedRule(rule)); }+ catch { return []; } // External stylesheets may not expose their CSSOM.+ }).join("\n");+ document.head.append(style);+ return () => style.remove();+ }, []);+}diff --git a/ui/storybook/support/feature-map/FeatureOverview.tsx b/ui/storybook/support/feature-map/FeatureOverview.tsxindex b4c8429a0b..c241bc3e10 100644--- a/ui/storybook/support/feature-map/FeatureOverview.tsx+++ b/ui/storybook/support/feature-map/FeatureOverview.tsx@@ -75,7 +75,9 @@ export function FeatureMapIndex() {].join(" ").toLowerCase().includes(search);}),})).filter(section => section.features.length), [search]);- const foundations = examples.filter(entry => (entry.home === "foundations" || !entry.capabilities.length)+ const proposals = examples.filter(entry => entry.home === "design-proposals"+ && ["Design proposals", entry.file, entry.purpose, entry.notes].join(" ").toLowerCase().includes(search));+ const foundations = examples.filter(entry => entry.home !== "design-proposals" && (entry.home === "foundations" || !entry.capabilities.length)&& ["Shared foundations", entry.file, entry.purpose, entry.status, entry.implementation, entry.boundary].join(" ").toLowerCase().includes(search));return (<main className="paperclip-story__inner space-y-6 p-6">@@ -86,7 +88,15 @@ export function FeatureMapIndex() {<a className="text-sm underline underline-offset-4" href={`${recipeRoot}README.md`} target="_blank" rel="noreferrer">Read the feature-map index</a><Input aria-label="Find a feature or capability" placeholder="Find a feature, capability, or example…" value={query} onChange={event => setQuery(event.target.value)} /></header>- {sections.length === 0 && foundations.length === 0 ? <p>No matching features or examples.</p> : null}+ {sections.length === 0 && foundations.length === 0 && proposals.length === 0 ? <p>No matching features or examples.</p> : null}+ {proposals.length ? (+ <section className="space-y-3">+ <h2 className="text-lg font-semibold">Design proposals</h2>+ <p className="text-sm text-muted-foreground">Design work awaiting review and app adoption. These examples do not count as current production coverage.</p>+ {error ? <p role="alert">Example links could not load. Reload to try again.</p> : null}+ <ul className="divide-y divide-border">{proposals.map(entry => <SuiteLink key={entry.file} entry={entry} links={links} />)}</ul>+ </section>+ ) : null}{sections.map(section => (<section key={section.title} className="space-y-3"><h2 className="text-lg font-semibold">{section.title}</h2>