Repository navigation
feat(tooling): record screenshots as video, with a pointer and callouts - #704
Merged
Merged
Conversation
The screenshot harness could only produce stills, and a still of a multi-step flow does not say *where* the user tapped — on a phone that is most of the story. - **Video, on both platforms**: `video-desktop` / `video-mobile` record scenarios to mp4. Chrome's screencast only emits a frame when the page changes, so frames are written with their real timestamps and encoded with those delays; pauses stay pauses instead of being flattened to a fixed frame rate. ffmpeg is checked up front so a missing install fails before recording starts. (`efmpeg` blocking on stdin when it is not a terminal is what `-nostdin` fixes.) - **Pointer indicator**: a blue dot follows every tap/hover, with a ring on the tap itself, drawn inside the page so it lands in both stills and video. This is what makes mobile footage followable. - **Callouts**: a `marks` step draws a numbered badge on a target (by accessible name or raw coordinates) with a label beside it, so a screenshot can explain itself. `dx`/`dy`/`side` place a callout when two targets are close; numbers accumulate across a scenario, `marksClear` restarts them, and `pointerHide` removes the dot for a clean product shot. `--annotate false` disables both. `mobile/tabs-annotated` is a worked example, so the feature stays exercised. Also fixes the label placement: the anchor is zero-sized, so pinning `right:30px` pushed a right-hand label off the opposite edge — it has to be `left:30px`. The docs state the four use cases this now covers (release notes between two versions, a test checklist for those changes, a single feature diagram, a flow walkthrough) plus video, so a request can be answered from the doc alone.
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.
Follow-up to #703, which added the screenshot harness (rendering the real desktop/mobile UI against demo data in a headless Chrome). Two gaps were left: no video, and nothing on screen saying where the user tapped.
Video (desktop + mobile)
Chrome's screencast only emits a frame when the page changes, so a fixed
-frameratewould compress idle stretches and make the video feel sped up. Frames are written with their real timestamps and encoded with those delays, so the scenario's pace is preserved. ffmpeg is checked before recording starts, so a missing install fails immediately rather than after a long capture. (ffmpeg blocks reading stdin when it is not a terminal —-nostdinis what makes the encode finish.)Video and screenshots share one scenario table, so nothing is maintained twice.
Pointer indicator
In a video of a phone UI, nothing shows where the finger landed. A blue dot now follows every
tap/hover, with an expanding ring at the tap itself. It is drawn inside the page, so it appears in stills as well — which is what lets a single screenshot read as "and then tap here".Callouts
A
marksstep draws a numbered badge on a target (by accessible name, or rawx/y) with a label beside it:{ "marks": [{ "at": "工作区", "label": "① 工作区列表", "dy": -34 }, { "at": "对话", "label": "② 对话列表,可左右滑动切换", "dy": -34 }] }dx/dy/sideplace a callout when two targets are close; numbers accumulate across a scenario,marksClearrestarts them, andpointerHideremoves the dot for a clean product shot.--annotate falsedisables both overlays.mobile/tabs-annotatedis a committed worked example, so the feature stays exercised.Also
right:30pxpushed a right-hand label off the opposite screen edge. It has to beleft:30px.docs/guide/screenshots.zh-CN.mdalone.Makefileuntouched (as before, this is driven as a script, not make targets).Verification
node --checkon the driver,ast.parseoncapture.py, scenario JSON parses.scripts/check-docs.pyclean for the changed docs.git statusshows no png/mp4/jpg.