Context. surface studio · domain design · route /studio/component-primitives · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/component-primitives/page.tsx
Last walked. 2026-05-29 automated runtime walk (Playwright headless) — render, /v1 data (2xx), console/page-errors, expected content, screenshot verified; live screen-reader, touch, offline, and telemetry-delivery checks pending a manual AT pass. Evidence: WALKTHROUGH/results/runtime-sweep-2026-05-29.md; body re-derived 2026-06-03 from current source (lane-console architecture); 2026-07-02 studio-design-lane-consoles Playwright pass covers live BFF catalog/validate, auth/schema gates, error states, issue/no-issue results, quick actions, and mobile no-overflow.
Purpose#
Validate a component-primitive composition tree with the real design-system
composition + accessibility contract validator: the Composition Validation Lane
flags unknown primitives, missing required props, missing accessible names,
illegal children, and nested interactive content. It is a live admin console
wired to /v1/admin/studio/component-primitives, not an in-page simulation.
Entry points#
- Direct URL / bookmark —
/studio/component-primitives(signed-in + studio entitlement; admin scope required to validate) - Sibling Studio routes — reached via the quick-action panel on color-system, spacing-layout, complex-interactions, and other design/governance pages
Layout regions#
page.tsx mounts <ShellLayout active="studio"> and renders
<StudioComponentPrimitivesWorkspace /> followed by a single panel of
quick-action links.
- Shell:
ShellLayoutchrome with the Studio tab active - Workspace heading:
WorkspaceHeadingrenders the page<h1>"Studio Component Primitives", followed by thedata-component-primitives-summaryparagraph - Composition Validation Lane: an
<h2>data-cp-lane-heading("Composition Validation Lane") section with the load states and, when ready, the validate form and result - Quick-actions panel: 17 sibling
quickActionLinks — Navigation/Commands, Search/Discovery, Cross-Domain Entity Model, Workspace Context Switching, Multi-Project Operations, Authentication Architecture, Session and Device Management, RBAC and Permission Policy UX, Enterprise Tenant Isolation, Audit and Compliance Surfaces, Notification Center, Activity and Change Feeds, Complex Interactions, "Back to Spacing/Layout workspace", "Back to Color System workspace", "Back to Typography workspace", and "Back to Design Language workspace". No self-link and no Route Map panel.
States#
- Loading —
data-cp-loading("Loading composition validator…") - Unauthorized —
data-cp-unauthorized("Access restricted.") on 401/403 - Error —
data-cp-error("Could not load the composition validator.") - Ready / form —
data-cp-enums("N primitives · M interactive · K issue codes") plus thedata-cp-formvalidate form - Result —
data-cp-resultheadline (data-cp-headlinewithdata-valid) plus either thedata-cp-issueslist ofdata-cp-issue-rowitems (data-issue-code,data-issue-path) ordata-cp-no-issues("No contract violations found.") - Validate error —
data-cp-validate-errorfor invalid JSON or a non-200 response
Interactions#
- Composition (JSON) —
textareadata-cp-payload,aria-label="composition json", seeded with{ composition: { type, props, accessibleName?, children[] } } - Validate composition —
buttondata-cp-submit(type="submit"); POSTs{ composition }to/v1/admin/studio/component-primitives/validate, settingdata-cp-resulton a 200 with a validresult, ordata-cp-validate-errorotherwise - Quick-action links — each
quickActionLinknavigates to its sibling Studio route (see Layout regions for the 17 targets)
E2E coverage#
Coverage depth: deep.
studio-design-lane-consoles.spec.tsdrives/studio/component-primitivesthrough the live catalog, malformed-JSON client guard, real BFF 400 validation detail, invalid-composition issue rows, valid-composition no-issues result, exact quick-action href list, loading / unauthorized / malformed-catalog fail-closed states, mobile no-overflow, and direct BFF 401 / 403 / 400 gates.
Data & contracts#
- Reads:
GET /v1/admin/studio/component-primitiveson mount — returns the catalog (primitiveTypes[],interactiveTypes[],issueCodes[]) - Writes:
POST /v1/admin/studio/component-primitives/validate— body{ composition }, returns{ result: { valid, errorCount, nodeCount, interactiveCount, issues[] } } - Realtime: none
- Caching: client
fetchwithcache: 'no-store';buildBffAuthHeaders()attaches the bearer token - Auth/role check: admin-scoped fail-closed —
admin:*oradmin:studio, 401/403 under the studio workspace gate
Cross-references#
- Parent:
../studio-overview.md - Sibling:
studio-color-system.md,studio-typography.md,studio-spacing-layout.md,studio-complex-interactions.md,studio-design-language.md - Component source:
apps/oshun/web/src/components/studio/StudioComponentPrimitivesWorkspace.tsx - BFF store:
apps/oshun/bff/src/studio/component-composition-store.tsbehind/v1/admin/studio/component-primitives
Known downstream boundaries#
- Current source intentionally uses the flat quick-action panel and no Route Map panel; the 2026-07-02 browser spec asserts the exact target list.
- The canonical primitive catalog is currently the BFF contract in
component-composition-store.ts(Stack,Card,Text,Icon,Button,Link,Input) and is read back through the live catalog before validation.