Skip to content

feat(figma): data-driven collection specs, modeless layer, bare names - #1542

Merged
GarthDB merged 5 commits into
mainfrom
feat/cn3v-figma-mode-groups
Oct 15, 2026
Merged

GarthDB merged 5 commits into
mainfrom
feat/cn3v-figma-mode-groups

Conversation

@GarthDB

@GarthDB GarthDB commented Oct 15, 2026

Copy link
Copy Markdown
Member

Description

Figma exporter follow-ups to the xqln epic (stack 1/3):

  • COLLECTION_SPECS is now built from graph.mode_sets via collection_specs() (cn3v.3). Output is byte-identical for the current collections.
  • figma export --modeless-layer (cn3v.4): writes one modeless variable per token into the existing "Spectrum" collection. A token that varies on one axis gets a VARIABLE_ALIAS to its mode-group variable; an axis-invariant token carries the concrete value. Fails fast if the collection is missing.
  • figma export --no-folder-prefix (cn3v.7): names variables by bare token name.
  • Adds a CTR-only golden test for 11k.23 verification.

Both new flags are opt-in; default output and the baseline are unchanged. cn3v.5 and cn3v.6 are not started (pending alignment).

Related Issue

Beads: spectrum-design-data-11k.23, cn3v.3, cn3v.4, cn3v.7. Follows #1538 and #1539.

Motivation and Context

Mode sets were hardcoded in the exporter. Deriving the collections from the graph is the prerequisite for the mode-group / modeless-alias model.
Import/diff inversion of bare names and flipping the prefix default stay gated on design removing the folders and re-snapshotting s2-web-variables.baseline.json.

How Has This Been Tested?

  • moon run sdk:test: passed (1561 tests, golden payload unchanged without UPDATE_GOLDEN).
  • moon run sdk:lint: passed.
  • moon run sdk:fmt: applied.
  • moon run root:check-legacy-consumers: passed.
  • node .github/scripts/check-ci-coverage.mjs: passed.
  • New tests cover the modeless layer (alias, invariant value, missing collection) and unprefixed names. No changeset: Rust-only, CLI is not published.

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.

@changeset-bot

changeset-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: aacc813

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

This PR includes changesets to release 1 package
Name Type
@adobe/design-data-tui Minor

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

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Run report for aacc8137

Total time: 2m 50s | Comparison time: 4m 54s | Estimated savings: 2m 3s (42.0% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 10.3ms Passed
🟩 SyncProject(sdk) 0.6ms Passed
⬛️ SetupToolchain(node:20.17.0) 779.6ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 1.4s Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 620.2ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.5ms Skipped
🟩 SetupEnvironment(rust, sdk) 121.7ms Passed
⬛️ InstallDependencies(rust, sdk) 2.6ms Skipped
🟩 RunTask(sdk:fmt-check) 854.2ms Passed
🟩 InstallDependencies(javascript, sdk) 5s Passed
🟩 RunTask(sdk:codegen-check) 105.9ms Passed
🟩 RunTask(sdk:lint) 57.4s Passed
🟩 RunTask(sdk:test-doc) 1m 54s Passed
🟩 RunTask(sdk:test) 2m 44s Passed SLOW
Changed files
.changeset/figma-modeless-layer-bare-names.md
sdk/cli/src/main.rs
sdk/plugins/figma/src/audit.rs
sdk/plugins/figma/src/import.rs
sdk/plugins/figma/src/import/diff.rs
sdk/plugins/figma/src/import/tests.rs
sdk/plugins/figma/src/mapping.rs
sdk/plugins/figma/src/mapping/convert.rs
sdk/plugins/figma/src/mapping/golden_tests.rs
sdk/plugins/figma/src/mapping/graph.rs
sdk/plugins/figma/src/mapping/modeless.rs
sdk/plugins/figma/src/mapping/payload.rs
sdk/plugins/figma/src/mapping/routing.rs
sdk/plugins/figma/src/mapping/tests.rs

@GarthDB
GarthDB added this pull request to stack #1545 October 15, 2026 21:47
test and others added 2 commits October 15, 2026 14:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds --modeless-layer (cn3v.4) and --no-folder-prefix (cn3v.7) to figma export.
Both are off by default; default output is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GarthDB
GarthDB force-pushed the feat/cn3v-figma-mode-groups branch from 7cf14e0 to 2524cb6 Compare October 15, 2026 21:48
test and others added 3 commits October 15, 2026 16:06
…ix to audit/diff

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GarthDB
GarthDB merged commit ed1f625 into main Oct 15, 2026
9 checks passed
@GarthDB
GarthDB deleted the feat/cn3v-figma-mode-groups branch October 15, 2026 22:30
@GarthDB GarthDB mentioned this pull request Oct 15, 2026
GarthDB pushed a commit that referenced this pull request Oct 15, 2026
…#1542)

- Derive collection specs from graph mode sets instead of hardcoding them.
- Add opt-in `figma export --modeless-layer` and `--no-folder-prefix` (also accepted by `figma audit` and `figma diff`); defaults unchanged.
- Key the variable index by (collection, name) so bare names can't collide across collections; warn when a modeless source variable is missing.
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