Skip to content

test(web): ChatMarkdown thread find waits for highlights to settle - #21121

Merged
juliusmarminge merged 1 commit into
mainfrom
test/chatmarkdown-find-mermaid-settle
Oct 18, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
test/chatmarkdown-find-mermaid-settle

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

ChatMarkdown.browser.test.tsx "highlights the indexed occurrences of SearchSourceAlpha in ```mermaid" flakes. It failed on #21118, which only touches the right panel test, and on an unrelated branch (run 39104001715). Both times it found [''] instead of ['SearchSourceAlpha'].

The test read the CSS highlights after a single animation frame. The Mermaid block renders lazily and can swap its source text after that frame, so the highlight range is briefly empty. The assertion now runs inside vi.waitFor. This test uses real timers, so waitFor actually polls. The neighbouring Mermaid test already waits the same way.

The thread-find tests pass 8 times in a row locally. Like the right panel flake, it never failed locally, so this rests on the reasoning above.

Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

The Mermaid case read CSS highlights right after one frame. The lazy diagram
block can swap its source text after that, leaving an empty range for a
moment, and the test failed on two unrelated PRs' CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 18, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 18, 2026
@github-actions github-actions Bot added the size:XS 0-9 changed lines (additions + deletions). label Oct 18, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f55388e

Macroscope's review found this PR approvable — This is a small, test-only change confined to an ignored path, adjusting assertion timing for asynchronously rendered highlights. It has no production runtime, product-default, schema, deployment, or static-analysis suppression impact.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: f2a7135a-0d6a-4c70-9ca8-ba53aa055b4f
📥 Commits

Reviewing files that changed from the base of the PR and between 8fbc22c and f55388e.

📒 Files selected for processing: 1
  • apps/web/src/components/ChatMarkdown.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The thread-find highlighting browser test now waits for the expected highlight ranges to settle before checking their count and text. The expected results are unchanged.

Changes: Thread-find highlight test

Layer / File(s) Summary
Wait for highlight ranges
apps/web/src/components/ChatMarkdown.browser.test.tsx
The test uses vi.waitFor to retry the highlight-range assertion until every range matches the query and expected count.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to f5538

This test-only change waits for the expected highlights to settle without changing production behavior. No merge-blocking risk remains.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the web test change and the reason for waiting for highlights to settle. It is concise and follows the repository's conventional commit style.
Description check Passed The description explains the flaky behavior, expected behavior, root cause, code change, affected test, verification results, and tooling used. It does not use the template headings or explicitly stat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the flaky behavior, expected behavior, root cause, code change, affected test, verification results, and tooling used. It does not use the template headings or explicitly state the scope or approval exemption, but the focused test-only change and linked CI failures provide sufficient context.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@juliusmarminge
juliusmarminge merged commit d0918f1 into main Oct 18, 2026
32 checks passed
@juliusmarminge
juliusmarminge deleted the test/chatmarkdown-find-mermaid-settle branch October 18, 2026 07:19
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 18, 2026
## What's Changed
* perf(mobile): Metro runs the React Compiler, with a coverage ratchet by @juliusmarminge in pingdotgg/t3code#20967
* perf(mobile): usage screens compile with the React Compiler by @juliusmarminge in pingdotgg/t3code#20969
* perf(mobile): Connect onboarding compiles with the React Compiler by @juliusmarminge in pingdotgg/t3code#20970
* perf(mobile): device preview compiles with the React Compiler by @juliusmarminge in pingdotgg/t3code#20971
* fix(android): foldable sidebar and layout fixes by @t3dotgg in pingdotgg/t3code#21071
* test(mobile): measure renders on a device by @juliusmarminge in pingdotgg/t3code#21001
* fix(web): Working threads can be dragged into chat as references again by @t3dotgg in pingdotgg/t3code#19697
* refactor(web): the command palette caches its derived lookups without "use memo" by @juliusmarminge in pingdotgg/t3code#21116
* feat(mobile): link, unlink and watch a thread's pull requests from its sheet by @flamboh in pingdotgg/t3code#20394
* test(web): the right panel Escape test advances fake frames until focus returns by @juliusmarminge in pingdotgg/t3code#21118
* test(web): ChatMarkdown thread find waits for highlights to settle by @juliusmarminge in pingdotgg/t3code#21121


**Full Changelog**: pingdotgg/t3code@v0.1.1-nightly.20261018.3285...v0.1.1-nightly.20261018.3302

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.1-nightly.20261018.3302
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 18, 2026
## What's Changed
* perf(mobile): Metro runs the React Compiler, with a coverage ratchet by @juliusmarminge in pingdotgg/t3code#20967
* perf(mobile): usage screens compile with the React Compiler by @juliusmarminge in pingdotgg/t3code#20969
* perf(mobile): Connect onboarding compiles with the React Compiler by @juliusmarminge in pingdotgg/t3code#20970
* perf(mobile): device preview compiles with the React Compiler by @juliusmarminge in pingdotgg/t3code#20971
* fix(android): foldable sidebar and layout fixes by @t3dotgg in pingdotgg/t3code#21071
* test(mobile): measure renders on a device by @juliusmarminge in pingdotgg/t3code#21001
* fix(web): Working threads can be dragged into chat as references again by @t3dotgg in pingdotgg/t3code#19697
* refactor(web): the command palette caches its derived lookups without "use memo" by @juliusmarminge in pingdotgg/t3code#21116
* feat(mobile): link, unlink and watch a thread's pull requests from its sheet by @flamboh in pingdotgg/t3code#20394
* test(web): the right panel Escape test advances fake frames until focus returns by @juliusmarminge in pingdotgg/t3code#21118
* test(web): ChatMarkdown thread find waits for highlights to settle by @juliusmarminge in pingdotgg/t3code#21121


**Full Changelog**: pingdotgg/t3code@v0.1.1-nightly.20261018.3285...v0.1.1-nightly.20261018.3302

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.1-nightly.20261018.3302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant