Skip to content

ui-kit: Settings/Storage phone stories render at desktop width outside the test runner #3749

Closed

Description

@schlessera

Context

The Settings/Storage stories (packages/ui-kit/stories/conversation/StorageTheme.stories.tsx:46-66) take a width arg: 320 for Phone, 1280 for Desktop. Only the Vitest runner applies it. consumerViewport returns early outside the runner (stories/conversation/_consumer-parity.tsx:48). In the interactive Storybook, and in a static build, Phone therefore renders at whatever width the canvas has, which on a desktop browser is the desktop layout. Phone and Desktop look identical, and the phone version cannot be checked at phone width.

In the same interactive context, painted() (_consumer-parity.tsx:80-92) asserts the runner's viewport and reduced-motion media. So every Settings/Storage play function reports a failure ("expected false to be true") when the story is opened by hand.

The other consumer-parity stories that use the same width arg share the defect: AccountTheme, AnswerTheme, ApifyRunApproval, ApifySettings, ApifySpend, ArtifactTheme and JournalTheme.

Scope

  • Make each consumer-parity story's declared width drive the Storybook viewport, through Storybook's built-in viewport global with phone and desktop options matching the declared widths. A story's phone variant then opens at phone width in the interactive UI.
  • Keep consumerViewport's exact runner resize authoritative in Vitest.
  • Make painted() assert only what holds in the context it runs in, so opening a story by hand does not report a failure, while the runner keeps its exact checks.

Out of scope

  • Changing the Storage tab's own responsive layout in ui-react.
  • Adding new stories or widths.

Acceptance criteria

  • Opening Settings/Storage → Phone in Storybook renders a 320px-wide viewport with the phone layout. Desktop renders at 1280px.
  • Every consumer-parity story with a width arg selects the matching viewport. A unit or story test fails if a story's width and its viewport global disagree.
  • Interactive Storybook reports no play failure for Settings/Storage stories. The Vitest runner still asserts the exact viewport, media queries and consumer stylesheet.

Verification

Storybook Vitest project, plus a static build opened at a desktop viewport showing the phone story at 320px.

Contract impact

None.

Activity

  1. added this to the 0.45.0 milestone on Nov 8, 2026
  2. added
    type: fix
    area: ui-kit
    priority: p2
    agent-ready
    on Nov 8, 2026
  3. self-assigned this
    on Nov 8, 2026
  4. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim-180872) together with #3748 and #3749, on branch fix/3748-consumer-story-styles. Both fix the consumer-parity story harness. No open PR references these issues.

  5. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Delivered in #3754 (squash 8aa5c6c). Consumer stories select a Storybook viewport that matches their width (stories/_viewports.ts). The runner refuses a story whose width and viewport disagree, and painted() no longer reports runner-only failures when a story is opened by hand. Verified in the manager UI: Storage Phone opens at 320 and Desktop at 1280.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-kitpriority: p2type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions