mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-22 18:22:07 +00:00
File > Close, a file tab's x and File > Close All ran the engine's
close/closeall directly, which drop the drawing. Nothing checked for
unsaved changes on any platform; the web report just made it visible.
- New ui-egui `closing` module: close requests from the UI go through a
queue of drawings (by DocState uid). A dirty drawing is shown and asked
about in an in-app egui modal ("Save changes to X?" Save / Don't Save /
Cancel, Escape = Cancel), the same on desktop and web.
- Save routes to the existing qsave path (picker for untitled drawings)
and closes only if the drawing is really clean afterwards; otherwise it
stays open with its edits and a status message.
- Close All asks per dirty drawing in tab order; Cancel stops it.
- Menu, typed CLOSE/CLOSEALL (null params) and the tab x use the prompt;
JSON calls (engine.execute, control, MCP, scripts) keep discarding
without asking.
- Shortcuts are paused while the prompt is open; ui.inspect reports
`closePrompt`.
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3dd97cad56
commit
1fdee1a1a4
6 files changed
+329
-3
No files matched your search
@@ -19,7 +19,7 @@ Errors come back as `{"id": …, "ok": false, "error": "message"}`.
|
||||
| `engine.execute` | `{command, params}` | Run any command with JSON parameters. Never opens a dialog. |
|
||||
| `engine.commands` | | Every command: id, label, menu path, shortcut, aliases, params doc, enabled. |
|
||||
| `drawing.inspect` | `{entities?, limit?}` | Drawing summary (counts, extents, layers, styles, blocks, layouts, selection, undo) and entities with handles and geometry. |
|
||||
| `ui.inspect` | | UI state, canvas rect, view, cursor and snap, performance counters. |
|
||||
| `ui.inspect` | | UI state, canvas rect, view, cursor and snap, performance counters; `closePrompt`: the drawing a "Save changes?" prompt is asking about (null when none). |
|
||||
| `ui.menu.list` / `ui.menu.invoke` | `{command}` | The menu tree; invoke an item like a click (interactive). |
|
||||
| `ui.pointer` | `{x, y, space?: "world"\|"screen", button?, action?: "click"\|"move"}` | Click in the drawing area (world coordinates by default). Right button = Enter. |
|
||||
| `ui.click` / `ui.move` | `{x, y, button?, shift?}` | Real egui pointer events in screen points (reach every widget). |
|
||||
|
||||
Reference in new issue
Block a user