Skip to content

fix(web): dismissing pull request checkout toast cancels handoff - #46801

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-checkout-toast-dismiss-cancels
Dec 1, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-checkout-toast-dismiss-cancels

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When the "Preparing the pull request checkout..." toast is dismissed, the draft still moves onto the pull request branch and the task still fills the composer instead of cancelling the handoff. On /pull-requests (PullRequestDetailPanel), even X fails to cancel; in usePullRequestHandoffs (/new?pr=..., branch toolbar), swipe and focused Escape fail.

Change

Move onClose from data.onClose to Base UI's top-level onClose in usePullRequestActions.ts, and mirror cancelled and top-level onClose in PullRequestDetailPanel.tsx. Base UI calls top-level onClose once from closeToast (used by X, swipe, and focused Escape); toastManager.update never calls it, and loading toasts have no auto-dismiss timer.

Scope

Bug fix in apps/web. An in-flight server checkout request is not aborted. Small fix; no issue needed.

Verification

  1. On /pull-requests, open a PR and click Check out → In a separate worktree (or open /new?pr=...).
  2. Dismiss "Preparing the pull request checkout..." (X, swipe right, or focused Escape).
  3. Wait and check branch/composer.

Setup: Linux Chromium, dark, 1280x800, isolated data (T3CODE_DEV_SEED=0). Steps: Start PR worktree checkout → dismiss toast → wait 25s.

eca5cb0c0f51a97a8a386812

/pull-requests X: switched to PR worktree

/pull-requests X: switched to PR worktree

/pull-requests X: stayed on current checkout

/pull-requests X: stayed on current checkout

/new?pr=... swipe: switched to PR, filled composer

/new?pr=... swipe: switched to PR, filled composer

/new?pr=... swipe: stayed on main, empty composer

/new?pr=... swipe: stayed on main, empty composer

/new?pr=... Escape: switched to PR, filled composer

/new?pr=... Escape: switched to PR, filled composer

/new?pr=... Escape: stayed on main, empty composer

/new?pr=... Escape: stayed on main, empty composer

Captures taken on eca5cb0c0f51 / a97a8a386812; both fix files are byte-identical at d5b65be8c0a6 (after test-only follow-up and test-only merge with 7a9d2131fa45).

Not shown: Mobile (no loading toast, lazy on send); macOS/Windows desktop (shared web UI, Linux verified).

Browser test proof (fail on base / pass on head), check:changed, and 2x100 stress summary

Also verified on a97a8a386812: happy paths (Checked out, Checkout ready), /pull-requests swipe and Escape dismissals.

Browser tests on base (eca5cb0c0f51) vs head (d5b65be8c0a6)

Command:

vp test run apps/web/src/components/pullRequest/usePullRequestActions.browser.test.tsx apps/web/src/components/pullRequest/PullRequestDetailPanel.permissions.browser.test.tsx

Base (eca5cb0c0f51) — 2 failed | 13 passed (15):

 ❯ src/components/pullRequest/usePullRequestActions.browser.test.tsx (6 tests | 1 failed)
   × stops a pull request handoff when its loading toast is dismissed via escape
 ❯ src/components/pullRequest/PullRequestDetailPanel.permissions.browser.test.tsx (9 tests | 1 failed)
   × stops a detail-panel checkout handoff when its loading toast is dismissed
 Test Files  2 failed (2)
      Tests  2 failed | 13 passed (15)

Head (d5b65be8c0a6) — 16 passed (16):

 ✓ src/components/pullRequest/usePullRequestActions.browser.test.tsx (6 tests)
 ✓ src/components/pullRequest/PullRequestDetailPanel.permissions.browser.test.tsx (10 tests)
 Test Files  2 passed (2)
      Tests  16 passed (16)

vp run check:changed on d5b65be8c0a6

check:changed summary
  pass  format  0.7s
  pass  lint  3.9s
  pass  knip  7.9s
  pass  typecheck (2 packages)  9.8s
  pass  test (2 files)  11.0s
  pass  react compiler (2 files)  1.4s

2x100 concurrent browser test stress run on d5b65be8c0a6

Loop a: 100/100 passed, 0 failed
Loop b: 100/100 passed, 0 failed

Generated with Gemini 4 Neon in T3 Code Nightly

Dismissing the "Preparing the pull request checkout..." loading toast by swiping or pressing Escape left the checkout handoff running in usePullRequestHandoffs because its cancellation callback was stored under data.onClose, which only the dismiss button invoked. The duplicate startHandoff in PullRequestDetailPanel did not wire toast dismissal cancellation at all, so even clicking the dismiss button left the checkout running.

Move the cancellation callback to Base UI's top-level onClose on toastManager.add in usePullRequestHandoffs and mirror that cancellation flow in PullRequestDetailPanel.
Await prepareThread before dismissing the loading toast in both pull request checkout browser tests so each test proves checkout preparation started prior to dismissal, and remove the vacuous Checkout ready dialog absence check.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Dec 1, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d5b65be

Macroscope's review found this PR approvable — Dismissing the checkout toast now cancels follow-on draft updates and task handoff in both entry points. Existing checkout modes and permissions remain unchanged, and already-started checkout work is not aborted.

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

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d5b65be and f71418c.

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

No actionable comments were generated in the recent review.

Walkthrough

The pull request updates pull-request handoff cancellation. Closing the loading toast stops checkout setup after thread creation or changes how the preparation result is handled. Browser tests cover Escape and notification-button dismissal, including conflict-resolution checkout.

Changes: Handoff cancellation

Layer / File(s) Summary
Stop handoff setup after dismissal
apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx, apps/web/src/components/pullRequest/usePullRequestActions.ts
The toast close callback records cancellation. startHandoff stops after thread creation if the toast was closed, and handles cancellation after checkout preparation.
Test dismissal during handoff
apps/web/src/components/pullRequest/PullRequestDetailPanel.permissions.browser.test.tsx, apps/web/src/components/pullRequest/usePullRequestActions.browser.test.tsx
Browser tests cover Escape and notification-button dismissal. They verify that the Fix or resolve button is enabled after preparation resolves, and that the draft has no branch or prompt.

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

Change: Bug fix

Suggested reviewers: stienswout, juliusmarminge

Merge Risk: Minimal · previous review d5b65

Dismissing the checkout loading toast now cancels the pull request handoff instead of letting it continue. The change is small and covered by browser tests. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: dismissing the pull request checkout toast now cancels the handoff. It follows the conventional commit format and matches the changed files, which move onClose to the …
Description check Passed The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the bug and the expected behavior. The Change section explains the onClose move and t…
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 names the main change: dismissing the pull request checkout toast now cancels the handoff. It follows the conventional commit format and matches the changed files, which move onClose to the top-level Base UI option and add cancellation handling.

Full details: Description check

Explanation

The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the bug and the expected behavior. The Change section explains the onClose move and the cancellation handling. The Scope section calls this a bug fix and says no issue is needed. The Verification section gives reproduction steps, browser test results on base and head, check results, and stress run results, with before/after screenshots. Minor gaps: the Scope section does not link an issue or a maintainer request, and it gives a reason for skipping one. The template also asks for a model and harness attribution at the end, and the description says it was generated with Gemini 4 Neon in T3 Code Nightly, so that line is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 77d0753 and d5b65be.

Files selected for processing: 4

  • apps/web/src/components/pullRequest/PullRequestDetailPanel.permissions.browser.test.tsx
  • apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
  • apps/web/src/components/pullRequest/usePullRequestActions.browser.test.tsx
  • apps/web/src/components/pullRequest/usePullRequestActions.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 1, 2026
@juliusmarminge
juliusmarminge force-pushed the fix/web-pr-checkout-toast-dismiss-cancels branch from f3c74ed to f71418c Compare December 1, 2026 14:08
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment for every capture: Linux web client, Chromium 156, 1280×800, light theme, fresh isolated database and synthetic checkout-demo project. Real GitHub PRs and server checkout operations; the driver holds genuine completion replies until dismissal, without fabricating responses.

  1. Open the /new?pr= link for #46628 with prompt 'REPRO-ESCAPE-PROMPT check this pull request'; click Check out, focus the preparing-checkout toast, and press Escape.
  2. After the toast disappears, release the held genuine server checkout reply and capture the draft after completion.
  3. Open /pull-requests with #36927 selected in the detail panel; choose Check out → In a separate worktree, then click the preparing toast's Dismiss notification button.
  4. Release that genuine checkout reply and capture the draft after completion. Run these same steps on both commits.

Scenario: Escape dismissing checkout prevents the late draft and prompt handoff

Proven: the scenario fails on base 89ba000739 and passes on head f71418c371.

Base 89ba000739 Head f71418c371
Result ❌ failed
ASSERTION_FAILED: Escape dismissal keeps the task prompt out of the composer: expected "REPRO-ESCAPE-PROMPT check this pull request" not to contain "REPRO-ESCAPE-PROMPT"
✅ passed
dismissed before checkout finishes Base 89ba000739: dismissed before checkout finishes Head f71418c371: dismissed before checkout finishes
draft after dismissed checkout completes Base 89ba000739: draft after dismissed checkout completes Head f71418c371: draft after dismissed checkout completes
detail dismissed before checkout finishes Base 89ba000739: detail dismissed before checkout finishes Head f71418c371: detail dismissed before checkout finishes
detail draft after dismissed checkout completes Base 89ba000739: detail draft after dismissed checkout completes Head f71418c371: detail draft after dismissed checkout completes
failure Base 89ba000739: failure
Recordings Before After
Both dismissal flows Before recording After recording
Full runner video Before full video After full video

Scenario source

Observed: base adopts both PR worktrees and fills the linked task prompt; head leaves both drafts on main with empty composers after the server checkouts complete.

Not shown:

  • Swipe gesture dismissal was not exercised; the recordings cover focused Escape and the detail-panel Dismiss notification button.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 1, 2026
@juliusmarminge
juliusmarminge merged commit 35b6c5f into pingdotgg:main Dec 1, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 1, 2026
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
Surgically ports 62 upstream Web UI fixes from pingdotgg/t3code
(772e3d4..1e6e7d7) into apps/web and scripts/scenarios while
preserving all 31 locked T4 customizations, T4 branding, and
t4-overrides.css.

Also restores React Compiler compilation for Sidebar by moving the
default new Set(...) parameter inside settleLaunchGroup into the
function body so switching threads produces 0 unaffected row re-renders.

Ported (62 commits):
- 1a08049 (pingdotgg#46481): right-panel launcher keys blocked while context menu open
- 6bdd718 (pingdotgg#46489): Enter restores highlighted stashed prompt (scenario e2e; web code already absorbed)
- 347f551 (pingdotgg#46490): Escape closes open context menu before layer beneath it
- afa3003 (pingdotgg#46487): workflows page uses width of wide window
- a2ba869 (pingdotgg#46485): keep joined emoji whole in screen-reader announcements
- a8ee725 (pingdotgg#46493): holding stash shortcut keeps prompt saved (scenario e2e; web code already absorbed)
- 5048c80 (pingdotgg#46499): Mod+S moves edited queued reply to prompt stash
- 179e6c3 (pingdotgg#46506): holding stash delete shortcut removes one prompt (scenario e2e; web code already absorbed)
- c101437 (pingdotgg#44079): fold PR diff whose header was clicked
- 9b27e5a (pingdotgg#46562): second Mod+T keeps right-panel Add menu shortcuts working
- 62cf1fe (pingdotgg#46592): wait for dialog focus before opening context menu over it
- fda1c30 (pingdotgg#46579): resting on issue row prefetches detail
- 28f0c93 (pingdotgg#46593): slash-command description tooltip closes when modal opens
- 789784b (pingdotgg#46603): keep selected tab in Workflows links
- 2bc37d9 (pingdotgg#46597): / and Mod+F in Settings ignore open context menu
- b21923b (pingdotgg#46640): effort shortcut closes nested Permissions menu in model picker
- a5a39fa (pingdotgg#46641): inline thread details card grows with interface font size
- 36983d6 (pingdotgg#46644): workflow runs open in resizable right panel
- 2ad902f (pingdotgg#46691): Mod+F on PRs page ignores open menu
- 97d727c (pingdotgg#46699): Link pull request dialog closes when leaving thread
- 7a9d213 (pingdotgg#46729): refuse saving edit to deleted project script action
- bdda9ce (pingdotgg#46745): settling open delegated task opens next thread
- 3763606 (pingdotgg#46760): command menu description tooltip closes on composer focus loss
- 00eae4b (pingdotgg#46764): reopen workflow run on first click
- 19094fd (pingdotgg#46765): boring sidebar folder rows offer snooze again
- dec756c (pingdotgg#46766): reopen last workflow run after hiding panel
- 33ce571 (pingdotgg#46777): keep workflow runs open behind tab menus
- a989ee8 (pingdotgg#46779): restore focus after closing workflow run
- 5c42b2e (pingdotgg#46786): reopen closed workflow run tabs
- caec30f (pingdotgg#46792): cancel tab drags when switching threads
- 27cf2cf (pingdotgg#46794): disable empty panel shortcuts as it closes
- d65936e (pingdotgg#46791): reveal all side panel tabs when they fit
- a9daa0b (pingdotgg#46781): right-panel shortcuts ignore presses while menu/dialog open
- 35b6c5f (pingdotgg#46801): dismissing PR checkout toast cancels handoff
- e9da1b0 (pingdotgg#46818): boring sidebar folder row actions keep height and clicks
- 9feac49 (pingdotgg#46855): long PR search preserves grapheme clusters
- acef160 (pingdotgg#46849): find shared voice dictionary by Japanese label
- 19da14d (pingdotgg#46796): scrolled right panel tabs no longer block chat titlebar drag
- 506bc36 (pingdotgg#46853): close guest share and handoff dialogs when leaving thread
- b4fd7ba (pingdotgg#46879): let Escape and app shortcuts pass through terminal font preview
- f5689ae (pingdotgg#46835): long history load errors wrap without timeline horizontal overflow
- 6b64b0c (pingdotgg#46890): focus command dialog popup when search input disabled
- 70c9da7 (pingdotgg#46900): focus PR Author/Labels filter search inputs on keyboard open
- 891bf1a (pingdotgg#46924): late slash results no longer open tooltip after focus leaves
- 80f0f8a (pingdotgg#46930): copying failed message keeps its images
- e9ca942 (pingdotgg#46659): show workflow question kinds only in filter
- aa8c7c7 (pingdotgg#46941): queued message moves to stash only once removed
- 3ea13b6 (pingdotgg#46940): editing answer while image prepares cancels held submit
- a143526 (pingdotgg#46970): pasting copied file over reattach marker no longer reports failure
- b33c330 (pingdotgg#47011): stub addComposerFilesToDraft with new return shape in test
- a0fb9d1 (pingdotgg#46974): Issues Labels/Assignee filters focus search on keyboard open
- cb525f4 (pingdotgg#47029): clicking anywhere on terminal or panel tab activates it
- 498a3b6 (pingdotgg#47022): syncing messages line no longer shifts whole chat
- e903c85 (pingdotgg#47046): pasted messages with thread link keep picture
- 6a13142 (pingdotgg#47013): limit style invalidation during right-panel resize
- cd8961e (pingdotgg#47078): pasting copied file no longer takes preparing screenshot slot
- 8d0fb4b (pingdotgg#47100): stop showing previous Usage period as loading after failure
- 515b8c9 (pingdotgg#47114): Tab from Permissions menu keeps focus inside model picker
- a681dd5 (pingdotgg#47125): middle-clicking file link no longer opens broken tab
- bbde8dc (pingdotgg#44842): use plus icon for project new-thread buttons
- 59af88f (pingdotgg#47105): switching threads no longer re-renders unaffected sidebar rows
- 1e6e7d7 (pingdotgg#47080): Reopen Closed Tab skips workflow runs removed from history

Already absorbed in HEAD (3 commits):
- 20a0e5f (pingdotgg#46927), a684090 (pingdotgg#47026), c557dab (pingdotgg#47076)

Skipped cleanly (3 commits):
- 70224ca (pingdotgg#46712): depends on unported ui/open-popups.tsx (pingdotgg#45341)
- cf475c4 (pingdotgg#47034): depends on unported ui/open-popups.tsx (pingdotgg#45341)
- be3cc6c (pingdotgg#47145): depends on unported fitsWithAllowance/workGroupOverflowAllowance in TimelineWorkGroupRows.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants