feat(plugin-autocapture-browser): add captureCssClasses option (DMT-525)#1770
Open
Dogfalo wants to merge 2 commits into
Open
feat(plugin-autocapture-browser): add captureCssClasses option (DMT-525)#1770Dogfalo wants to merge 2 commits into
Dogfalo wants to merge 2 commits into
Conversation
Adds an `elementInteractions.captureCssClasses` option (default true) that, when set to false, omits the `classes` field from every entry in the captured element-interaction hierarchy. The top-level `[Amplitude] Element Class` property is intentionally not affected. The effective value is read live from the options bag on every capture so that in-place updates delivered via the existing `elementInteractions` remote-config channel (the same pattern used for `pageActions`) are honored on the next capture without SDK reinitialization. The live options bag is also forwarded to the Visual Labeling selector iframe via the messenger handshake so the UI / AI flows stay consistent with what the SDK is capturing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sClasses Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
size-limit report 📦
|
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
elementInteractions.captureCssClassesoption (defaulttrue). When set tofalse, theclassesfield is omitted entirely from every entry in the captured element-interaction hierarchy — not present asnull, not as[].classesfield. The top-level[Amplitude] Element Classevent property is intentionally unaffected.DataExtractorreads the effective value live from the options bag on every capture (not cached at construction), so in-place updates delivered via the existingelementInteractionsremote-config channel — the same pattern used forpageActions— are honored on the next capture without SDK reinitialization.elementInteractionsOptionsfield) so the UI / AI flows can branch oncaptureCssClassesand stay consistent with what the SDK is capturing.Test plan
pnpm --filter @amplitude/plugin-autocapture-browser testpasses, including the new suites:data-extractor.test.ts→captureCssClasses option threading(default-on byte-equivalence, off path omits field entirely, top-level[Amplitude] Element Classstill populated, in-place options-bag flips honored on next capture in both directions).hierarchy.test.ts→captureCssClasses option(default / explicit-true / explicit-false / sensitive-input cases).default-event-tracking-advanced.test.ts→ liveelementInteractionsOptionsreference passed toenableVisualTagging.captureCssClasses: false, verify a real click event in the browser produces an[Amplitude] Element Hierarchypayload that contains no"classes"key while[Amplitude] Element Classis still populated.🤖 Generated with Claude Code