The title bar's ×, File ▸ Quit, the OS closing the window (Alt+F4, Cmd+Q, the window manager:
close_requested is cancelled until the designs are answered) and app.quit / ui.window close all
go through documents::request_quit, which asks Save / Don't Save / Cancel once per design with
unsaved changes. Save saves (Save As for a never-saved design) and quits only if it saved; Don't
Save discards (no recovery copy is kept); Cancel or Esc stays open. Closing a tab asks the same
question (now titled "Save changes to <name>?"); New and Open never replace an unsaved design
(they open a tab). The web app asks through beforeunload while a design is unsaved. Control:
ui.documents {action: quit, answer: save|dont_save|cancel}, app.quit {force}. Tests: quit with
Save then Don't Save across two tabs, Cancel, a Save that saves nothing, Save As; scenario
s43_quit_asks_to_save.
Fixes #33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
851 B
JSON
17 lines
851 B
JSON
[
|
|
{"note": "Issue #33: quitting with unsaved changes asks \"Save changes to <name>?\"; Cancel stays open."},
|
|
{"call": "engine.execute", "params": {"command": "solid.box", "params": {"length": 20, "width": 10, "height": 5}}},
|
|
{"call": "ui.window", "params": {"action": "close"}},
|
|
{"expect": {"shown": "Don't Save", "quitting": true, "quit_requested": false}},
|
|
{"widget": "Cancel"},
|
|
{"expect": {"not_shown": "Don't Save", "quitting": false, "quit_requested": false, "bodies": 1}},
|
|
{"note": "The File menu's Quit asks the same; Esc answers Cancel."},
|
|
{"call": "app.quit"},
|
|
{"expect": {"shown": "Don't Save", "quit_requested": false}},
|
|
{"key": "Escape"},
|
|
{"expect": {"not_shown": "Don't Save", "quitting": false, "quit_requested": false}},
|
|
{"call": "app.quit"},
|
|
{"widget": "Don't Save"},
|
|
{"expect": {"quit_requested": true}}
|
|
]
|