Skip to content

feat(stories): MobileBaseline contract for interactive primitives - #8

Merged
A-PachecoT merged 1 commit into
mainfrom
feat/mobile-first-stories
May 21, 2026
Merged

A-PachecoT merged 1 commit into
mainfrom
feat/mobile-first-stories

Conversation

@A-PachecoT

Copy link
Copy Markdown
Member

Summary

Companion to docs-ai PR #46 (mobile-first Tier 1 contract). Lands the MobileBaseline story pattern in @cofoundy/ui so the mobile-first contract is enforced at story-review time, not after a real device exposes a regression.

Changes

  • src/stories/_shared/viewports.ts (NEW) — canonical viewport constants (VIEWPORT_MOBILE = 375 px iPhone SE, VIEWPORT_MOBILE_LANDSCAPE = 414 px, VIEWPORT_TABLET = 768 px iPad, VIEWPORT_DESKTOP = responsive). String values match @storybook/addon-viewport defaults bundled by addon-essentials.
  • src/stories/chat-widget/FloatingWidget.stories.tsx — the only existing positive case (4 inline viewport constants) refactored to import from _shared so we have a single SSOT.
  • src/stories/ui/Button.stories.tsx — new MobileBaseline story verifying size='lg' keeps ≥ 44×44 px tap target on mobile.
  • src/stories/ui/Input.stories.tsx — new MobileBaseline story verifying the 16 px font-size floor (prevents iOS auto-zoom).
  • src/stories/navigation/NavDropdown.stories.tsx — new MobileBaseline story that makes the component's self-asserted "44 px touch targets" visually auditable at 375 px.
  • CLAUDE.md — new "Mobile-state stories — MobileBaseline contract" section mandating the pattern for every interactive primitive + cross-link to the canonical PRD.

Pilot scope

Tier-1 ships 3 primitives only (Button / Input / NavDropdown — the three R5 flagged as zero-baseline). Backfill of the remaining 91 stories is deferred to Tier 2, one task per category, to keep the contract PR reviewable.

Spec

Source of truth: docs-ai .cofoundy/specs/architecture-v1.md §8 + the canonical PRD at https://docs.cofoundy.dev/team/docs-ai/mobile-first-contract-v1 (§7).

Test plan

  • _shared/viewports.ts exports VIEWPORT_MOBILE / _LANDSCAPE / TABLET / DESKTOP
  • FloatingWidget refactor — no duplicated constants; existing stories preserved
  • Button / Input / NavDropdown each export MobileBaseline using VIEWPORT_MOBILE
  • Verify in Storybook: pnpm storybook → check each new story renders at 375 px
  • Chromatic visual check on push (existing pipeline)

…005)

Mobile-first contract — every interactive primitive must publish a
MobileBaseline story at 375px (iPhone SE) so the floor is visible at
story-review time, not after a real device exposes the regression.

Changes:
  - src/stories/_shared/viewports.ts — canonical viewport constants (NEW)
  - src/stories/chat-widget/FloatingWidget.stories.tsx — refactor to import
    from _shared (was the only positive case; 4 constants migrated)
  - src/stories/ui/Button.stories.tsx — MobileBaseline (lg ≥ 44 px tap target)
  - src/stories/ui/Input.stories.tsx — MobileBaseline (16 px font floor)
  - src/stories/navigation/NavDropdown.stories.tsx — MobileBaseline
  - CLAUDE.md — Mobile-state stories contract section + pilot scope note

Tier-1 pilot: Button, Input, NavDropdown. Remaining 91 stories backfill in
Tier 2. Source: docs-ai .cofoundy/specs/architecture-v1.md §8 + published
PRD at docs.cofoundy.dev/team/docs-ai/mobile-first-contract-v1.

Co-authored-by: contract-author <agent@cofoundy.dev>
@A-PachecoT
A-PachecoT merged commit 192e9c5 into main May 21, 2026
1 check failed
@A-PachecoT
A-PachecoT deleted the feat/mobile-first-stories branch May 21, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant