Skip to content

Establish a backend-connected dev workflow (fix dev preview / sidecar) #233

Closed

Description

@CameronBrooks11

What

Establish a faithful, backend-connected dev loop for the FiberPath GUI so the UI can be developed and QA'd against real compute (toolpath previews, plan/validate), not a backendless browser shell.

Why

Today there is no good dev loop for current code:

  • npm run dev (Vite browser build, :5173) has no backend. The FastAPI sidecar binds a random 127.0.0.1 port and reports it to the Rust shell; the frontend learns it via invoke("api_base_url") (src/lib/apiClient.ts), which doesn't exist in a plain browser. Result: "CLI Backend Unavailable", no previews, Failed to list ports.
  • The prebuilt src-tauri/target/release/fiberpath_gui binary embeds a stale dist — it shows a different, older UI ("Main/Stream") than current source ("Prepare/Machine"), so it's misleading for QA (cf. the stale-installer gotcha, Release packaging attaches stale prior-version installers to new releases #120).
  • npm run tauri dev does give the real backend ("Backend: Ready", real previews) but isn't documented as the canonical loop, and its native window needs scrot/xdotool to screenshot in headless/agent contexts.

Where

  • fiberpath_gui/src/lib/apiClient.ts, src/lib/commands.ts, src/api/client.ts
  • fiberpath_gui/src-tauri/src/api_sidecar.rs, api_path.rs, main.rs
  • fiberpath_gui/vite.config.ts, package.json, README.md

Approach (negotiable)

Pick the minimal path that yields a backed dev loop:

  • Primary: make npm run tauri dev the documented canonical dev loop (real shell + sidecar + HMR); README + AGENTS note.
  • Optional (nicer inner loop): a dev-only browser shim so npm run dev can reach a standalone sidecar — start the sidecar on a known port and provide window.__TAURI__ invoke("api_base_url"/"check_cli_health") stubs in dev, so the browser build gets real previews and is Chrome-drivable. Keep it dev-only; do not ship.
  • Make the "backendless" state obviously a dev condition, not a scary error.

Acceptance criteria

  • A single documented command brings up the GUI with a working backend (real preview renders; health shows ready).
  • README/AGENTS document the dev workflow and explicitly warn that the prebuilt release binary may be stale.
  • (If shim chosen) npm run dev in a browser can generate a real preview against a local sidecar.
  • No silent "looks broken" backendless preview without an explanatory dev hint.
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

    enhancementgui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions