Editor drop zone + Wisp canvas host
The editor's center canvas region. WispCanvasHost picks a
backend — CssFallback (used by SSR + mdBook), a pre-rendered
WispAsset { asset_path }, or WispRuntimeUnavailable (renders a
warning banner). EditorDropZoneCanvas wraps the host in the
dotted drop overlay + action cards + recent-clips strip the user
sees when no clip is loaded.
States
| State | Story |
|---|---|
| Empty | editor-drop-zone-empty |
| Drag active | editor-drop-zone-drag-active |
| With recent clips | editor-drop-zone-with-recent |
| Canvas host — CSS fallback | wisp-canvas-host-fallback |
| Canvas host — runtime unavailable | wisp-canvas-host-asset |
API
#![allow(unused)] fn main() { use ui_storybook::components::editor::{ EditorDropZoneCanvas, WispCanvasHost, CanvasBackendView, }; use ui_storybook::fixtures::editor::sample_editor_drop_zone; view! { <EditorDropZoneCanvas view=sample_editor_drop_zone(/* drag_active */ false) /> } }
The component never touches wgpu directly — it just renders the
backend the parent picked. CssFallback keeps SSR + mdBook
snapshots stable; future tickets that wire up a real wgpu canvas
in CSR will swap in WispAsset (committed PNG) or implement a
runtime path without changing the component contract.
Composition
flowchart TD
DropZone[EditorDropZoneCanvas]
DropZone --> Host[WispCanvasHost]
Host --> Backend{CanvasBackendView}
Backend -->|CssFallback| Css[CSS checkered + label]
Backend -->|WispAsset| Img[<img> pre-rendered]
Backend -->|WispRuntimeUnavailable| Banner[Warning banner]
DropZone --> Content[Drop overlay + headline + actions]
DropZone --> Recent[Recent clips strip]