Context. surface studio · domain design · route /studio/typography · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/typography/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/generate, auth/schema gates, error states, quick actions, and mobile no-overflow.
Purpose#
Generate a modular type scale with the real generator: the Type Scale Lane
computes font size = base × ratio^step and snaps each line height up to the
baseline grid for vertical rhythm. It is a live admin console wired to
/v1/admin/studio/type-scale, not an in-page simulation.
Entry points#
- Direct URL / bookmark —
/studio/typography(signed-in + studio entitlement; admin scope required to generate) - Sibling Studio routes — reached via the quick-action panel on color-system, spacing-layout, design-language, and other design/governance pages
Layout regions#
page.tsx mounts <ShellLayout active="studio"> and renders
<StudioTypographyWorkspace /> followed by a single panel of quick-action
links.
- Shell:
ShellLayoutchrome with the Studio tab active - Workspace heading:
WorkspaceHeadingrenders the page<h1>"Studio Typography", followed by thedata-typography-summaryparagraph - Type Scale Lane: an
<h2>data-ts-lane-heading("Type Scale Lane") section with the load states and, when ready, the generate form and result table - Quick-actions panel: 17 sibling
quickActionLinks — Color System, Spacing/Layout, Component Primitives, Complex Interactions, 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, "Back to Design Language workspace", and "Back to Studio IA workspace" (/studio). No self-link and no Route Map panel.
States#
- Loading —
data-ts-loading("Loading type-scale generator…") - Unauthorized —
data-ts-unauthorized("Access restricted.") on 401/403 - Error —
data-ts-error("Could not load the type-scale generator.") - Ready / form —
data-ts-enums("N common ratios") plus thedata-ts-formgenerate form - Result —
data-ts-resultheadline (data-ts-headlinewithdata-ts-range) and thedata-ts-scaletable ofdata-ts-step-rowrows (data-ts-font,data-ts-line-height) - Generate error —
data-ts-generate-errorfor invalid JSON or a non-200 response
Interactions#
- Scale (JSON) —
textareadata-ts-payload,aria-label="type scale json", seeded with{ baseSizePx, ratio, steps[], lineHeightMultiplier, baselineGridPx } - Generate scale —
buttondata-ts-submit(type="submit"); POSTs the parsed JSON to/v1/admin/studio/type-scale/generate, settingdata-ts-resulton a 200 with a validresult, ordata-ts-generate-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/typographythrough the live catalog, malformed-JSON client guard, real BFF 400 validation detail, successful modular-scale generation, 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/type-scaleon mount — returns the catalog (commonRatios{}) - Writes:
POST /v1/admin/studio/type-scale/generate— returns{ result: { scale[], summary{ stepCount, minFontSizePx, maxFontSizePx } } } - 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-spacing-layout.md,studio-component-primitives.md,studio-complex-interactions.md,studio-design-language.md - Component source:
apps/oshun/web/src/components/studio/StudioTypographyWorkspace.tsx - BFF store:
apps/oshun/bff/src/studio/type-scale generator behind/v1/admin/studio/type-scale
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 generator snaps to the caller-provided
baselineGridPx; feeding the scale into a future live theming pipeline is outside this route's current contract.