Skip to content
Toolkit

ADR-0036: Two more rows that were deletions — the rule's first application, and what a story is not

  • Status: Accepted
  • Date: 2026-08-21
  • Deciders: Renaissance workstream 002, phase 01 tail (PermissionGrid and DiffViewer, the second and third authoring rows to be censused before being designed); applies ADR-0035, ADR-0019, ADR-0021

Context

ADR-0035 retired Form and FormField rather than authoring them, and set a rule:

An authoring row is a claim that the app has a component Studio lacks. Run the call-site census before the component is designed, not after. A row with zero call sites is not a small authoring job — it is a deletion, and authoring it would add an export to the design system that no consumer asked for.

It then applied that rule to the seven planned rows that remained and found two more zeros, which it recorded and deliberately did not sweep in: a second component's disposition is not that item's to decide. This is that decision, taken on its own commit. The census is re-run here from scratch rather than inherited, because ADR-0035's own Verification section is a list of three corrections a census needed before it could be trusted.

PermissionGrid: the second component that arrived dead

90 lines, exporting one function and no type — PermissionGridProps is declared but never exported, so nothing outside the file could even have named its shape.

ProbeResult
<PermissionGrid in any file in the working tree0
<PermissionGrid in any commit, git log -G over --all0
imports of the name, anywhere0 (the barrel line is the only export)
'PermissionGrid' as a string a registry could key on0
the name in the 28 Playwright specs under apps/web/tests/0
a storynone exists
any CSS selector containing permission0
.d.ts, Swift, studio/packages/react/src/index.js0

This is a stronger result than Form's. Form had at least an ambiguous history — git log -G'<Form' matched six commits, all of them TypeScript type arguments, and ADR-0035 had to state the finding precisely to keep it true. <PermissionGrid is unambiguous and matches nothing, ever. Like ui/Form.tsx, the file has not been edited since the 2026-08-12 extraction that created it. It arrived dead and was scheduled for authoring nine days later.

The 001 inventory row that seeded the ledger said so at the time and was read as a schedule rather than a verdict:

| `PermissionGrid` | 0 pages yet | Built for workspaces | — .station/jobs/001-renaissance/evidence/studio-component-inventory.md:66

"0 pages yet" was accurate on 2026-08-13 and is accurate now. Nothing about the row changed; what changed is that a rule now exists for reading it.

What the census found underneath it, which is a product fact and not a design -system one. The server half of this feature ships: apps/api/internal/models/team.go:37 declares AllTeamAccessKeys, and internal/handlers/teams.go:277-287 and :340 build a member's access map from input.Access over exactly those keys, with the enforcement exercised by apps/web/tests/e2e-live/workspace-roles.spec.ts. apps/web/src contains no permissions UI at all. So this component was not merely unused — it was the only client of a live API contract, and the contract is now unclaimed. That does not change the decision (a design system does not author an export for a screen nobody has built), but it is the reason the archived file is worth keeping precisely: it matched the server's key vocabulary exactly. Recorded as an open item.

The vocabulary is worth stating, because a first pass at this ADR got it backwards and called correct code a latent defect. The keys are spelled action.resource — read.all, create.links, delete.biolinks. The component read parts[0] as the action for the label and parts[1] as the resource for the grouping; that is not two functions disagreeing about the key, it is two functions reading the two halves a two-part key has, and it is right for what the server sends. Its one real defect is the accessible one: the groups are plain <div>s with a <span> heading rather than a fieldset and legend, so every checkbox would have been announced as its bare action word with no resource. Nobody saw it, because nothing rendered it.

DiffViewer: the component whose only call site was its own story

124 lines, and unlike PermissionGrid it contains something worth keeping: an LCS dynamic-programming line diff over Uint32Array rows, with unchanged regions collapsed to a context window. It is the most substantial dead component this workstream has found.

It has zero production call sites, and — this is the finding that needed stating carefully — it has never had one:

ProbeResult
<DiffViewer in the working tree1, ui/OverlaysAndData.stories.tsx:214
<DiffViewer in any commit, git log -G over --all7 commits, and in every one the only file containing it is OverlaysAndData.stories.tsx
production imports0 — the story's import { DiffViewer } from './index' was the file's only non-@studio/react import
the name in the 28 Playwright specs0
.d.ts, Swift, Studio React0

So the story is not a survival of a call site that used to exist. The story is all there ever was.

A story is not a consumer. This workstream has counted that way from the beginning, in both directions: Button's census reported "287 of them across 71 files once the four in its own stories are set aside", and Card's did the same. Counting a story here would invert the rule — a component would justify its own existence by demonstrating itself, and every dead export could be kept alive by adding one. The story is retired with the component.

The near-miss worth recording for the next census, as BlockSettingsForm was for ADR-0035: CHANGELOG.md:422 lists DiffViewer (LCS unified diff) under Added, in the same breath as EmptyState, which is a real converted component. A census that reads the changelog for evidence of use finds a shipping announcement for something that never shipped to a screen.

What was measured before deciding, and what it cost

Neither component gets a Studio counterpart. ADR-0019 governs what an authored component owes the one it replaces; with nothing to replace, there is no subject — the same reading ADR-0035 applied to Form. Two specific gaps are therefore recorded rather than filled: Studio has no permissions matrix and no diff surface, and if either is ever wanted, the archived files are the starting point.

PermissionGrid took no CSS with it, which is a first for this workstream: every class its markup named is a shared utility with other emitters. The Form retirement deleted .field-label .req; this one deletes nothing, because the component owned nothing.

DiffViewer is the opposite, and the cleanest ADR-0021 sweep on record. Eight class names, DiffViewer.tsx the sole emitter of every one, all thirteen rules contiguous under one section comment in styles/components.css:

Counts are className/class positions across the whole repository, app and preview page together, not apps/web/src alone — which is what makes the two rows differ:

ClassEmitters beforeEmitters after
.diff-viewer, .diff-head, .diff-stat-add, .diff-stat-del1 each (the component alone)0
.diff-body, .diff-line, .diff-gutter, .diff-text2 each (the component + the preview card)0
.is-add, .is-del, .is-skiponly ever compounded on .diff-line0 anywhere in the app

The single complication is the one the Badge, Card and Form retirements all met: .station/jobs/002-renaissance/preview/current-design.html hand-rolled a two-line diff card and was the last emitter of four of those classes anywhere. That page links the app's real stylesheets, so deleting the rules without retiring the card would have been a visible regression, not a tidy-up: retiring both on one commit is required here, not stylistic. The class names are spelled in prose there rather than quoted as markup, so a future emitter census greps the file clean.

Two survivals are worth naming, and they are not the same case, though a first pass at this ADR recorded them as one:

  • .framed (components.css:954) — 2 emitters, now 1, CodeEditor.tsx:227, and that is one emitter anywhere: the preview page never named it.
  • .checkbox (patterns.css:329) — down to 1 in apps/web/src (QrCodeBuilderPage.tsx:624) but 5 in the repository, the other four being current-design.html:188,379,381,382.

So only .framed is where .field-label was left by ADR-0035 — one call site from dead. .checkbox is two retirements from it, and its preview emitters are load-bearing for three cards on that page. Recording them identically would have handed a future sweep a deletion that breaks the preview, which is the error this section exists to prevent. Both are open items rather than deletions, per the routine's no-adjacent-cleanup rule.

Decision

PermissionGrid and DiffViewer are retired, not authored. Both files are archived to .archives/removal-safe/, both barrel lines are replaced by the retirement note components/ui/index.ts carries for every such component, DiffViewer's story goes with it, its thirteen CSS rules are deleted, and both ledger dispositions are removed — with no source knowing the names, the gate's S2 rule requires it.

What this adds to ADR-0035's rule, since five planned rows remain:

A census counts production call sites. A Storybook story, a preview page, and a changelog entry are all demonstrations of a component, not uses of it, and a component that is only ever demonstrated is dead. Where the only call site is a demonstration, the demonstration is retired with the component — otherwise the next census finds a call site and the rule never fires again.

A note on the ledger's vocabulary, because it invited this. ledger.json has two statuses, planned and not-planned, and neither means "this was looked at and there is nothing to build." PermissionGrid and DiffViewer sat at planned for nine days meaning only "not yet done". The gate is right not to grow a third word — it reads source, and a retired component leaves no source to read (ADR-0018) — but the row cannot record a census, so the census lives in the barrel comment, the archive register and this file. That is why those comments are long.

Consequences

  • The scoreboard moves twice more without a component being written: 10 app-side and 10 awaiting authoring → 8 and 8; 0 awaiting conversion is unchanged. Three of the eight carry a not-planned React disposition (Select, Switch, DisplayRulesEditor), so five rows are planned, and those five are the whole authoring queue: TimezonePicker (1 production use), MultiSelect (2), CodeEditor (4), DateTimePicker (5), ColorPicker (22). ADR-0035 predicted exactly this number; it is now the gate's number too, and the overstatement it recorded has shrunk from five rows to three.
  • Three of the twelve rows the phase-01 authoring queue started with were dead, and the queue's ordering is why they surfaced together: "ordered by blast radius" put the three smallest first, and the three smallest were empty. The ordering has now paid for itself twice. What it cannot do is distinguish small from zero, which is what the census is for.
  • .field-label is no longer the only class one emitter from death. .framed and .checkbox join it, both as a side effect of deleting dead components rather than of any conversion. This is the shape of the phase-01 tail: nothing is being replaced, so every sweep subtracts.
  • CHANGELOG.md:422 is left as it stands. It is a historical record of what a release claimed, and it was true that the code was added. Amending it would make the archive register's job — recording what was true and what it turned out to mean — the changelog's, and this repository keeps one canonical place per concept. The near-miss is recorded here and in the register instead.
  • The i18n ratchet falls by two, 1982 → 1980, one per file, confirmed by isolation in scripts/i18n-baseline.json with the arithmetic. Both are JsxText: All (PermissionGrid's select-all label) and unchanged line (DiffViewer's collapsed-region row). Neither is a relocation or an extraction, as with Form — but the two differ from each other in a way worth one line: PermissionGrid's string was rendered by nothing, ever, while DiffViewer's was rendered in Storybook by the story that was its only call site. One was read by nobody and the other only by developers. DiffViewer's other four JsxText nodes (→, +, −, ⋯) were never counted — the method requires an ASCII letter — and its aria-label is a template literal, which the method's attribute rule does not reach. That last point is open item 8 in miniature: a real accessible name, uncounted.
  • There is no new test, deliberately — ADR-0035's reasoning applies unchanged and is not restated. Nothing moves: no consumer changes, no rendered markup changes, and the available assertions are the ones Card.test.tsx:268-272 already makes for a converted component — that the barrel no longer exports the name, that the deleted rules are gone. The honest reason for not adding them here is not that they would be vacuous: it is that they are cheaper than the risk they cover only when a consumer exists to regress, and here none ever did. The verification is the census, the build compiling against a shorter barrel and a story-less stories file, and the gates.
  • apps/web/src/components/ui/ is down to eight exported components. The workstream's charter is that it reaches zero; three of the last four reductions were deletions rather than conversions, and that is worth knowing before phase 03 is scoped — the remaining eight include five real authoring jobs and three that stay app-side by disposition, so the directory does not empty by conversion alone.

Verification

npm run verify exits 0 — Studio build and lint, nine parity gates, the unit suite, and the web build compiling against a components/ui barrel two exports shorter and a OverlaysAndData.stories.tsx with one story fewer. apps/api is untouched, so its Go gate does not apply.

The census was run three ways and agreed each time: a subagent's exhaustive sweep over every naming form (PascalCase, kebab-case, snake_case, CSS selectors, data attributes, string literals), an independent repeat by the integrating session with different patterns, and git log -G over all history for both JSX tags. Two numbers the sweeps disagreed on were re-derived rather than reconciled by reading, which is the ADR-0035 discipline:

  1. .framed's emitter count. A word-boundary grep for framed over apps/web/src returns six; a parser-shaped count of className positions returns one. The other five are not five of a kind, which is worth spelling out because the loose grep hides the difference: two are the word framed in EmptyState.test.tsx's prose (:187, :368) and three are the rules themselves in components.css (.framed at 954, .framed.is-invalid at 959, .framed-head at 962) — declarations, not emissions, and the thing the count is meant to be counted against. The ADR-0021 question is how many places emit the class, so the answer is one, and the loose grep would have reported a comfortable margin where there is none.
  2. The size of the deleted CSS block. "14 rules" and "13 rules" both circulated; the block is 13 selectors plus its section comment, counted off the pre-deletion blob rather than off either summary.

The emitter counts in this file and in the barrel comments are the className-position counts, not word greps.

Source: docs/decisions/0036-two-more-rows-that-were-deletions.md

Library