Skip to content

Stop visual-test scripts leaving empty folders and popping Finder#1144

Merged
nadaverell merged 1 commit into
mainfrom
claude/background-screenshot-issue-24f01c
Jul 10, 2026
Merged

Stop visual-test scripts leaving empty folders and popping Finder#1144
nadaverell merged 1 commit into
mainfrom
claude/background-screenshot-issue-24f01c

Conversation

@roylibman

@roylibman roylibman commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Visual-test runs that capture no screenshots no longer leave empty timestamped folders behind or open Finder on an empty directory. This keeps repeated local visual-test runs quiet while preserving screenshot folders when captures actually exist.

What changed

  • visual-test-stop.sh opens the screenshot folder only when it contains captured files.
  • Empty run directories are removed during stop instead of being left under .playwright-mcp/visual-test/.
  • visual-test-start.sh prunes leftover empty timestamped directories before a new run starts.
  • The startup prune preserves the screenshot directory for the currently active run recorded in .playwright-mcp/visual-test-state.env when that Radar process is still alive, so relaunching with --skip-build cannot delete the active capture target.

Testing

  • bash -n scripts/visual-test-start.sh
  • bash -n scripts/visual-test-stop.sh
  • git diff --check
  • visual-test: skipped (script-only cleanup; no UI delta)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 46d66f2. Configure here.

Comment thread scripts/visual-test-start.sh
visual-test-start.sh pre-creates the timestamped screenshot dir before any capture, and visual-test-stop.sh then ran open on it unconditionally. Runs that captured nothing left an empty zero-KB folder and popped a Finder window every time.

Stop only opens the folder when it actually contains screenshots and removes it otherwise. Start prunes leftover empty dirs from prior runs while preserving the active run recorded in the state file.
@nadaverell nadaverell force-pushed the claude/background-screenshot-issue-24f01c branch from 46d66f2 to 896e942 Compare July 10, 2026 08:09
@nadaverell nadaverell merged commit 3e580a0 into main Jul 10, 2026
9 checks passed
@nadaverell nadaverell deleted the claude/background-screenshot-issue-24f01c branch July 10, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants