Repository navigation
feat(gui): Svelte Marlin machine control + streaming (#219) - #227
Merged
Merged
Conversation
Closes #219. Ports the riskiest surface — connection, manual commands, file streaming, live log — to Svelte. Part of epic #214, strangler-on-main: React still ships; Svelte stays behind the dev-only entry and out of the bundle (unchanged at 595.75 kB). - state/machine-session.svelte.ts: one runes session consolidating the Zustand streamStore + useConnectionActions + useManualCommandActions + useStreamingActions + useStreamEvents. Reuses marlin-api.ts (Tauri bridge) and streamFeedback.ts/toastMessages.ts unchanged via the notifications adapter. - components/machine/{Connection,ManualControl,FileStreaming}Section + StreamLog; MachineWorkspace.svelte subscribes to the 4 stream events via $effect. - Emergency stop (M112) given a distinct destructive treatment, behaviourally separate from graceful cancel. Two correctness improvements over the React original (both adversarially flagged): - e-stop now clears isStreaming/progress (UI can't offer Pause/Stop while disconnected). - stale stream-progress from a finished/cancelled job is dropped (guard on isStreaming). 740 tests; the machine-session suite covers connect/disconnect/failure, pause/resume, cancel-vs-stop, the concurrency guard, failed-cancel/stop resets, manual gating, milestone/throttle, the error event, stale-event drop, unlisten cleanup, and the 5000-entry log cap. Adversarially reviewed (riskiest-slice pass). Closes #219. Refs #214
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #219. Ports the Marlin machine-control / G-code streaming UI to Svelte — the riskiest slice. Part of epic #214 (strangler-on-
main: React still ships; Svelte stays behind the dev-only entry and out ofvite build— unchanged at 595.75 kB).What changed
src/state/machine-session.svelte.ts— one runes session consolidating the ZustandstreamStore+ the three React action hooks (useConnectionActions/useManualCommandActions/useStreamingActions) +useStreamEvents. Holds connection / streaming / manual / log state and all actions; reusesmarlin-api.ts(Tauri bridge) andstreamFeedback.ts+toastMessages.ts(log/toast builders) unchanged, adapted to the Sveltenotificationsstore.MachineWorkspace.svelte(rewritten from the GUI shell: Prepare/Machine workspace, regions, menu + status bar, restrained desktop redesign #216 placeholder) lays out Connection / Manual Control / File Streaming + the live Output Log, and subscribes to the four Tauri stream events (started/progress/complete/error) via an$effectwith proper unlisten cleanup.Parity preserved
Connect (connecting→connected, →disconnected on failure), disconnect, pause→paused, resume→connected, cancel (resetAfterCancel: stays connected), emergency stop (→disconnected);
streamControlLoadingguards against concurrent control actions;manualControlsEnabled = isConnected && (!isStreaming || paused); progress throttling + 25/50/75 milestone toasts; the 5000-entry log cap.Deferred
The
?keyboard-shortcuts help modal moves to #220 (dialogs).Verification
tsc,svelte-check(0/0), 733 vitest tests (+19: the machine-session state machine — connect/disconnect/failure, pause/resume, cancel≠stop, the loading guard, manual-control gating, file select, and event-subscription wiring — plus a workspace render test), coverage 80.6/70.6/79.2/82.0 (> 60/50/65/60), stylelint,lint:css:vars,vite build, bundle budget.refreshPortserror path logs to the Output Log with error styling (real connect/stream needs the Tauri sidecar + a Marlin board).Notes for reviewers
tauri dev+ hardware (or--dry-run); the browser preview shows the UI + non-Tauri error paths.Closes #219. Part of #214.