Migrate post editor preferred style variations to preferences store#39337
Merged
Migrate post editor preferred style variations to preferences store#39337
Conversation
|
Size Change: +13 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
18 tasks
Member
|
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 ✅ |
noisysocks
approved these changes
Mar 11, 2022
Member
noisysocks
left a comment
There was a problem hiding this comment.
Only looked at the code. It looks nice. Nice code 👍
7419cdd to
c43c461
Compare
Contributor
Author
|
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. |
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?
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:
registerStorein favor ofregister.How?
preferredStyleVariationsare 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:
trunkopen the post editor and dismiss the welcome guide