Skip to content

Repair wp/5.1 branch Actions: Wait for the caret before bolding in the writing flow test - #85677

Merged
desrosj merged 1 commit into
fix-actions-5.1/update-undo-snapshot-spacefrom
fix-actions-5.1/wait-for-caret-in-writing-flow-test
Oct 29, 2026
Merged

desrosj merged 1 commit into
fix-actions-5.1/update-undo-snapshot-spacefrom
fix-actions-5.1/wait-for-caret-in-writing-flow-test

Conversation

@desrosj

@desrosj desrosj commented Oct 26, 2026

Copy link
Copy Markdown
Member

Part of #83422.

What?

Makes adding blocks › should clean TinyMCE content in test/e2e/specs/writing-flow.test.js wait 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's RichText learns where the caret is only from the next selectionchange event. An event trace of failing runs showed the bold shortcut arriving first in every failure: RichText was selected and handled the shortcut, but its selection start and end were still undefined, so no format placeholder was rendered.

How?

Before Backspace, the test registers a selectionchange listener 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) when RichText stopped relying on the DOM for format boundaries.

Testing Instructions

A throwaway diagnostic ran links.test.js and writing-flow.test.js together 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

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Oct 26, 2026
@desrosj desrosj self-assigned this Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af9734f8-7410-4745-8827-2797f967c0bc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 27, 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.

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: desrosj <desrosj@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@ramonjd ramonjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests are passing. LGTM

@desrosj
desrosj force-pushed the fix-actions-5.1/wait-for-caret-in-writing-flow-test branch from 82e5de6 to fb6e0b1 Compare October 29, 2026 12:48
@desrosj
desrosj removed this pull request from stack #85678 October 29, 2026 17:59
@desrosj
desrosj force-pushed the fix-actions-5.1/wait-for-caret-in-writing-flow-test branch from fb6e0b1 to d20a156 Compare October 29, 2026 18:00
@desrosj
desrosj added this pull request to stack #85963 October 29, 2026 18:01
@desrosj
desrosj force-pushed the fix-actions-5.1/wait-for-caret-in-writing-flow-test branch from d20a156 to b1eb855 Compare October 29, 2026 20:21
@desrosj
desrosj merged commit c8256f2 into wp/5.1 Oct 29, 2026
6 checks passed
@desrosj
desrosj deleted the fix-actions-5.1/wait-for-caret-in-writing-flow-test branch October 29, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants