-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Styles: Save and Delete functionality for user variations #46952
Conversation
Size Change: +3.52 kB (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
Flaky tests detected in 975326c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3886573790
|
c3c2a1b
to
51fbfd9
Compare
b8171fc
to
15c9e21
Compare
@jasmussen @youknowriad @ellatrix Can I have some help finding someone to review this? |
This is an impressive PR. Great work. It's going to take some time for me to review it properly. That said, first I think I want to mention is that if you're able to split it into smaller PRs that can ship independently, I think that's better for reviews and iterations. For instance the "wp-env" change is clearly something that need to be extracted out of this PR into a dedicated PR. |
I also see that there are some changes to the php side (endpoints I assume), is it possible to extract these to their own PR? In other words, does it make sense for these changes to happen independently or not? |
Thank you for looking into it! I will try to split the things I can into other PRs. The wp-env thing definitely can go to an independent PR.
Unfortunately I don't think it makes sense splitting the PHP endpoints into a separate PR, because the JavaScript relies on new endpoints to work. |
Yeah, but I mean can we land the endpoints first and then the JS changes? |
Yep, we could do that. Should I split it that way? |
Yeah I think so, especially if these endpoints changes could make sense regardless of whether we land the JS or not. |
Alright. I will do that and ping you when it's done. Thanks a lot for your help. |
@youknowriad I split this PR into 3:
I'm closing this PR in favor of those 3. |
Thanks @ribaricplusplus -- apologies for the delay in getting back to you. Had this to get to today and, upon catching up, I see you've already gotten direction! |
What?
Partially addresses #45371. Makes it possible to save and delete custom user variations. Adds a warning that is shown if a user has modified Global Styles and then tries to switch either to a theme variation or a custom user variation, because if the user switches, they would lose the unsaved changes.
This PR also makes a small tweak to
wp-env
to make it possible to run xdebug for php unit tests. Just run them usingnpm run test:unit:php:debug
@carolinan @annezazu Can you help me find someone to review this? I don't know who to ping.
Testing Instructions
The PR includes unit tests and e2e tests. For manual testing, see the screencasts for a demonstration of all testable functionality.
Screenshots or screencast
Creating and deleting variations
Video1.mp4
Switching between variations
Video2.mp4
Keeping the selected custom variation in sync with current user global styles
Video3.mp4
Display a warning if unsaved changes are about to be lost while switching
Video4.mp4