Skip to content

Support the new Review Notes Experiment on a block-by-block basis#267

Merged
jeffpaul merged 10 commits intoWordPress:developfrom
dkotter:feature/review-notes-single
Mar 5, 2026
Merged

Support the new Review Notes Experiment on a block-by-block basis#267
jeffpaul merged 10 commits intoWordPress:developfrom
dkotter:feature/review-notes-single

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Mar 4, 2026

What?

In #260 we added an Experiment to review all your blocks and add Notes with review suggestions. This PR brings that same functionality to the individual block level, allowing you to run a review on an individual block instead of across all blocks.

Why?

All the core functionality is in place to support review on a single block and there may be times where a user wants to review a single block (think a single paragraph) rather than having to review the entire post. So this PR adds the ability to trigger review on a single block.

How?

  • Hook into BlockSettingsMenuControls to add a block toolbar button to supported blocks that can be used to trigger review. This is nested under the block More menu
  • Refactor code so it can easily be used to review a single block or review all blocks
  • When review is triggered on a single block (using the block toolbar button) the button shows a loading state and when finished, a snackbar notice is shown with a success message and the Notes area is automatically opened

Use of AI Tools

Used both Claude Code and Cursor running Sonnet 4.6 and GPT-5.3 Codex respectively to plan changes and implement most of those changes, with final review, testing and cleanup done by me

Testing Instructions

  1. Pull this PR down and run npm i && npm run build && composer install
  2. Add valid AI credentials
  3. Turn on the Review Notes Experiment
  4. Create a new post or edit an existing post
  5. Click into a paragraph or image block (as an example)
  6. Click into the More menu (three dots)
  7. Find the new Generate Review Note button and click on it
  8. Ensure a loading state is shown
  9. Once finished, ensure a success message is shown and the Notes panel opens up
  10. Ensure WordPress AI notes are there

Screenshots or screencast

Generate Review Note block toolbar button Generate Review Note block toolbar button showing loading state Open WordPress Playground Preview

@dkotter dkotter self-assigned this Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

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

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

@jeffpaul
Copy link
Member

jeffpaul commented Mar 4, 2026

Could also bury this option a bit more by placing it within the vertical 3 dot menu where the "Add note" button/link is. No real strong opinion on this, happy to land this as-is and iterate from community feedback.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.48%. Comparing base (3b059d9) to head (71f765d).
⚠️ Report is 11 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #267   +/-   ##
==========================================
  Coverage      57.48%   57.48%           
  Complexity       563      563           
==========================================
  Files             35       35           
  Lines           2907     2907           
==========================================
  Hits            1671     1671           
  Misses          1236     1236           
Flag Coverage Δ
unit 57.48% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@dkotter
Copy link
Collaborator Author

dkotter commented Mar 4, 2026

Could also bury this option a bit more by placing it within the vertical 3 dot menu where the "Add note" button/link is. No real strong opinion on this, happy to land this as-is and iterate from community feedback.

Yeah, wasn't sure exactly where to put this. It's nice at the top-level because it's easy to find but I never loved it there (easy to be confused on what it actually is). I've moved it to the nested menu now

@jeffpaul
Copy link
Member

jeffpaul commented Mar 4, 2026

Any chance of dropping this right after the Add note menu option? Perhaps updating to "Generate review note" to match the (oddly) sentence case here? Perhaps also replacing the icon with a keyboard shortcut of CAPSLOCK COMMAND M (to be simmilar to "Add note" one of OPTION COMMAND M)?

Screenshot 2026-03-04 at 1 56 26 PM

@dkotter
Copy link
Collaborator Author

dkotter commented Mar 4, 2026

Any chance of dropping this right after the Add note menu option?

As far as I can find (and had Claude and Cursor look as well) there's only two available slots here for us to use. One is what we're using now which drops things into the section before the section that has the Delete button (with no controls on where it shows in that section). Or there's a unstable API that adds it as the very first item in that menu. That may be better positioning though has the risk of using the unstable API.

Perhaps updating to "Generate review note" to match the (oddly) sentence case here?

I can update that to match

Perhaps also replacing the icon with a keyboard shortcut of CAPSLOCK COMMAND M (to be simmilar to "Add note" one of OPTION COMMAND M)?

I'm assuming you'd not just want to update the icon to be the shortcut but then also have that keyboard shortcut trigger this functionality? If so, the problem here is the loading state only shows on the button. So if someone uses the keyboard shortcut when the block is selected but they don't have that menu open, there isn't a loading state that shows (so no real way for them to know something is happening). I can look into ways to add a loading animation to the entire block if we think the keyboard shortcut would be useful.

Worth noting two other things:

  1. Looks like the keyboard shortcut for Notes is part of 7.0 (or when using the Gutenberg plugin). I don't see that on 6.9
  2. Looks like capslock is not a valid shortcut so we'd need to use something else (command, shift, option and control are all options)

@jeffpaul
Copy link
Member

jeffpaul commented Mar 4, 2026

Bah, I'd say just merge as-is and we can iterate once 7.0 is out and we get some feedback on the feature. No need to chase down these last couple of bits.

@jeffpaul jeffpaul self-requested a review March 4, 2026 23:11
@jeffpaul jeffpaul moved this to Needs review in WordPress AI Planning & Roadmap Mar 4, 2026
@jeffpaul jeffpaul added this to the 0.4.0 milestone Mar 4, 2026
@jeffpaul jeffpaul merged commit 213b339 into WordPress:develop Mar 5, 2026
18 of 24 checks passed
@github-project-automation github-project-automation bot moved this from Needs review to Done in WordPress AI Planning & Roadmap Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants