Skip to content

Strip variant-prefixed classes from combined HTML snapshot - #112

Merged
DavertMik merged 1 commit into
mainfrom
fix/strip-variant-classes
Aug 15, 2026
Merged

Strip variant-prefixed classes from combined HTML snapshot#112
DavertMik merged 1 commit into
mainfrom
fix/strip-variant-classes

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

What

cleanElement() in src/utils/html.ts now 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.

htmlMinimalUISnapshot already filtered these through its (:|__) rule, so this only brings the combined path in line with the minimal one.

<div class="card dark:bg-slate hover:underline md:flex panel">   →   <div class="card panel">

Verification

  • tests/unit/html.test.ts — 55/55 pass with this change applied.
  • Direct check via bun -e on htmlCombinedSnapshot, 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 clean origin/main checkout and also breaks tests/unit/web-element.test.ts, so it is unrelated to this change and out of scope here.

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

Explorbot Self-Regression

Commit 4bea527 · run

Scenario Result Attempts Duration
basic (native) PASS 1/3 9m
experience: control OK — failed as expected 1/1 1m
experience: seeded PASS 1/3 2m

Attempt details

  • basic (native) attempt 1 — PASS: login evidence: PASS (post-login plan=true, post-login research=true); research: PASS (files=6, wellFormed=true, keywords=7/3); scenarios: PASS (tests=6/5, features=4/3); tests passed: PASS (5 passed, 0 failed (reporter: 5 passed, 0 failed))
  • experience: control attempt 1 — PASS: control: OK — failed as expected (0 passed, 1 failed)
  • experience: seeded attempt 1 — PASS: seeded: PASS (1 passed, 0 failed)

Session analysis — basic (native):

Session Analysis

Explored 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

  • Pages: /issues
  • Features: Create issue, filter by status, filter by label, text search, clear filters

What works

  • Issue creationET-1 Create new issue with all fields
  • Status filteringET-2 Filter issues by status
  • Label filteringET-3 Filter issues by label
  • Text searchET-4 Search for issues by text
  • Clear filtersET-5 Clear all filters and reset list

Execution Issues

  • ET-2 Filter issues by status — selected Closed in UI but verification checked for Open; test passed despite this mismatch
  • ET-5 Clear all filters and reset list — failed to reset Status dropdown to "Any status" but final state showed all 6 issues anyway, test passed vacuously

@DavertMik
DavertMik merged commit 7a492a0 into main Aug 15, 2026
3 checks passed
@DavertMik
DavertMik deleted the fix/strip-variant-classes branch August 15, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant