-
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
Query block enhanced pagination: Detect inner plugin blocks during render #55714
Query block enhanced pagination: Detect inner plugin blocks during render #55714
Conversation
…gin-blocks-during-render' into try/query-block-detect-inner-plugin-blocks-during-render
Size Change: +105 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ phpunit/blocks/render-query-test.php |
Flaky tests detected in 062e795. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6709060875
|
It is still unclear what "inner blocks are compatible" means. Where are the issues with third party blocks, the limitations, documented or mentioned? |
As @luisherranz shared:
As @ocean90 notes:
With the logic now being reversed (with this PR), the old string would cause confusion. Thus, the string are required for this fix. In addition, as @luisherranz points out, punting the fix to later, i.e. 6.4.1, will also confuse users:
Thus, the string changes are needed for this fix. Update: Removed the decision making part, as it's a release decision that should not block this PR's progression. |
Thinking about this more.... @luisherranz advises the strings need to change from a user, product, and technical perspective. IMO the decision of whether to ship this fix in 6.4.0 or 6.4.1 should not block this fix's progression. Let's get this fix done and ready. Moved the when to ship discussion and decision to Make/Core slack. |
@luisherranz as you've noted, the string changes are essential for this PR and fix. The "when to ship" decision can be separated from getting this PR ready for merge. I've moved the "when to ship" decision to Make/Core slack. |
Current status:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better. Nice work @luisherranz :)
Thanks, everyone ❤️ Merging now 🙂 |
Update:
Okay to merge. |
Thank you everyone 🎉 |
…nder (#55714) * Flag inner plugin blocks inside query loop * Improve PHP logic a little * Only disallow plugin blocks and post content * Get rid of global variables * Fix returned content from render callback * Handle composed query stacks * Disable navigation on the browser * Replace `count` with `empty` * Add PHPdocs and improve var naming * Lint PHP * Clarify docs a little * Move the disable check before preventDefault * Restore previous navigate logic * Set filter priorities back to 10 * Basic inspector warnings * Make render query filter static * Add stable modal logic * Switch back to ToggleControl * Auto remove filter when query stack is empty * Add first unit tests * Switch to inverse control * Add test case for nested queries * Prevent passing `null` to the Tag Processr * Get rid of explicit auto mode and notices * Test directives in the Pagination Previous block * Minor typos and improvements * Improve modal texts * Fix WPCS * Reorder teardowns * Reset the dirty flag after it's used * Prevent usage of post content block --------- Co-authored-by: David Arenas <david.arenas@automattic.com>
I just cherry-picked this PR to the 6.4-rc3-2 branch to get it included in the next release: 563c5a8 |
* Update label for lightbox editor UI (#55724) * Update label for lightbox editor UI * Change lightbox label in Global Styles * Require queryId for enhanced pagination. (#55720) * Change pattern category taxonomy public param to false (#55748) * Query block enhanced pagination: Detect inner plugin blocks during render (#55714) * Flag inner plugin blocks inside query loop * Improve PHP logic a little * Only disallow plugin blocks and post content * Get rid of global variables * Fix returned content from render callback * Handle composed query stacks * Disable navigation on the browser * Replace `count` with `empty` * Add PHPdocs and improve var naming * Lint PHP * Clarify docs a little * Move the disable check before preventDefault * Restore previous navigate logic * Set filter priorities back to 10 * Basic inspector warnings * Make render query filter static * Add stable modal logic * Switch back to ToggleControl * Auto remove filter when query stack is empty * Add first unit tests * Switch to inverse control * Add test case for nested queries * Prevent passing `null` to the Tag Processr * Get rid of explicit auto mode and notices * Test directives in the Pagination Previous block * Minor typos and improvements * Improve modal texts * Fix WPCS * Reorder teardowns * Reset the dirty flag after it's used * Prevent usage of post content block --------- Co-authored-by: David Arenas <david.arenas@automattic.com> * Reuse existing screen-reader-text CSS class. (#55309) --------- Co-authored-by: Artemio Morales <artemio.morales@a8c.com> Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Co-authored-by: Glen Davies <glendaviesnz@users.noreply.github.com> Co-authored-by: Luis Herranz <luisherranz@gmail.com> Co-authored-by: David Arenas <david.arenas@automattic.com> Co-authored-by: Andrea Fercia <a.fercia@gmail.com>
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@57048 602fd350-edb4-49c9-b593-d223f7449a82
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. Built from https://develop.svn.wordpress.org/trunk@57048 git-svn-id: http://core.svn.wordpress.org/trunk@56559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. Built from https://develop.svn.wordpress.org/trunk@57048 git-svn-id: https://core.svn.wordpress.org/trunk@56559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Reviewed by davidbaumwald , jorbin. Merges [57048] to the 6.4 branch. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. git-svn-id: https://develop.svn.wordpress.org/branches/6.4@57049 602fd350-edb4-49c9-b593-d223f7449a82
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Reviewed by davidbaumwald , jorbin. Merges [57048] to the 6.4 branch. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. Built from https://develop.svn.wordpress.org/branches/6.4@57049 git-svn-id: http://core.svn.wordpress.org/branches/6.4@56560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Fixes #55706.
Why?
The main problem is explained in the following issue:
How?
By applying two changes:
I tried to use
ToggleGroupControl
instead ofToggleControl
because it makes the change to "Auto" much more explicit, butToggleGroupControl
has a bug when the value is changed programmatically usingsetAttributes()
. Also,ToggleGroupControl
doesn't have support yet for disabled, which is required for this use case.Testing Instructions
Screenshots or screencast
I made a video to explain how the UX works, especially to get feedback from design about the "Auto" mode:
https://www.loom.com/share/311ee1534a1641a786b765b6cbff48bb
Drawings
Tasks
core/pattern