From bdc2dbf60d8f9cfd60a866a4af7541d132d7a421 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Tue, 22 Sep 2026 20:59:05 -0400 Subject: [PATCH] fix(v2): code-review pass on storybook viewport presets Drop the manual data-bp pin in RTable MobileCardStack (it now uses the phone viewport global), give each RomM preset its own tier, remove the no-op install from storybook.test.ts, and correct the related docs. Co-Authored-By: Claude Opus 5.5 (1M context) --- .claude/skills/frontend-v2-input/SKILL.md | 4 +-- frontend/.storybook/rommViewports.ts | 23 ++++++--------- .../src/v2/composables/useBreakpoint/index.ts | 7 ++--- .../src/v2/lib/data/RTable/RTable.stories.ts | 28 +++++-------------- frontend/test/storybook.test.ts | 4 --- 5 files changed, 21 insertions(+), 45 deletions(-) diff --git a/.claude/skills/frontend-v2-input/SKILL.md b/.claude/skills/frontend-v2-input/SKILL.md index cfb634696..0f3acefe7 100644 --- a/.claude/skills/frontend-v2-input/SKILL.md +++ b/.claude/skills/frontend-v2-input/SKILL.md @@ -48,7 +48,7 @@ When a dialog opens, push a scope; when it closes, pop. This stops Escape from c ## Responsive layout (universal viewport) -- **Single breakpoint source: `useBreakpoint`** (`src/v2/composables/useBreakpoint/`). Material thresholds — `xs <600`, `sm 600–959`, `md 960–1279`, `lg 1280–1919`, `xl ≥1920`. `installBreakpointAttribute()` mirrors the active set onto `` (once from `AppLayout` and `AuthLayout` in the app; also from `.storybook/preview.ts` and `frontend/test/storybook.test.ts` so Storybook and composed-story tests match production CSS). +- **Single breakpoint source: `useBreakpoint`** (`src/v2/composables/useBreakpoint/`). Material thresholds: `xs <600`, `sm 600–959`, `md 960–1279`, `lg 1280–1919`, `xl ≥1920`. `installBreakpointAttribute()` mirrors the active set onto `` (from `AppLayout` and `AuthLayout` in the app, and from `.storybook/preview.ts` so stories match production CSS). - **Layout switches live in CSS** via the attribute selector: `html[data-bp~="xs"] .foo { … }`, `html[data-bp~="sm-and-down"] .foo { … }`. **No raw `@media` for layout** — the only allowed `@media` are `prefers-reduced-motion` and print. The attribute is on `` so it reaches teleported overlays. - **Conditional rendering** (mount/unmount a different component per tier) uses the `useBreakpoint()` refs in `