# Preview & Playback [Back to Index](./README.md) WebGPU preview with RAM preview caching, source monitor playback, edit overlays, multi-preview targets, and output windows. --- ## Overview The preview system is built around a single WebGPU engine and a unified render-target store. The main preview canvas, additional preview panels, multi-preview slots, and output windows all register as render targets and are rendered through the same engine path. Current preview-related overlays and modes include: - Main composition preview - Source monitor for raw media playback - Edit mode overlay for clip/layer transforms - Mask and SAM2 overlays - Statistics overlay - Multi-preview panel - Output windows with separate popup canvases --- ## Preview Targets ### Main Preview - Renders the active composition or a pinned composition source. - Uses `engine.registerTargetCanvas()` to attach the canvas to WebGPU. - Registers as an active-comp or independent render target in `renderTargetStore`. ### Independent Previews - Non-active compositions are rendered as independent targets. - `renderScheduler` drives those targets without depending on the main editor preview loop. - Each target can toggle its own transparency grid state. - During edit-mode scrubbing, independent previews keep their last visible frame while the video decoder seeks instead of flashing black. - Edit mode is panel-local: the Edit button only affects that preview, and the global `Tab` shortcut targets the focused preview or, with no focused preview, the first editable preview. ### Output Windows - Output windows are popup windows managed by `OutputWindowManager`. - They reconnect after refresh when the session still knows the window was open. - Popup focus is transferred only when playback is not active, so playback is less likely to stall in the background. --- ## Source Monitor The source monitor shows a raw media file in the preview panel instead of the composition. ### Behavior - Video sources always use the panel-local HTML `