feat(rootage)!: resolve ComponentSpec by state precedence, not document order - #2007
Draft
te6-in wants to merge 2 commits into
Draft
feat(rootage)!: resolve ComponentSpec by state precedence, not document order#2007te6-in wants to merge 2 commits into
te6-in wants to merge 2 commits into
Conversation
…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
|
Contributor
Alpha Preview (Stackflow SPA)
|
Contributor
Alpha Preview (Storybook)
|
| if (order < 0) continue; | ||
| } | ||
|
|
||
| slotProperties[declaration.property] = { declaration, rule }; |
Contributor
Alpha Preview (Docs)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.