Editorial Updates: Fix missed updates for Pullquote and other value-based blocks - #930
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #930 +/- ##
==========================================
Coverage 75.84% 75.84%
Complexity 3021 3021
==========================================
Files 132 132
Lines 11966 11966
==========================================
Hits 9076 9076
Misses 2890 2890
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:
|
|
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. |
| * @param block The block to inspect. | ||
| * @return The editable text attribute. | ||
| */ | ||
| function getEditableTextAttribute( block: Block ) { |
There was a problem hiding this comment.
Couple suggestions:
- The
getBlockTextfunction we use elsewhere defaults tocontentand thenvalue. Here we default tovaluethencontent. I think ideal would be to standardize the two so there's never a mismatch - I'd recommend moving this function into the
src/utils/blocks.tsfile alongside the other block functions (likegetBlockText)
5a0143e to
9851d44
Compare
What, Why, and How?
The
Pullquoteblock can receive notes through theGenerate Editorial Notesflow, but clickingApply Editorial Updatesgenerates a successful response without updating the block.This happens because
Pullquotestores its primary text in thevalueattribute (Ref). Editorial Updates previously handled Image blocks throughaltand defaulted all other supported blocks tocontent, causing updates for Pullquote blocks to be written to the wrong attribute.This PR detects whether a block uses
valueand writes the generated update to that attribute when present. This fixes Pullquote updates and supports other value-based blocks in the future.Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.6
Used for: Code reviews and drafting the e2e test.
Testing Instructions
Screencast
Before
before.mov
After
after.mov
Changelog Entry