Repository navigation
Closed
Labels
area:ioimport/export and file formats (STEP, IGES, 3MF, glTF, designs)in progresssomeone is working on it (see comments)needs-triageno priority yet; a maintainer sorts it with /triage
Description
A command sent as a step of engine.script runs in the engine, but the window never does its own part for it. engine.execute and engine.batch run that part. So view.grid {"on": false} in a script replies {"on": false} and the grid stays on the screen.
Reproduction
SolidCraft v0.30.0 (main 29a6bbd) on Windows, started with --control <port> and a new, empty design. The engine.script branch in crates/ui-egui/src/control.rs is the same on today's main for a script with no panel commands.
- Send
{"method": "engine.script", "params": {"commands": [{"command": "view.grid", "params": {"on": false}}]}}.- Reply:
{"ok": true, "result": [{"on": false}]}. - The grid is still drawn.
- Reply:
- Send
{"method": "engine.batch", "params": {"commands": [{"command": "view.grid", "params": {"on": false}}]}}.- Reply:
{"ok": true, "result": {"completed": 1, "results": [{"on": false}], "undone": 0}}. - The grid is gone.
- Reply:
- Send
{"method": "engine.execute", "params": {"command": "view.grid", "params": {"on": true}}}. The grid comes back. - Send step 1 again. The grid stays on.
Expected: the same step does the same thing through engine.script, engine.batch and engine.execute.
Why
engine.executeand every document step ofengine.batchgo throughcontrol::execute, which callsSolveApp::run.SolveApp::runends inafter_command, which callscommand_completed. That is where the window applies a command's reply.engine.scriptcallsapp.session.run_script_eachinstead, so none of that runs for its steps.- A script that contains a panel command takes another branch. That branch runs every step through
control::execute. So whether a script's steps reach the window depends on whether any step is a panel command.
What else a script step misses
These are the window's parts in command_completed and control::execute. Each one is skipped for a script step:
sketch.finishandsketch.cancel: the window doesn't close the sketch.view.fitandview.home: the view isn't framed.view.tool,view.tool.zoomandview.spin: the navigation tool and spin don't change.view.visual_style,view.grid,view.ground_shadow,view.navigation_barandview.layout: the window keeps its old settings.view.next_tabandview.previous_tab: the tab doesn't change.diagnostics.validation: the preference isn't kept.select.filter, andselect.modefrom Selection: a Selection mode on the navigation bar chooses what a click on the model picks (#4255) #6326: the window's picking doesn't change.browser.expand_allandbrowser.collapse_all: the browser doesn't fold.- The Render workspace commands (
view.render_*,render.lights.*). - The first-body fit, and
component.update_linksrefreshing a part edited in place.
Related
- Save: a design changed while it is written stays unsaved, and scripts wait for it (#6003) #7619 closed one gap of the same cause: a script no longer runs during a window Save.
- Send to Slicer: network folder targets, with Format and Quality rows (#2304) #10605 and Send to Slicer: SFTP network folder targets (#2304) #10918 keep network folders added by a script step. They add a check in
run_script_each's callback for that one case. - GUI control channel: each request waits for a GUI frame, and MCP
batchis one round-trip per step, so batches cost N frames (1 s each when the window is off-screen) #743 asks for rollback inengine.script. That is a separate question: this issue keeps today's stop-at-the-first-error behaviour.
Found while working on #6326.
Metadata
Metadata
Assignees
Labels
area:ioimport/export and file formats (STEP, IGES, 3MF, glTF, designs)in progresssomeone is working on it (see comments)needs-triageno priority yet; a maintainer sorts it with /triage
Activity
github-actions commentedon Nov 6, 2026
Claimed by @CamWight through #12630. The claim lapses after 14 days without pushes.
CamWight commentedon Nov 6, 2026
Pictures of the reproduction, on v0.30.0 (main 29a6bbd) with a new, empty design.
After step 1,
engine.scriptwithview.grid {"on": false}: the reply says{"on": false}, and the grid is still drawn.After step 2,
engine.batchwith the same step: the grid is gone.claim: tangency-labs#12629
Control channel: each step of engine.script runs as engine.execute ru…
Control channel: each step of engine.script gets the window's follow-…