Skip to content
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

Closed
15 of 18 tasks
talldan opened this issue May 19, 2021 · 5 comments
Closed
15 of 18 tasks

Migrate editor preferences to new package. #31965

talldan opened this issue May 19, 2021 · 5 comments
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Package] Edit Post /packages/edit-post [Type] Code Quality Issues or PRs that relate to code quality [Type] New API New API to be used by plugin developers or package users. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@talldan
Copy link
Contributor

talldan commented May 19, 2021

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 new preferences 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

@talldan talldan added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Package] Edit Post /packages/edit-post [Type] New API New API to be used by plugin developers or package users. [Feature] Navigation Screen [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels May 19, 2021
@noisysocks
Copy link
Member

Maybe a seperate issue, but it's not great at all that #31925 duplicates images.js as it's quite a large file. We need to refactor this to a common package or maybe to wp-admin/images/.

@talldan
Copy link
Contributor Author

talldan commented Aug 20, 2021

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 preferences

Screenshot 2021-08-20 at 12 37 07 pm

The 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 mode

Screenshot 2021-08-20 at 12 41 44 pm

This 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 Types

Screenshot 2021-08-20 at 12 44 50 pm

Very 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 variations

Screenshot 2021-08-20 at 12 47 04 pm

This is in the edit-post store, so it doesn't feel like this feature was implemented in the right way originally—it'll only work in the post editor. Where should it live? Again a very block-oriented feature. An option could be a 'Block Preferences' package that has this and the Block Manager.

localAutosaveInterval

It 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.

@talldan
Copy link
Contributor Author

talldan commented Sep 1, 2021

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.

@talldan talldan self-assigned this Feb 2, 2022
@talldan
Copy link
Contributor Author

talldan commented Feb 2, 2022

Now things are a bit calmer again following 5.9 I'll work on the new preferences package.

@talldan talldan changed the title Migrate editor preferences to the Interface package. Migrate editor preferences to new package. Feb 2, 2022
@talldan talldan added the [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. label Mar 2, 2022
@annezazu
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Package] Edit Post /packages/edit-post [Type] Code Quality Issues or PRs that relate to code quality [Type] New API New API to be used by plugin developers or package users. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

4 participants