Skip to content

Fix Editorial Note generation spinner scope - to active block in block settings menu#794

Merged
dkotter merged 7 commits into
WordPress:developfrom
Intenzi:fix/editorial-notes-block-spinner
Jun 29, 2026
Merged

Fix Editorial Note generation spinner scope - to active block in block settings menu#794
dkotter merged 7 commits into
WordPress:developfrom
Intenzi:fix/editorial-notes-block-spinner

Conversation

@Intenzi

@Intenzi Intenzi commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #792

For the "Generate Editorial Note" option in Editorial Note experiment:

  • Shows the "Reviewing..." loading spinner only on the actual clicked block, instead of showing it on every content block's option menu.
  • Displays an additional info for the other blocks stating that a review process is ongoing for another block.

Why?

It solves a visual bug where running an AI review on one block makes it look like every block is being reviewed.

How?

This is address by tracking the specific block ID under review instead of a global true/false state, other blocks correctly show as disabled with an explanation (Another block is currently being reviewed) rather than showing a confusing loading spinner.

  • Instead of using a simple isReviewing boolean state, we now track reviewingClientId which stores the ID of the block currently under review / null if none under review.

  • This allows to check for isReviewing i.e. any block is under review by evaluating !!reviewingClientId i.e. truthy if a block ID is stored and false if null.

  • By comparing reviewingClientId to the current block's ID, we only show the "Reviewing..." text and loading spinner conditionally to the under review block only.

  • And for non equality, where we know a review is still occurring, the menu item remains as "Generate Editorial Note" and displays an additional info label of "Another block is currently being reviewed." while staying disabled.

  • Added an e2e test to verify the same.

Use of AI Tools

AI assistance: Yes
Tool(s): Antigravity IDE
Model(s): Gemini 3.5 Flash (Low)
Used for: Identifying the relevant files for the fix, suitable resolutions and E2E test implementation. Final implementation and tests were reviewed and edited by me.

Testing Instructions

  1. Enable Editorial Note experiment.
  2. Open the post editor and insert two paragraph blocks with enough content to run AI Editorial reviews.
  3. Select the first block, click the "Options" (three dots) button in the block toolbar, and click "Generate Editorial Note".
  4. While the review is running (spinner showing on the first block), select the second block and click its "Options" button in the block toolbar.
  5. Observe the menu item for Editorial Notes on the second block:
  6. It should display the "Generate Editorial Note" label but disabled, along with helper info text indicating that "Another block is currently being reviewed."

Screenshots or screencast

compressto10mbs.mov

Changelog Entry

Fixed - Scope the Editorial Note generation loading spinner only to the block currently being reviewed.

Open WordPress Playground Preview

@github-actions

github-actions Bot commented Jun 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. 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: Intenzi <intenzi@git.wordpress.org>
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.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.48%. Comparing base (11bef15) to head (1af82c6).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #794   +/-   ##
==========================================
  Coverage      76.48%   76.48%           
  Complexity      1869     1869           
==========================================
  Files             89       89           
  Lines           7990     7990           
==========================================
  Hits            6111     6111           
  Misses          1879     1879           
Flag Coverage Δ
unit 76.48% <ø> (ø)

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.

@jeffpaul jeffpaul added this to the 1.1.0 milestone Jun 26, 2026
@jeffpaul

Copy link
Copy Markdown
Member

@Intenzi any reason we're blocking other blocks from kicking off a single block editorial review? Can multiple editorial reviews on single blocks NOT run at the same time?

@Intenzi

Intenzi commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

@jeffpaul Yeah, thats definitely something we could look into as an enhancement! The decision to block concurrent reviews is existing behaviour that we inherited, we were already utilising reviewBlocked to prevent other blocks from being reviewed simultaneously. The goal of this PR was to fix the UX of that existing decision ^-^

Comment thread src/experiments/editorial-notes/components/EditorialNotesPlugin.tsx Outdated
Comment thread tests/e2e/specs/experiments/editorial-notes.spec.js Outdated
@dkotter dkotter modified the milestones: 1.1.0, 1.2.0 Jun 29, 2026
@dkotter dkotter modified the milestones: 1.2.0, 1.1.0 Jun 29, 2026
@dkotter dkotter merged commit 9394765 into WordPress:develop Jun 29, 2026
26 checks passed
@dkotter dkotter mentioned this pull request Jun 29, 2026
32 tasks
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 Note generation spinner shows on all blocks' settings menu

3 participants