Skip to content

feat(visuals): component visual recipe format and SVG renderer (1/6, merge commit not squash) - #1575

Merged
GarthDB merged 15 commits into
next/visual-recipesfrom
slice/1-recipe-renderer
Oct 31, 2026
Merged

GarthDB merged 15 commits into
next/visual-recipesfrom
slice/1-recipe-renderer

Conversation

@GarthDB

@GarthDB GarthDB commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Description

Merge with a merge commit, not squash, so the stacked slices keep their commit identities.

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

This slice adds the recipe format and everything needed to render one:

  • Spec and schema: spec/component-visuals.md (draft RFC), the component-visual schema, and a visual-schema enforcement script wired into design-data:validate.
  • Core renderer: sdk/core/src/visual.rs: compiles a recipe against the token graph and builds a scene (box, text, icon, nested flow layout, per-corner radius, pressed scale), then emits SVG. Scene token refs carry the alias chain.
  • CLI and WASM: design-data render (SVG), Dataset.renderScene and Dataset.renderSvg in the browser.
  • Site v1: design-data site --out <dir> writes a static explorer (sdk/plugins/site). It starts here because the first site commit is bundled with the renderer in feat: component visual recipes, renderer, and static explorer site #1569.
  • Pilot recipes: visuals/{action-button,button,badge,switch}.json, with their anatomy in components/ and 15 switch color relationships.
  • Validation: SPEC-060 to 063 check a recipe against its component and relationships (validate --visuals-path).
  • Plumbing: the site plugin is registered in the AI inventory, and the WASM test timeout is raised.

Not in this slice: more recipes (checkbox), option constraints and recipe lints (slice 2a), relationship-bound recipes (2b), site UI polish and WASM parity tests (3), anatomy standard (4), platform-aware rendering (5).

Review guide for this slice, in order:

  1. packages/design-data-spec/spec/component-visuals.md and packages/design-data-spec/schemas/component-visual.schema.json: the format.
  2. sdk/core/src/visual.rs: compile and scene building (largest file, 2.2k lines).
  3. packages/design-data/visuals/*.json: pilot recipes (large JSON; read one, skim the rest).
  4. sdk/core/src/validate/rules/spec06*.rs: SPEC-060 to 063.
  5. sdk/plugins/site, sdk/cli/src, sdk/wasm: consumers.

Related Issue

Epic spectrum-design-data-p6ga (component visual recipes); slicing tracked in p6ga.9; split from #1569.

Motivation and Context

#1569 is about 100 commits and cannot be merged to main until the recipes are complete. The owner wants the normal workflow of small reviewable PRs, so the work is cut into six slices that land on next/visual-recipes and reach main in one final merge.

How the slice was made: the 14 commits of #1569 up to the AI inventory fix, cherry-picked in order onto next/visual-recipes (which is main at the #1574 release). Commits already on main were skipped. One conflict, SPEC-072 sitting next to SPEC-060 to 063 in rules.yaml and rules/mod.rs, was resolved by keeping both.

How Has This Been Tested?

On the slice head, in a clean worktree:

  • 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: all pass; legacy output unchanged
  • node tools/changeset-linter/src/cli.js check --fail-on-warnings: 1 valid
  • node .github/scripts/check-ci-coverage.mjs: 0 uncovered
  • pnpm ai:check valid; git diff pnpm-lock.yaml empty

The slice boundary after this one (2a) was also verified by stacking 2a and 2b on this branch and running the same checks.

Screenshots (if appropriate):

N/A (SVG output is covered by the tests above; the site is reviewed in slice 3).

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)

Changeset: component-visual-recipes (minor for @adobe/spectrum-design-data, @adobe/design-data-spec, @adobe/design-data-wasm). It accumulates on the integration branch and is 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 and others added 14 commits October 31, 2026 14:06
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds switch anatomy, color relationships, nested box layout, ring around a part,
and handle-only press target to the renderers (Rust + JS runtime).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow a single conditional entry per prop (when, relativeTo), add the
trackColor prop, and validate every recipe in design-data:validate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…EC-060..063)

Add Layer 2 rules that check visuals/*.json against component and
relationship data, and a --visuals-path option on design-data validate.
Add the progress anatomy part to action-button and drop xs from the
button sizeScale.
… candidates

Rank candidates against the requested size instead of dropping those
pinned to another size, and cover it with a gap-by-size test.
…eout

root:ai-check failed because sdk/plugins/site and its assets package were
not in the inventory.

sdk-wasm:test timed out because the visual parity test builds the site
with the debug CLI at import time.
@changeset-bot

changeset-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9f1de95

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 9f1de955

Total time: 8m 11s | Comparison time: 15m 49s | Estimated savings: 7m 38s (48.3% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 11.5ms Passed
🟩 SyncProject(sdk) 0.9ms Passed
🟩 SyncProject(design-data-spec) 1ms Passed
🟩 SyncProject(sdk-wasm) 0.9ms Passed
🟩 SyncProject(design-data) 1.4ms Passed
🟩 SyncProject(design-data-glue) 1.1ms Passed
🟩 SyncProject(design-data-mcp) 1.3ms Passed
⬛️ SetupToolchain(node:20.17.0) 189.7ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 315.3ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 243.6ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
🟩 SetupEnvironment(javascript) 0.7ms Passed
⬛️ InstallDependencies(javascript) 0.1ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 1.4ms Skipped
🟩 SetupEnvironment(rust, sdk) 121.9ms Passed
⬛️ InstallDependencies(rust, sdk) 27.5ms Skipped
🟩 RunTask(design-data:validate-visuals) 428ms Passed
🟩 RunTask(design-data:validate-registry) 455.6ms Passed
🟩 RunTask(sdk:fmt-check) 1.4s Passed
And 15 more...
Expanded report
Action Time Status Info
🟩 InstallDependencies(javascript, sdk) 4.1s Passed
🟩 RunTask(sdk:codegen-check) 76.3ms Passed
🟩 RunTask(sdk:lint) 1m 1s Passed
🟩 RunTask(sdk:test-doc) 2m 8s Passed SLOW
🟩 RunTask(sdk:build) 2m 25s Passed SLOW
🟩 RunTask(design-data:legacy-output) 1.2s Passed
🟩 RunTask(design-data:validate-dataset) 26.3s Passed
🟩 RunTask(design-data:validate) 34.3s Passed
🟩 RunTask(sdk-wasm:cache-build) 3m 6s Passed SLOW
🟩 RunTask(sdk:test) 4m 21s Passed SLOW
🟩 RunTask(sdk-wasm:build) 2m 25s Passed SLOW
🟩 RunTask(design-data-mcp:stage) 1.7s Passed
🟩 RunTask(design-data-mcp-eval:test) 19.2s Passed
🟩 RunTask(sdk-wasm:test) 1m 36s Passed
🟩 RunTask(sdk-wasm:ci) 13.3ms Passed
Changed files
.ai/inventory.json
.changeset/component-visual-recipes.md
docs/hub-prototype/README.md
docs/hub-prototype/serve.mjs
docs/repo-index.md
llms.txt
packages/design-data-spec/rules/rules.yaml
packages/design-data-spec/schemas/component-visual.schema.json
packages/design-data-spec/spec/component-visuals.md
packages/design-data-spec/spec/index.md
packages/design-data/components/action-button.json
packages/design-data/components/badge.json
packages/design-data/components/button.json
packages/design-data/components/switch.json
packages/design-data/moon.yml
packages/design-data/relationships/switch.json
packages/design-data/scripts/validate-visuals.js
packages/design-data/visuals/action-button.json
packages/design-data/visuals/badge.json
packages/design-data/visuals/button.json
packages/design-data/visuals/switch.json
sdk/Cargo.lock
sdk/Cargo.toml
sdk/cli/Cargo.toml
sdk/cli/src/main.rs
sdk/core/src/graph.rs
sdk/core/src/lib.rs
sdk/core/src/validate/mod.rs
sdk/core/src/validate/rules/mod.rs
sdk/core/src/validate/rules/spec060.rs
sdk/core/src/validate/rules/spec061.rs
sdk/core/src/validate/rules/spec062.rs
sdk/core/src/validate/rules/spec063.rs
sdk/core/src/validate/rules/visual_util.rs
sdk/core/src/visual.rs
sdk/plugins/PLUGINS.md
sdk/plugins/figma/src/mapping.rs
sdk/plugins/figma/src/mapping/names.rs
sdk/plugins/site/AGENTS.md
sdk/plugins/site/Cargo.toml
sdk/plugins/site/assets/AGENTS.md
sdk/plugins/site/assets/backend.js
sdk/plugins/site/assets/index.html
sdk/plugins/site/assets/package.json
sdk/plugins/site/assets/visual-runtime.js
sdk/plugins/site/src/lib.rs
sdk/wasm/ava.config.js
sdk/wasm/src/dataset.rs
sdk/wasm/test/render.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, 4 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

switch


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


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

…mment

Also say in the changeset that the badge isDisabled option is removed.
@GarthDB
GarthDB merged commit 2473657 into next/visual-recipes Oct 31, 2026
9 checks passed
@GarthDB
GarthDB deleted the slice/1-recipe-renderer branch October 31, 2026 20:41
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