Skip to content

feat(gui): drive Marlin through the API sidecar; delete the stdio bridge (#193, #194) - #262

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/gui-machine-api
Jun 28, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/gui-machine-api

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Final cutover slice for epic #195: the GUI's machine control moves from the Rust-owned fiberpath interactive stdio subprocess to the local API sidecar (#260), and the subprocess machinery is deleted.

⚠️ Needs hands-on validation (live app + real board)

The automated gates are green, but this changes the live machine UX. Please drive the app against the RAMPS board and confirm:

  1. Connect — select port + baud → Connect; the new connection panel shows firmware/capabilities; status → Connected.
  2. Manual command — G28 / M114 / custom; replies appear in the log; manual controls disabled mid-stream (enabled when paused).
  3. Stream a job — pick a .gcode file → Start; live progress bar + current command advance via the 250 ms poll; milestone toasts at 25/50/75%; completion toast.
  4. Pause / Resume / Cancel mid-stream — poll reflects each; Cancel keeps the connection.
  5. E-Stop — both the Manual E-Stop and the streaming Stop call /machine/estop, halt the board, drop to Disconnected; then reconnect works (the fix below).
  6. Poll latency (250 ms) feels OK on a long real job.

What changed

  • marlin-api.ts → typed client over /machine/* (no Tauri events/invoke).
  • machine-session.svelte.ts → 250 ms poll loop folding job events (progress/action/complete/error) into UI state; subscribe() removed.
  • Rust: src-tauri/src/marlin.rs deleted (~660 lines: ResponseRouter, subprocess manager, 10 marlin_* commands); main.rs cleaned; unused direct tokio dep dropped; tauri-types.ts deleted. Sidecar/window/file-picker machinery kept.
  • GUI: machine connection info panel in the Stream tab #146: connection panel (firmware/capabilities) in ConnectionSection.
  • Integration fix I found in review: the sidecar's /estop halts but keeps the port open, so the GUI's stop=disconnect model would 409 on reconnect — the GUI now also DELETE /connection after estop (the next connect DTR-resets and recovers the board).

Gates (green)

tsc, svelte-check (368 files, 0/0), 321 vitest, CSS lints, cargo check + cargo clippy. (cargo verified in a fresh target dir — stale fiberpath-api sidecars from old tauri dev sessions hold the in-place binary; pkill -f bundled-api/fiberpath-api to clear them.)

After this

Only the F-deletes remain (execution/marlin.py + interactive.py + the interactive CLI command — now unused) and the 0.9.0 release.

…dge (#193, #194)

Rewire the desktop GUI's machine control from the Rust-owned `fiberpath
interactive` stdio subprocess to the local HTTP API sidecar:

- marlin-api.ts now calls the generated typed client (/machine/*); streaming
  progress is polled from GET /machine/jobs/{id}?since= instead of Tauri
  stream-* events. machine-session.svelte.ts runs a 250ms poll loop folding
  job events (progress/action/complete/error) into UI state.
- Delete src-tauri/src/marlin.rs (~660 lines: ResponseRouter, subprocess
  manager, 10 marlin_* commands) and their main.rs registration + the now-
  unused direct tokio dep. The Tauri shell keeps window/file-picker/compute-
  sidecar only. tauri-types.ts deleted (no importers).
- #146: connection panel shows firmware/capabilities. E-stop now also closes
  the sidecar connection so a reconnect (which DTR-resets the board) isn't
  refused as already-connected.

GUI gate green: tsc, svelte-check (368 files, 0), 321 vitest, css lints,
cargo check + clippy. Needs live-app + hardware validation. Part of #195.
@CameronBrooks11
CameronBrooks11 merged commit 5e9f590 into main Jun 28, 2026
18 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/gui-machine-api branch June 28, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant