fix(sdk): stop counting all-uncovered multi-mode entries as mismatches - #1444
Merged
Conversation
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>
|
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 bd8d5795Total time: 2m 33s | Comparison time: 4m 35s | Estimated savings: 2m 1s (44.2% faster)
Changed files |
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 diffwas classifying 242colorTheme/*variables asmulti_mode_mismatchagainst the
s2-web-variables.baseline.jsonsnapshot. Inspecting the JSON outputshowed 241 of them had every mode (Light/Dark/Wireframe) classified as
skipped-uncovered— design-data has no per-color-scheme member to compare againstin any mode (a plain single-scheme alias like
accent-color-100, not a realper-scheme set) — not an actual mismatch. Only 1 entry was a genuine 3-mode
divergence.
diff_multimode's rollup (and its caller's counter) insdk/core/src/figma/import.rstreated "every mode uncovered" the same as "some modediverged," both collapsing to
MultiModeMismatch. The per-mode "uncovered" resultitself is correct and deliberate — for a CTR-backed key,
diff_multimoderefuses tofall back to the context-free leaf/
conceptIdvalue, since that would silentlycompare 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_multimodeis unchanged.Fix: the rollup gains a third arm — when every mode is
SkippedUncovered, rollup to
SkippedUncovered{reason: "multimode-uncovered"}instead ofMultiModeMismatch; the caller counts by the returned class instead ofMatch-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 diffis 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?
color_theme_all_modes_uncovered_reports_skipped_not_mismatch, reproducingthe
accent-color-100shape (single-scheme alias, no per-scheme siblings).cargo test -p design-data-core --lib --features figma figma::import::— 52passed, 0 failed.
moon run sdk:test— full suite, 1421 passed, 1 skipped.moon run sdk:lint— clean.figma diff --snapshot sdk/core/tests/fixtures/figma/s2-web-variables.baseline.json --format jsonbefore/after:
multi_mode_mismatch242 → 1,skipped_uncovered0 → 241, allother counts unchanged. Diffed all 3353 entries before/after: exactly the 241
multi-mode-mismatch→skipped-uncoveredtransitions occurred, nothing elsechanged.
Screenshots (if appropriate):
N/A
Types of changes
Checklist:
🤖 Generated with Claude Code