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

Document structure and stats do not consistently process synced patterns (aka reusable blocks) #33079

Open
mrwweb opened this issue Jun 29, 2021 · 8 comments
Labels
[Block] Block The "Reusable Block" Block [Feature] Document Outline An option that outlines content based on a title and headings used in the post/page [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended

Comments

@mrwweb
Copy link

mrwweb commented Jun 29, 2021

Preface: This behaves like a regression for the fix that closed #12042 and #11744.

Description

  • Headings in reusable blocks are not reflected in the Document Outline
  • The word count and character counts do not include blocks reusable blocks
  • The total block count, paragraph count, and heading count—surprisingly—are correct
  • The issue applies to saved and unsaved reusable blocks.
  • The issue happens regardless of whether the reusable block was created on the post or added to it from an existing reusable block.

Step-by-step reproduction instructions

  1. Make a new page
  2. Put some content on the page including multiple paragraphs and headings
  3. Note the Document Outline
  4. Turn at least one heading and paragraph of that content into a reusable block
  5. Note the change to the Document Outline

Expected behaviour

Document Outline reflects entire page content regardless of whether it includes a reusable block.

Actual behaviour

Document outline, word count, and character count exclude content in reusable blocks

Screenshots

Page content with four headings
List view of page showing two headings on page and two headings in a reusable block
Document Outline showing incorrect word, character, and outline. Showing correct heading and block count

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: Not installed
  • Are all plugins except Gutenberg deactivated? No plugins at all
  • Are you using a default theme (e.g. Twenty Twenty-One)? Twenty Twenty

Device information

  • Device: Desktop
  • Operating system: Windows 10
  • Browser: Firefox 90.0b12
@talldan talldan added [Block] Block The "Reusable Block" Block [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended General Interface Parts of the UI which don't fall neatly under other labels. labels Jun 30, 2021
@kathrynwp kathrynwp added [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Feature] Document Outline An option that outlines content based on a title and headings used in the post/page labels Aug 18, 2022
@kathrynwp
Copy link

I can still replicate this with:

WordPress 6.0.1
No plugins active

Initial Document Outline

Add_New_Page_‹Self-hosted_Test—_WordPress

Outline After One Heading & One Paragraph made into a Reusable Block

Add_New_Page_‹Self-hosted_Test—_WordPress

@cbirdsong
Copy link

I can confirm this is still an issue in Wordpress 6.3.

@jordesign
Copy link
Contributor

Confirming this is still true testing WP6.4 RC2 as well - headings and text within Synced patterns are not registered in the outline.

@afercia afercia removed the [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later label Feb 20, 2024
@afercia
Copy link
Contributor

afercia commented Feb 20, 2024

This was also reported in #51909, for the sunced patterns.

The word and characters count is still incorrect on current trunk version 17.7.0. See screenshot below.

Removing the Low priority label as I think this should be fixed soon. Introducing features that break other existing features and keeping showing users very evident wrong inforation in the user interface is less than ideal. I'm not sure providing users with broken functionality helps with increasing trust with the editor.

Screenshot 2024-02-20 at 09 22 36

@afercia
Copy link
Contributor

afercia commented Feb 20, 2024

After some quick testing, seems that on current trunk headings within synced patterns are now correctly parsed and added in the document outline. See animated GIF below, where after page refresh the synced pattern is fetched and when loaded the additional heading within the pattern is added to the document outline.

Some more extended testing would be welcome.

synced pattern outline

@mrwweb mrwweb changed the title Document structure does not consistently process reusable blocks Document structure and stats do not consistently process synced patterns (aka reusable blocks) Feb 20, 2024
@afercia
Copy link
Contributor

afercia commented Jun 19, 2024

Update: testing on latest trunk 18.6.0-rc.1 this appears to still (again?) be a problem. Headings within Synced Patterens aren't included in the document outline. Which makes this feature visibly not fully functional and it's in this state since a while. I would appreciate this issue to get some more priority as it's a buggy functionality visible to all users.

In the GIF below:

  • Keep the Document Overview > Outline panel open.
  • Add a couple headings and a paragraph.
  • Select the last heading and paragraph.
  • Make them a Synced pattern.
  • Observe the last heading disappears from the document outline.

headings within patterns

@mrwweb
Copy link
Author

mrwweb commented Jun 19, 2024

Which makes this feature visibly not fully functional

💯 This feels like a serious bug and one that hasn't been addressed for years now. It should ideally be addressed holistically to resolve both this issue and #5037 at the same time.

It seems like the Document Outline needs to reflect the actual post content so the heading outline includes synced patterns as well as headings in custom blocks. Without that, the heading outline is frequently wrong, potentially providing an accessibility false positive in the outline.

@afercia
Copy link
Contributor

afercia commented Jun 20, 2024

It seems like the Document Outline needs to reflect the actual post content so the heading outline includes synced patterns as well as headings in custom blocks.

I'd totally agree this feature needs to be rethinked. I'm not sure it can be based on the block type. To provide a fully correct outline, this feature needs to be aware of all the headings that are actually rendered, even if they come from, for example, shortcodes (besids patterns, custom blocks, stc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Block The "Reusable Block" Block [Feature] Document Outline An option that outlines content based on a title and headings used in the post/page [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants