Fix Editorial Note generation spinner scope - to active block in block settings menu#794
Conversation
…pinner and notice
|
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 If 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@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? |
|
@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 |
What?
Closes #792
For the "Generate Editorial Note" option in Editorial Note experiment:
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
isReviewingboolean state, we now trackreviewingClientIdwhich stores the ID of the block currently under review /nullif none under review.This allows to check for
isReviewingi.e. any block is under review by evaluating!!reviewingClientIdi.e. truthy if a block ID is stored and false ifnull.By comparing
reviewingClientIdto 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
Screenshots or screencast
compressto10mbs.mov
Changelog Entry