-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 editor package isPublishSidebarEnabled
to preferences store
#39707
Conversation
Size Change: -11 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
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.
Nice work on all these migration PRs @talldan! The code change looks good to me visually, but for some reason the publish setting didn't appear to be preserved for me when I switched from trunk
to this branch. I had it switched off, but after changing branches, it defaulted back to on
:
The steps I took:
- Switched to
trunk
, cleared local storage - Created a new post, ensured the setting defaults to enabled
- Published the post
- Created a new post, set the pre-publish setting to disabled
- Published the post
- Closed the window
- Switched branch
- Created a new post, the pre-publish setting appears to default to
on
- Toggling the setting thereafter appeared to work correctly
Apologies if I missed a step during testing!
Thanks for testing. I see that too, it seems to only happen on a newer version of |
c5a81e3
to
0e9c7b4
Compare
@andrewserong I see what it is. The migration function was ignoring a Not sure how I didn't notice it in my own testing, maybe I refreshed the page too quickly. Thanks for catching it. |
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.
Great catch @talldan, that's testing nicely now! 🎉
This LGTM — and I assume since the public API remains the same (all the selectors are still available, it's just that internally they now dispatch to a different store), we don't need to flag the change in the packages' changelogs?
Good question. Given the API is still the same I think it's ok not to mention anything. It's just an internal change. I may come back later and deprecate some of the selectors and actions for the post editor, at which point I'll mention it in the changelog. Thanks for the review. |
Part of #31965
What?
Migrates the editor package's
isPublishSidebarEnabled
preference to the preferences store.Why?
As outlined in #31965, the goal is to move persisted data out of our various stores to a centralized preferences store.
How?
This change is very straightforward, as this preference is just a single value, the changes are:
editor
package's preferences reducer and related code has been removedTesting Instructions
trunk
first, open the post editor's preferences modal and turn off 'Include pre-publish checklist'.