When Enter was refused (Enter repeats a command that isn't available),
headless failed the cmdline.key call while the app dropped the error,
and pressing Enter in the app's command line echoes it. Both now echo
the error to the history and reply with the command-line state, the
`output` lines the key added and `error` only when Enter was refused,
the shape #351 gives cmdline.input.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Both backends now return the same command-line state (prompt, running,
keywords, accept, buffer, history, historyExpanded). cmdline.input echoes
a refused line to the history and `output` and also reports it in `error`
on both sides. Headless app.open without a path answers "missing path"
like the app instead of reaching OPEN. Documented in control-protocol.md.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The control server gave up after 60 s with "timeout" but left the request
queued, so the app ran it later and a client retry applied it twice.
Requests now carry a shared state: on timeout the server cancels a request
the app has not started (reply state "not-run", safe to retry) and the app
skips it; one already started replies state "may-have-run". The MCP bridge
passes that on in its error.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Save As suggested `.dxf` for every untitled drawing, so saving new work as
DWG meant typing the extension each time. AutoCAD keeps this choice in
Options > Open and Save > "Save as".
- File > Default Save Format > DXF / DWG sets the format Save As suggests
for drawings that have no file yet. Drawings opened from a file keep that
file's format, as before. DXF stays the default.
- The choice is saved across restarts with the other preferences
(`saveFormat`), survives Reset Palettes, and is scriptable as
`ui.saveformat {format}` or the `saveFormat` UiState field.
- Ukrainian labels for the new menu entries.
On macOS the suggested `.dwg` name needs DWG in the Save As filter list
(#198) to survive the dialog.
Claude-Session: https://claude.ai/code/session_019uMCkRAB8DMd8MEmoY9Vyr
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Rebase onto main: the interface language is saved with main's other
preferences (cadcraft.prefs, beside the theme) instead of its own storage
key, on desktop and web; strings main added or changed in the touched
places (Dynamic Input settings, Properties header and current-property
rows, block picker, theme and command-history menu items, open/save
filters) are wrapped and translated; main's native-menu poll order is kept.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Clicks on the command line's history, the UCS icon and the ViewCube ring fell
through to the drawing (picking objects or starting a selection window, or
entering a point during a command), the chevron did nothing, and the wheel over
the overlays zoomed the drawing. The ViewCube's Top face was a click-only
widget, so the canvas still counted as hovered underneath it (crosshair, wheel).
- Every overlay now registers a widget that senses clicks and drags, so egui
hands the pointer to the overlay instead of the canvas.
- Command line: a click on the history lines or the chevron (now pointing up)
opens a scrollable history window with the whole log; F2 and TEXTSCR open it
too (`ui.toggle.history`, Window > Command History). Dragging the history's
top edge sets how many lines show (`ui.cmdline.lines`, 0-12).
- ViewCube (new viewcube.rs): Top face and a Home button run `zoom.extents`;
hover highlights; right-click menu (Home, Hide ViewCube). The compass ring
says that the 2D plan view can't rotate (no view twist yet) instead of
doing nothing.
- UCS icon and the WCS pill open the coordinate-system menu (World, Hide UCS
Icon).
- Control channel: `ui.drag` (real press, move, release) and
`cmdline.state` -> `historyExpanded`.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Light and System interface themes (System follows the OS appearance live)
CADCraft had one hard-coded dark interface: Tokens::get() always returned
Tokens::DARK and Visuals::dark() was installed once at startup.
- theme.rs: Tokens::LIGHT (light grey chrome, dark text) beside the unchanged
Tokens::DARK; Tokens::get() returns the palette of the theme in use (a
UI-thread thread-local set once per frame). Both egui styles are built from
the tokens and egui is switched to the shown theme, so standard widgets,
menus and popups follow too. The drawing area (canvas, grid, axes,
selection, grips, ViewCube, UCS icon) keeps its model-space colours in both
themes: drawing colours are not part of the interface theme.
- ThemePref { System, Light, Dark } in UiState (`theme`), resolved every
frame against ctx.system_theme(), so System follows the OS (winit, or the
browser's prefers-color-scheme) live without touching the saved choice.
No reported appearance: System shows Dark (SYSTEM_FALLBACK). Default stays
Dark (today's look).
- View > Interface Theme > Use System Setting / Light / Dark (ui.theme.system,
ui.theme.light, ui.theme.dark) and ui.theme {theme} for scripts and the
control channel; ui.inspect reports the theme shown.
- Hard-coded colours on the command line (history, border, keywords,
AutoComplete list), the status-bar message and the layer status icon go
through tokens; overlays drawn on the canvas use a new canvas_ink token.
- Desktop app: the choice persists via eframe storage (`persistence`
feature, key cadcraft.prefs); window geometry and egui memory are not
persisted, as before.
Fixes#59.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Document the theme field away from other PRs' edits to avoid merge conflicts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>