-
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
Consider rewriting the wordcount/document outline feature as an extension #4287
Comments
I like using this as an example of an extension with a popover (one of the simplest extensions you could write). |
Nice 👍 |
cc @atimmer since you're working on the sidebar plugins |
Really like this idea :) |
Worth noting this doesn't render on a sidebar at all. |
@mtias True, but this might share pin/unpin feature with the sidebar plugins. I'm thinking registering the plugin should be similar and you just change between sidebar/popover using a "type" or something? |
I still think we should follow PHP part of WP and build the whole extensibility layer based on hooks API (actions and filters). I strongly believe that this is one of the key factors why WP is so customizable. |
My thinking was that a plugin would have a "render" method and they would use a sidebar slot or a popover. |
We have specific APIs in the PHP side for similar use-cases (aka metaboxes :) )
This moves the burden of handling the "show/hide" flag to the plugin author while it can be implemented if it's just a |
I was thinking about this and considered a more abstract API. I've posted it on Slack: https://wordpress.slack.com/archives/C02QB2JS7/p1515576014000052. I'll repeat it here for posterity:
(Could also be called All these different types can have the starring functionality to make it possible for users to make any plugin a first-class citizen. We could then have ‘dumb’ wrappers for I think we can also have actions and filters to do the same things. I think we should also have these. That could make more advanced functionality possible if desired by a plugin author. Such as opening both a sidebar & a popover from a single button click. I don’t know why you would want this, but one part of creating a vast ecosystem is allowing things you cannot imagine yourself. Edit: |
☝️ this features a "pin" icon, allowing you to pin or unpin this. It's quick and dirty, would like to polish it more, but it conveys the point. To recap the ideas for this kind of extensibility right now, they are:
|
@jasmussen this looks good to me as a starting point. |
I've moved this to Future due to lack of recent traction. |
Is this still something we want to do? Shouldn't we consolidate the block navigation and the document outline instead? |
I personally think that block navigation should be replaced by an improved way of using keyboard navigation to quickly switch between blocks rather than keep this separate UI element which duplicates content. Regarding rewriting Document Outline as an extension I think it should be doable at the moment given that we have all components required ready:
The question is if this is important enough to invest our time on it at the moment. Do you see how this could benefit other features in core? Where could we replicate the same behavior? |
I'd agree with @gziolo: not sure investing time on this is worth it. Also, worth considering the document outline is not just about words/elements count. It contains the headings hierarchy checker, which is greatly important for a well structured post. See also the discussion during yesterday's dev chat about the headings level in the .org network. I'd like to remind this was one of the features that received a spontaneous applause from the audience during the Gutenberg demo at the State of the Word 2017 🙂Burying it into the ellipsis menu as a "pinnable" feature doesn't seem ideal to me. Instead, I'd greatly appreciate some focus on #10581 to put a small notice in the sidebar heading inspector and warn users when they use an incorrect heading level. |
The block navigation is very important for nested blocks too. |
Worth pointing out the block navigation is not the topic of this thread. In that vein,
Yes, either the document outline gets merged into the block navigation, or it gets rewritten as an extension. The meta-point of this ticket is to simplify. There's a lot of stuff up there, and the more buttons you have, the less value each button has. So if the two buttons can become one, then as far as I'm concerned that solves this ticket for me. If there's an existing ticket to merge those two, feel free to close this one in favor of that. |
Closing this in favor of efforts in #19344. |
The editor bar right now contains, from the left:
The Document Structure takes up highly valuable real estate on the left, where the most important button of them all, the inserter, sits. It even has a similar roundish icon. While we could look at addressing that, instead what if we rethought the position and feature a little bit?
We would rewrite the feature to be a native editor extension (see #3330), enabled by default. You'd be able to "unpin it" just like you can unpin a sidebar, at which point you'd have to get to the feature in the ellipsis menu.
Quick and dirty mockup:
The text was updated successfully, but these errors were encountered: