Skip to content

fix(sdk): resolve code-font-family CTR in figma diff - #1446

Merged
GarthDB merged 1 commit into
mainfrom
fix/figma-diff-code-font-family-ctr
Sep 10, 2026
Merged

fix(sdk): resolve code-font-family CTR in figma diff#1446
GarthDB merged 1 commit into
mainfrom
fix/figma-diff-code-font-family-ctr

Conversation

@GarthDB

@GarthDB GarthDB commented Sep 10, 2026

Copy link
Copy Markdown
Member

Description

figma diff against the "S2 - Web" baseline
(sdk/core/tests/fixtures/figma/s2-web-variables.baseline.json) reported 3
remaining Layout/code-font tokens figma_only:

  • Code/Font family
  • platformScale/code-cjk-font-family
  • platformScale/code-font-family

10 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_SCHEMAS in graph.rs deliberately excluded
font-family.json, so the inline code-font-family CTR
(packages/design-data/relationships/code.json, value "Source Code Pro")
never indexed into relationship_tokens, and resolve_relationship_ref
returned None for it and its aliasing siblings.

  • sdk/core/src/graph.rs: add "font-family.json" to
    INLINE_CTR_COMPARABLE_SCHEMAS, mirroring the existing
    dimension/multiplier/gradient-stop/opacity handling. code-font-family is
    the only inline font-family CTR in the corpus, so blast radius is contained
    to these 3 tokens.
  • The Figma-side "STRING" branch in diff_against_source
    (sdk/core/src/figma/import.rs) already compares font-family values
    verbatim — no new comparison rule, no font-name normalization added (that
    stays scoped to font-weight/style via record_is_font_name).
  • Updated the stale test that asserted the old "stays unresolved" contract
    (resolve_relationship_ref_stays_unresolved_through_font_family_chain ->
    resolve_relationship_ref_resolves_through_font_family_chain).
  • Added figma::import::tests coverage: verbatim match and a genuine mismatch
    case for an inline font-family CTR.

No exporter (mapping.rs) changes — figma_only comes 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_only gaps tracked under
spectrum-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.
  • End-to-end: ran
    cargo run -p design-data-cli -- figma diff --snapshot core/tests/fixtures/figma/s2-web-variables.baseline.json --format json
    and confirmed all 3 entries moved from figma_only to match, with
    figma_only: 0 and no new value_mismatch entries (the 1 pre-existing
    value_mismatch is unrelated and unchanged).

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)

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.

🤖 Generated with Claude Code

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-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a3c492e

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

This PR includes changesets to release 10 packages
Name Type
@adobe/spectrum-design-data Patch
@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
component-options-editor Patch
@adobe/spectrum-design-data-mcp 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

Copy link
Copy Markdown
Contributor

🎨 Token Changes Report

Tokens Changed (0)

Original Branch: main


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

@github-actions

Copy link
Copy Markdown
Contributor

🧩 Component Schema Changes Report

No component schema changes detected.

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

@github-actions

Copy link
Copy Markdown
Contributor

Run report for a3c492e0

Total time: 2m 24s | Comparison time: 4m 16s | Estimated savings: 1m 51s (43.5% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 10.5ms Passed
🟩 SyncProject(sdk) 0.5ms Passed
⬛️ SetupToolchain(node:20.17.0) 13.6ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 2.1ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.4ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 189.8ms Skipped
🟩 SetupEnvironment(rust, sdk) 249.4ms Passed
⬛️ InstallDependencies(rust, sdk) 7.7ms Skipped
🟩 RunTask(sdk:fmt-check) 1.3s Passed
🟩 InstallDependencies(javascript, sdk) 4s Passed
🟩 RunTask(sdk:codegen-check) 144.1ms Passed
🟩 RunTask(sdk:lint) 47.5s Passed
🟩 RunTask(sdk:test-doc) 1m 47s Passed
🟩 RunTask(sdk:test) 2m 20s Passed SLOW
Changed files
.changeset/figma-code-font-family-ctr-resolution.md
sdk/core/src/figma/import.rs
sdk/core/src/graph.rs

@GarthDB
GarthDB merged commit 63daf55 into main Sep 10, 2026
10 checks passed
@GarthDB
GarthDB deleted the fix/figma-diff-code-font-family-ctr branch September 10, 2026 07:11
@GarthDB GarthDB mentioned this pull request Sep 10, 2026
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