Repository navigation
Repair wp/5.1 branch Actions: Wait for the caret before bolding in the writing flow test - #830
Closed
desrosj wants to merge 1 commit into
Conversation
|
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. |
Backspace in the empty paragraph replaces it with a new default block. That block's RichText learns where the caret is only from the next `selectionchange` event. When the bold shortcut arrived first, RichText had no caret position, so no format placeholder was rendered and "Inside" was typed without bold. Wait for a `selectionchange` in the newly focused block before pressing the shortcut. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013wZdkg9DSpSbQmRpBymFfV
desrosj
force-pushed
the
fix-actions-5.1/wait-for-caret-in-writing-flow-test
branch
from
October 26, 2026 19:14
307ec6b to
7410be0
Compare
Owner
Author
|
Moved to WordPress#85677. |
desrosj
deleted the
fix-actions-5.1/wait-for-caret-in-writing-flow-test
branch
October 29, 2026 22:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 WordPress@0f01eec (WordPress#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
https://claude.ai/code/session_013wZdkg9DSpSbQmRpBymFfV