impeccable icon indicating copy to clipboard operation
impeccable copied to clipboard

[Bug] detect: elements inside an `inert` subtree under a page overlay count as occluded/nested content

Open openwong2kim opened this issue 1 month ago • 3 comments

Summary

The browser detector counts elements inside an inert subtree, that sits under an absolutely positioned page overlay, as live page content. text-occlusion and nested-cards then fire on content the user cannot see or reach. This is the same family as #882 (closed <details> content counted as an occluder), but for inert.

Where I hit it

I ran /impeccable critique against the Fleet page of an Electron app (wmux). The scanner was injected into the renderer through CDP, which works fine; see the separate issue about desktop apps.

  • The Fleet page is a route overlay: .wmux-page { position: absolute; z-index: 40 }.
  • The workspace view stays mounted underneath, inside an ancestor with the inert attribute.

The scan reported:

  • text-occlusion ×27. Every hit pointed at the inert sidebar under the overlay. The overlay's own rows hit-test to themselves.
  • nested-cards and cramped-padding also fired on the inert sidebar and a pane header under the overlay.

So 30+ of the 35 findings on that page were noise. The real ones (three low-contrast hits and a skipped heading level) were easy to miss among them.

Repro (minimal)

<body>
  <div inert>
    <aside style="width:260px;border:1px solid #ddd;border-radius:8px;padding:8px">
      <div style="border:1px solid #ddd;border-radius:8px;padding:8px">Workspace A</div>
      <span>Status text that is fully covered</span>
    </aside>
  </div>
  <main style="position:absolute;inset:0;z-index:40;background:#fff">Overlay page</main>
</body>

Run the browser detector: the covered, inert text is reported.

Expected

Skip elements inside an inert subtree, the same way #918 skips closed <details> content. More generally, skip anything that is not hit-testable at rest (also covers aria-hidden route stacks and visibility:hidden keep-alive views).

Environment

impeccable skill 4.5.0, CLI 4.0.0 (darwin-arm64), detector injected via impeccable live-server into an Electron 146 renderer.


Prepared with AI assistance (Claude Code); reviewed and posted by the account owner.

openwong2kim avatar Oct 05 '26 14:10 openwong2kim

If it helps, I'm happy to send a PR for this one. The fix looks like the same shape as #918: check inert (and other not-hit-testable-at-rest states) in the occlusion and nesting paint checks, with a should-pass fixture case, failing Rust coverage first, and the regenerated in-page bundle. I'll wait for a maintainer go-ahead before opening anything, per the contribution guidelines.


Prepared with AI assistance (Claude Code); reviewed and posted by the account owner.

openwong2kim avatar Oct 05 '26 15:10 openwong2kim

Confirmed: inert is only consulted in the hidden-content check, not by text-occlusion, nested-cards or cramped-padding. Please go ahead with the PR. Keep it to inert subtrees (widening to aria-hidden or visibility: hidden can be a follow-up), with a should-pass fixture case, Rust coverage, an oracle case, and the refreshed bundle from cargo xtask bundle.

(Reply by Claude Code on behalf of @pbakaus.)

pbakaus avatar Oct 15 '26 14:10 pbakaus

@openwong2kim are you still planning a PR for this? It's still reproducible on main (#1137's hidden-mockup filter doesn't cover inert subtrees). If we don't hear back in about a week, we'll fix it ourselves. (Comment posted by Claude Code on behalf of @pbakaus.)

pbakaus avatar Oct 23 '26 18:10 pbakaus