feat: animation inspection, burst capture, and screencast commands#1224
Open
Gablas wants to merge 6 commits intovercel-labs:mainfrom
Open
feat: animation inspection, burst capture, and screencast commands#1224Gablas wants to merge 6 commits intovercel-labs:mainfrom
Gablas wants to merge 6 commits intovercel-labs:mainfrom
Conversation
New commands for inspecting and capturing browser animations: - `animation list` — query all running animations via Web Animations API - `animation pause/resume [index]` — control animation playback - `animation scrub <0.0-1.0> [index]` — scrub to specific progress - `animation audit` — performance/a11y audit (layout triggers, reduced motion) - `screenshot --burst N --interval Ms [--gif path]` — multi-frame capture - `screencast <duration_ms> [--gif path]` — CDP Page.startScreencast streaming GIF encoding uses the `image` crate (already a dependency). Screencast achieves ~25fps via native CDP frame streaming, vs ~5fps with polling.
Contributor
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
added 5 commits
April 12, 2026 17:40
Adds start/stop mode to screencast that records frames in the background while logging every command that runs during the recording: agent-browser screencast start agent-browser click @E5 agent-browser fill @e10 "hello" agent-browser screencast stop ./output --gif recording.gif The stop output includes a timeline mapping each action to the nearest captured frame by timestamp, so you can see exactly which frame corresponds to each interaction. Uses a background tokio task with its own CDP event subscriber for continuous frame collection independent of command processing.
CDP's Page.startScreencast only sends frames when the screen changes, so recordings during sleep/idle periods between commands had almost no frames. Added a 250ms polling fallback using Page.captureScreenshot that kicks in when no screencast frames arrive, ensuring continuous frame coverage even on static pages.
screencast.rs:
- Replace abort+sleep with cooperative shutdown via oneshot channel
- Pass user's format/quality into background collector (was hardcoded jpeg/80)
- Fix Lagged broadcast error in screencast_capture (was breaking loop early)
- Propagate file write errors instead of silently swallowing with .is_ok()
- Log Page.stopScreencast cleanup failures instead of discarding
- Log ACK failures and base64 decode errors in background collector
- Use Option<String> for TimelineEntry.action instead of empty string sentinel
- Extract save_recording_output to reduce ScreencastRecording unit size
animation.rs:
- Detect JS-returned { error: "..." } objects in eval_and_return and
convert to Err (was silently returned as Ok, bypassing error handling)
- Add keyframeError field to list output when getKeyframes() throws
- Add comments to catch blocks explaining why errors are expected
commands.rs:
- Validate --burst flag has a valid positive integer (was silently defaulting)
Timeline entries now capture action-specific metadata: - navigate: url - scroll: direction - wait: duration - press: key - click/fill: selector, value (already worked) Browser close during active recording no longer loses frames. The close handler auto-saves collected frames to the default screencast output directory before shutting down. Also made screencast stop work even after browser close by not requiring an active browser connection to save the recording.
… GIFs screencast start now accepts --fps N and --quality N flags. Default changed from ~4fps/q80 to 2fps/q60, producing ~18x smaller GIFs (485KB vs 9MB for a 5-second recording). Examples: screencast start # 2fps, jpeg quality 60 screencast start --fps 1 --quality 30 # low bandwidth screencast start --fps 10 # high framerate for animation capture
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.
Closes #1223
What this does
Adds commands for inspecting and capturing browser animations. More context in the linked issue, but the short version: agents couldn't see animations before, now they can.
Three things:
animation list/pause/resume/scrub/auditcommands that use the Web Animations API to query and control animationsscreenshot --burst N --interval Ms --gif pathfor multi-frame capture with optional GIF encodingscreencast <duration_ms> --gif pathusing CDP's native Page.startScreencast for efficient frame streamingNo new dependencies. GIF encoding uses the
imagecrate that's already in Cargo.toml.New commands
animation listanimation pause [index]animation resume [index]animation scrub <0.0-1.0> [index]animation auditscreenshot --burst 10 --interval 200 --gif out.gifscreencast 3000 --gif out.gifTesting
animation liston animate.style, returns CSS animation with full keyframesanimation audit, correctly flags perf-good properties and reduced-motion handlingscreencast 5000 --gifon a real app, captured 352 frames of a streaming chat responseHappy to adjust anything based on your prefferences. First time contributing here so let me know if I missed something.