Skip to content

The three console SDUI preview harnesses author 79 Tailwind classNames inside real page source strings — the practice the shipped lint rule warns on, working only by the coincidence ADR-0065 names as the failure #5470

Description

@os-support-ai

Found while implementing #5461 (which corrects the prose framing on PageSchema.kind
and react-page.tsx). Filing rather than fixing — outside that card's declared file
surface, and the right resolution here is a judgement call rather than a mechanical edit.

What is there

apps/console/src/ holds three browser preview harnesses for the ADR-0080 source tiers,
each served by its own .html entry (sdui-jsx-preview.html, sdui-tiers-preview.html,
sdui-workbench-preview.html). Each defines a real page source string and renders it
through the real PageRenderer. Measured at 9bd753682, counting only className=
occurrences inside the page-source template literals:

FileclassName= inside page sourceTier
apps/console/src/sdui-jsx-preview.tsx40kind:'jsx'
apps/console/src/sdui-tiers-preview.tsx25kind:'html' + kind:'react'
apps/console/src/sdui-workbench-preview.tsx14kind:'react'
total79

Why this is the defect and not just style

ADR-0080's 2026-06-30 header amendment (under ADR-0065, Accepted) retracted the
"HTML + Tailwind" framing for page source: source is runtime metadata, the console's
Tailwind is compiled at build time by scanning the console's own src with no safelist,
so an authored utility class silently produces no CSS. "Do not author Tailwind classes
in page source."

These previews are the one place in the repo where that rule is violated and still
looks right
, and the files say why in their own headers:

 * Tailwind v4 scans this file's text for class candidates, so the runtime
* source strings below are fully styled.
/* ADR-0080 browser preview: a kind:'jsx' page rendered through the real
* PageRenderer (compile -> SchemaRenderer). Tailwind v4 scans this file's text
* for class candidates, so the runtime source string is fully styled. */

That is the ADR-0065 failure mode stated as the mechanism: styling that "works only by
coincidence" — here, the coincidence that the page source happens to live inside a .tsx
file the console's own Tailwind scan reaches. Lift the same string into actual page
metadata (which is what these previews are demonstrating) and every one of the 79 classes
produces nothing, with no error anywhere.

Two consequences worth separating:

  1. Teaching. These are the repo's worked examples of the two tiers. An author or an
    authoring agent copying sdui-tiers-preview.tsx's html source into a real page gets a
    correctly structured, correctly bound, entirely unstyled page.
  2. Gate disagreement. Run through os validate, all three sources would trip
    page-source-className-tailwind (validatePageSourceStyling, shipped in
    @objectstack/lint@11.5.0) — a warning on kinds html, react and jsx. The repo's
    own demo of a tier fails the framework's own rule for that tier.

Counter-evidence that the previews are the outlier and not the practice: #5461 measured
the three real kind:'react' pages in the framework's examples/app-showcase at zero
className and 37 style={{ between them.

What needs deciding

Not mechanical, which is why this is its own card:

  • (a) Rewrite the three sources to the real per-tier primitive — react via inline
    style objects with hsl(var(--token)) theme colours, html via the blocks' own
    structured props (flex direction/gap, grid columns) plus a JSON style object,
    per content/docs/guide/react-pages.md §Styling. Highest fidelity: the previews would
    then demonstrate what authors are told to write, and would exercise the token path in a
    browser. Cost: the visual richness of the current previews is doing real work in a
    manual dogfood loop, and some of it may not survive the translation.
  • (b) Keep them and annotate. Add a header note stating that these are console-internal
    harnesses whose sources are build-scanned, that authored metadata gets no such scan, and
    that the shown classes are therefore not a pattern to copy. Cheap, honest, but leaves a
    worked example that contradicts the rule for anyone who reads the source rather than the
    header.
  • (c) Split. Keep the current files as renderer-plumbing previews, and add one small
    token-styled source per tier as the authoring example.

I recommend (a) for sdui-tiers-preview.tsx at minimum — it is the file that
explicitly labels itself "Browser preview for the two AI-authoring tiers", so it is the
one making an authoring claim — and (b) for the other two if the rewrite cost is
judged too high.

Related: #5469 tracks the 8 remaining prose sites of the same retracted framing; #5461
fixes the published PageSchema.kind TSDoc and react-page.tsx.


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions