Skip to content

Expose visual explanation controls#1871

Merged
chubes4 merged 1 commit into
mainfrom
fix/1870-visual-explanation-contract
Jul 18, 2026
Merged

Expose visual explanation controls#1871
chubes4 merged 1 commit into
mainfrom
fix/1870-visual-explanation-contract

Conversation

@chubes4

@chubes4 chubes4 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expose visual explanation element/candidate limits and repeatable selectors in the public wordpress.visual-compare command contract
  • normalize camelCase and kebab-case fields consistently for pair and matrix runs
  • preserve bounded defaults while strictly rejecting malformed limits
  • record effective options and selector inheritance in deterministic screenshot-backed evidence

Closes #1870

How to test

  1. Check out this branch in a fresh clone.
  2. Run npm ci.
  3. Run npm run test:browser-visual-compare-contract.
  4. Run npm run test:browser-visual-compare-fair-ratio.
  5. Run npm run test:browser-visual-compare-layout-drift.
  6. Run npm run test:browser-visual-compare-blocks-engine-adapter.
  7. Confirm malformed values such as 1.5, 160px, zero, and negatives are rejected.
  8. Confirm matrix entries accept maxExplanationElements, maxExplanationCandidates, and explainSelectors while retaining command-level selectors.

Verification

  • TypeScript build/typecheck passes through the contract test
  • All listed focused visual-compare tests pass
  • Browser DOM capture test was not run locally because Playwright Chromium is not installed; screenshot-backed contract coverage passes

Backwards compatibility

Additive command-contract change. Existing defaults remain 25 explanation elements and 160 candidate DOM elements. No existing argument behavior changes except malformed positive-integer values now fail instead of being partially parsed.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI gpt-5.6-sol via OpenCode
  • Used for: Implemented and reviewed the command contract, normalization, validation, evidence, tests, and PR.

@chubes4
chubes4 merged commit fedc677 into main Jul 18, 2026
4 checks passed
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.

Expose visual explanation depth and selector controls

1 participant