fix(shell): bound Outlet in SuspenseBoundary so navigation stops flashing #82
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VAPP-37-suspense-boundary-shell-flash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every sidebar page fetches its data with
use_server_future(...)?, which suspends the page component while the server-fn POST is in flight. The content-paneOutletinlayout.rshad noSuspenseBoundaryabove it (and none existed anywhere in the tree), so that suspense unwound to the root: while the POST was pending the whole shell (sidebar, topbar, statusbar, content) left the DOM and re-painted on resolve, which read as a full-screen flash on every navigation. Root cause is page-level suspense with no boundary, not a redirect bounce, shell remount, or style recalc.Wrap the
Outletin aSuspenseBoundary(inside anErrorBoundary) at the content pane so a page's suspense, or a failing server fn, is caught there: only this pane shows aLoading…placeholder while the POST is in flight and the shell stays painted. The redirectuse_effect(layout.rs) is untouched, soNeedsFirstUser->/setupand missing-session ->/loginbehavior is unchanged. The fix is framework-level and applies to both the web (wasm) and wry desktop targets.Add
layout_guard.rs, a compile-time test that fails if theSuspenseBoundary/ErrorBoundary/Outlettrio disappears fromlayout.rs, so the boundary cannot silently regress.#VAPP-37