feat(demo): add Scene/Stage DSL, runner, and example scenario#4784
Merged
gregpriday merged 3 commits intodevelopfrom Apr 2, 2026
Merged
feat(demo): add Scene/Stage DSL, runner, and example scenario#4784gregpriday merged 3 commits intodevelopfrom
gregpriday merged 3 commits intodevelopfrom
Conversation
- Fix ffmpeg frame naming bug: encode now uses frame-%06d.png matching capture output - Add Stage class wrapping window.electron.demo.* via page.evaluate() - Add demo runner script with CLI args (--scenario, --output, --preset, --fps) - Add basic-terminal example scenario (open terminal, type command) - Add demo/tsconfig.json for standalone NodeNext type checking - Add npm scripts: demo (launch demo mode), demo:record (record scenario) - Add demo-output/ to .gitignore
- Add fps validation in runner (guard against NaN/0/negative, default to 30) - Remove unused --keep-frames CLI flag - Fix window-destroyed mid-capture stall: call stopCapture() instead of silent return
- Add file-level eslint-disable for no-explicit-any in stage.ts (page.evaluate browser context) - Remove unused framesDir variable initialization in runner.ts
5019f01 to
967bb8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StageAPI (demo/stage.ts) withcursor,keyboard,camera,wait, andsleephelpers that wrap the existing low-level demo IPC commandsDemoRunner(demo/runner.ts) that handles Electron launch, scene sequencing, and the full capture lifecycle (start → scenes → stop → encode)basic-terminalexample scenario showing cursor movement, clicking, and terminal typing end-to-endnpm run demoandnpm run demo:recordscripts topackage.jsonResolves #4778
Changes
demo/stage.ts— Stage class with five namespaced sub-APIs, auto-wires capture lifecycle around scene executiondemo/runner.ts— DemoRunner class; reusese2e/helpers/launch.tsfor Electron launch with retry, loads scenario files dynamicallydemo/scenes/basic-terminal.ts— working example scenario; imports selectors from the shared E2E registrydemo/tsconfig.json— TypeScript config scoped to the demo directoryelectron/ipc/handlers/demo.ts— minor handler additions to surfacestartCapture/stopCapture/encodeover IPC.gitignore— ignoredemo/output/artefactsTesting
All three unit tests in
electron/ipc/handlers/__tests__/demo.handlers.test.tspass. Typecheck, lint, and format all clean (npm run check).