-
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
Add filter for the Preferences modal sections #29825
Conversation
a5030c1
to
ef11fee
Compare
I've updated the filter name to |
I'm all in favor of making the Preferences modal extensible. That's a really great idea. Thank you for starting this PR with the initial proposal. It feels like we could benefit from creating a more formal API that would be similar to how you work with the custom sidebars using SlotFill as the foundation. There is several plugins available that use the same pattern: Aside from that, the biggest question is whether we want to allow adding extensions only to the |
Thanks for the feedback, @gziolo. I agree that SlotFills as a foundation matches the general pattern used in core better. This also would be beneficial if we end up extracting editor Preferences to the Interface package (#31965). I assume not all editors would have the same sets of preferences, and they might want to extend it as needed. /cc @talldan |
Yeah, I think a slot/fill makes sense. It's a longer term thing, but it might be good to consider various APIs. I'm thinking:
I'm still very early into the work on #31965, but will try to share a draft PR in the next few days. It doesn't have any overlap with this PR, but it will move towards a more generic idea of a preference. |
@Mamaduka Here's that draft PR, sorry it took a bit longer than I said it would - #33774 I think the preferences modal could be looked at in a follow-up. At the moment my plan is to move everything into the interface package, but that might change depending on feedback. Interface does already have some good well defined abstractions for extensibility with its complementary areas and pinned items, so I could see a slot/fill for preferences following a similar pattern. |
Thanks, @talldan. I'll have a closer look next week. |
Description
Introduces new
editorPost.PreferencesModal.sections
filter. Using this filter, plugin authors will be able to add/remove sections from the "Preferences" modal.Note: Currently preference modal
Section
component isn't exported, so I had to copy it for testing. What's the best option to make this available for plugins?Fixes #28970 and #16401.
How has this been tested?
With custom code that uses this filter.
Custom code
Screenshots
Types of changes
New feature
Checklist: