Skip to content

screenshot upload, closing - #1

Closed
BelKed wants to merge 141 commits into
mainfrom
t3/preview-dialogs-stay-in-tab
Closed

BelKed wants to merge 141 commits into
mainfrom
t3/preview-dialogs-stay-in-tab

Conversation

@BelKed

@BelKed BelKed commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Problem

In the desktop app, a page in a Browser tab that calls alert() or confirm() opens Electron's native app-modal box over the whole window. It appears even when you are in another thread and does not say which tab it came from.

When the agent answers with preview_dialog, the page gets the answer, but the native box stays until the tab closes. The last comment on pingdotgg#17518 reports the same thing. pingdotgg#32847 fixes the hang when answering, and leaves the native box alone.

Repro: open a page in the Browser panel and run confirm("Delete this draft?").

Change

  • Desktop: when a Browser guest attaches, its -run-dialog handler is replaced. The dialog stays pending on its tab as dialog in the tab state. It is answered over IPC (answerDialog) or by CDP Page.handleJavaScriptDialog. It clears on Page.javascriptDialogClosed, a main-frame navigation, a closed or replaced guest, or a destroyed guest, the same way Chrome dismisses dialogs on navigation.
  • Web: the desktop Browser panel shows the same dialog card as the streamed browser. The card moves out of ServerBrowserSurface into BrowserDialogCard, and its copy does not change.
  • The first answer wins, from the agent or the card, and closes the dialog everywhere.
Light Dark
Before Before, light Before, dark
After After, light After, dark

Scope

  • Bug fix for desktop Browser tabs only. The streamed browser already had the card.
  • prompt() is not supported in Electron renderers, so it never reaches this path.
  • Not covered: popup windows, beforeunload, and the mini player.
  • A dialog in a tab that is not shown waits like one in a background Chrome tab. The card shows when the tab is shown, and the agent sees it in preview_status.
  • -run-dialog and -cancel-dialogs are internal Electron events. The Electron version is pinned. If they are renamed, dialogs fall back to the native box, and nothing hangs.

Verification

  • PageDialogs.test.ts and new cases in Manager.test.ts cover these, and they fail on main:
    • hold, answer, and CDP close;
    • navigation dismiss;
    • a replaced, closed, or destroyed guest;
    • a dialog raised before the tab registers its guest.
  • Electron 44.10.1 script, outside the app:
    • The default handler opens the native box.
    • With the hold, Page.javascriptDialogOpening fires, and both a CDP answer and a card answer reach the page.
    • did-start-navigation fires while the dialog blocks, but the commit waits for the answer.
  • Real dev desktop app, test page with alert(), confirm() and a delayed alert():
    • No native box in any case.
    • Accept and Dismiss return true and false.
    • Refresh, typing a URL, and CDP Page.navigate with a pending dialog all load with no stale card.
    • An alert() on page load shows the card.
    • Closing the panel before a delayed alert() shows the card when the panel reopens.
  • vp run check:changed passes, except for the browser tests. They need Playwright Chromium, which is not installed locally.

Model: Claude Opus 5.5 and Claude Sonnet 5.5. Harness: Claude Code in T3 Code.

BelKed and others added 30 commits November 14, 2026 22:42
…ads (pingdotgg#34638)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…gg#22795)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ercent-encoded (pingdotgg#36929)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#15622)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…tgg#35135)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ses for them (pingdotgg#36950)

Co-authored-by: 0xpolarzero <0xpolarzero@gmail.com>
…ngdotgg#22614)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#30066)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…9466)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…dotgg#23134)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…t switches back (pingdotgg#30107)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…g#24140)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…dotgg#34636)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#30209)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
juliusmarminge and others added 26 commits November 14, 2026 18:46
…efusing it (pingdotgg#31661)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…gdotgg#31695)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ranch on its t3/ name (pingdotgg#31662)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Federico Lomurno <275704276+flomurno@users.noreply.github.com>
…other limits (pingdotgg#31748)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
… every folder for each expansion (pingdotgg#31465)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…dotgg#31781)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…nd draft rows (pingdotgg#31195)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#31593)

Co-authored-by: Matyas Rathonyi <matyasrathonyi@imac-server2.tailacc4a3.ts.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…text (pingdotgg#31780)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
@BelKed BelKed closed this Nov 15, 2026
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 15, 2026
@github-actions

Copy link
Copy Markdown

This PR changes the test suite by +134 test cases (browser +10, unit +66, server +58).

New browser test files: apps/web/src/components/chat/McpAppFrame.browser.test.tsx, apps/web/src/components/diffs/DiffFileTree.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

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

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.