-
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
Stabilize the Table of Contents Block #42229
Comments
My main concern with stabilizing the Table of Contents block is that, if the ideas in #41173 are implemented, it could drastically alter both the attribute schema and saved markup of the block. We might end up creating another backwards compatibility nightmare if we stabilize the block in its current form. I haven't had time to work on prototyping this idea, unfortunately. The more I think about it, the more I realize that using a Table of Contents outside of the post content is actually the primary use-case for some website designs, so it feels almost wrong to have it be stabilized while it remains unusable there. There's also the undo history bug described in #41031, which is just rather annoying to deal with. I have no clue how to fix it. |
While you are looking at another iteration on the Table of Content Block, During the various iterations it started out as bullet list.
During the discussion, it was not accepted as a needed feature, and argued that it was in the theme developer's domain. I still feel that an end user should be able to change the nature of the Table of Content list, via an option in the Sidebar, rather having the need to connect with a developer to modify the theme css. To be consistent, most core blocks have myriad of options applied to each instance of the block, in addition to the theme.json settings for Global Styles. For now, the current Table of Contents block doesn't provide neither block based options nor a theme.json or Global Style implementation to change the display of the Headlines. With more options it would shine so much brighter, especially if it makes it into the next major WordPress release. |
I 100% agree with @bph and @ZebulanStanphill assessments. This block, while a great start, could use some additional love. To echo some of the previous comments:
|
As far as I'm aware there is no reason not to stablise this selector. Also noting it is not widely used. |
I think styling enhancements aren't necessary blockers for stabilization. These can be done after. The "Table of Contents outside of the post content" is nice to have but not a blocker, in my opinion. My best guess is that we'll have to use dynamic rendering and parse content blocks to achieve this. The "undo bug" breaks editor history, so it probably should be fixed before we consider stabilizing the block — recent findings from @kevin940726 on this issue - #41031 (comment). P.S. It would be nice to stress test the block on large posts and see if it affects typing. |
Yeah, I am all for stabilizing. I just don't think we should include it in Core until the block is a bit more full-featured. While a great step forward, it feels incomplete. |
Technically speaking, the issue is about exposing this block for WordPress Core by removing the experimental flag that ensures Table of Contents block can be used only with the Gutenberg plugin.
We need to make the decision whether this block should be general purpose and work everywhere or we limit its usage to the post editor. One way to approach it could by setting in In general, it's a challenge to ensure that the Table of Contents block stays in sync when some dynamic blocks change outside of the place where the table of contents gets updated. It's also an issue when using the post editor and you have a Reusable block with heading that can be modified in every place on the site. |
The table of contents block also needs to add an |
cc @priethor to see if this is still important for 6.1. |
I should note that due to being busy with several other things, it is unlikely that I will be able to help much with stabilizing the Table of Contents block, besides reviewing PRs from other people. If anyone wants to tackle the aforementioned issues, feel free to do so, because I simply don't have the time available to do so right now. If you ask me, the switch back to dynamic rendering and the question of a bullet style option are two things that must be tackled prior to the block being considered stable. |
I think it is still worth exploring having the ToC block in 6.1. I don't think being limited to the Post Editor is a blocker; to me, it's an opportunity to include it earlier with a limited scope and iterate later on it. |
My primary concern is not the limitations it would have if merged now, but rather the backwards-compatibility burden it would cause later on, if (or most likely, when) the implementation changes. I've already seen several recent cases of core blocks having to make a bunch of compromises due to an inability to update existing static-rendered blocks on the front-end. For example:
|
Bringing this to @michalczaplinski and @ockham's attention as a decision needs to be made for 6.1. While I'm all in for including this in core feature-wise, apart from that, it hasn't been released in Gutenberg in a stable manner yet and won't be before Beta 1. |
Based on all the concerns in the current thread I would not feel comfortable including the Table of Contents block in the 6.1 in its current form. It seems that we'd at least need to complete the following:
The Feature Freeze for 6.1 is in exactly 2 weeks. Are there any volunteers that would like to work on those features so that we could stabilize the ToC block and include it in the 6.1 ? Are there any other issues that would be considered must-haves? 🙂 |
The TOC block was not included in the 6.1 Beta, so I am going to remove this PR from the 6.1 Project Board. |
Let's aim to have this for 6.2 🙏 |
So is this block still on the roadmap for 6.2? It would be great to have, as its been in development for so long now :) |
Pinging 6.2 Editor Tech co-leads @Mamaduka and @ntsekouras as a heads up as this was punted from 6.1. Going to add to 6.2's project board for now for consideration. |
There's a clear path right now. The blocker is someone diving in to do the work right now. For 6.3, we weren't able to get someone in place who could do so. |
My schedule is very busy lately, so it is unlikely that I will be able to do much here, though I'll try and review any PRs relating to the block if I have the time. |
I've consolidated the remaining items in the issue description. 🚀 |
The #54224 is ready for review. Fixes the undo quirk and page permalink bugs. |
As a follow-up on the decision that the Table of Content will not be shipping in 6.4, I removed it from the project board |
Looks like the table of contents block is not published on wordpress 6.5.2 |
WordPress version 6.5.3 does not have a table of contents block, I recommend adding a Table of Contents block to WordPress 6.6 to quickly create a table of contents based on all the headings on a page. From then on I won't need to install the Table of Contents Plugin anymore. |
Would the Table of Contents block be a good candidate for a canonical block plugin? I see it mentioned on this related issue: #58773. It would still need to be installed as a plugin, but as it would be a block plugin this would be a smoother experience, as they can be installed directly from the inserter. Edit: I just saw your comment over on the same issue 😄 |
There are a total of about 1 million active installs for the Table of Contents plugins, which I think is large enough to include the Table of Contents Block in WordPress core |
@richtabor any chance to get this stabilized soon? |
I don't know if this is a known issue and if it is the place to report it, but when using the Gutenberg TOC on a WooCommerce Single Product template the headings are listed properly, but the items on the TOC aren't linking to them - they are just static |
I work with folks on the Woo side and will ping them about this! |
@asafm7, it seems to be behaving like that for me on all templates, with only the Gutenberg plugin enabled (no WooCommerce). For example, if you add it to |
@WunderBart I tried it in a Single Post template which I considered the most straightforward use case for the TOC block. It doesn't work at all in this use case - nothing is showing on the front end. In the block description, it says "Headings with HTML anchors will be linked here". I've tried adding HTML Anchors to the headings and it is still not working. Unless I'm missing something, the editor doesn't seem to automatically add anchors to headings anyway, which makes the usage of the TOC block, even if it did work, a bit tedious. |
Thanks for checking, @asafm7. I'm trying to verify if the TOC block is broken specifically in the WooCommerce context or if it's broken upstream. For me, the buggy behavior I described above is the same regardless of whether I have the WooCommerce plugin active or not. Having said that, I've tested against the
|
Thanks, @WunderBart. So yes, it seems to be a general template-context issue rather than a WooCommerce issue. |
What problem does this address?
The table of content blocks was first released in Gutenberg 13.3 as an experimental block. A few releases later, no major bugs have been reported and we should start considering taking the block out of experimental.
What is your proposed solution?
Taking the block out of experimental would bring the block closer to shipping in WordPress 6.1.
Apart from removing the experimental flag in
block.json
it would be good to stabilize the dependent selector__experimentalGetGlobalBlocksByName
, first introduced in #39610.Pending items
__experimentalGetGlobalBlocksByName
The text was updated successfully, but these errors were encountered: