mirror of
https://github.com/penpot/penpot.git
synced 2026-11-16 15:11:17 +00:00
* 🐛 Limit token propagation to the new instance on swap and instantiate Switching a variant and adding a component instance re-applied every active token to every shape of every page. In files with thousands of token-styled shapes this took over 10 seconds, while only the new instance needed the file's token values. propagate-workspace-tokens takes an optional scope (page id and root ids) that limits the propagation to those shapes and their descendants. component-swap and instantiate-component pass the new instance's root. Calls without a scope still cover the whole file. Closes #13019 AI-assisted-by: claude-opus-5-5 * ✨ Add token tests for instantiate, swap and multi-page propagation Cover instantiate-component and component-swap with components whose stored values differ from the resolved tokens, checking that the new instance gets the file's token values and other shapes are untouched. Add a second page to the propagation tests to check that unscoped propagation reaches other pages and scoped propagation does not. AI-assisted-by: claude-opus-5-5