Update client layout instrumentation - #1128
Open
shawj0 wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds lightweight detection of a small set of exact “agentic browser” DOM markers during existing layout discovery/mutation processing, emitting a page-level variable signal (<!>ABS) once per detected marker. It also bumps the monorepo/package versions to 0.8.70 for beta rollout.
Changes:
- Add
layout/agentmarker detection and wire it into the layout node traversal + layout startup. - Expose the new signal via types (
AgenticBrowserSignalenum +Constant.AgenticBrowserSignal = "<!>ABS"). - Add a Playwright test suite covering initial, dynamic, transient, shadow DOM, and iframe scenarios; bump package versions to 0.8.70.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/agentic-browser.test.ts | Adds Playwright coverage for the new agentic marker variable emission behavior. |
| packages/clarity-visualize/package.json | Bumps package and dependency versions to 0.8.70. |
| packages/clarity-js/types/data.d.ts | Adds AgenticBrowserSignal enum and <!>ABS constant key to the public type surface. |
| packages/clarity-js/src/layout/node.ts | Hooks marker detection into element processing during layout traversal. |
| packages/clarity-js/src/layout/index.ts | Resets agentic marker state during layout startup. |
| packages/clarity-js/src/layout/agent.ts | Implements exact-id marker identification and per-page deduped variable emission. |
| packages/clarity-js/src/core/version.ts | Bumps clarity-js internal version string to 0.8.70. |
| packages/clarity-js/package.json | Bumps package version to 0.8.70. |
| packages/clarity-devtools/static/manifest.json | Bumps extension manifest version/version_name to 0.8.70. |
| packages/clarity-devtools/package.json | Bumps package and dependency versions to 0.8.70. |
| packages/clarity-decode/package.json | Bumps package and dependency versions to 0.8.70. |
| package.json | Bumps root monorepo version to 0.8.70. |
| lerna.json | Bumps Lerna version to 0.8.70. |
| clarity("start", { | ||
| delay: 50, | ||
| projectId: "test", | ||
| upload: (payload) => { window.payloads.push(payload); } |
Contributor
Author
There was a problem hiding this comment.
This callback runs inside an injected HTML <script> as plain JavaScript, so a TypeScript annotation would be invalid here. This matches existing test patterns; no change needed.
added 4 commits
August 3, 2026 14:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b609ea0-752a-4773-927c-7d6515ff9c75
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b609ea0-752a-4773-927c-7d6515ff9c75
Roman (rgaleev)
approved these changes
Aug 4, 2026
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
Why
Downstream processing needs a compact page-level indication when these controls are present. Capturing the values during the traversal that already processes layout changes avoids a second DOM scan.
The typed Dimension path provides a compact numeric wire contract and owns per-page deduplication. It avoids using customer events, click telemetry, or the generic system-variable namespace.
Behavior
Not changed
Validation
ABSvariable.Backend contract
Decode should add matching
ClientDimension.AgenticBrowserSignal = 39and route values 1-5 to the session classifier. Unknown Dimension 39 is safely ignored by older Decode builds during rolling deployment.Risk and rollout
Risk is limited by exact matching, typed values, Dimension-level deduplication, and reuse of the current traversal. Publish 0.8.70-beta through the normal beta flight, monitor value distribution and client performance, and roll back by disabling the flight if needed.