Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖👋 Welcome👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @mdtanjid0! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. 🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
|
Thanks for contributing, @mdtanjid0! I think it's better to split the PR. We can extract the |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…laude/gutenberg-issue-84328-3bffa7 # Conflicts: # packages/editor/src/components/collab-sidebar/utils.js
…laude/gutenberg-issue-84328-3bffa7 # Conflicts: # packages/editor/CHANGELOG.md
|
@mdtanjid0 thanks for the effort here, I suggest closing this as not planned, see #84328 (comment) |
|
Thanks for contributing, @mdtanjid0! Closing based on the discussion in the issue: #84328 (comment). |

What?
Part of #84328
Selecting text and adding a note now creates an inline note in blocks whose text is stored in a
stringattribute or nested in another attribute. Before, these always got a block-level note.Now inline: Table cells, Navigation Link, Submenu, Home Link, Navigation Overlay Close, Search, Read More, Post Terms, Post Author (byline), Post Navigation Link, Post Excerpt ("read more" text), and Playlist (caption, not listed in the issue).
Why?
The listed blocks fail for three different reasons. This PR covers the first two:
wrapInlineNoteandremoveNoteFormatonly accepted aRichTextData, so astringattribute edited throughRichTextnever got a marker. The readers (findNoteRange,getNoteAtCaret) already handled strings.body.0.cells.1.content), but the helpers only read and wrote top-level attribute keys.identifier, so the selection carries noattributeKey. That is ablock-librarychange and is in Categories: Add the RichText identifier to the label #84522.How?
rich-textinblock.jsonisn't an option: arich-textattribute without a source fails validation on parse and the saved value is dropped.findNoteInBlockand the caret helpers walk nested attribute values and key them by the same dot-separated pathRichTextreports. A nested value is written back by copying its top-level attribute with the value replaced. The marker stays the only anchor; the path is found at read time.On the front end, markers in these attributes are removed by the existing
render_blockfilter. I checked Read More, Search (including the button'saria-label), Post Terms, Post Navigation Link, Post Author and Navigation Link.Not covered, happy to follow up or adjust based on what you prefer:
Testing Instructions
<mark>around it.Automated:
npm run test:unit -- packages/editor/src/components/collab-sidebar/test/utils.jsdom.test.jsnpm run test:e2e -- test/e2e/specs/editor/various/block-notes.spec.jsTesting Instructions for Keyboard
Same as above. Select the text with Shift+Arrow keys, press Shift+F10 on the block toolbar's Options button, and choose Add note.
Use of AI Tools
This PR was authored with Claude Code (Claude Opus 5.5). I reviewed the changes; the unit tests and the Chromium e2e tests for Notes were run locally.
🤖 Generated with Claude Code