Skip to content

fix(design-data): resolve inline-value opacity CTRs in figma diff - #1442

Merged
GarthDB merged 1 commit into
mainfrom
fix/figma-opacity-ctr-resolution
Sep 10, 2026
Merged

GarthDB merged 1 commit into
mainfrom
fix/figma-opacity-ctr-resolution

Conversation

@GarthDB

@GarthDB GarthDB commented Sep 10, 2026

Copy link
Copy Markdown
Member

Description

figma diff was reporting 54 component-level opacity tokens (e.g.
table-row-hover-opacity, popover-border-opacity) as figma-only, even
though they already exist as inline-value CTRs in
packages/design-data/relationships/*.json and are published in
@adobe/spectrum-tokens. This was never a corpus/authoring gap — it was a
resolution-wiring bug: INLINE_CTR_COMPARABLE_SCHEMAS in graph.rs excluded
opacity.json, so reindex_relationship_tokens never indexed these CTRs into
relationship_tokens, and resolve_relationship_ref returned None for
them.

  • sdk/core/src/graph.rs: add "opacity.json" to
    INLINE_CTR_COMPARABLE_SCHEMAS, mirroring the existing
    dimension/multiplier/gradient-stop handling. Verified the synthesized
    TokenRecord retains $schema: opacity.json so record_is_opacity still
    fires the 0–1 → 0–100 fraction/percent conversion in diff_against_source.
    Also verified the fix covers the bare S2.Color-theme alias form (via
    resolve_alias_target) and multi-mode opacity (via diff_multimode /
    best_relationship_candidate).
  • Added a unit test resolving an inline opacity CTR
    (table-row-hover-opacity) via resolve_relationship_ref.

No token/corpus changes, no exporter (COLLECTION_SPECS) changes — this is
purely a diff-side resolution fix, and is orthogonal to the upcoming
mode-group collection-model redesign.

Related Issue

Closes spectrum-design-data-11k.10.11. Corrects the premise of
spectrum-design-data-11k.18, which had deferred these entries as an
out-of-scope "corpus migration" — they're CTRs, not missing data.

Motivation and Context

spectrum-design-data-11k.10 scoped the Figma Variables mapping gap when
figma diff reported 2003 figma-only entries. Its children collapsed that
to 67 via diff-side resolution fixes; this closes the remaining opacity
subset of that residual (the user explicitly scoped this PR to opacity only —
the 13 non-opacity figma-only entries left after this change are the same
class of issue and are filed as a separate follow-up,
spectrum-design-data-11k.10.12).

How Has This Been Tested?

  • Added unit test resolve_relationship_ref_resolves_inline_opacity_ctrs.
  • Ran figma diff against the S2-Web baseline before/after:
    figma-only dropped 67 → 13 — all 54 opacity entries now resolve
    (mostly match; multi-mode opacity lands on the per-scheme path). No new
    value-mismatch or multi-mode-mismatch entries were introduced (spot
    checked the 5 opacity entries that appear in multi-mode-mismatch — they
    were already there before this change, unrelated to it).
  • moon run sdk:test: 1420/1420 pass (up from 1417 + 1 skipped).
  • cargo clippy --workspace -- -D warnings: clean.
  • node tools/changeset-linter/src/cli.js check --fail-on-warnings: clean.

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

`figma diff` reported 54 component-level opacity tokens as figma-only
(e.g. table-row-hover-opacity, popover-border-opacity) even though they
exist as inline-value CTRs in packages/design-data/relationships/*.json
and are published in @adobe/spectrum-tokens. They were never a corpus
gap: `INLINE_CTR_COMPARABLE_SCHEMAS` (graph.rs) excluded opacity.json,
so `reindex_relationship_tokens` never indexed them into
`relationship_tokens`, and `resolve_relationship_ref` returned None.

- **sdk/core/src/graph.rs**: add "opacity.json" to
  INLINE_CTR_COMPARABLE_SCHEMAS, mirroring the existing
  dimension/multiplier/gradient-stop handling; add a unit test
  resolving an inline opacity CTR (table-row-hover-opacity).

Verified via `figma diff` against the S2-Web baseline: figma-only
67 -> 13 (all 54 opacity entries resolve; residual 13 are unrelated
Banner/Form item/Code/List gaps, filed as 11k.10.12). No new
value-mismatch or multi-mode-mismatch entries.

Closes spectrum-design-data-11k.10.11.

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: e4336bd

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

🧩 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

🎨 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

Run report for e4336bd1

Total time: 2m 25s | Comparison time: 4m 19s | Estimated savings: 1m 54s (44.0% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 10.8ms Passed
🟩 SyncProject(sdk) 0.5ms Passed
⬛️ SetupToolchain(node:20.17.0) 12.9ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 2.6ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.4ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 199.2ms Skipped
🟩 SetupEnvironment(rust, sdk) 145ms Passed
⬛️ InstallDependencies(rust, sdk) 3.6ms Skipped
🟩 RunTask(sdk:fmt-check) 1.7s Passed
🟩 InstallDependencies(javascript, sdk) 4.5s Passed
🟩 RunTask(sdk:codegen-check) 152.7ms Passed
🟩 RunTask(sdk:lint) 49.9s Passed
🟩 RunTask(sdk:test-doc) 1m 47s Passed
🟩 RunTask(sdk:test) 2m 20s Passed SLOW
Changed files
.changeset/figma-opacity-ctr-resolution.md
sdk/core/src/graph.rs

@GarthDB
GarthDB merged commit 009ccdd into main Sep 10, 2026
10 checks passed
@GarthDB
GarthDB deleted the fix/figma-opacity-ctr-resolution branch September 10, 2026 04:52
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