Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Allow inheriting the global query arguments #27128
Query block: Allow inheriting the global query arguments #27128
Changes from 25 commits
6629662
9d3d835
166d525
17c9150
8ccec48
db4af75
8a3c9e8
3325878
20e23ac
406442d
239e7ef
fd70067
7ca7b4a
d68e8e8
5b4fc7b
dcd942a
37bd1d2
243c237
f1cb044
1aeb80c
7709c41
9d5c02a
628184c
c82e063
334beae
ccf3513
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Now that I better understand the proposed changes, it looks like we can avoid passing
isGlobalQuery
down, and we could modify the context passed in the Query block instead. What would be even better is to read theslug
and other query params from the context set by the editor. In fact, there might be something like that already:gutenberg/packages/edit-site/src/components/editor/index.js
Lines 160 to 183 in 5c530b2
I'm going to investigate how it all works as it would make everything so much easier to control for all blocks like Query Pagination, or for example Calendar block that should look different depending on query args selected.
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.
If we are going this way (not decoupling context with preview), that was the direction I was following as well in my explorations.
setPage
sets context to blocks that needed and was setting info in FSE navigation sidebar.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.
@aristath, this is the only part of this PR that I'm not particularly happy about but at the same time it allows us to move forward so I think it's an acceptable compromise. I plan to look into the context propagation separately anyway.