fix(sdk): resolve code-font-family CTR in figma diff - #1446
Merged
Conversation
Add font-family.json to INLINE_CTR_COMPARABLE_SCHEMAS so the inline code-font-family CTR indexes into relationship_tokens and resolves during figma diff, matching the existing dimension/multiplier/ gradient-stop/opacity handling. The Figma-side STRING comparison in diff_against_source already compares font-family values verbatim, so no new comparison rule is needed. Moves the last 3 Layout/code-font figma_only entries against the "S2 - Web" baseline to match: - Code/Font family - platformScale/code-cjk-font-family - platformScale/code-font-family code-font-family is the only inline font-family CTR in the corpus, so blast radius is contained to these three. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: a3c492e 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 a3c492e0Total time: 2m 24s | Comparison time: 4m 16s | Estimated savings: 1m 51s (43.5% faster)
Changed files |
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
figma diffagainst the "S2 - Web" baseline(
sdk/core/tests/fixtures/figma/s2-web-variables.baseline.json) reported 3remaining Layout/code-font tokens
figma_only:Code/Font familyplatformScale/code-cjk-font-familyplatformScale/code-font-family10 of the original 13 figma-only entries in this family were fixed in #1445
(multi-hop alias-chain resolution). These 3 are a different root cause: not
alias depth (they're 0-1 hop, well within #1445's fix), but a resolution-wiring
gap —
INLINE_CTR_COMPARABLE_SCHEMASingraph.rsdeliberately excludedfont-family.json, so the inlinecode-font-familyCTR(
packages/design-data/relationships/code.json, value"Source Code Pro")never indexed into
relationship_tokens, andresolve_relationship_refreturned
Nonefor it and its aliasing siblings."font-family.json"toINLINE_CTR_COMPARABLE_SCHEMAS, mirroring the existingdimension/multiplier/gradient-stop/opacity handling.
code-font-familyisthe only inline font-family CTR in the corpus, so blast radius is contained
to these 3 tokens.
"STRING"branch indiff_against_source(
sdk/core/src/figma/import.rs) already compares font-family valuesverbatim — no new comparison rule, no font-name normalization added (that
stays scoped to font-weight/style via
record_is_font_name).(
resolve_relationship_ref_stays_unresolved_through_font_family_chain->resolve_relationship_ref_resolves_through_font_family_chain).figma::import::testscoverage: verbatim match and a genuine mismatchcase for an inline font-family CTR.
No exporter (
mapping.rs) changes —figma_onlycomes from the reverse pass,which never consults the exporter (same as #1445).
Related Issue
Closes
spectrum-design-data-11k.10.12.Motivation and Context
Closes out the last of the code-font
figma_onlygaps tracked underspectrum-design-data-11k.10(figma export: extend Variables mapping beyond.Color theme/.Platform scale).How Has This Been Tested?
moon run sdk:test: 1425 tests run, 1425 passed, 1 skipped.moon run sdk:lint: clean.node tools/changeset-linter/src/cli.js check --fail-on-warnings: clean.cargo run -p design-data-cli -- figma diff --snapshot core/tests/fixtures/figma/s2-web-variables.baseline.json --format jsonand confirmed all 3 entries moved from
figma_onlytomatch, withfigma_only: 0and no newvalue_mismatchentries (the 1 pre-existingvalue_mismatchis unrelated and unchanged).Screenshots (if appropriate):
N/A
Types of changes
Checklist:
🤖 Generated with Claude Code