Scene
A scene is a named sequence of steps — the unit of camera and caption continuity.
A scene is a named sequence of steps. Scenes are the unit of camera continuity and caption flow: within a scene, the camera and overlays behave coherently; between scenes, you can cut or crossfade.
Defining a scene
Inside demo.run, call demo.scene(...) for each scene:
The first argument is the scene id (stable, used in diagnostics and the timeline). The second is an async callback receiving a DemoScene builder. You can also pass scene metadata as the second argument:
The DemoScene builder
The builder has fifteen methods — one per step kind. Each is async and returns Promise<void>:
| Method | Step kind | Captures? |
|---|---|---|
goto(path) | browser.goto | Yes |
click(target) | browser.click | Yes |
fill(target, value) | browser.fill | Yes |
select(target, value) | browser.select | Yes |
expectVisible(target) | assert.visible | Asserts |
expectText(target, text) | assert.text | Asserts |
expectUrl(path) | assert.url | Asserts |
establish(target?) | camera.establish | Camera |
focus(target, opts?) | camera.focus | Camera |
hold(duration) | timeline.hold | Timing |
transition(opts?) | timeline.transition | Timing |
caption(text, opts?) | overlay.caption | Overlay |
callout(target, opts) | overlay.callout | Overlay |
visual(id, props, opts?) | overlay.visual | Overlay |
cue(name) | cue | Marker |
See steps for the semantics of each.
Scene ordering
The order of demo.scene(...) calls is the order of scenes in the final video. There is no separate ordering field.
Optional id on steps
Every step method accepts an optional { id } in its options. This id is stable across edits and is how the Studio and diagnostics refer to a specific step. If you omit it, Democraft generates one — but explicit IDs make diffs and diagnostics far easier to read.
Camera continuity
Within a scene, establish and focus moves compose: a focus after an establish animates from the established framing to the focused target. Across scenes, the camera resets unless you bridge them with a transition.
See capture vs render for how camera state is resolved into the timeline.