🐛 Propagate tokens when restoring a deleted component

A token edit sets the shapes on pages, not the main a deleted component
stores, so a restored main came back with the values its tokens had when
it was deleted, and synced them into its copies.

Restoring a component in the current file propagates the tokens, so the
restored main takes their current values.

Not covered by a test: the frontend suite compiles it in the full
validation that follows.

AI-assisted-by: claude-opus-5-5
This commit is contained in:
alonso.torres 2026-11-13 08:40:36 +01:00
parent e22ca8b7ce
commit 33a8b09362

View File

@ -543,7 +543,11 @@
(rx/of (dch/commit-changes changes)
(when local?
(ptk/data-event :layout/update {:page-id page-id :ids frames})))))))
(ptk/data-event :layout/update {:page-id page-id :ids frames}))
;; the restored main takes the current values of the tokens it
;; applies, which no token edit reached while it was deleted
(when local?
(dwtp/propagate-workspace-tokens)))))))
(defn restore-components
"Restore multiple deleted component definded by a map with the component id as key and the component library as value"