Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(skills): let demo storyboards upload a file (#126023)

Daniel Marchuk0227344739a2
diff --git a/.agents/skills/recording-demo-videos/references/storyboard.md b/.agents/skills/recording-demo-videos/references/storyboard.md
index 503e27245fc7..0c6925ee9d11 100644
--- a/.agents/skills/recording-demo-videos/references/storyboard.md
+++ b/.agents/skills/recording-demo-videos/references/storyboard.md
@@ -36,24 +36,25 @@ A storyboard is one JSON file. Paths in it are relative to the file.
## Steps
-A step runs its keys in this order: `goto`, then `caption` (and its voiceover line), `scroll`, `hover`, `click`, `type`, then `wait_for`, `sticker`, then `hold`.
+A step runs its keys in this order: `goto`, then `caption` (and its voiceover line), `scroll`, `hover`, `click`, `type`, `upload`, then `wait_for`, `sticker`, then `hold`.
A `card` or `http` step does only that.
-| Key | Meaning |
-| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `goto` | A path on `base_url` or a full URL, such as the local inbox at `http://localhost:1080`. The load is cut from the video |
-| `caption` | Text in the caption bar, kept until the next caption. `""` hides it |
-| `scroll` | Pixels to scroll down with the mouse wheel (negative scrolls up) |
-| `hover` | A target. The cursor glides to it |
-| `click` | A target. The cursor glides to it and clicks |
-| `type` | `{ "target": …, "keys": ["Home", "ArrowRight x10"], "text": " new words" }`. Clicks the target, presses the keys (`x10` repeats), then types the text |
-| `wait_for` | A target that must be visible. In a `goto` step it waits after the load, otherwise after the action. The wait is cut from the video, so wait on real content, not on a fixed time |
-| `say` | The voiceover line for the step, when it should differ from the caption. `""` keeps the step silent |
-| `sticker` | A hedgehog that pops in once the action is done: `{ "hog": "mailbox", "text": "You've got mail", "position": "bottom-right", "seconds": 3 }`. Positions: `bottom-right`, `bottom-left`, `top-right`, `top-left` |
-| `zoom` | `true` frames the clicked or typed-in target until just after the action. `{ "target": …, "level": 1.6 }` frames a detail once it is on screen, for the rest of the step. See [Zoom](#zoom) |
-| `hold` | Seconds to stay on the result. Default: a quarter of a second per caption word, at least 1.5. With a voiceover, half a second, and the step always waits for its line to finish. Usually leave it unset |
-| `card` | A full-screen card mid-video, with the same fields as `title` |
-| `http` | A terminal card that types out a curl command, sends the request, and shows the response. See below |
+| Key | Meaning |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `goto` | A path on `base_url` or a full URL, such as the local inbox at `http://localhost:1080`. The load is cut from the video |
+| `caption` | Text in the caption bar, kept until the next caption. `""` hides it |
+| `scroll` | Pixels to scroll down with the mouse wheel (negative scrolls up) |
+| `hover` | A target. The cursor glides to it |
+| `click` | A target. The cursor glides to it and clicks |
+| `type` | `{ "target": …, "keys": ["Home", "ArrowRight x10"], "text": " new words" }`. Clicks the target, presses the keys (`x10` repeats), then types the text |
+| `upload` | `{ "file": "devices.csv", "target": … }`. Sets a file on a file input, as if the viewer picked it. `file` is relative to the storyboard, and `target` defaults to `input[type=file]`. Pair it with a `hover` on the drop zone so the viewer sees where the file went |
+| `wait_for` | A target that must be visible. In a `goto` step it waits after the load, otherwise after the action. The wait is cut from the video, so wait on real content, not on a fixed time |
+| `say` | The voiceover line for the step, when it should differ from the caption. `""` keeps the step silent |
+| `sticker` | A hedgehog that pops in once the action is done: `{ "hog": "mailbox", "text": "You've got mail", "position": "bottom-right", "seconds": 3 }`. Positions: `bottom-right`, `bottom-left`, `top-right`, `top-left` |
+| `zoom` | `true` frames the clicked or typed-in target until just after the action. `{ "target": …, "level": 1.6 }` frames a detail once it is on screen, for the rest of the step. See [Zoom](#zoom) |
+| `hold` | Seconds to stay on the result. Default: a quarter of a second per caption word, at least 1.5. With a voiceover, half a second, and the step always waits for its line to finish. Usually leave it unset |
+| `card` | A full-screen card mid-video, with the same fields as `title` |
+| `http` | A terminal card that types out a curl command, sends the request, and shows the response. See below |
A step has one `wait_for`. JSON keeps only the last of two equal keys, so a step that needs to wait after a `goto` and again after a `click` must be two steps.
diff --git a/.agents/skills/recording-demo-videos/scripts/record_demo.py b/.agents/skills/recording-demo-videos/scripts/record_demo.py
index 2f1941d45380..887119c58e47 100644
--- a/.agents/skills/recording-demo-videos/scripts/record_demo.py
+++ b/.agents/skills/recording-demo-videos/scripts/record_demo.py
@@ -688,6 +688,10 @@ class Recorder:
for _ in range(int(times or 1)):
await page.keyboard.press(name)
await page.keyboard.type(self.vars.real(spec.get("text", "")), delay=spec.get("delay_ms", 80))
+ if "upload" in step:
+ spec = step["upload"]
+ loc = self.locate(page, spec.get("target", {"selector": "input[type=file]"}))
+ await loc.set_input_files(str(self.base / self.vars.real(spec["file"])))
acted = self.now()
if "wait_for" in step and "goto" not in step:
await self.waited(self.locate(page, step["wait_for"]).wait_for(timeout=STEP_TIMEOUT_MS))