Skip to content

Editorial Notes/Updates: Support multiple comments/notes per block - #1222

Merged
dkotter merged 9 commits into
WordPress:developfrom
yogeshbhutkar:editorial-notes/support-multiple-comments
Nov 4, 2026
Merged

dkotter merged 9 commits into
WordPress:developfrom
yogeshbhutkar:editorial-notes/support-multiple-comments

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What?

Closes #1221

Editorial Notes and Editorial Updates now support blocks with more than one Note thread.

Why?

Since WordPress/gutenberg#75147, a block can have several Note threads, so core stores metadata.noteId as an array of IDs instead of a single number.

Both features still expected a single number, which caused these bugs:

  • Editorial Notes: Creating the AI's Note on a block that already had a Note failed with an invalid parent error. Starting a new AI thread also overwrote the block's existing thread IDs, which detached those Notes from the block.
  • Editorial Updates: Blocks using the array format were ignored, because their noteId wasn't a number.

How?

Shared helpers (src/utils/notes.ts)

  • getNoteIds() reads noteId in either format and returns a clean list of unique IDs.

  • addNoteId() adds a new thread ID without removing existing ones. It keeps the single-number format unless the block already uses an array, so older WordPress versions keep working.

  • collectThreadTexts() gathers the root and reply texts for a set of threads, and both features use it.

  • The block and note types, the review/note-creation helpers and the revisions helpers moved out of the hooks into types/ and utils/ folders for each feature. The hooks now hold only the hook logic.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5.5
Used for: Drafting the changes, and stress testing them. I've reviewed the code and self-tested the changes.

Screencast

pr.mov

Changelog Entry

Fixed - Editorial Notes and Updates now support multiple comments/notes per block.

Open WordPress Playground Preview

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.90%. Comparing base (a8a1d4a) to head (ff77101).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1222   +/-   ##
==========================================
  Coverage      84.90%   84.90%           
  Complexity      4727     4727           
==========================================
  Files            182      182           
  Lines          17572    17572           
==========================================
  Hits           14920    14920           
  Misses          2652     2652           
Flag Coverage Δ
unit 84.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review October 26, 2026 11:30
@yogeshbhutkar
yogeshbhutkar requested a review from a team October 26, 2026 11:30
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

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: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@dkotter dkotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the backwards compat item I flagged, the changes here also break Editorial Updates. So I know the PR description mentions handling those changes separately but I think we'd want those bundled here so we don't merge code that breaks a feature

Comment thread src/utils/notes.ts Resolved
@jeffpaul jeffpaul added this to the 1.6.0 milestone Oct 28, 2026
@yogeshbhutkar
yogeshbhutkar force-pushed the editorial-notes/support-multiple-comments branch from 0121177 to 1e79111 Compare October 29, 2026 08:52
@yogeshbhutkar
yogeshbhutkar marked this pull request as draft October 29, 2026 08:52
@yogeshbhutkar
yogeshbhutkar force-pushed the editorial-notes/support-multiple-comments branch 2 times, most recently from 59ed032 to 2d9a495 Compare November 3, 2026 04:28
@yogeshbhutkar yogeshbhutkar changed the title Editorial Notes: Support multiple comments/notes per block Editorial Notes/Updates: Support multiple comments/notes per block Nov 3, 2026
@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review November 3, 2026 07:34
@yogeshbhutkar
yogeshbhutkar requested a review from dkotter November 3, 2026 07:40
Comment thread docs/experiments/editorial-updates.md Resolved
@yogeshbhutkar
yogeshbhutkar force-pushed the editorial-notes/support-multiple-comments branch from 7d07b6a to fd5c4b2 Compare November 4, 2026 05:08
@yogeshbhutkar
yogeshbhutkar requested a review from dkotter November 4, 2026 05:31
@dkotter
dkotter merged commit b2f708b into WordPress:develop Nov 4, 2026
36 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the editorial-notes/support-multiple-comments branch November 4, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editorial Notes: Fails to create Notes when a block has multiple Note threads

3 participants