fix: improve pagination, linking directly to comments#431
fix: improve pagination, linking directly to comments#431laurelfulford wants to merge 5 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Improves the theme’s slide-in comments panel UX by enabling in-panel comment pagination, preserving deep-linking to individual comments across pages, and making comment timestamps linkable for easier sharing.
Changes:
- Add fetch-based in-panel pagination and comment form submission, swapping the rendered
.wp-block-commentsmarkup without a full page reload. - Auto-open the comments panel on paginated comment URLs and on direct
#comment-Nlinks, with scroll-to-comment behavior. - Enable linking from the comment date by allowing the Comment Date block to render as a link.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/js/front-end/menus/comments.js | Adds inline pagination + form submit via fetch, swaps comments block HTML, updates URL, and auto-opens/scrolls for comment deep links. |
| parts/comments-contents.html | Makes the comment date render as a link (to enable direct linking to specific comments). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @thomasguillot! This could probably use your eyes just to get some feedback on the fade/loading-ish behaviour that you get on pagination 🙂 Just let me know if anything needs tweaking! |
Screenshot.2026-03-27.at.10.56.24.mp4This is great and works as it says on the tin. I’m wondering if we should disable scrolling on the main body and keep it limited to the overlay, similar to how the overlay menu works. Right now it feels a bit more annoying than helpful. I think the original idea was to let people view the content and comments at the same time, but realistically that only works on very wide screens, so it’s probably not worth the tradeoff. |
|
For the fade-in/loading state, I think this works well since it’s pretty quick. If the load time was longer, we’d probably need a spinner (eg.g |
All Submissions:
Changes proposed in this Pull Request:
This PR tweaks the current comment panel approach in the theme to fix a couple UX issues:
Closes NPPD-1280.
How to test the changes in this Pull Request:
npm run build.Other information: