How It Works
The full lifecycle of a comment, from click to resolution.
Enter comment mode
Press C on your keyboard, or click the toggle button. The cursor changes to a crosshair and elements start highlighting as you hover.
Click an element
Click any highlighted element. A comment input anchors near the element you selected. The SDK generates a CSS selector and a fingerprint to track this element across page loads.
Write your comment
Type what you see or pick a starter chip. The comment is pinned to that specific element — not a screenshot coordinate, not a vague description.
AI enrichment runs
If AI is enabled, the SDK captures element metadata (tag, text, styles, position) and sends it for enrichment. The AI adds context: what kind of element it is, what might be wrong, and what action to take.
Comment appears in the dashboard
The comment shows up in your Lay dashboard, grouped by page and element. Your team sees the exact element, the comment, the AI context card, and a viewport screenshot.
Your team understands what you mean
No more "the thing on the right." No more screenshots in Slack with red circles. The comment is attached to the element itself. Navigate, resolve, and archive from the dashboard.
Under the hood
When a comment is created, the SDK captures three pieces of data to anchor it:
- CSS selector — A stable path like #submit-btn or [data-feedback-id="checkout-form"]. Used for fast, exact matching.
- Element fingerprint — A hash of the element's tag, text content, attributes, and position. Used as a fallback when the selector stops matching.
- Viewport screenshot — A capture of the visible page at the moment of commenting. Gives visual context in the dashboard.
If the selector stops matching after a deploy, the fingerprint scorer finds the closest match in the current DOM and reattaches the comment automatically.