Repository navigation
Description
Context
Running fastled and selecting a sketch opens the desktop viewer window showing a bare "Not Found" instead of the compile progress page.
This looks like a regression of #149, but it isn't — #149's instant-launch loading page was only wired into the axum HTTP server. The Tauri viewer never touches that server:
compile_and_serve(crates/fastled-cli/src/commands.rs:83) launches the Tauri viewer pointed at the output dir before the first compile.- The viewer serves files straight from disk via its own
fastled://custom protocol (crates/fastled-cli/src/tauri_viewer.rs:43) and loadsfastled://localhost/index.html. - On a fresh sketch,
fastled_js/index.htmldoesn't exist yet, so the protocol handler returns the literal body"Not Found"(tauri_viewer.rs:57). - The viewer also has no SSE subscription, no status polling, and no reload trigger — so even after the build succeeds it stays stuck on "Not Found".
So the loading page, live compile log streaming (#153 / PR #154), and failure UX all work in a regular browser but never appear in the viewer window, which is the default UX.
Proposal
Point the Tauri webview at the HTTP server URL (http://{addr}) instead of the fastled:// file protocol:
launch_tauri_viewertakes the server URL rather than a directory; the viewer subcommand accepts a URL.- The webview loads
WebviewUrl::External(http://{addr}). - Remove (or stop using) the custom protocol handler for this path — the HTTP server already serves the loading page when
index.htmlis missing, streams build logs over SSE, auto-reloads on success, and sets the COOP/COEP headers (server.rs:402-407) the protocol handler was duplicating by hand.
This gives the viewer and browser a single shared code path for loading/compiling/error states.
Acceptance criteria
- Fresh sketch (no
fastled_js/index.html): viewer window shows the loading/compiling page immediately, never "Not Found" - Viewer shows live build log lines via SSE during compile
- On build success, viewer auto-navigates/reloads to the built sketch
- On fatal compile/link error, viewer shows the error state from feat: live colored compile log streaming in browser loading page (spinner only, no progress bar) #153 (no false success, no blank page)
- SharedArrayBuffer still works in the viewer (COOP/COEP via HTTP server headers)
Decisions
- Fix approach: external HTTP URL over teaching the custom protocol about loading/SSE — single code path, less duplication. Triage can override.
- Filed as a separate issue rather than folding into PR feat: live colored compile log streaming in browser loading page #154: feat: live colored compile log streaming in browser loading page #154 implements streaming in the server; this is viewer wiring.
Related issues
- feat: instant launch — explicit failure UX in the loading page #149 (instant launch loading page — HTTP server only)
- feat: live colored compile log streaming in browser loading page (spinner only, no progress bar) #153 / PR feat: live colored compile log streaming in browser loading page #154 (live compile log streaming + fatal-error UX)
Activity
fix(viewer): point Tauri viewer at the HTTP server instead of serving…