Skip to content

fix(studio): ask about unsaved changes in the page; a native confirm() answers no unseen in the window - #760

Merged
pbertsch merged 2 commits into
mainfrom
fix/native-confirm
Nov 17, 2026
Merged

pbertsch merged 2 commits into
mainfrom
fix/native-confirm

Conversation

@pbertsch

Copy link
Copy Markdown
Member

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

  • npm run test:confirm (incl. the new test), browser goto-line specs (8 passed)
  • mutant: the native confirm( back in main.ts is caught
  • disclosure scan

🤖 Generated with Claude Code

https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF

…) answers no unseen in the window

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
@pbertsch
pbertsch requested a review from a team as a code owner November 17, 2026 04:52
…ative dialogs; merge main

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
@pbertsch
pbertsch merged commit 5633b5a into main Nov 17, 2026
10 of 11 checks passed
@pbertsch pbertsch mentioned this pull request Nov 17, 2026
3 tasks
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant