refactor(notebook): eliminate empty notebook flash with eager WASM init#564
Merged
refactor(notebook): eliminate empty notebook flash with eager WASM init#564
Conversation
…init and loading skeleton Move WASM initialization to module import time (before React renders) to eliminate the 50-100ms latency during bootstrap. Add isLoading state to distinguish "cells haven't loaded yet" from "genuinely empty notebook". Show a skeleton placeholder instead of the "Empty notebook" UI during loading, providing visual continuity. - Eager WASM init: const wasmReady at module top level, starts loading before useEffect - isLoading state: tracks bootstrap progress, exported from useAutomergeNotebook hook - CellSkeleton component: simple placeholder matching cell layout with animated input area - Wired through App.tsx → NotebookView to consume isLoading prop Fixes the jarring 4-5 frame sequence on startup where "Empty notebook" appears before cells load.
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
Eliminates the jarring visual flicker (4-5 distinct frames) when opening a notebook by:
isLoadingstate to distinguish "cells haven't loaded yet" from "genuinely empty notebook"Changes
wasmReadypromise at module top level,isLoadingstate tracks bootstrap completioncells.length === 0 && isLoading, preserving "Empty notebook" UI as safety net for edge casesisLoadingfrom hook through to viewVerification
NotebookState::new_empty())PR submitted by @rgbkrk's agent, Quill