fix(desktop-browser): ask the user before a page's alert, confirm, or leave-site prompt is answered - #8432
fix(desktop-browser): ask the user before a page's alert, confirm, or leave-site prompt is answered#8432waleedlatif1 wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
… leave-site prompt is answered
…over reload leave prompts
cb2fcc6 to
ce07a73
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Summary
alertandconfirmon the user's own page now wait for the user in a Sim modal (titled with the page's host), instead of being answered instantly — a site's "Delete this?" no longer silently cancels. The user is only asked when the page is on screen and is theirs: the agent's page (not taken over), a hidden panel, or another chat's browser keep the shell answering, so there is no new friction for work the user did not startbeforeunload) from browser chrome — URL bar, Back/Forward, Reload, reload shortcuts — now asks "Leave site?": Stay keeps the page and its draft, Leave replays the navigation once. Electron decides an unload in two places (will-prevent-unloadand the CDP dialog), so both consult oneclaimUserLeavedecisionenable-page-dialogs, and older shells ignore that actionclaim: false) now leaves the new page unclaimed instead of inheriting the previous page's claim, matchingswitchTab's documented intentBrowserPageState.dialogandrespond-dialog/enable-page-dialogspanel actions in@sim/browser-protocolType of Change
Testing
apps/desktop/e2e/browser-page-dialogs.spec.ts(Playwright_electron, JSON check report toDESKTOP_BROWSER_DIALOGS_REPORT_PATH): shell still answers without the renderer opt-in; the user's confirm waits and their answer reaches the page; agent clicks (with and without a requested answer) never wait on the user; leaving a draft from the URL bar asks and Stay keeps it; Leave navigates without asking twice; the agent's unclaimed page and an off-screen panel stay automatic. Fails on staging at the user-confirm check, passes on this branch (3/3 repeats); removing the agent-ownership guard turns the agent check redbrowser-focus.spec.tsstill passes on this buildvitestdesktop (875) and sim browser suites (196), type-check both apps,bun run lint,check-block-registry,bun run check:audits,docs-manifest:checkChecklist
test-auditauthoring gate)