-
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
Migrate post editor preferred style variations to preferences store #39337
Migrate post editor preferred style variations to preferences store #39337
Conversation
Size Change: +13 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
I've tested this according to the instructions, and the style variation preferences subsist and are being migrated to the right store in local storage. Tests pass ✅ Also booted up in IOS just to make sure things look okay (even though style variation preferences don't show on mobile). Happy to give it another test after a rebase and give it the ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only looked at the code. It looks nice. Nice code 👍
7419cdd
to
c43c461
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested and LGTM!
Thanks for the reviews. 🎉 The only failing e2e tests are from a known issue in WordPress core (https://core.trac.wordpress.org/ticket/55367), which should hopefully be fixed soon. I'll go ahead and merge this. |
What?
Addresses some of #31965
Migrates the post editor's preferred style variations data to the preferences store.
Why?
The roadmap is detailed in #31965.
The goal is to use the preferences package for storing any persisted preference state, removing persistence from all other packages.
This will:
registerStore
in favor ofregister
.How?
preferredStyleVariations
are a little tricky. The way this system works now isn't ideal because:I could've fixed the first two things by giving it a revamp, but given the last point I've decided to leave everything working in the same way. The discussion in #34522 seems to point to this working very differently in the near future.
Testing Instructions
To test, you'll need to temporarily re-enable the feature by commenting out these three lines:
gutenberg/packages/block-editor/src/components/default-style-picker/index.js
Lines 54 to 56 in 680d1aa
Then:
trunk
open the post editor and dismiss the welcome guide