figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

Fix token group renaming to work consistently across all sets

Open Copilot opened this issue 8 months ago • 1 comments

Problem

Currently, renaming a token by clicking on its individual instance (e.g. token.sm) updates any token values that reference it across all sets. However, renaming via the parent group name (e.g. token) does not propagate to every set. This inconsistency can lead to confusion and require manual fixes.

Before this fix:

  • Individual token renaming: Updates references across all sets ✅
  • Group token renaming: Only renames tokens in specified parent set ❌

Solution

Modified the renameTokenGroup reducer and effect to operate across ALL token sets instead of just the specified parent set, making the behavior consistent with individual token renaming.

Key changes:

  1. Updated renameTokenGroup reducer: Now iterates through all token sets instead of just the specified parent set
  2. Updated renameTokenGroup effect: Now collects renamed tokens from all sets and calls updateAliases for each one
  3. Added comprehensive test: Created test that verifies tokens are renamed across all sets when renaming a group

After this fix:

  • Individual token renaming: Updates references across all sets ✅
  • Group token renaming: Updates references across all sets ✅

Example

Consider this scenario with tokens in multiple sets:

// Global set
"colors.primary.500": "#3b82f6"

// Theme set  
"colors.primary.500": "#ff0000"
"button.background": "{colors.primary.500}" // Reference to the token

Before: Renaming colors.primarycolors.brand in global set only:

  • Global: colors.primary.500colors.brand.500
  • Theme: colors.primary.500 unchanged ❌, button.background still references {colors.primary.500}

After: Renaming colors.primarycolors.brand consistently:

  • Global: colors.primary.500colors.brand.500
  • Theme: colors.primary.500colors.brand.500 ✅, button.background{colors.brand.500}

Fixes #3410.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://168.63.129.16:80/machine/
    • Triggering command: /usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Jun 04 '25 20:06 Copilot

⚠️ No Changeset found

Latest commit: 0833390d1f03fa1097048d8b9656ba0ba493159e

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

changeset-bot[bot] avatar Jun 04 '25 21:06 changeset-bot[bot]