Skip to content

feat(rootage)!: resolve ComponentSpec by state precedence, not document order - #2007

Draft
te6-in wants to merge 2 commits into
devfrom
feat/next-rootage
Draft

feat(rootage)!: resolve ComponentSpec by state precedence, not document order#2007
te6-in wants to merge 2 commits into
devfrom
feat/next-rootage

Conversation

@te6-in

@te6-in te6-in commented Aug 14, 2026

Copy link
Copy Markdown
Member

No description provided.

te6-in and others added 2 commits August 14, 2026 15:33
…nt order

A ComponentSpec was parsable but not resolvable: nothing in the document
determined which value a slot property takes for a given variant assignment and
set of active states. Composition lived in the engine, precedence rode on map
key order that JSON does not preserve, and overwriting happened per property, so
`disabled` and `loading` together produced a loading background under disabled
text — a state nobody designed.

`definitions` becomes a flat `rules` array plus an ordered `schema.states`.
A property's winner follows from suppression, then state rank, then variant
subset containment; a pair the document leaves undecided is rejected by
`validate` rather than tiebroken. Rule order carries no meaning, and `enabled`
is gone — values that apply whatever is going on are a rule with no states.

Migration is value-preserving: across all 1659 (variant x state) cells no value
changed and none disappeared, and the generated CSS is byte-identical. What
changed afterwards is deliberate — `disabled` now outranks every state and
suppresses `pressed`, and geometry once written under `enabled` no longer
vanishes the moment any state turns on.

The web recipes still write `disabled` before `loading` at equal specificity, so
rendered CSS keeps the old behaviour; TODOs mark the five affected recipes.

BREAKING CHANGE: the ComponentSpec exchange JSON replaces `data.definitions`
with `data.rules` and `data.schema.states`, and the `enabled` key in
`@seed-design/css/vars/component/*` is now `rest`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KvtdwhvmnRWChRCYryzdR3
…ting

The spec block walked `componentSpec.body` — a variant node holding state
nodes — which no longer exists. Group the flat rules by variant selector so the
page keeps one heading and one table per variant region, and let the table take
the rules of that region directly.

A rule that names no state now prints `rest`, matching the key the generated
`@seed-design/css/vars/component/*` modules publish; the migration guide's
typography snippet follows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuSpZ6q6AGaKPQ5TocVrRa
@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d90a1e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Alpha Preview (Stackflow SPA)

@github-actions

Copy link
Copy Markdown
Contributor

Alpha Preview (Storybook)

if (order < 0) continue;
}

slotProperties[declaration.property] = { declaration, rule };
@github-actions

Copy link
Copy Markdown
Contributor

Alpha Preview (Docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants