Repository navigation
feat: instant launch — explicit failure UX in the loading page - #149
Merged
Merged
Conversation
The instant-launch flow already exists: compile_and_serve starts the HTTP server, spawns the Tauri viewer, and only then runs the first compile — so the viewer opens within ~1s and serves LOADING_PAGE (which streams /build-stream SSE) while compilation happens behind it. On success, the page reloads to fetch the freshly-written index.html. This PR closes the remaining acceptance-criteria gaps in #148: * Error UX: previously a failed compile only updated the status text while the spinner kept spinning. Now setError() switches the spinner to red, stops the elapsed timer, and explicitly keeps the page on the build view (no navigation, no 404). * Elapsed time: new #elapsed counter alongside the status, useful on cold-cache first compiles. * Log clearing on rebuild: when a fresh 'compiling' status arrives after a prior build, the log is cleared and the timer reset so the user sees the new compile's output cleanly. Without this, a second failure would stack on top of the first. * Cleanup: removed a dead `const logEl = document.addEventListener(...)` binding that only captured undefined. New test test_loading_page_stays_when_build_failed_and_no_index_html seeds the server's output dir with a build-status.json of status=error and verifies GET / still returns 200 with the loading page (asserts the embedded setError branch is present). Verified: `soldr cargo test -p fastled-cli --lib server::` → 18 passed. Closes #148 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Jun 11, 2026
Closed
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 #148.
Summary
The instant-launch flow is already in place:
commands.rs::compile_and_servestarts the HTTP server, spawns the Tauri viewer, and only then runs the first compile — so the viewer window opens within ~1s and servesLOADING_PAGE(which streams/build-streamSSE) while compilation happens behind it. On success, the page reloads to fetch the freshly-writtenindex.html. This PR closes the remaining acceptance-criteria gaps in #148 by hardening the page's behavior on compile failures and on rebuilds.Changes (all in
crates/fastled-cli/src/server.rs)setError()switches the spinner to red, stops the elapsed timer, and explicitly keeps the page on the build view — no navigation, no 404 (criterion 5).#elapsedshows tenths-of-a-second beside the status. Useful on cold-cache first compiles (criterion 3).compilingstatus arrives after a prior build, the log is cleared and the timer reset, so the user sees the new compile's output cleanly. Without this, a second failure would visually stack on top of the first (criterion 6).const logEl = document.addEventListener(...)binding that only capturedundefined.Test
New
test_loading_page_stays_when_build_failed_and_no_index_html:build-status.jsonofstatus=error.GET /still returns200with the loading page (never404, never a stale page).setErrorbranch is present in the served HTML.Out of scope
src/fastled/frontend/).commands.rs(it's already correct).Test plan
soldr cargo test -p fastled-cli --lib server::-> 18/18 passfastled <sketch>, observe viewer opens immediately with streaming log; introduce a syntax error and verify viewer stays on build view with red spinner; fix it, verify next rebuild clears log and transitions to sketch.