Skip to content

Query block enhanced pagination: false positives on patterns/template-parts (including TT4 default templates) #55706

@luisherranz

Description

@luisherranz

Description

As reported by @afercia in this PR, the enhanced pagination of the Query block cannot be enabled in the Twenty Twenty-Four theme because we were being very cautious in detecting unsupported blocks.

This is the explanation of the issue:

  • The enhanced pagination is the first of a series of user experiences based on client-side navigation. Other ones that we would like to try in the future are infinite scroll, instant search or client-side form submissions.
  • This client-side navigation can only be enabled when all the blocks of that section are compatible with them. In this case, the section is the Query block and its inner blocks.
  • We are still working on this compatibility layer, so in WP 6.4 we decided to restrict compatibility to Core blocks.
  • We are checking if all the inner blocks of the Query block are compatible in the Editor.
  • If there is a block that is not compatible, the enhanced pagination cannot be activated. For example, if you add a block from a plugin, a modal appears telling you that this block is not compatible and that the enhanced pagination has been disabled. If you try to enable it again, you can't because the toggle is disabled until you remove the unsupported block. You also see a notice informing you about this.
  • Even though all Core blocks are compatible, there are blocks that can change outside of the template that contains the Query block: the synced patterns and template parts.
  • For example, imagine that you add a synced pattern to your Query block. It doesn't contain any blocks from plugins, so everything is compatible and you can enable the enhanced pagination. Now, you open another template that also contains the same synced pattern and edit it from there, adding a block from a plugin. As there's no way to change the setting of the previous template, so we cannot guarantee anymore that the enhanced pagination will work correctly.
  • For that reason, we currently consider patterns and template parts as non-supported blocks.
  • The default templates of TT4 contain a "Post Meta" template-part inside the Query block (<!-- wp:template-part {"slug":"post-meta"} /-->), therefore you can't activate the enhanced pagination.
  • But unless you edit that template part and include a block from a plugin, it's really a false positive.

Step-by-step reproduction instructions

  • Install TT4.
  • Go to edit the home page.
  • Try to enable the enhanced pagination of the Query block.
  • The enhanced pagination is disabled and cannot be enabled.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions