Documentation
Verify a component's render
Let your agent compare its render with the reference crop, without leaving your machine.
A render can look right and still drift by a few pixels. Cadralia gives your agent the reference crop and a command to compare it with its own page. The check is an extra capability, not a required step.
It consumes no extraction: the command runs locally, without a session.
The command
Your agent runs:
cadralia-bridge check \
--reference <selectionId> \
--url <its local URL> \
--target "<target selector>"
The agent provides the URL of the page it worked on, or a preview route for the component. Cadralia never guesses the development server.
selectionId is the delivery identifier. It appears in the panel history and in
the handoff the agent received.
What the command produces
The command captures the target element, compares it with the reference crop and
writes four files under .cadralia/checks/<selectionId>/:
reference.png, the delivered crop;current.png, the element as rendered;diff.png, the difference map;report.json, the metrics and the regions ranked by difference.
The report compares geometry, spacing, typography, colors, borders, radii, shadows, icons and graphics. Text content may differ: that is not a failure.
The report is informational. No threshold blocks a delivery or declares the work finished. The agent reads it, decides what to fix, and runs the command again if it wants to.
Two honest rules
- The width must match. An element rendered at another width than the reference fails with a clear message instead of producing a false score. Target a container at the design width, or adjust the page before running again.
- The source scroll is never replayed. Cadralia compares the element with the crop, never the whole page. The starting position of the selection is provenance, not an instruction.
Target a container that matches the area. An element screenshot clips what extends beyond its box, such as an outer shadow.
First version limits
The check works against a local URL, without a session:
- authenticated pages are not supported yet;
- modals, popovers and toasts are not captured;
- native browser dialogs cannot be captured;
- the reference is cached at delivery time. An old history entry cannot be checked again until the reference is persisted in the API.
These limits concern the check. Selection, extraction and acting on a detail keep working normally.
If the check fails
- The reference is missing. Deliver the area again to rebuild the local cache.
- The width does not match. Target a container at the reference width, or render the component at that width.
- The selector finds nothing. Check the URL and the selector. The page must be served, not only present in an editor.
- The browser is missing. Install Chrome, or let Playwright install its Chromium. The command falls back to the system browser last.
To reference an element on any page, see Act on a detail.