Autonomous Visual Feedback Loop
To iteratively verify visual changes and CSS styling on UI components without human intervention, use the built-in single-capture script. This allows you to rapidly generate a screenshot of your work and use your native multimodal vision to inspect the result.
The Loop
- Make changes to the DSL, CSS, or processor code.
- Run the compiler or dev server so the changes are built.
- Capture the component by setting environment variables before calling
pnpm test:screenshot.
Option A: Using specific names
# Capture a standalone componentTARGET_COMPONENT="login-form" pnpm test:screenshot
# Capture a specific tab of a grouped componentTARGET_COMPONENT="showroom:nav-stepper-mid" TARGET_TAB="In Progress" OUT_NAME="showroom:nav-stepper-mid" pnpm test:screenshotOption B: Using the Showroom URL (Easiest)
If you are looking at the Showroom and have the specific URL for a tab (e.g. http://localhost:4321/showroom#tab-panel-160), you can just pass the URL directly:
TARGET_URL="http://localhost:4321/showroom#tab-panel-160" pnpm test:screenshot(The script will automatically determine the correct filename and save it.)
- Read the resulting PNG (saved to
tests/.artifacts/screenshots/) using yourread_filetool to visually verify your fix.
Doβs and Donβts
Do:
- Run the compiler or dev server before capturing so changes are built
- Use
TARGET_URLwhen you already have the Showroom URL β it is the easiest option - Read the resulting PNG with your file-reading tool to visually verify the result
Donβt:
- Skip the build step before capturing β screenshots will show stale output
- Rely solely on the screenshot without visually inspecting it via multimodal vision
Definition of Done
- Screenshot captured and visually verified
- No visual regressions detected or all regressions fixed