Status: Accepted (2026-11-27, WP-D). Implements 0025 in apps/web.
ADR 0025 puts the shell and panels on React 19 under hard rules: the engine stays outside React, panels read the editor’s external store through useSyncExternalStore selectors, non-urgent updates are transitions, the layers list is virtualized, and no document data lives in React state. Those rules leave several mechanics open: how the stage and the engine’s DOM are owned, how a store snapshot becomes a non-urgent render (useSyncExternalStore updates are always synchronous), where sync/presence state lives, and how a virtual list reads 682K rows without per-row objects.
<main id="stage"> once; mountEditor creates the two canvases inside it and removes them on destroy(). The editor frame creates its host (offline createLocalSession, or the live FileController) inside one layout effect and disposes it in the cleanup, so a re-run effect (Fast Refresh, StrictMode) gets a fresh host on fresh canvases instead of a released GL context. Overlays (HUD, toolbar, toast) are React siblings above the canvases (CSS z-index).useStore(store, select?, equal?) wraps useSyncExternalStore with a per-snapshot memoized selector and an equality check, so a store tick re-renders only components whose slice changed. The editor’s stores already notify at most once per frame; shell stores (ValueStore) notify on change only.useDeferredValue. Heavy panel bodies (properties, layers rows, perf stats) take the store value through useDeferredValue and render it from a memoized child, so the synchronous store render is a no-op bail-out and the real work runs at transition priority after the frame. Small slices (tool, zoom label, empty hint, HUD text) render directly: they are a few text nodes. User-driven state (scroll position, inline rename) stays urgent.Editor handle as a prop and read through its store; the layers list reads LayerTree by index during render (handle, name, kind, depth, flags for the ~30 visible rows), keyed by slot so scrolling reuses DOM nodes. Row heights are fixed (28 px); past 8M px of scroll height the position is scaled.FileController (apps/web/src/shell/fileController.ts) owns the sync client, the page session, page switching (with per-page viewport restore through EditorHandle.get/setViewport), the status pill (2 Hz poll for the pending count) and the avatar list (recomputed at most once per frame on peer changes). React reads its ValueStores. Remote cursors and selections are drawn by the editor on its overlay canvas, not in the DOM.destroy() reuses a canvas whose WebGL context was released (“shader error”).subscribe + startTransition(setState) instead of useSyncExternalStore: transitions for every update, but loses tearing protection and contradicts 0025’s binding rule; useDeferredValue gives the same scheduling with the sanctioned hook.react-window or similar for the layers list: another dependency for ~80 lines; it also assumes item arrays or per-item data getters we already have on LayerTree.window.editor is set by mountEditor (tools/bench) and removed on destroy.