Repository navigation
Repair wp/5.1 branch Actions: Wait for the caret before bolding in the writing flow test - #85677
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
aabf635 to
82e5de6
Compare
82e5de6 to
fb6e0b1
Compare
fb6e0b1 to
d20a156
Compare
d20a156 to
b1eb855
Compare
Part of #83422.
What?
Makes
adding blocks › should clean TinyMCE contentintest/e2e/specs/writing-flow.test.jswait for the new block's caret before pressing the bold shortcut.Why?
The test fails intermittently on
wp/5.1, receiving<p>Inside</p>instead of<p><strong>Inside</strong></p>. Backspace replaces the empty paragraph with a new default block, and that block'sRichTextlearns where the caret is only from the nextselectionchangeevent. An event trace of failing runs showed the bold shortcut arriving first in every failure:RichTextwas selected and handled the shortcut, but its selection start and end were stillundefined, so no format placeholder was rendered.How?
Before Backspace, the test registers a
selectionchangelistener that sets a flag once the selection is inside a newly focused contenteditable. After Backspace, it waits for that flag before pressing the shortcut. Upstream never fixed this test; it was deleted in 0f01eec (#13697) whenRichTextstopped relying on the DOM for format boundaries.Testing Instructions
A throwaway diagnostic ran
links.test.jsandwriting-flow.test.jstogether 30 times per variant (run 39531134819). The test failed in 10 of 30 runs with the unchanged spec and 0 of 30 with this change. ESLint passes on the file.Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code