Skip to content

Categories: Add the RichText identifier to the label - #84522

Open
mdtanjid0 wants to merge 5 commits into
WordPress:trunkfrom
mdtanjid0:fix/accordion-heading-categories-rich-text-identifier
Open

mdtanjid0 wants to merge 5 commits into
WordPress:trunkfrom
mdtanjid0:fix/accordion-heading-categories-rich-text-identifier

Conversation

@mdtanjid0

@mdtanjid0 mdtanjid0 commented Oct 11, 2026 •

Copy link
Copy Markdown

What?

Part of #84328

Adds the missing identifier to the Categories label RichText. Split from #84337, as requested there.

The Accordion Heading part of this PR was dropped, since #84497 already fixed it on trunk.

Why?

Without an identifier, RichText stores the selection without an attributeKey, so features that map the selection back to a block attribute can't find it. For Notes, readInlineSelection returns null and selecting text in the label always adds a block-level note.

How?

identifier="label", matching the attribute the RichText edits.

The Categories label is a string attribute, not rich-text, so this change alone doesn't enable inline notes on the label. It also needs #84337, which adds inline notes for string attributes.

Testing Instructions

  1. Check out this branch with Notes: Add inline notes to text in string and nested attributes #84337 applied.
  2. Open a post and enable Notes from the Options menu > Notes > All notes.
  3. Insert a Categories block and enable "Show label" in the block settings.
  4. Select part of the label text, choose Add note from the block options menu, and send the note.
  5. The selected text is highlighted, and the note is anchored to it instead of the whole block.

Without #84337, the note is still added at the block level, same as trunk. Nothing else should change.

Testing Instructions for Keyboard

Same as above. Select the text with Shift+Arrow keys.

Use of AI Tools

This PR was authored with Claude Code (Claude Opus 5.5). I reviewed the change. The Categories label was not tested by hand.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🤖 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.

🎉 Props

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: mdtanjid0 <mdtanjid@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 11, 2026
@t-hamano t-hamano added [Block] Categories Affects the Categories Block [Block] Accordion Affects the Accordion Block labels Oct 12, 2026

@t-hamano t-hamano 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.

Hi @mdtanjid0, since the issue with the Accordion Heading block was resolved in #84497, could you rebase this PR and focus only on the Categories block?

mdtanjid0 and others added 2 commits October 15, 2026 15:59
WordPress#84497 already covers Accordion Heading on trunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdtanjid0 mdtanjid0 changed the title Accordion Heading, Categories: Add the RichText identifier Categories: Add the RichText identifier to the label Oct 15, 2026
@mdtanjid0

Copy link
Copy Markdown
Author

Thanks @t-hamano! Updated with trunk and dropped the Accordion Heading change, since #84497 covers it. This PR now only sets identifier="label" on the Categories label RichText. Since label is a string attribute, inline notes there also depend on #84337.

@t-hamano t-hamano 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.

LGTM!

Comment thread packages/block-library/CHANGELOG.md Outdated
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @mdtanjid0!

I applied @t-hamano's suggestion to the changelog. Let's merge this once the checks pass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Accordion Affects the Accordion Block [Block] Categories Affects the Categories Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants