Improve spinner and video mode diagnostics#2
Merged
Conversation
Fail fast in the no-spinner path so a delayed loading indicator cannot appear during the final Playwright action timeout and make the add-spinner hint contradict the current UI. Also preserve the expanded loading-text selector via RegExp.source and add a regression covering a late spinner. This commit includes the staged spec readability cleanup from the working tree.
Teach spinnerWaiter to treat visible-but-disabled targets as not ready for click-like actions, so spinner-backed disabled buttons get the longer spinner wait instead of timing out at the action timeout. Record elapsed middleware time before videoMode as dead air, which keeps spinnerWaiter independent while still trimming readiness waits from tight videos. Keep a short final visible hold before trimming after-test padding so the final result remains visible in the tight cut. Update the ffmpeg video spec to use always-rendered disabled stage buttons, assert the final hold, and keep README guidance aligned with the plugin ordering behavior.
…pinner-dx # Conflicts: # src/plugins/spinner-waiter.ts
commit: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ac145dd. Configure here.
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
This tightens middlewright's loading-state and video-mode story:
spinnerWaiternow treats disabled action targets as not ready, so a visible disabled button can still wait behind real progress UI instead of failing early.videoModerecords dead-air spans and element highlight rectangles as metadata, then renders trimming and annotations in post with ffmpeg.page.videoModeexposes runtime helpers for dead air, metadata, output paths, and source range controls likesetStartTime()/setEndTime().pnpm exec pkg-pr-new publish --packageManager=pnpm.Demo videos
These come from
VIDEO_MODE=1 pnpm spec -g list-and-describe --headedin../iterate. The rendered output shows the pointer guidance, dead-air trimming, action holds, and frame-stepper behavior; the raw video is included for comparison.Rendered video-mode output:
video-rendered.webm
Raw Playwright recording:
video-raw.webm
Example
Validation
pnpm typecheckpnpm buildpnpm exec publintpnpm testNote
Medium Risk
Large behavioral change to videoMode and middleware dispatch (timing, arg rewriting, lifecycle order); ffmpeg is now required in CI and for rendered video output, though coverage is extensive.
Overview
Reworks
videoModefrom slowing the browser (pre-action pauses and DOM outlines) to recording dead-air spans and highlight metadata during the test, then producingvideo-raw.webm,video-rendered.webm,video-mode.json, and an HTML frame-stepper via ffmpeg after the run. Tests getpage.videoModecontrols (deadAir,setStartTime/setEndTime,metadata,outputPaths).The plugin system gains
ActionContext.timing, middlewarenext(adjustedArgs), typedpageExtension, andafterTestFinalize(so other hooks can still see an open page before video finalize closes it and writes artifacts).spinnerWaitertreats visible disabled action targets as not ready and routes fast-fail through the middleware chain; bundled plugins no-op whenPWDEBUG=1.CI installs ffmpeg for video tests and publishes pkg-pr-new preview packages on pull requests. Docs and specs cover the new video pipeline, debug mode, and plugin boundaries.
Reviewed by Cursor Bugbot for commit cbdf837. Bugbot is set up for automated code reviews on this repo. Configure here.