-
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
Query loop: the 'Max page to show' setting doesn't preview in the editor #63027
Comments
Hi Mate, I am looking into this and let you know if I can fix it :) |
Hi, I've reviewed it, and here are my thoughts:
Regarding 2, do you think implementing this will result in additional fetch requests to get the post count? Regards, |
It's a reasonable concern but this already happens when changing the 'Items per page' and 'Offset' values. At each change, posts are fetched including all the posts content, which may be potentially huge. As far as I see, the responses are cached so that subsequent requests with the same values won't trigger a new fetch. On the other hand, triggering a new request at any React
Debouncing should be a standard in these cases. Cc @youknowriad any thoughts? |
Thanks for the issue, but I don't think it's something we should do, as the decision to render pagination blocks like that (static) was intentional. While your example seems fine to had that change in pagination, it's not worth it to add that much complexity and make extra requests(performance), as in most cases users just need to have a way of changing settings in pagination blocks and style them. I suggest we close this one. |
@ntsekouras thanks for your feedback. I'm not sure I understand how that relates to whether it was a good or not so good decision. I appreciat eit was intentional but thtat doesn't necessarily mean it was a good decision.
I don't think this would add 'complexity' can you please elaborate on your concerns in that regard? I don't share the concern about performance. First, as mentioned in this issue description, changing other settings like 'Items per page' or 'Offset' already triggers a new request. Changing 'Max page to show' wouldn't be different so your concerns aout performance should theoretically apply to all settings, not just this specific case. Secondarily, ideally, any request should also return 'meta information' in the response like the classic WP_Query does with However, I'm not even sure that would be needed. The editor is supposed to provide a visual preview of the front end. The pagination linnks preview in the editor are non-functional links. They are just a preview. When changing the 'Max pages to show' setting, the Pagination block should only change how many links are visually shown in the preview. Not sure there's a need of triggering a new request in the first place?
Yes, and in order to do so users need a 1-to-1 preview of the front end. To me, this seems a valid issue and closing it would go against the whole purpose of providing users with an accurate preview of the front end. |
If I'm not wrong this will require implementing a close clone of paginate_links in JS. Maybe it's simpler than what I have in mind, but I don't think so. Regarding the performance, yeah, it will not be a bad hit. In general I think it's not great to do this in this dynamic block. For example we create a Query Loop block when we have just two results. That might not even show any pagination blocks probably and after a while the user adds more posts and has to go back to the post with the Query Loop block and style accordingly the pagination blocks, based on the number of results at that specific time.
Sure. I'm just sharing my thoughts as I implemented these blocks initially, and of course people can chime in and change that eventually. Let's keep it open to gather more feedback then. |
Description
Discovered while working on #63020
The editor is supposed to provide a preview of the blocks (the entire page, I would say) that is as close as possible to the page on the front end. However, it appears the Query loop 'Max page to show' setting doesn't provide any preview in the editor. It just stays in its default view.
Not sure but this may happen because the Paginaion is actually a separate block. Regardless, as a user I'd be pretty disoriented by not seeing any change in the editor preview and think there's something not working as expected.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: