close
Skip to content

Commenting scaling feature#73621

Open
karthick-murugan wants to merge 1 commit intoWordPress:trunkfrom
karthick-murugan:commenting-features-scales
Open

Commenting scaling feature#73621
karthick-murugan wants to merge 1 commit intoWordPress:trunkfrom
karthick-murugan:commenting-features-scales

Conversation

@karthick-murugan
Copy link
Contributor

Closes #71668

This PR updates the useBlockComments hook to load comments in two stages:

Initial request: Fetch only top-level note comments.

Background request: Fetch all note comments (with intermediate results enabled).

Why?

The current commenting implementation may not scale well when there are many (hundreds or thousands) comments (or comment replies) on a post.

How

  • Load only top-level comments first to render the sidebar immediately.
  • Then fetch all remaining comments in the background using intermediate results.
  • Enable the background fetch only after top-level data is ready, preventing sidebar flicker and scaling to large comment sets.

Testing Instructions

  • Open a post with many comments (or create >100 notes).
  • Open the collab sidebar.
  • The sidebar loads quickly with top-level comments.
  • Replies load gradually in the background.

Note: This is an initial workaround to improve loading behavior for large comment sets. The approach may evolve as we gather more community feedback, validate performance, and explore more robust long-term solutions.

Video

REC-20251127190803.mp4

@karthick-murugan karthick-murugan marked this pull request as ready for review November 27, 2025 16:14
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: karthick-murugan <karthickmurugan@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: TimothyBJacobs <timothyblynjacobs@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@karthick-murugan karthick-murugan changed the title Commeting scaling feature Commenting scaling feature Dec 1, 2025
@t-hamano t-hamano added [Type] Performance Related to performance efforts [Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting labels Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting [Type] Performance Related to performance efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure notes feature scales to many notes

2 participants