Skip to content

test(web): the right panel Escape test advances fake frames until focus returns - #21118

Merged
juliusmarminge merged 1 commit into
mainfrom
test/right-panel-escape-focus-timers
Oct 18, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
test/right-panel-escape-focus-timers

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

RightPanelTabs.keyboard.browser.test.tsx "uses a custom binding from a text field and closes on Escape" still flakes after #21030. It failed on main CI for 16918b5, which includes that change, and on #21116, which doesn't touch the right panel. In both, focus ended on <body> instead of the "Add panel surface" trigger.

The test runs on fake timers. vi.waitFor advances them outside act, so React doesn't always flush the menu's close and its focus restore before waitFor gives up. The test now advances frames inside act, the same way its press helper does, for up to 10 frames until focus returns, then asserts.

The test passes 15 times in a row locally. The old version also passed locally every time, so the evidence for this fix is the reasoning above, not a local reproduction. If it flakes on CI again, the next step is to stop relying on focus restore timing in this test at all.

Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

…us returns

The test runs on fake timers, so vi.waitFor advanced time outside act and
React did not always flush the menu close and focus restore before it gave
up. It still failed on main CI twice after the waitFor change. Each frame is
now advanced inside act, like the test's press helper does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels 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
@macroscopeapp

macroscopeapp Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 87f500d

Macroscope's review found this PR approvable — This is a narrowly scoped browser-test timing adjustment in an ignored test path, with no production runtime or customer-facing behavior impact. It does not alter product defaults or static-analysis configuration.

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: 91accc08-0baf-4147-9306-04d50058894f
📥 Commits

Reviewing files that changed from the base of the PR and between 8f02648 and 87f500d.

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

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

📝 Walkthrough

The focus-restoration browser test replaces vi.waitFor polling with fake animation-frame advancement. It checks for focus on the menu trigger for up to 10 frames, then asserts focus.

Changes: Focus restoration test

Layer / File(s) Summary
Frame-based focus assertion
apps/web/src/components/RightPanelTabs.keyboard.browser.test.tsx
The test advances up to 10 fake animation frames and checks whether focus has returned to the menu trigger before asserting focus.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Suggested reviewers: bil0000

Merge Risk: ⚪ Minimal · up to 87f50

This update changes how the browser test waits for focus restoration while retaining its assertion. The supplied context identifies no actionable merge-blocking risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the changed web test and the new fake-frame advancement behavior.
Description check Passed The description explains the flaky test, the cause, the fix, and the verification results. It does not use the required section headings or provide a clear scope-and-approval statement, but the core i…
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 test, the cause, the fix, and the verification results. It does not use the required section headings or provide a clear scope-and-approval statement, but the core information is complete.

✨ 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.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 87f500d.

This comment will update automatically after the next completed run.

@juliusmarminge
juliusmarminge merged commit c524537 into main Oct 18, 2026
47 of 49 checks passed
@juliusmarminge
juliusmarminge deleted the test/right-panel-escape-focus-timers branch October 18, 2026 07:17
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:S 10-29 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