fix(design-data): route opacity tokens to Color theme, not Platform scale, in figma exporter/diff - #1435
Merged
Merged
Conversation
…cale, in figma exporter/diff Opacity tokens are typed FLOAT but were classified TokenKind::Scale in the mapping.rs alias pre-pass and flat dispatch, so they were emitted into .Platform scale (platformScale/*) instead of .Color theme (colorTheme/*) — the collection the hand-built S2 - Web library actually uses for them. This made ~62 opacity tokens show up as missing/figma-only in `design-data figma diff` even though generated equivalents existed under the wrong name. - Route opacity to .Color theme in both the alias-target pre-pass and the flat-token dispatch branch (mapping.rs) - process_color_set_token now infers FLOAT/COLOR from any sets member instead of only the first, fixing a latent (currently harmless) misclassification risk - diff_values now falls back to resolve_alias_target when invert_name returns None (bare, slash-less Figma names), recovering all 35 S2.Color-theme opacity variables, which are VARIABLE_ALIASes into .Color theme with no "/" in their own name (import.rs) - Add unit tests for the new collection routing, the any-member color-set type inference, and the bare-name alias fallback Closes spectrum-design-data-11k.18 (DNA-1953). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 8895939 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
Contributor
🎨 Token Changes ReportTokens Changed (0)Original Branch: This comment was automatically generated by the token diff tool. 🤖 |
Contributor
🧩 Component Schema Changes ReportNo component schema changes detected.This comment was automatically generated by the component schema diff tool. 🤖 |
Contributor
Run report for 8895939eTotal time: 2m 23s | Comparison time: 4m 13s | Estimated savings: 1m 50s (43.5% faster)
Changed files |
This was referenced Sep 9, 2026
Merged
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.
Description
Opacity tokens are typed FLOAT but were classified
TokenKind::Scalein theFigma variables exporter's alias pre-pass and flat dispatch, so they were
emitted into
.Platform scale(platformScale/*) instead of.Color theme(
colorTheme/*) — the collection the hand-built "S2 - Web" library actuallyuses for them. This made ~62 opacity tokens show up as missing/
figma-onlyin
design-data figma diffeven though generated equivalents existed underthe wrong name.
.Color themein both the alias-target pre-pass and theflat-token dispatch branch (
mapping.rs)process_color_set_tokennow infers FLOAT/COLOR from anysetsmemberinstead of only the first, fixing a latent (currently harmless)
misclassification risk
diff_valuesnow falls back toresolve_alias_targetwheninvert_namereturns
None(bare, slash-less Figma names), recovering all 35S2.Color-themeopacity variables, which areVARIABLE_ALIASes into.Color themewith no/in their own name (import.rs)Related Issue
Closes spectrum-design-data-11k.18 (DNA-1953).
Motivation and Context
Flagged by Nate Baldwin on the Design Data / Figma Vars comparison Canvas —
opacity tokens were reported as missing from the generated Figma variables,
blocking parity verification against the manual S2 Web library.
How Has This Been Tested?
type inference, and the bare-name alias fallback
moon run sdk:test— 1417/1417 passed, no regressionsdesign-data figma diff --snapshot core/tests/fixtures/figma/s2-web-variables.baseline.json:all 27
.Color theme+ 35S2.Color-themepreviously-flagged opacityentries now resolve out of
figma-onlyfigma-onlyopacitytokens belong to legacy component files (
card.json,menu.json,table.json, etc.) entirely absent from the resolved token graph — apre-existing legacy-source-discovery gap unrelated to Figma routing, not a
corpus migration this task covers
Types of changes
Checklist:
🤖 Generated with Claude Code