Repository navigation
fix(studio): ask about unsaved changes in the page; a native confirm() answers no unseen in the window - #760
Merged
Merged
Conversation
…) answers no unseen in the window Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
…ative dialogs; merge main Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
jay23606
added a commit
to jay23606/flutter-probe
that referenced
this pull request
Nov 17, 2026
…) answers no unseen in the window (AlphaWaveSystems#760) ## Summary Found in the native-window check: with unsaved changes, clicking another file did nothing. The only `confirm()` in the frontend (`openProbeFile`, "Discard unsaved changes?") is not shown by the window's webview and answers no, so the click was swallowed. (Playwright's headless browser shows native dialogs, which is why the browser specs never saw it.) - New `discard-dialog.ts` and a card in `index.html`, with the clear-data question's safe defaults: "Keep editing" is focused, Escape is a no, Enter on "Discard changes" does nothing (click or Space says yes), a click on the dark area is not an answer, Tab stays inside, one question at a time. - `goto-line` spec gl-03 now drives the in-page dialog (and fails if a native dialog appears) instead of accepting a native one: Escape, Enter-on-Discard (nothing), Keep editing, then Discard. - A node test fails on any `confirm(`, `alert(` or `prompt(` in `studio/frontend/src` (it ignores declarations such as `deps.confirm`, comments and strings); reintroducing the native call fails it (checked). I have not seen the native confirm fail in the real window myself; the report comes from the window check. The in-page dialog is correct either way. ## Test plan - [x] `npm run test:confirm` (incl. the new test), browser `goto-line` specs (8 passed) - [x] mutant: the native `confirm(` back in `main.ts` is caught - [x] disclosure scan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found in the native-window check: with unsaved changes, clicking another file did nothing. The only
confirm()in the frontend (openProbeFile, "Discard unsaved changes?") is not shown by the window's webview and answers no, so the click was swallowed. (Playwright's headless browser shows native dialogs, which is why the browser specs never saw it.)discard-dialog.tsand a card inindex.html, with the clear-data question's safe defaults: "Keep editing" is focused, Escape is a no, Enter on "Discard changes" does nothing (click or Space says yes), a click on the dark area is not an answer, Tab stays inside, one question at a time.goto-linespec gl-03 now drives the in-page dialog (and fails if a native dialog appears) instead of accepting a native one: Escape, Enter-on-Discard (nothing), Keep editing, then Discard.confirm(,alert(orprompt(instudio/frontend/src(it ignores declarations such asdeps.confirm, comments and strings); reintroducing the native call fails it (checked).I have not seen the native confirm fail in the real window myself; the report comes from the window check. The in-page dialog is correct either way.
Test plan
npm run test:confirm(incl. the new test), browsergoto-linespecs (8 passed)confirm(back inmain.tsis caught🤖 Generated with Claude Code
https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF