Skip to content

feat(visuals): checkbox recipe, option constraints and recipe lints (2a/6) - #1576

Merged
GarthDB merged 16 commits into
next/visual-recipesfrom
slice/2a-checkbox-constraints-lints
Oct 31, 2026
Merged

GarthDB merged 16 commits into
next/visual-recipesfrom
slice/2a-checkbox-constraints-lints

Conversation

@GarthDB

@GarthDB GarthDB commented Oct 31, 2026

Copy link
Copy Markdown
Member

Squash merge is fine; the next slice is rebased onto the result.

Part 2a of 6 of the visual recipes work from draft #1569, targeting the long-lived integration branch next/visual-recipes (not main). Based on #1575 (slice 1).

Description

This slice adds the checkbox recipe, option constraints, and the recipe lints. It does not bind recipes through relationships; that is slice 2b.

  • Checkbox recipe: visuals/checkbox.json, its anatomy, relationship contexts (the S2 prefix is stripped; error and disabled bindings), and isSelected-scoped selected relationships.
  • Option constraints: constraints on the component format (spec/option-constraints.md, component.schema.json) with first constraints on button, action-button and checkbox, taken from react-spectrum S2. SPEC-064 and SPEC-065 validate them. The site matrix skips combinations an error constraint excludes and explains why.
  • Recipe conditions: an option condition may be an array (any of); SPEC-061 validates each element. The button static color recipe is scoped with it.
  • Recipe lints: SPEC-066 to 071 report recipe coverage and convention problems (uncovered options and states, token selectors a relationship already covers, literals, deprecated tokens, focus ring names). recipe_lint_baseline holds each recipe at its current warning count, so a new warning fails and an improvement must lower the baseline.
  • Renderer: pressed parts scale their nested children (pressTarget).
  • Data fixes found by rendering: badge data and label colors, and button icon-only padding.
  • Docs: switch isReadOnly has no distinct visual.

Catalog: a separate docs(spec) commit adds SPEC-066 to 071 to rules/rules.yaml (they had Rust rules and spec text but no catalog entries, as in #1569), written from the component-visuals table and the Rust rules, and puts SPEC-072 after them so the ids run in order. A test that keeps the code and the catalog in step is filed separately (not in this PR).

Review guide, in order:

  1. spec/option-constraints.md, component.schema.json, sdk/core/src/constraints.rs: the constraints format and its checks.
  2. sdk/core/src/validate/rules/spec06[4-9].rs, spec07[01].rs, recipe_lint_baseline.rs and the new rules.yaml entries: the rules.
  3. packages/design-data/visuals/checkbox.json and the checkbox relationships and component data.
  4. The remaining small fixes (data, visual.rs press scaling, site matrix).

Related Issue

Epic spectrum-design-data-p6ga (component visual recipes); slicing tracked in p6ga.9; split from #1569. Part 2a of 6, after #1575.

Motivation and Context

Slice 1 landed the format, the renderer and the four pilot recipes. This slice adds the fifth recipe (checkbox) and the guard rails that keep recipes honest: constraints so the matrix renders only valid combinations, and lints with a baseline so recipe quality cannot regress silently.

How the slice was made: the 15 commits of #1569 (plus one docs(spec) commit for the catalog) between the end of slice 1 and the first relationship-binding commit, cherry-picked in order onto next/visual-recipes. Commits already on main were skipped. Conflicts were only SPEC-072 sitting next to the new rules in rules.yaml and rules/mod.rs; both were kept. The recipe lint baseline needed no edit.

How Has This Been Tested?

On the slice head, in a clean worktree, rebased onto the merged slice 1:

  • cargo fmt --check and cargo clippy --workspace --all-targets -- -D warnings
  • moon run sdk:test sdk-wasm:test design-data:validate design-data:validate-dataset tokens:verifyLegacyOutput --force (uncached): all 11 tasks pass; legacy output unchanged
  • node tools/changeset-linter/src/cli.js check --fail-on-warnings: 7 valid
  • node .github/scripts/check-ci-coverage.mjs: 0 uncovered
  • rules.yaml parses with 72 rules, each with introduced_in, and every rule id implemented in sdk/core has an entry (ad hoc check)
  • pnpm ai:check valid; git diff pnpm-lock.yaml empty
  • New conformance fixtures for SPEC-064 and SPEC-065 (valid and invalid)

Slice 2b was also stacked on this one and passes the same checks.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Changesets: option-constraints, option-constraints-rules, option-constraints-matrix, visual-recipe-array-conditions, button-static-color-recipe, checkbox-relationship-context-prefix (new), and an addition to component-visual-recipes. They accumulate on the integration branch and are not released until the final merge to main.

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

test added 16 commits October 31, 2026 14:41
Add fuchsia-subtle background relationships, trim the non-semantic
background context string, default variant and style, and rename the
info variant to informative to match the registry, tokens, and Figma.
…kens

The badge relationships and recipe referenced the white and black palette
tokens deprecated in 15.6.0. Repoint them to transparent-static-white-1000
and transparent-static-black-1000, which have identical values.
The size M, L, and XL icon-only relationships pointed at accessory-item
padding (5, 7, 9px). Figma resolves 7, 10, and 13px, which is
base-padding-vertical, as size S already did.
Add the checkbox anatomy, the box and dash anatomy terms, and a recipe covering
size, selected, indeterminate, emphasized, disabled, and error.

The renderers draw checkmark and dash glyphs through a new recipe glyph field, and
size conditions now match the requested size instead of the default.
Read component constraints in sdk/core.
SPEC-064 (error) checks that constraint option names and values are declared.
SPEC-065 (warning) flags recipes and relationships that match only combinations
excluded by an error constraint.

Closes hb15.4, hb15.5.
… explain them

Evaluate component constraints in the browser (constraints.js, mirroring
constraints.rs), drop excluded matrix rows and columns, footnote advisory
cells, mark unsupported picker values, and explain unsupported selections
with one-click fixes. A shared fixture keeps the Rust and JS evaluations
in lockstep.
…ption conditions

Button static black/white now renders correctly (qkj5.43-.48): variant and
style conditions on static label, icon, fill and border rules, plus static
focus ring, disabled and outline hover/down rules.

The recipe renderers (sdk/core, site runtime) now match array values in
when.options, as the spec already described (qkj5.49).
SPEC-061 compared the whole array to the option's declared values, so
button.json's variant [primary, secondary] failed with 14 errors. Check each
element, for both the declared-values and boolean checks.
Describe the recipe lints from the component-visuals table and the Rust rules.
Keep the ids in order: SPEC-072 now follows SPEC-071.
@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5e2f478

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@adobe/spectrum-design-data Minor
@adobe/design-data-spec Minor
@adobe/design-data-wasm Minor
@adobe/spectrum-component-api-schemas Patch
@adobe/design-system-registry Patch
@adobe/design-data-agent-mcp Patch
@adobe/design-data-mcp Patch
markdown-generator Patch
@adobe/token-corpus-migrate Patch
@adobe/token-naming-audit Patch
@adobe/design-data Patch
s2-tokens-viewer Patch
@adobe/spectrum-design-data-mcp Patch
component-options-editor Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Run report for 5e2f4783

Total time: 8m 58s | Comparison time: 16m 49s | Estimated savings: 7m 51s (46.7% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 10.2ms Passed
🟩 SyncProject(sdk) 0.6ms Passed
🟩 SyncProject(design-data-spec) 1ms Passed
🟩 SyncProject(design-data) 1.3ms Passed
🟩 SyncProject(sdk-wasm) 1.7ms Passed
🟩 SyncProject(design-data-glue) 0.9ms Passed
🟩 SyncProject(design-data-mcp) 1.7ms Passed
⬛️ SetupToolchain(node:20.17.0) 158.8ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 118.8ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
🟩 SetupEnvironment(javascript) 0.6ms Passed
⬛️ InstallDependencies(javascript) 0.1ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.8ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 394.7ms Skipped
🟩 RunTask(design-data:validate-registry) 256.2ms Passed
🟩 RunTask(design-data:validate-visuals) 312.3ms Passed
🟩 SetupEnvironment(rust, sdk) 201.4ms Passed
⬛️ InstallDependencies(rust, sdk) 2.5ms Skipped
🟩 RunTask(sdk:fmt-check) 1.9s Passed
And 15 more...
Expanded report
Action Time Status Info
🟩 InstallDependencies(javascript, sdk) 4.8s Passed
🟩 RunTask(sdk:codegen-check) 70ms Passed
🟩 RunTask(sdk:lint) 1m 2s Passed
🟩 RunTask(sdk:build) 1m 59s Passed
🟩 RunTask(design-data:legacy-output) 1.3s Passed
🟩 RunTask(design-data:validate-dataset) 23.5s Passed
🟩 RunTask(sdk:test-doc) 2m 37s Passed SLOW
🟩 RunTask(design-data:validate) 34.6s Passed
🟩 RunTask(sdk-wasm:cache-build) 3m 6s Passed SLOW
🟩 RunTask(sdk:test) 4m 44s Passed SLOW
🟩 RunTask(sdk-wasm:build) 2m 39s Passed SLOW
🟩 RunTask(design-data-mcp:stage) 1.7s Passed
🟩 RunTask(design-data-mcp-eval:test) 19.4s Passed
🟩 RunTask(sdk-wasm:test) 2m 9s Passed SLOW
🟩 RunTask(sdk-wasm:ci) 13.4ms Passed
Changed files
.changeset/button-static-color-recipe.md
.changeset/checkbox-relationship-context-prefix.md
.changeset/component-visual-recipes.md
.changeset/option-constraints-matrix.md
.changeset/option-constraints-rules.md
.changeset/option-constraints.md
.changeset/visual-recipe-array-conditions.md
packages/design-data-spec/conformance/README.md
packages/design-data-spec/conformance/invalid/SPEC-064/dataset.json
packages/design-data-spec/conformance/invalid/SPEC-064/expected-errors.json
packages/design-data-spec/conformance/invalid/SPEC-065/dataset.json
packages/design-data-spec/conformance/invalid/SPEC-065/expected-errors.json
packages/design-data-spec/conformance/valid/SPEC-064/dataset.json
packages/design-data-spec/conformance/valid/SPEC-064/expected-errors.json
packages/design-data-spec/conformance/valid/SPEC-065/dataset.json
packages/design-data-spec/conformance/valid/SPEC-065/expected-errors.json
packages/design-data-spec/rules/rules.yaml
packages/design-data-spec/schemas/component-visual.schema.json
packages/design-data-spec/schemas/component.schema.json
packages/design-data-spec/schemas/relationship.schema.json
packages/design-data-spec/spec/component-format.md
packages/design-data-spec/spec/component-visuals.md
packages/design-data-spec/spec/index.md
packages/design-data-spec/spec/option-constraints.md
packages/design-data-spec/spec/relationship-format.md
packages/design-data/components/action-button.json
packages/design-data/components/badge.json
packages/design-data/components/button.json
packages/design-data/components/checkbox.json
packages/design-data/components/radio-button.json
packages/design-data/components/switch.json
packages/design-data/registry/anatomy-terms.json
packages/design-data/relationships/badge.json
packages/design-data/relationships/button.json
packages/design-data/relationships/checkbox.json
packages/design-data/relationships/combo-box.json
packages/design-data/relationships/radio-button.json
packages/design-data/relationships/switch.json
packages/design-data/relationships/text-area.json
packages/design-data/visuals/action-button.json
packages/design-data/visuals/badge.json
packages/design-data/visuals/button.json
packages/design-data/visuals/checkbox.json
packages/design-data/visuals/switch.json
sdk/core/src/constraints.rs
sdk/core/src/lib.rs
sdk/core/src/registry_data.rs
sdk/core/src/validate/rules/mod.rs
sdk/core/src/validate/rules/spec053.rs
sdk/core/src/validate/rules/spec061.rs
sdk/core/src/validate/rules/spec062.rs
sdk/core/src/validate/rules/spec064.rs
sdk/core/src/validate/rules/spec065.rs
sdk/core/src/validate/rules/spec066.rs
sdk/core/src/validate/rules/spec067.rs
sdk/core/src/validate/rules/spec068.rs
sdk/core/src/validate/rules/spec069.rs
sdk/core/src/validate/rules/spec070.rs
sdk/core/src/validate/rules/spec071.rs
sdk/core/src/validate/rules/visual_util.rs
sdk/core/src/visual.rs
sdk/core/tests/constraint_cases.rs
sdk/core/tests/fixtures/option-constraint-cases.json
sdk/core/tests/fixtures/recipe-lint-baseline.json
sdk/core/tests/recipe_lint_baseline.rs
sdk/moon.yml
sdk/plugins/site/AGENTS.md
sdk/plugins/site/assets/AGENTS.md
sdk/plugins/site/assets/constraints.js
sdk/plugins/site/assets/index.html
sdk/plugins/site/assets/visual-runtime.js
sdk/plugins/site/src/lib.rs
sdk/wasm/moon.yml
sdk/wasm/test/constraints-parity.test.js
sdk/wasm/test/visual-runtime-parity.test.js

@github-actions

Copy link
Copy Markdown
Contributor

🎨 Token Changes Report

Tokens Changed (0)

Original Branch: next/visual-recipes


This comment was automatically generated by the token diff tool. 🤖

@github-actions

Copy link
Copy Markdown
Contributor

🧩 Component Schema Changes Report

Component Schemas Changed (0 added, 0 deleted, 6 updated)

Original Branch: next/visual-recipes

✅ No Breaking Changes

This PR contains only non-breaking changes to component schemas.

🔄 Non-Breaking Updates

action-button

badge

button

checkbox

radio-button

switch


This diff was generated automatically and contains only backward-compatible changes.


This comment was automatically generated by the component schema diff tool. 🤖

@GarthDB
GarthDB merged commit bf5e8a8 into next/visual-recipes Oct 31, 2026
9 checks passed
@GarthDB
GarthDB deleted the slice/2a-checkbox-constraints-lints branch October 31, 2026 21:01
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.

1 participant