-
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 editor preferences to new package. #31965
Comments
Maybe a seperate issue, but it's not great at all that #31925 duplicates |
Now in a pretty good state for migrating 'feature' preferences to the interface package, with PRs open for every editor that implements these preferences. What other kind of preferences are there? The only remaining preferences live in the post editor: Panel preferencesThe way these are implemented is already very generic, and it could easily be brought to other editors. It also fits in quite nicely with the remit of the interface package. However, no other editors have any need to implement this, so it might be worth waiting until a use case arises. Editor modeThis is also very specific to the post editor, and might not be something to migrate to other editors. Though there is a feature request to bring this to the widget editor (#33518). Block Manager / Hidden Block TypesVery much a feature that is desired in other editors, so this could be refactored, hover I'm not convinced that the interface package is the right option. Interface deals more with UI abstractions, and this is very block specific. It could perhaps be its own package? Default block style / Preferred style variationsThis is in the localAutosaveIntervalIt seems like this is outside the remit of this change. I don't think there's a user facing way to modify this value. I'm not completely sure why it needs to be persisted to local storage. Would be good to understand more about that. |
The latest feedback (#24370 (comment)) is to create a new 'preferences' package. I don't really have the bandwidth to handle that, so I'll hand this over to another willing contributor. |
Now things are a bit calmer again following 5.9 I'll work on the new preferences package. |
Looks like this work has been completed! I'm going to close this out as a result but let me know if it needs to be reopened. |
What problem does this address?
The editor more menu is entirely implemented in the edit-post package and not reusable across editors.
The site and widgets editors are duplicating a lot of code to implement more menus, and this seems unnecessary. Much of the options could be implemented in a more generic and reusable way.
What is your proposed solution?
Either migrate the preferences to the
interface
package or create a new package.Interface seems a good fit because it already has some similar UI concepts in the sidebar and tabs that it exposes. These are configurable, so migrating the more menu would involve similar work.The preferences for some editors have now already been migrated to interface, but the plan is to now create a newpreferences
package, so they'll need to be migrated again.Update - the new preferences package has now been shipped, and the next step is to migrate the preferences in each of our editors/packages.
Status
@wordpress/preferences
package #38873editorMode
to use preferences store and removelocalAutosaveInterval
preference #39180panels
state to preferences store #39604enableItems
data to preferences package #39449isPublishSidebarEnabled
to preferences store #39707The text was updated successfully, but these errors were encountered: