Skip to content

Control channel: a step in engine.script skips the window's part of the command, so view.grid off leaves the grid on #12629

Closed

Description

@CamWight

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.

  1. Send {"method": "engine.script", "params": {"commands": [{"command": "view.grid", "params": {"on": false}}]}}.
    • Reply: {"ok": true, "result": [{"on": false}]}.
    • The grid is still drawn.
  2. 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.
  3. Send {"method": "engine.execute", "params": {"command": "view.grid", "params": {"on": true}}}. The grid comes back.
  4. 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.execute and every document step of engine.batch go through control::execute, which calls SolveApp::run. SolveApp::run ends in after_command, which calls command_completed. That is where the window applies a command's reply.
  • engine.script calls app.session.run_script_each instead, 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.finish and sketch.cancel: the window doesn't close the sketch.
  • view.fit and view.home: the view isn't framed.
  • view.tool, view.tool.zoom and view.spin: the navigation tool and spin don't change.
  • view.visual_style, view.grid, view.ground_shadow, view.navigation_bar and view.layout: the window keeps its old settings.
  • view.next_tab and view.previous_tab: the tab doesn't change.
  • diagnostics.validation: the preference isn't kept.
  • select.filter, and select.mode from 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_all and browser.collapse_all: the browser doesn't fold.
  • The Render workspace commands (view.render_*, render.lights.*).
  • The first-body fit, and component.update_links refreshing a part edited in place.

Related

Found while working on #6326.

Activity

  1. added
    area:io
    needs-triage
    in progress
    on Nov 6, 2026
  2. github-actions commented on Nov 6, 2026

    @github-actions
    Contributor

    Claimed by @CamWight through #12630. The claim lapses after 14 days without pushes.

  3. CamWight commented on Nov 6, 2026

    @CamWight
    ContributorAuthor

    Pictures of the reproduction, on v0.30.0 (main 29a6bbd) with a new, empty design.

    After step 1, engine.script with view.grid {"on": false}: the reply says {"on": false}, and the grid is still drawn.

    After engine.script: the grid is still drawn

    After step 2, engine.batch with the same step: the grid is gone.

    After engine.batch: the grid is gone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:ioin progressneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions