fix(figma): stop stuck saves and sync prefixed names to builders - #39
Draft
DavidBabinec wants to merge 1 commit into
Draft
DavidBabinec wants to merge 1 commit into
DavidBabinec wants to merge 1 commit into
Conversation
The WordPress save from the Figma plugin had no try/finally, so a throw in the writes or the builder sync left the save spinner running, and a falsy write ended the save with no message. The builder sync also dropped the project's class and variable prefixes that the WordPress-side save passes, so prefixed projects sent unprefixed classes and color variables to Bricks and Oxygen.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Saving from the Figma plugin to WordPress could leave the save spinner running forever, end with no message when WordPress rejected a write, and send Bricks and Oxygen unprefixed class names and color variables on projects with a class or variable prefix.
Why
syncWphad no try/finally, so any throw in the writes or the builder sync skippedsetIsLoading(false), and a falsy write fell through silently. It now catches, shows an error toast, and always clears loading.usePushFigmaSynccalled the classes and colors refresh without the prefixes thatpackages/wp/src/hooks/usePush.tspasses frompreset.classPrefixandpreset.variablePrefix; it now passes both.Verification
New hook tests fail on main (6 of 7) and pass with the fix.
Notes
Not driven inside Figma Desktop against a live WordPress site; the save path only runs in that host.