Skip to content

test(web): source control writing settings test waits for the reset button - #30372

Merged
Yash-Singh1 merged 1 commit into
mainfrom
t3/fix-source-control-writing-settings-flake
Nov 5, 2026
Merged

Yash-Singh1 merged 1 commit into
mainfrom
t3/fix-source-control-writing-settings-flake

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

SourceControlWritingSettings.browser.test.tsx > "resets mixed template preferences without replacing each environment's instructions" fails now and then in CI with expected "vi.fn()" to be called 1 times, but got 0 times (failing job, on a PR that doesn't touch this area).

Root cause

The reset button sits inside the Advanced fold, a Base UI CollapsiblePanel that animates its height over 200ms with overflow: hidden. The test clicked the button right after opening the fold, while the panel was still animating:

  1. Playwright's visible and stable checks pass mid-animation, because the button's own box is non-empty and doesn't move while the panel grows.
  2. To reach the clipped button, Playwright scrolls the overflow: hidden panel. A diagnostic run logged the panel at height: 0.2px with scrollTop: 39 when pointerdown hit the button.
  3. As the panel keeps growing, the browser clamps scrollTop, and the content, button included, moves down.
  4. Playwright checks the hit target only on the first pointer event. If the button moves between press and release, click fires on a common ancestor, so onClick never runs and updateSettings is never called.

There's no async step between the click and updateSettings (the reset onClick calls it synchronously), so wrapping the assertions in vi.waitFor would not help: the click itself is lost. The component has no race either: a person can't click a button that is still clipped.

Fix

Before clicking, wait until the button is fully visible: await expect.element(button).toBeInViewport({ ratio: 1 }). toBeInViewport uses an IntersectionObserver, which accounts for clipping by the panel. Once the button is fully visible at scrollTop: 0, Playwright doesn't scroll the panel, and the rest of the animation doesn't move the button.

Verification

A loaded runner lengthens the gap between Playwright's press and release, so the repro sets Playwright's click delay (the hold between mousedown and mouseup), with the real 200ms transition left as is:

  • Before (main), 6 runs per hold of 10/30/60/100ms: 11 of 24 failed with the CI error, every one at 60ms or 100ms.
  • After, same sweep: 24/24 passed. 12 runs per hold under 16 yes > /dev/null stressors: 48/48 passed.
  • The unmodified test passes, and vp run check:changed passes.

Plain CPU stress (40 repeats with 16 stressors) and Chromium CPU throttling did not reproduce the failure on their own on this machine.

Model and harness: Claude Opus 5.5 in Claude Code, run from T3 Code.

🤖 Generated with Claude Code

…utton

The test clicked the reset button while the Advanced panel was still
animating open. Playwright scrolled the clipped panel to reach the button,
and the growing panel shifted it between press and release, so the click
missed and updateSettings was never called. Wait until the button is fully
visible before clicking.

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 Nov 3, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bc8162d

Macroscope's review found this PR approvable — The change is confined to an ignored browser-test path and is described as waiting for the reset button to become visible before clicking. No material production behavior or product-default change is indicated.

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 Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The browser test now waits for the “Reset change request templates” button to be fully in the viewport after opening Advanced and before clicking it. Existing assertions remain unchanged.

Changes: Reset button browser test

Layer / File(s) Summary
Wait for reset button visibility
apps/web/src/components/settings/SourceControlWritingSettings.browser.test.tsx
The test documents the panel-scroll and click-timing issue, then waits for the reset button to be fully in the viewport before clicking it.

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

Change: Other

Possibly related PRs

  • pingdotgg/t3code#25651: Adds the Advanced settings panel that contains the reset row tested here.
  • pingdotgg/t3code#28842: Places the source-control template controls in Advanced settings and updates the related test flow.

Suggested reviewers: maria-rcks

Merge Risk: Minimal · up to bc816

The test now waits for full viewport visibility before clicking, with no identified merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the problem, the root cause, the fix, and verification. The Problem section describes the flaky CI failure and its error text. The Change section explains why waiting for the bu… Add a "Scope and approval" section. Link the triaged bug issue or the discussion where a maintainer approved this direction, including the approval comment. If no issue or discussion exists, explain why this test-only fix for an obvious fla…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title "test(web): source control writing settings test waits for the reset button" matches the one-file change. The change makes the browser test wait for the Reset change request templates button…
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: Title check

Explanation

The title "test(web): source control writing settings test waits for the reset button" matches the one-file change. The change makes the browser test wait for the Reset change request templates button to be in the viewport before clicking it. The title is specific and uses a conventional commit prefix. It is a test-only fix, so the title describes the main change.

Full details: Description check

Explanation

The description covers the problem, the root cause, the fix, and verification. The Problem section describes the flaky CI failure and its error text. The Change section explains why waiting for the button to be fully in the viewport fixes the race. The Verification section gives repro counts before and after the fix and lists the checks that ran. The template's Scope and approval section is missing. The author does not link a triaged issue or maintainer approval, and does not explain why the change qualifies as a small, obvious fix without prior approval. The description also has no before/after screenshots, but the template only requires them for UI changes, and this change is test-only. The description is mostly complete, but the missing Scope and approval section is a required gap.

Resolution

Add a "Scope and approval" section. Link the triaged bug issue or the discussion where a maintainer approved this direction, including the approval comment. If no issue or discussion exists, explain why this test-only fix for an obvious flake qualifies as a very small, focused fix without prior approval. Remove the trailing HTML comment and template prose from the final description if they were copied in.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d1ec71e and bc8162d.

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

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

@github-actions github-actions Bot added the size:XS 0-9 changed lines (additions + deletions). label Nov 3, 2026
@Yash-Singh1
Yash-Singh1 merged commit e402c94 into main Nov 5, 2026
30 checks passed
@Yash-Singh1
Yash-Singh1 deleted the t3/fix-source-control-writing-settings-flake branch November 5, 2026 20:22
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 6, 2026
**v0.1.8-nightly.20261106.4247** · 67 changes from 19 contributors

- **Environment dictation.** Choose an environment for dictation in web and desktop, including desktop browser annotations.
- **Fresh sessions.** Use /clear to start a fresh session without leaving your thread.
- **Scheduled task sessions.** Run scheduled tasks in one thread, either continuing the conversation or starting fresh each time.
- **Secret requests.** Answer secret requests using a secret provider instead of copying and pasting credentials.
- **Snooze questions.** Snooze a thread with a pending question and answer it later.
- **Claude Ultracode.** Use Ultracode at any effort level, including with Claude Sonnet 5.5 and Haiku 5.5.
- **Faster pull requests.** Pull requests open faster using data already available in the app.

### Plus 31 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(threads): side chats inherit parent permissions by default by @extoci in pingdotgg/t3code#31114
* fix(server): threads follow their worktree's branch changes by @Yash-Singh1 in pingdotgg/t3code#31599
* fix(pi): usage reports include sessions stored in a --session-dir launch argument by @saphid in pingdotgg/t3code#30690
* perf(mobile): skip unchanged terminal toolbar fade updates by @saphid in pingdotgg/t3code#25312
* perf(mobile): assemble HTML replacements in one pass by @saphid in pingdotgg/t3code#25278
* perf(mobile): skip canceled SVG parsing by @saphid in pingdotgg/t3code#25314
* test(server): strengthen v1 cutover proof with event-stream waits and content snapshots by @saphid in pingdotgg/t3code#11869
* fix(contracts): a stored secret reference is always sensitive by @yordis in pingdotgg/t3code#31403
* fix(server): a settings save no longer reads an unreadable secret again by @yordis in pingdotgg/t3code#31226
* fix(threads): allow snoozing pending input requests by @saphid in pingdotgg/t3code#20058
* fix(server): repair cutover test crypto import breaking main CI by @Yash-Singh1 in pingdotgg/t3code#31630
* feat(server): sends can start a fresh provider session by @juliusmarminge in pingdotgg/t3code#30323
* feat: /clear starts a fresh session in the same thread by @juliusmarminge in pingdotgg/t3code#30325
* feat: scheduled tasks can run in one thread with a fresh session each run by @juliusmarminge in pingdotgg/t3code#30326
* fix(web): dragging a sidebar thread no longer scrolls the list out from under the pointer by @juliusmarminge in pingdotgg/t3code#30346
* fix(assets): preserve the PR repository for GitHub media by @juliusmarminge in pingdotgg/t3code#21631
* fix(server): load PR uploads from SSO organizations by @juliusmarminge in pingdotgg/t3code#21632
* fix(mobile): the Duo inspector stops at its widest instead of vanishing by @juliusmarminge in pingdotgg/t3code#31665
* test(server): launcher PATH lookup test no longer drops the Windows drive letter by @tris203 in pingdotgg/t3code#22534
* test(server): replay tests delete their temp directories by @only21mil in pingdotgg/t3code#23445
* fix(mobile): transcribe Android audio during recording by @PixPMusic in pingdotgg/t3code#31300
* test(web): linked-environment subagents keep opening in their own thread by @RealDoc06 in pingdotgg/t3code#26492
* test(server): pin post-commit outbox settle boundary by @Narayan201120 in pingdotgg/t3code#27560
* test: remove unreachable github cli decoding test by @t3-code-bot[bot] in pingdotgg/t3code#28115
* test(server): retain delegated child events when detaching a parent by @benjamin-di in pingdotgg/t3code#29622
* test(lint): pin which ResizeObserver constructions no-raw-resize-observer reports by @only21mil in pingdotgg/t3code#28781
* test(mobile): drop two deleted tests from the React test list by @only21mil in pingdotgg/t3code#28800
* test(web): worked-for expand test waits for the timeline to finish loading by @saphid in pingdotgg/t3code#29661
* test(web): avoid PDF worker startup timeouts in attachment tests by @voltcrash in pingdotgg/t3code#29933
* test(web): source control writing settings test waits for the reset button by @juliusmarminge in pingdotgg/t3code#30372
* test(web): keep the work heading test inside the viewport by @voltcrash in pingdotgg/t3code#30613
* test: use an empty config file instead of the null device for git fixtures on Windows by @Pyseph in pingdotgg/t3code#30772
* test: remove stale tests for unused thread and onboarding helpers by @t3-code-bot[bot] in pingdotgg/t3code#30817
* test(server): correct Windows path and settings assertions by @ElliotDrel in pingdotgg/t3code#30983
* feat(claude): Ultracode works with any effort, like Claude Desktop by @Bil0000 in pingdotgg/t3code#27034
* perf(pr): pull requests paint from data already held, on web, desktop and mobile by @Bil0000 in pingdotgg/t3code#27798
* fix(mobile): approval card buttons line up by @shivamhwp in pingdotgg/t3code#31415
* fix(gitlab): author names link to GitLab profiles by @TonybynMp4 in pingdotgg/t3code#30418
* fix(gitlab): merge messages drop agent credits by @TonybynMp4 in pingdotgg/t3code#30441
* fix(gitlab): file and image comments appear as review threads by @TonybynMp4 in pingdotgg/t3code#30425
* fix(web): screen readers no longer read out a secret typed into the request card by @juliusmarminge in pingdotgg/t3code#31653
* perf(pr): actions update every client from the host's reply instead of re-reads by @Bil0000 in pingdotgg/t3code#25761
* feat(mobile): start side chats with /side by @juliusmarminge in pingdotgg/t3code#31709
* feat(claude): expose Ultracode on Claude Sonnet 5.5 and Haiku 5.5 by @DrSeedon in pingdotgg/t3code#30781
* feat(settings): Simlock, Antigravity and OpenCode credentials can come from a secret provider by @juliusmarminge in pingdotgg/t3code#31652
* refactor(mobile): screens declare what they are; layout and AppBar own every platform bar decision by @juliusmarminge in pingdotgg/t3code#31310
* fix(server): a saved source control token that can't be read no longer falls back to another account by @juliusmarminge in pingdotgg/t3code#31646
* feat(secrets): answer a secret request with a secret provider reference by @juliusmarminge in pingdotgg/t3code#31670
* fix(settings): removing a secret provider clears the fields that used it by @juliusmarminge in pingdotgg/t3code#31651
* docs(user): explain secret providers and secret requests by @juliusmarminge in pingdotgg/t3code#31654
* feat(server): transcribe audio on a chosen environment by @juliusmarminge in pingdotgg/t3code#30625
* feat(web): opt into environment dictation on this device by @juliusmarminge in pingdotgg/t3code#30623
* feat(desktop): dictate into browser annotations with the same consent by @juliusmarminge in pingdotgg/t3code#30624
* feat(mobile): opt in to dictation on a paired environment by @juliusmarminge in pingdotgg/t3code#31059
* fix(web): keep the folder path caret in place while editing by @juliusmarminge in pingdotgg/t3code#31642
* perf(mobile): call the highlights lexer through Nitro, up to 10x faster calls on Android by @camchis in pingdotgg/t3code#31188
* fix(claude): turns use the downloaded model catalog by @juliusmarminge in pingdotgg/t3code#31717
* fix(gitlab): bot authors are flagged as bots by @TonybynMp4 in pingdotgg/t3code#30383
* fix(gitlab): merge requests can edit their labels by @TonybynMp4 in pingdotgg/t3code#30483
* perf(mobile): faster thread sync, connects, and reconnects on bad wifi by @Bil0000 in pingdotgg/t3code#28487
* fix(mobile): iPad composer drops when the keyboard floats or minimizes by @juliusmarminge in pingdotgg/t3code#31251
* perf(mobile): stop iOS syntax highlighting from looking up a thread-local on every lexer call by @camchis in pingdotgg/t3code#31187
* fix(gitlab): edited comments wake PR watchers by @TonybynMp4 in pingdotgg/t3code#30403

## New Contributors
* @benjamin-di made their first contribution in pingdotgg/t3code#29622
* @ElliotDrel made their first contribution in pingdotgg/t3code#30983
* @DrSeedon made their first contribution in pingdotgg/t3code#30781

**Full Changelog**: pingdotgg/t3code@v0.1.8-nightly.20261105.4234...v0.1.8-nightly.20261106.4247

</details>


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

Labels

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.

2 participants