Skip to content

Epic: migrate the GUI from React to Svelte 5 + restrained desktop UI redesign #214

Closed

Description

@CameronBrooks11

Epic: migrate the GUI from React to Svelte 5 + restrained desktop UI redesign

Decision (from an architecture review, grounded in the current code)

Move fiberpath_gui off React + Zustand to Svelte 5 as a plain Vite SPA inside the existing Tauri shell — no SvelteKit (a desktop SPA needs no router/SSR/meta-framework). Treat it as a UI architecture reset, not a mechanical React→Svelte transcription, paired with a restrained desktop UI redesign (denser, calmer, slicer-appropriate).

The strong parts of today's architecture are not React-specific and stay: the Tauri/Rust bridge, the Python compute backend, the OpenAPI-typed client + generated types + CI drift gate (#191/#198), the Zod/JSON-schema validation boundary, the explicit Marlin streaming state, and the token-based CSS. Svelte replaces only the framework + state-management ceremony.

Why

  • Less state ceremony — $state/$derived/$effect runes in .svelte.ts modules replace Zustand + useShallow + memo/debounce render-management. Zustand disappears rather than being swapped for another store lib.
  • Less composition indirection — App.tsx assembles whole element trees and passes them as ReactNode props into MainTab; Svelte regions own their layout directly.
  • Fewer dependencies & lower LoC — drop 10 React-coupled packages; the viewport, DnD, and store glue collapse into native code.
  • Right moment — the UI is still bounded (no real toolpath renderer yet). Waiting until the viewport/telemetry/slicer surface grows makes this far more expensive.

Baseline (measured 2026-06-26, GUI v0.7.4)

  • Handwritten TS/TSX 8,712 LoC (79 files, 40 components) · CSS 3,283 LoC (19 files) · tests 7,695 LoC (53 files).
  • 28 dependencies (11 prod / 17 dev). Bundle JS 599 KB / CSS 59 KB (budget 750/90).
  • Viewport = PNG preview + react-zoom-pan-pinch (no vector/canvas). DnD = one use (LayerStack reorder, @hello-pangea/dnd).
  • State = 3 Zustand stores (project/stream/toast); transient UI state (isDirty/filePath/activeLayerId/validationErrors) is mixed into the persisted project document.

Strategy

Scope (vertical slices, on the branch)

Targets (directional, NOT hard acceptance criteria)

A smaller line count that hides state transitions or weakens tests is not an improvement. Track, don't gate on:

  • Handwritten frontend LoC (TS + CSS) ↓ · external frontend deps ↓ (≥10 packages removed) · bundle JS ↓
  • Number of state abstractions ↓ · UI concepts needed to change a feature ↓
  • Test coverage of machine-state transitions held or improved.

Reconciliation with existing issues

Non-goals

  • No SvelteKit, Tailwind, component library, frontend router, or CSS-in-JS.
  • No change to the Python compute backend, the OpenAPI contract, or the Rust serial path.
  • No switch from the PNG preview to vector/WebGL rendering (evaluate separately, after parity).
  • No dual-framework app is ever shipped — only React is wired to the entry until cutover (both frameworks' source coexist in-repo meanwhile, Svelte tree-shaken out of the build).

Activity

  1. added
    gui
    epic
    roadmap
    on Jun 26, 2026
  2. CameronBrooks11 commented on Jun 27, 2026

    @CameronBrooks11
    MemberAuthor

    ✅ Epic complete — the GUI is migrated from React to Svelte 5. All 7 slices merged via strangler-on-main (one PR each, full CI + adversarial review gate):

    Final metrics vs the React baseline: production code 8,712 → 6,031 LoC (−31%), tests 7,695 → 4,572 (−41%), frontend deps −10 packages, production JS bundle 599 KB → 308 KB (−48%). Plus the restrained Prepare/Machine redesign and #147 fixed.

    No SvelteKit; plain Svelte 5 (runes) SPA in the same Tauri shell. Python backend, OpenAPI client, Rust bridge, and Zod boundary unchanged. See the migration ADR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicguiroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions