ADR-0028: An empty state inside a frame does not draw one — the contract a component has with its container
- Status: Accepted
- Date: 2026-08-20
- Deciders: Renaissance workstream 002, phase 02 (
EmptyState, the sixteenth conversion); extends ADR-0022, and follows ADR-0019, ADR-0023, ADR-0024, ADR-0026, ADR-0027
Context
The last three conversions each found the ledger row wrong in a new
direction. ADR-0026: the same name can be two different elements. ADR-0027:
the same name can be two different kinds of control, and the real
counterpart may be exported under another name. Textarea then widened that
again — the same kind of control, and still not one-to-one, because the app
exported a field where Studio exports a control plus a wrapper.
EmptyState passes all three of those checks. Run ADR-0027's question first:
is Studio's same-named export the same kind of thing? Yes — both are a
centred column of icon, headline, sentence and one action, for a list with
nothing in it. Run ADR-0026's: diff the elements. They are near-identical.
Run Textarea's: is the app's export doing more than one job Studio has
split? No — one export each. Then diff the props, which is where every
previous check ends:
app components/ui/EmptyState.tsx | Studio EmptyState (feedback.jsx) | |
|---|---|---|
| Icon | icon?: ReactNode in an .icon-tile.is-lg | icon — an icon-font class in .lk-empty__tile |
| Headline | title: string → <h3 class="empty-state-title"> | title → <h3 class="t-title-sm">, plus accent |
| Sentence | description?: string | children |
| Action | action?: ReactNode | actions?: ReactNode |
| Padding | compact?: boolean — --space-5 vs --space-8 --space-5 | — |
| Announced | role="status" | nothing |
Three of those are ordinary migration work, one is ADR-0024 again, and none of them is the finding. The finding is a row that is not in the table at all, because it is not a property of the component:
.lk-empty { border: 1px dashed var(--border-strong); background: var(--surface); }
DESIGN.md specifies that frame, and it is right. It is right for an empty state that is the page's content — the thing you see when a collection is empty and the collection is the screen. It is wrong for an empty state that is the body of something that already drew edges. Of the 21 places Cardsite renders one:
- 14 are the
emptyprop of aDataTable, landing intd.lk-table__emptyinside the table's own border; - 2 are the body of a
Card; - 5 are free-standing in the page —
CataloguePage's no-results state and the four AI pages' History sections, each sitting directly under a section heading with nothing else around it.
So the import swap the ledger row implies ships a dashed box inside a border on 16 screens out of 21. Nothing in the props says so, nothing in the component can see it, and — the part that makes this worth an ADR rather than a commit message — every check the previous six ADRs added comes back clean. ADR-0022 is the nearest miss: it is about the space a component needs from its container, and made a Studio component pad its own edges rather than ask the call site what its container was doing. This is the mirror image. It is about the material a component draws that its container has already drawn, and the answer cannot be "always" or "never".
The app component had it right by accident on 16 of those and wrong on 5: it drew no edges at all, so it could not double up, and it could not stand alone either — which is why all five free-standing empty states in the product are bare columns floating in the page.
And the count above is itself the ADR's cautionary tale. The first draft
of this document said 20 of 21, because the survey it was written from
described the four AI sites as "not wrapped in a Card" and that phrase was
read as a container rather than as its absence. An adversarial recount — one
that named the immediate rendering container of each site rather than
summarising them — moved four sites from one column to the other and changed
which variant they ship. That is the same failure ADR-0022 records, at the
same step, one conversion later, which is why the check below is stated as a
procedure and not as a caution.
Decision
A Studio component that draws its own frame takes a variant that does not, and the variant is named for the container, not for the size.
Concretely, for EmptyState:
.lk-emptykeeps the frame DESIGN.md specifies. It is the default because a component's default should be the standalone case — an empty state that draws nothing is invisible when nothing else is on the screen, and that failure is silent, where a double border is at least visible.compactdrops the frame and tightens the padding. Its meaning is "my container already draws edges", not "smaller". The prop name survives from the app component, where 19 of 21 sites already passed it; its definition does not, and neither does which sites get it: of those 19, four are free-standing and now render framed.- The frame is neutralised with
border-color: transparent, notborder: 0. The border stays in the box model, so a framed and a compact empty state of the same content are the same height and a call site can switch between them without relayout. - DESIGN.md gains the variant. A rule the stylesheet has and the specification does not is how the two drift.
This keeps an opt-in that ADR-0022 removed, and the difference is the
minority. ADR-0022's rule is prefer removing a failure mode to testing for
it: it deleted Pagination's inset prop because 11 of 11 call sites wanted
the gutter, so the prop was "a trap with documentation" — a modifier every
real consumer had to remember. compact is the same shape at 16 of 21, and it
survives for the one reason inset could not: the minority here is real and
permanent. Five empty states genuinely stand alone in the page, and an empty
state that draws nothing when nothing else is on screen is the silent failure
inset never had a counterpart for. There is no default that serves both, and
the component cannot see its own container.
What ADR-0022 is owed instead is the artefact it says nobody writes — it
records that inset's suite "asserted the modifier's mechanism thoroughly
while asserting that any call site actually passed it not at all". So keeping
the opt-in is conditional on the call-site check: EmptyState.test.tsx reads
every page, works out what actually contains each empty state, and fails if
the variant disagrees in either direction. A trap with documentation is a
trap; a trap with a gate is a prop.
And the general check this adds, before any conversion: for every component that draws a frame, a background, a shadow or a rule, ask what is already drawing that where this lands — and answer it by listing the immediate rendering container of every call site, not by classifying them from the component's own file. ADR-0022's first draft failed exactly this way: it keyed a gutter on "inside a flush card", which fit the four call sites read closely and broke on the two classified from a glance.
Two corollaries that fall out of the same reasoning:
- The count is the argument. "Most call sites want X" is not a call-site-by-call-site override; it is a variant. 16 of 21 is a variant. It is also why the variant is not the default: the other five are real.
- A call site that changes variant is a rendering change, and it is
recorded. Five did here, in both directions.
LinksPagewas the app's non-compact default inside a<Card>and now passescompact, because the alternative was a dashed box inside a card border. The four AI History sections passedcompactand no longer do, because they stand alone and the app had never had a frame to give them. Both belong in the commit and in the archive register, not in a reviewer's memory.
Consequences
EmptyStategainscompact, and.lk-empty--compactjoins the component layer.apps/webpasses it at 16 of 21 sites, and a test asserts that.- Every one of the 21 changes appearance, and that is stated rather than
implied by "one call site changed on purpose". Adopting Studio's material
is the point of the conversion (ADR-0019), but the deltas are the visible
facts of the commit: the headline goes 14px/600 in
--on-surfaceto 22px--font-display/500 in--text; the sentence 13px/--on-surface-3at 340px measure to 15px/--text-2at 420px; the icon tile 48px on--surface-2in--on-surface-2ink to 52px on--accent-softin--accent-line— a grey tile turning lime on 19 screens; and the column gap 8px to 16px. A 22px display headline inside a 20px-padded table cell on 14 screens is the largest of these and is deliberate. - The headline must declare its own ink, which the first draft of this
change forgot.
.t-title-smdeclares nocolorbecause the full bundle has an ambient--text; the standalone layer has no ambient anything, andtd.lk-table__emptysetscolor: var(--text-3)for its own bare placeholder. So on the 14 table sites the headline inherited a step fainter than.lk-empty__desc's declared--text-2directly beneath it. This is ADR-0023's "two components that render against each other agree on the values that align them" at a property that ADR did not reach — it movedpaddingoff that cell and leftcoloron it..lk-empty__titlenow states--text. The--text-3still belongs on.lk-table__empty-textrather than on the cell; that isDataTable's rule to move, recorded rather than reached for here. - DESIGN.md's empty-state paragraph gains a sentence for the variant.
- Two defects found on the way, both live for Studio consumers before this
app imported anything, and both recorded here because they are instances
of rules that already exist rather than new ones:
- The markup named
t-title-smandt-body. Those classes are generated intostudio.type.css, which is in the full bundle and in no standalone layer — so every consumer importing@studio/core/css/componentsalone got the frame, the tile and the actions, and a headline in whatever the host's default happened to be. This is ADR-0023 rule (a) precisely: a.t-selector cannot join the.lk-layer without escaping the namespace the build checks, so the markup stops naming it and.lk-empty__title/.lk-empty__desccarry the material at the type scale's own values.preview/studio-design.htmlhid it for the same reason it hides missing icon fonts — it links the fullstudio.css. iconrendered<i className={icon}>. Passing the lucide element every icon-bearing call site in this app holds would have producedclass="[object Object]"and a blank 52px tile. ADR-0024; the fix is thestring | ReactNodecontractMenuAction.iconalready carries.
- The markup named
role="status"moves from the app component into Studio, and the claim is bounded: it marks the region, and whether a screen reader announces it is a separate question. All 21 sites mount the region and its content in one commit, and a live region inserted together with its text is not reliably announced — inherited from the component this replaces, not introduced, and not fixed by this change. Ten sites also put a<Button>inside the live region, which is a documented smell and is likewise inherited. An empty state is usually the only thing on screen and usually replaces a list that was there a moment ago; nothing announced that to a screen reader on any Studio consumer.- What this does not decide. Whether the other framed components —
Card,Banner,.lk-panel— have the same defect where they nest. They probably do somewhere; finding out is a survey, not this conversion. Nor does it reach Swift:StudioEmptyStatedraws its dashed border unconditionally and has no variant, so React and CSS now express something Swift cannot. The parity gate matches names and will not see it — phase 04's problem, recorded here so it is not discovered there.
Source: docs/decisions/0028-an-empty-state-inside-a-frame-does-not-draw-one.md