Strip variant-prefixed classes from combined HTML snapshot - #112
Merged
Conversation
Classes like `dark:bg-slate`, `hover:underline` or `md:flex` describe how an element looks in another state, not what it is. `cleanElement()` now drops any class containing `:`, matching what `htmlMinimalUISnapshot` already did through its `(:|__)` filter, so both snapshot paths agree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Explorbot Self-RegressionCommit
Attempt details
Session analysis — basic (native): Session AnalysisExplored the Issues page filtering and search capabilities. All core filter and search flows work, though some automation edge cases around filter reset did not fully execute as intended. Coverage
What works
Execution Issues
|
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.
What
cleanElement()insrc/utils/html.tsnow drops any class name containing:, so variant-prefixed classes (dark:bg-slate,hover:underline,md:flex,group-hover:opacity) no longer reach the combined HTML snapshot.Why
Those classes say how an element renders in some other state — a theme, a breakpoint, a pointer state — never what the element is. They are pure noise in the snapshot the agents read. Variants carrying a digit (
dark:bg-gray-800) were already dropped by the existing digit filter; the ones without (hover:underline) survived.htmlMinimalUISnapshotalready filtered these through its(:|__)rule, so this only brings the combined path in line with the minimal one.Verification
tests/unit/html.test.ts— 55/55 pass with this change applied.bun -eonhtmlCombinedSnapshot, output above.Note: running that test file again later hit a pre-existing environment failure — Bun refuses jsdom's CJS
require()of ESM parse5. It reproduces on a cleanorigin/maincheckout and also breakstests/unit/web-element.test.ts, so it is unrelated to this change and out of scope here.🤖 Generated with Claude Code