feat(design): show real loading, zero and error states in the review preview - #432
Merged
Merged
Conversation
…preview The review page kept a raw white iframe on screen while a revision built. The preview area now follows observed events through a pure state machine (packages/design/src/loading.ts): the design list, the preview request, the design app's build status (new revision/:id/status route), the frame's load and the runtime's design:ready message. It shows a target-shaped skeleton with the current stage and elapsed time, a zero state with the agent's live activity, and a failure summary with Retry, then fades the frame in. The presenter windows wait the same way. The first-use download of the design app reports its progress: the TUI shows it as a toast, and a review link opened meanwhile answers with a waiting page that follows the download instead of a connection error. Launches are shared in-process.
filipeforattini
force-pushed
the
design-loading-states
branch
from
September 24, 2026 15:47
17386a3 to
52eb869
Compare
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.
Summary
The review page showed a big white box while a revision's preview built (reported on 0.54, presentation target, design app). This adds real loading, zero and error states, and the plumbing to report progress.
packages/design/src/loading.ts, serialized into the page likestage/deck): the design list, the preview request, the build status, the frame'sload, and the runtime's newdesign:readymessage (posted byscreens.tsafterload+document.fonts.ready) produce the visible state.prefers-reduced-motion. A live reload keeps the current frame on screen until the new document arrives.GET …/:designID/revision/:revisionID/status(queued/toolswhile the Design tools install on first use /building/ready/failed). The page polls it only while the preview request is in flight. Hosts without the route (the inline HttpApi and legacy pages) fall back to a generic "Building the preview…". No HttpApi route is added.app-binary.ts): the archive is streamed, and progress is reported process-wide (progress/watch/describe). The design tools publish it as a TUI toast ("Downloading redcode-design 0.1.0… 45%").DesignApp.openanswers a review link through redcode's redirect with a waiting page (the progress, reloading itself) while the app downloads or starts. If the start fails, the page shows why, with Retry, instead of a connection error. Launches in one process now share oneensure.copy.ts, with pt-BR translations.Tests (no real browser)
packages/core/test/design-loading.test.ts: pure events → visible-state tests, serialization, waiting page.packages/core/test/design-app-binary.test.ts: download progress reported and described.packages/design-app/test/app.test.ts: the build status route goes from queued to ready around a preview.packages/redcode/test/design/app-status.test.ts: TUI toast status for the download.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.