Skip to content

fix: improve test.html visual clarity and verify-rule skill#207

Merged
purupurupu merged 19 commits into
mainfrom
fix/test_html
Mar 24, 2026
Merged

fix: improve test.html visual clarity and verify-rule skill#207
purupurupu merged 19 commits into
mainfrom
fix/test_html

Conversation

@purupurupu

Copy link
Copy Markdown
Owner

Summary

Systematic visual improvement of examples/test.html test cases across 15 rules, plus enhancements to the verify-rule skill. Every rule's test cases were verified against real Chromium behavior via Playwright, with per-case screenshots reviewed for visual correctness.

Changes to examples/test.html

Global:

  • Add overflow: hidden to .case CSS class to contain floated elements that were bleeding into adjacent cases

Per-rule improvements (15 rules):

Each rule received the same treatment:

  1. Background color (#e8e8e8) added to all warn and ok case elements for visual contrast
  2. Labels updated to be self-explanatory — warn labels describe the ignored behavior, ok labels explain why the property is effective and what to expect visually
  3. Trivial ok cases removed — default-value cases (e.g. "no margin set", "default auto"), display:contents, and other self-evident cases that add no meaningful coverage
  4. Proper structure — table-related rules now wrap targets in correct table/row/cell structure so internal table display types render correctly
Rule Key Visual Improvements
nonfloat-no-shape-outside Float ok case now has circle shape + wrapping text to show shape-outside effect
nonreplaced-no-aspect-ratio Warn/ok contrast shows height generation difference; img uses data URI SVG
nonreplaced-no-object-fit Img ok case uses wide SVG cropped by object-fit: cover; removed empty embed/object cases
nontable-no-border-spacing Ok table cases have bordered cells showing visible spacing gaps
nontable-no-empty-cells Ok case uses empty+filled cell pair to demonstrate empty-cells: hide
outline-no-style Warn shows no outline; ok shows red solid / blue dashed outline
scroll-no-scroll-padding Ok containers have gradient backgrounds; labels explain scroll-snap relationship
scroll-snap-no-align-without-type Warn/ok cases have scrollable multi-section content with color coding
static-no-offset Ok case shows position: relative + top: 20px actually shifting the element; removed non-verifiable sticky case
table-no-margin Warn cases wrapped in proper table structure; ok cases show margin with bordered cells
table-no-padding Same pattern as table-no-margin
transform-no-origin Warn/ok cases have dimensions; ok cases visually show rotation/scaling from top-left
visible-overflow-no-resize Warn has no resize handle; ok has visible handle in bottom-right corner
visible-overflow-no-text-overflow Warn shows text spilling out; ok shows ... ellipsis truncation

Changes to verify-rule skill (.claude/skills/verify-rule/SKILL.md)

  • New Step 4: Visual Screenshot Check — per-case screenshots taken during Playwright verification, reviewed via Read tool
  • Screenshot template added to Playwright test boilerplate (c.screenshot() per .case)
  • Cleanup updated to delete screenshots alongside temporary test files
  • Report template expanded with Visual Screenshot Check section
  • Label guidance updated — ok labels should explain "why effective" AND "what to expect visually"; non-visual cases should acknowledge limited verifiability

Test plan

  • pnpm test — all unit tests pass
  • pnpm test:e2e — all 20 e2e tests pass (dynamic test count, no code changes needed)
  • pnpm lint — no lint errors
  • Each rule verified individually via temporary Playwright test with per-case screenshots
  • Manual: open examples/test.html in browser and visually confirm warn/ok contrast for each rule section

- Add overflow:hidden to .case so floated elements don't bleed into
  adjacent cases
- Make shape-outside ok case visually verifiable with circle shape,
  background, and wrapping text
- Remove trivial default-value ok case (no meaningful coverage)
- Add background color to warn cases so the lack of height is visible
- Use data URI SVG for img ok case instead of broken empty src
- Update labels to describe visual behavior (height generated vs ignored)
- Remove trivial default-value and display:contents ok cases
Per-case screenshots are now taken during Playwright verification and
reviewed via Read tool to confirm CSS effects are visually apparent.
Catches issues like missing backgrounds, broken images, or styling
that triggers unrelated rule warnings.
- Add background color to all warn cases for visual contrast
- Improve img ok case with wide SVG to clearly show object-fit: cover
  cropping a 200x40 image into a 100x100 square
- Remove empty embed/object ok cases (not visually verifiable)
- Remove trivial ok cases (default values, explicit defaults,
  display:contents)
Explain why each ok case is valid and what to expect visually,
so the section is understandable without inspecting the elements.
ok labels should explain why the case is valid AND what to expect
visually, so the test.html section is understandable at a glance
without inspecting the elements.
- Add background color to all warn cases
- Add two bordered cells to table/inline-table ok cases so
  border-spacing gaps are clearly visible
- Update labels to explain what to expect visually
- Remove trivial default-value ok case
- Add background color to all warn cases
- Replace ok table-cell case with empty+filled cell pair so
  empty-cells: hide effect is visible (empty cell border hidden)
- Update labels to explain what to expect visually
- Remove trivial default-value and inherited ok cases
- Add background and padding to all cases for consistent styling
- Warn case text now states "no outline visible" to clarify the no-op
- Ok labels describe what outline is visible (color, style, width)
- Remove trivial "no inline outline properties" ok case
- Add background color to all warn cases
- Add gradient background to ok scroll containers so scrollable
  area is visible
- Update labels to explain why each case is/isn't a scroll container
  and note that scroll-padding effect requires scroll-snap for full
  visual confirmation
- Remove trivial default-value ok case
- Add background colors to warn and ok cases
- Ok cases now have multiple colored sections to show scroll-snap
  context (snap effect visible on scroll interaction)
- Update labels to explain parent snap-type relationship and what
  to expect
- Remove trivial default-value ok cases (align none, stop normal)
Warn cases now have scrollable content (two 100px sections) matching
ok cases, so the scrollbar is visible and the contrast between
"scrollable but no snap" vs "scrollable with snap" is clearer.
- Add background color to all warn and ok cases
- Warn labels describe the ignored behavior explicitly
- Ok labels explain the visual effect (element shifts, sticks on scroll)
- Remove redundant relative+top:0+left:0 ok case (no visible offset)
sticky + top effect requires scrolling which is not verifiable in
this test page (overflow: hidden on .case prevents scrolling).
The relative + top case already demonstrates that offsets work on
positioned elements.
- Wrap warn cases in proper table structure so internal table
  display types render correctly
- Add background color to all cases for visual contrast
- Ok labels explain the visible margin effect
- Remove trivial ok cases (table-row no margin, block with margin)
- Wrap warn cases in proper table structure so internal table
  display types render correctly
- Add background color to all cases
- Ok cases show padding effect with bordered cells and background
- Update labels to explain visible effects
- Remove trivial ok case (table-row with no padding)
- Add background and dimensions to all cases so transform effects
  (rotation, scaling) are visually obvious
- Ok labels describe the visible effect (rotated from top-left,
  scaled from top-left) and note non-visual cases (offset-path,
  will-change)
- Merge two will-change ok cases into one
- Remove trivial default ok case
- Add background color to all warn and ok cases
- Warn labels note "no resize handle" to explain the visual check
- Ok labels note "resize handle visible in bottom-right corner"
- Remove trivial resize:none ok case
- Add background color to all warn and ok cases
- Warn labels note "text spills out instead of showing ..."
- Ok labels describe visible effect (truncated with "...", scrollbar)
- Remove trivial ok cases (default clip, display:contents, overflow:auto)
- Keep input and vertical writing mode ok cases as meaningful edge cases
@purupurupu
purupurupu merged commit 312841f into main Mar 24, 2026
2 checks passed
@purupurupu
purupurupu deleted the fix/test_html branch March 24, 2026 13:29
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