Skip to content

Use a locator to wait for bracket marks to clear - #268

Merged
jserv merged 1 commit into
sysprog21:mainfrom
matthiola0:wait-editor-selection-paint
Oct 10, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
matthiola0:wait-editor-selection-paint

Conversation

@matthiola0

@matthiola0 matthiola0 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

CI for #263 failed in the editor cache test with 2 !== 1. Checking the assertion and repaint scheduling suggested a timing issue. I confirmed the ordering locally with a DOM trace and a controlled delay.

The trace showed the bracket marks being cleared after the counter reset, while the editor text was still unchanged. The selection repaint is queued through requestAnimationFrame, but the test resets the counter and replaces the text without waiting for it to finish. It can then count both operations and fail even when the editor behaves correctly.

This waits for the bracket marks to clear after selecting all text, then resets the counter before replacing the text. The expected count remains one.

Main now includes this wait through #252. After rebasing, the remaining changes are the locator wait suggested in review and a comment explaining why the selection repaint must finish before resetting the counter.

cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of writing Related to #263, explain the rationale and context that emerged during CI checks and the review of PR #263.

@jserv
jserv requested review from ColtenOuO and alanhc October 9, 2026 22:37
@sysprog21 sysprog21 deleted a comment from matthiola0 Oct 10, 2026
Comment thread tests/browser/editor-pipeline.test.js Outdated
@matthiola0
matthiola0 force-pushed the wait-editor-selection-paint branch from ffab3a7 to b3b5128 Compare October 10, 2026 15:37

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Check https://cbea.ms/git-commit/ carefully and enforce the rules.

@matthiola0
matthiola0 force-pushed the wait-editor-selection-paint branch from b3b5128 to 0136f88 Compare October 10, 2026 16:37
The editor cache test already waits for bracket marks to clear before
resetting the paint counter. Express the wait with a locator so the
expected DOM state is clear, and document why the wait is needed.
@matthiola0
matthiola0 force-pushed the wait-editor-selection-paint branch from 0136f88 to bf39687 Compare October 10, 2026 17:14
@matthiola0 matthiola0 changed the title Wait for bracket marks to clear in the editor test Use a locator to wait for bracket marks to clear Oct 10, 2026
@jserv
jserv merged commit 6d556b7 into sysprog21:main Oct 10, 2026
6 checks passed
@jserv

jserv commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Thank @matthiola0 for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants