-
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
Allow Filtering of Editor Modes #9292
Allow Filtering of Editor Modes #9292
Conversation
I'm happy to update the keyboard shortcut language, tests, etc once there's feedback on this. |
That’s an interesting idea. It probably would make sense also to automate rendering of the selected mode in here: @mtias, how does it fit in the roadmap for extensibility? |
@gziolo @mtias worth noting discussion on #9334 about potential for an official Focus Mode, and a Revisions Mode integrating the diff viewer could be powerful. This is one of a few high-level things I think could benefit from explicit action/filters. The new Editor View and Blocks are fantastic, but there are still situations entirely new views would be beneficial instead of registering a new sidebar box for every block. I see three unique/potential needs for views to be enabled by plugins: Document-Level Settings
Per-Block Metadata
Reduced Views
|
This would be a critical feature for before Meredith Corp would be able to start customizing and integrating Gutenberg into its WordPress CMS. There are actually several places where extensibility of the current experience is impossible, and its blocking our ability to get sign off on using Gutenberg at all. |
@mtias any thoughts on this..? the need for filterability here persists IMO, despite some really great changes to how modes/options have improved recently |
In terms of suggested features, this is quite compelling! Thanks for all the notes. I'd like to see plugins offer these to users, and I think this is generally achievable. However, architecturally, I'm not sure they fit with the Editor / Code modal binary; ultimately, I don't think we'd be offering a sane API for developers, nor something conducive to good experiences for users. There are other ways to go about it. For instance:
|
As this is already labeled Future and @mtias and I are working on prioritizing work for 5.0, I'm going to close the issue.
Depending on its course, development for 5.1 may provide some inspiration on how to tackle this approach and lead to consolidation of patterns in Finally, I'll reiterate that, despite the Future label, any work on features such as those listed in this issue can be started today. |
@mcsf thanks for responding to this. I totally understand the priority is 5.0 work and I'm not suggesting this takes priority. That said, there are plenty of places WordPress doesn't provide a sane API but provides filter for extensibility and customization. Perhaps I'm missing nuances for how this could be detrimental, but there shouldn't be harm in leaving the door open for others to extend the editor in ways outside the official roadmap. |
@0aveRyan I think one of the challenges is that client side filters have a much bigger impact on reliability… there are just many more ways a JS filter can break the experience that are harder for end-users to debug and recover from. I think tackling this within the context of the Plugins API as opposed to a filter makes a lot of sense, as plugins can be isolated in such a way that a broken JS plugin doesn't bring down the whole user experience with it. |
Thanks for the balanced arguments in this thread. :)
@0aveRyan: I'll echo @chrisvanpatten's arguments, and also add that there's generally been an attempt to avoid opening new patterns for extension when we don't know much about their possible uses. This is in good mesure based on our collective learnings from WP's history, in which have occasionally:
💯. My hope is also that certain patterns may emerge across plugins in such a way that helper plugins (or NPM modules) arise to ease some processes or designs. Then over time we can make informed decisions as to what we can bring back into the core framework. |
Alright, all fair points. I had been seeing relatively equal danger between PHP & JS filters, but yeah undetectable client-side errors definitely are fair reason to want to avoid something this significant. The combination of your first & last suggestion @mcsf would be enough to accomplish a quasi-mode without truly creating a new mode -- creating a different render view when plugin state is toggled combined with listening for a query param would be enough to deep-link into a I hadn't seen |
To this point, I'm truthfully not sure if it's possible to do a "takeover" like this (I've never tried), but if it isn't possible that feels like a good first extension point. |
@chrisvanpatten Yeah, haven't tried yet, but two things I'm going to test soon 1) Render new View/Edit for all content blocks based on |
You may be heading in a slightly different direction than I'd have picked, but that's not necessarily bad 😄. If you end up with interesting finds, feel free to loop me in. |
Description
Allow filtering of Editor Modes to let Plugins register custom editors
Example uses:
Screenshots
Checklist: