Skip to content

fix(design-data): stop dropping structure field from legacy token keys - #1517

Merged
GarthDB merged 3 commits into
mainfrom
fix/structure-legacy-key-banner-tokens
Oct 1, 2026
Merged

GarthDB merged 3 commits into
mainfrom
fix/structure-legacy-key-banner-tokens

Conversation

@GarthDB

@GarthDB GarthDB commented Sep 29, 2026

Copy link
Copy Markdown
Member

Description

Fixes the structure field being silently dropped from generated legacy token keys. Five banner/list gap and padding tokens in packages/tokens/src/layout.json were missing their structure prefix (gap-horizontal instead of banner-gap-horizontal, etc.), while every other structure-scoped token in the corpus correctly includes it.

  • packages/design-data/fields/structure.json: remove excludeFromLegacyKey: true, set on the (mistaken) assumption structure's value was always already embedded in property. An audit found 138/138 tokens carrying both structure and a pinned legacyKey include the structure word in that key — the exclusion only silently broke the five tokens with no pin to mask it.
  • sdk/core/src/naming.rs: update stale doc comments; rewrite the test that asserted the old (buggy) exclusion behavior to assert the corrected one.
  • sdk/core/src/registry_data.rs: regenerated via moon run sdk:codegen.
  • tools/token-mapping-analyzer/src/field-catalog.js: doc comment only — this JS mirror reads the field JSON live, so no logic change was needed.
  • packages/design-data/tokens/layout.tokens.json: add five deprecated companion tokens pinning the old generic keys (gap-horizontal, gap-vertical, padding-horizontal, padding-vertical, gap-regular), each with a lifecycle.replacedBy pointing at its corrected replacement, so existing consumers of the broken names get a renamed pointer instead of the key disappearing.
  • packages/tokens/src/*.json: regenerated via moon run design-data:legacy-output. Confirmed via diff that exactly the five keys correct themselves, the five old keys become deprecated aliases, and six dependent files' renamed pointers update to the corrected names.

Related Issue

Tracked as bead spectrum-design-data-mra7 (this repo uses beads for task tracking rather than GitHub issues for internal bugs). Reported by Helen Le / Nate Baldwin in the team's Slack thread about banner-padding/gap-* tokens missing from the Spectrum 2 Figma specs.

Motivation and Context

The Spectrum 2 Figma specs expect banner-padding-horizontal-compact-style names (structure-prefixed) for every banner/list token, but five tokens never got that prefix because of this bug — they were born wrong in the first design-data-generated release (@adobe/spectrum-tokens@15.0.0) and never shipped correctly. This surfaced as "why are these tokens missing" when in fact they existed under the wrong name.

How Has This Been Tested?

  • moon run sdk:codegen — regenerated registry_data.rs; diff is exactly the one expected field flag flip.
  • cargo test --package design-data-core naming:: — 54 unit + 7 integration tests passed.
  • moon run sdk:test — full SDK suite: 1511 passed, 2 skipped.
  • moon run design-data:legacy-output — regenerated packages/tokens/src/*.json; diff confirmed to be exactly the five renamed keys, five new deprecated aliases, and six dependent files' renamed pointers updating to the corrected names.
  • moon run design-data:roundtrip-verify — "Roundtrip OK".
  • moon run design-data:validate — exit 0, 0 errors (pre-existing warnings only, unrelated to this change).
  • moon run tokens:test — 27 passed, including checkUniqueTokenNames (no duplicate names introduced).
  • moon run token-naming-audit:test — 17 passed.
  • node tools/changeset-linter/src/cli.js check --fail-on-warnings — 5 valid changesets, 0 warnings/errors.
  • Manually inspected the lifecycle round-trip (deprecated/deprecated_comment/renamed) for all five new companion tokens — this path was previously unexercised in the corpus (zero cascade tokens used lifecycle.replacedBy before this change).

Screenshots (if appropriate):

N/A — data/naming change only.

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.

`packages/design-data/fields/structure.json` set `excludeFromLegacyKey: true`
on the (mistaken) assumption structure's value was always already embedded in
`property`. An audit of the corpus found 138/138 tokens with both `structure`
and a pinned `legacyKey` include the structure word in that key — the flag
only silently broke the handful of tokens with no pin to mask it: banner/list
gap and padding tokens in layout.tokens.json.

- packages/design-data/fields/structure.json: remove excludeFromLegacyKey.
- sdk/core/src/naming.rs: update stale doc comments; rewrite the test that
  asserted the old (buggy) exclusion behavior to assert the corrected one.
- sdk/core/src/registry_data.rs: regenerated via `moon run sdk:codegen`.
- tools/token-mapping-analyzer/src/field-catalog.js: update doc comment (no
  logic change — this JS mirror reads the field JSON live).
- packages/design-data/tokens/layout.tokens.json: add five deprecated
  companion tokens pinning the old generic keys (gap-horizontal,
  gap-vertical, padding-horizontal, padding-vertical, gap-regular) with a
  `lifecycle.replacedBy` pointing at each corrected token, so existing
  consumers of the broken names get a `renamed` pointer instead of a removal.
- packages/tokens/src/*.json: regenerated via
  `moon run design-data:legacy-output`. Confirmed via diff: exactly the five
  keys correct themselves (banner-gap-horizontal, banner-gap-vertical,
  banner-padding-horizontal, banner-padding-vertical, list-gap-regular), the
  five old keys become deprecated aliases, and six dependent files'
  `renamed` pointers update to the corrected names.

Validated: `moon run sdk:test` (1511 passed), `moon run tokens:test` (27
passed), `moon run design-data:roundtrip-verify` (OK), `moon run
design-data:validate` (0 errors, pre-existing warnings only),
`node tools/changeset-linter/src/cli.js check --fail-on-warnings` (5 valid).

Closes spectrum-design-data-mra7.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f0220d0

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

This PR includes changesets to release 16 packages
Name Type
@adobe/design-data-wasm Patch
@adobe/spectrum-design-data Minor
@adobe/spectrum-tokens Minor
s2-tokens-viewer Patch
@adobe/design-data-agent-mcp Patch
@adobe/design-data-mcp Patch
@adobe/design-data Patch
@adobe/token-naming-audit Patch
@adobe/spectrum-component-api-schemas Patch
@adobe/design-system-registry Patch
markdown-generator Patch
@adobe/token-corpus-migrate Patch
@adobe/token-names Patch
@adobe/spectrum-design-data-mcp Patch
token-mapping-analyzer Patch
component-options-editor 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

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Token Changes Report

Tokens Changed (32)

Original Branch: main

Renamed (5)
  • gap-horizontal -> banner-gap-horizontal
  • gap-vertical -> banner-gap-vertical
  • padding-horizontal -> banner-padding-horizontal
  • padding-vertical -> banner-padding-vertical
  • gap-regular -> list-gap-regular
Newly Deprecated (5)
  • gap-horizontal: Renamed to include the banner structure prefix; use banner-gap-horizontal instead.
  • gap-regular: Renamed to include the list structure prefix; use list-gap-regular instead.
  • gap-vertical: Renamed to include the banner structure prefix; use banner-gap-vertical instead.
  • padding-horizontal: Renamed to include the banner structure prefix; use banner-padding-horizontal instead.
  • padding-vertical: Renamed to include the banner structure prefix; use banner-padding-vertical instead.

Updated (22)

Updated Properties (22)
  • tree-view-item-to-header
    • renamed: gap-regular -> list-gap-regular
  • toast-bottom-to-text
    • renamed: padding-vertical -> banner-padding-vertical
  • toast-top-to-text
    • renamed: padding-vertical -> banner-padding-vertical
  • toast-top-to-workflow-icon
    • renamed: padding-vertical -> banner-padding-vertical
  • tab-item-to-tab-item-vertical-extra-large
    • renamed: gap-regular -> list-gap-regular
  • tab-item-to-tab-item-vertical-large
    • renamed: gap-regular -> list-gap-regular
  • tab-item-to-tab-item-vertical-medium
    • renamed: gap-regular -> list-gap-regular
  • tab-item-to-tab-item-vertical-small
    • renamed: gap-regular -> list-gap-regular
  • side-navigation-item-to-item
    • renamed: gap-regular -> list-gap-regular
  • gap-horizontal
    • uuid: c0571c46-5946-4896-bcbf-270560de5385 -> 88c10a5d-9495-44b2-8b03-e9283c79144b
  • gap-regular
    • uuid: b7e1af59-753e-4059-8f46-8d862f631ad8 -> c2408389-1e7e-4aae-8a49-d8b8233102c7
  • gap-vertical
    • uuid: 312ebac2-32a0-47a8-9c4e-e366b2232228 -> 952a4750-63b2-458e-81b1-bf00cb064934
  • padding-horizontal
    • uuid: eb386242-21c6-437b-8125-e6d4394dd9c5 -> f0749dc3-1649-4e6f-957e-c2194e191c88
  • padding-vertical
    • uuid: 64fa4ab7-be93-4420-8cdc-a6ef91499852 -> 9ae57860-2109-4f79-9230-7616e9898fd9
  • alert-banner-bottom-to-text
    • renamed: padding-vertical -> banner-padding-vertical
  • alert-banner-top-to-alert-icon
    • renamed: padding-vertical -> banner-padding-vertical
  • alert-banner-top-to-text
    • renamed: padding-vertical -> banner-padding-vertical
  • alert-banner-top-to-workflow-icon
    • renamed: padding-vertical -> banner-padding-vertical
  • action-bar-bottom-to-content-area
    • renamed: padding-vertical -> banner-padding-vertical
  • action-bar-label-to-action-group-area
    • renamed: gap-horizontal -> banner-gap-horizontal
  • action-bar-top-to-content-area
    • renamed: padding-vertical -> banner-padding-vertical
  • action-bar-top-to-item-counter
    • renamed: padding-vertical -> banner-padding-vertical

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 Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Run report for f0220d00

Total time: 2m 48s | Comparison time: 7m 34s | Estimated savings: 4m 46s (63.0% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 8.6ms Passed
🟩 SyncProject(sdk) 0.4ms Passed
🟩 SyncProject(design-data) 0.9ms Passed
🟩 SyncProject(tokens) 1.1ms Passed
⬛️ SetupToolchain(node:20.17.0) 853.5ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 1.1s Skipped
🟩 SetupEnvironment(rust, sdk) 86.7ms Passed
⬛️ InstallDependencies(rust, sdk) 2.4ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 954.8ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.9ms Skipped
🟩 SetupEnvironment(javascript) 1.1ms Passed
⬛️ InstallDependencies(javascript) 0.1ms Skipped
🟩 RunTask(sdk:fmt-check) 776.4ms Passed
🟩 RunTask(design-data:validate-registry) 248.7ms Passed
🟩 InstallDependencies(javascript, sdk) 4.8s Passed
🟩 RunTask(sdk:codegen-check) 59.3ms Passed
🟩 RunTask(tokens:buildTokens) 51.9s Passed
🟩 RunTask(sdk:lint) 58.9s Passed
And 12 more...
Expanded report
Action Time Status Info
🟩 RunTask(sdk:build) 1m 37s Passed
🟩 RunTask(tokens:verifyDesignDataSnapshot) 1s Passed
🟩 RunTask(tokens:verifyLegacyRoundtrip) 1.6s Passed
🟩 RunTask(design-data:legacy-output) 969ms Passed
🟩 RunTask(tokens:verifyLegacyOutput) 1.3s Passed
🟩 RunTask(tokens:validateDesignData) 1.2s Passed
🟩 RunTask(design-data:roundtrip-verify) 1.5s Passed
🟩 RunTask(tokens:test) 8.4s Passed
🟩 RunTask(design-data:validate-dataset) 20.4s Passed
🟩 RunTask(design-data:validate) 20.2s Passed
🟩 RunTask(sdk:test-doc) 1m 37s Passed
🟩 RunTask(sdk:test) 2m 41s Passed SLOW
Changed files
.changeset/banner-list-structure-legacy-key.md
packages/design-data/fields/structure.json
packages/design-data/tokens/layout.tokens.json
packages/tokens/src/action-bar.json
packages/tokens/src/alert-banner.json
packages/tokens/src/layout.json
packages/tokens/src/side-navigation.json
packages/tokens/src/tabs.json
packages/tokens/src/toast.json
packages/tokens/src/tree-view.json
sdk/core/src/naming.rs
sdk/core/src/registry_data.rs
tools/token-mapping-analyzer/src/field-catalog.js

@GarthDB
GarthDB merged commit e693b15 into main Oct 1, 2026
9 checks passed
@GarthDB
GarthDB deleted the fix/structure-legacy-key-banner-tokens branch October 1, 2026 15:46
@GarthDB GarthDB mentioned this pull request Oct 1, 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