Skip to content

fix(sdk): stop counting all-uncovered multi-mode entries as mismatches - #1444

Merged
GarthDB merged 1 commit into
mainfrom
fix/figma-diff-multimode-uncovered-rollup
Sep 10, 2026
Merged

fix(sdk): stop counting all-uncovered multi-mode entries as mismatches#1444
GarthDB merged 1 commit into
mainfrom
fix/figma-diff-multimode-uncovered-rollup

Conversation

@GarthDB

@GarthDB GarthDB commented Sep 10, 2026

Copy link
Copy Markdown
Member

Description

figma diff was classifying 242 colorTheme/* variables as multi_mode_mismatch
against the s2-web-variables.baseline.json snapshot. Inspecting the JSON output
showed 241 of them had every mode (Light/Dark/Wireframe) classified as
skipped-uncovered — design-data has no per-color-scheme member to compare against
in any mode (a plain single-scheme alias like accent-color-100, not a real
per-scheme set) — not an actual mismatch. Only 1 entry was a genuine 3-mode
divergence.

diff_multimode's rollup (and its caller's counter) in
sdk/core/src/figma/import.rs treated "every mode uncovered" the same as "some mode
diverged," both collapsing to MultiModeMismatch. The per-mode "uncovered" result
itself is correct and deliberate — for a CTR-backed key, diff_multimode refuses to
fall back to the context-free leaf/conceptId value, since that would silently
compare against an arbitrary wrong color-scheme sibling. So this is purely a
rollup/counting bug, not an entry-gate bug — the gate that routes tokens into
diff_multimode is unchanged.

Fix: the rollup gains a third arm — when every mode is SkippedUncovered, roll
up to SkippedUncovered{reason: "multimode-uncovered"} instead of
MultiModeMismatch; the caller counts by the returned class instead of
Match-vs-everything-else. Genuinely mixed/divergent entries are unaffected.

Related Issue

Closes spectrum-design-data-pna2 (beads issue; pre-existing behavior, confirmed
unrelated to #1442 via git stash before/after — identical count both sides).

Motivation and Context

figma diff is meant to surface real value drift between Figma and design-data.
Miscounting 241 coverage gaps as mismatches makes the report noisy and hides the
one real mismatch among false positives.

How Has This Been Tested?

  • Added color_theme_all_modes_uncovered_reports_skipped_not_mismatch, reproducing
    the accent-color-100 shape (single-scheme alias, no per-scheme siblings).
  • cargo test -p design-data-core --lib --features figma figma::import:: — 52
    passed, 0 failed.
  • moon run sdk:test — full suite, 1421 passed, 1 skipped.
  • moon run sdk:lint — clean.
  • Ran figma diff --snapshot sdk/core/tests/fixtures/figma/s2-web-variables.baseline.json --format json
    before/after: multi_mode_mismatch 242 → 1, skipped_uncovered 0 → 241, all
    other counts unchanged. Diffed all 3353 entries before/after: exactly the 241
    multi-mode-mismatchskipped-uncovered transitions occurred, nothing else
    changed.

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

diff_multimode's rollup collapsed "every mode uncovered" (no design-data
value to compare in any mode) into the same MultiModeMismatch bucket as
genuine per-mode divergence. 241 of 242 flagged entries against the
s2-web-variables baseline were plain single-scheme aliases (e.g.
accent-color-100) with no per-color-scheme member at all — a coverage
gap, not a mismatch.

- sdk/core/src/figma/import.rs: diff_multimode's rollup gains an
  all-uncovered arm, rolling up to SkippedUncovered{"multimode-uncovered"}
  instead of MultiModeMismatch; the caller counts by returned class
  instead of Match-vs-everything-else. Genuine mixed/divergent entries
  are unaffected. Adds a regression test reproducing the
  accent-color-100 shape.

Closes spectrum-design-data-pna2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd8d579

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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 bd8d5795

Total time: 2m 33s | Comparison time: 4m 35s | Estimated savings: 2m 1s (44.2% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 11.1ms Passed
🟩 SyncProject(sdk) 0.5ms Passed
⬛️ SetupToolchain(node:20.17.0) 18.8ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 2.3ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.6ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 211.8ms Skipped
🟩 SetupEnvironment(rust, sdk) 334ms Passed
⬛️ InstallDependencies(rust, sdk) 7ms Skipped
🟩 RunTask(sdk:fmt-check) 1.8s Passed
🟩 InstallDependencies(javascript, sdk) 4.6s Passed
🟩 RunTask(sdk:codegen-check) 112.8ms Passed
🟩 RunTask(sdk:lint) 52.6s Passed
🟩 RunTask(sdk:test-doc) 1m 55s Passed
🟩 RunTask(sdk:test) 2m 28s Passed SLOW
Changed files
sdk/core/src/figma/import.rs

@GarthDB
GarthDB merged commit 837cdc7 into main Sep 10, 2026
9 checks passed
@GarthDB
GarthDB deleted the fix/figma-diff-multimode-uncovered-rollup branch September 10, 2026 05:33
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