Detect modals, drawers and soft navigation as region-of-interest states - #158
Open
DavertMik wants to merge 28 commits into
Open
Detect modals, drawers and soft navigation as region-of-interest states#158DavertMik wants to merge 28 commits into
DavertMik wants to merge 28 commits into
Conversation
…rest tool results
…single detection module
…ay API Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
…e is a new state Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
…ional XPath Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
…-only roots Implements the region-states fixes spec: overlay carry-forward with close-check and one-deep parent restore; cross-URL detection gated by similarity; size band (10K floor, 60% page cap) with dominance guard; wrapper-descent semantic roots with no positional XPath exposure; newest-heading naming; ARIA identity merged with probe geometry; state capture on failed batches with truthful per-step reporting; region transitions wake the Pilot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014UNFgBpgs4waGN68TKH1m8
Field replay of the 2026-08-30 run showed the New Plan split-pane at 6.6K minified sitting under the 10K floor, and a filtered-list re-render passing every size gate as a nameless, rootless region. Floor drops to 5K minified; a region with neither a name nor a semantic root is discarded as noise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014UNFgBpgs4waGN68TKH1m8
A panel can appear together with an empty fixed-position guard element in the same container; probing the guard makes the center hit-test veto the whole region as covered. The largest appeared element is the subroot — its xpath is probed and its selector becomes the root. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014UNFgBpgs4waGN68TKH1m8
The suite-selector dialog arrived with a 622K flood of detached list nodes under body and a positionally re-keyed app shell; largest-wins picked the flood, tripped the cap and lost the 13K modal. Gates are per-candidate now: oversized parts are skipped, dominance spans the surviving candidates, fresh-heading candidates outrank larger stale reflows, and the probe skips candidates covered by another element. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014UNFgBpgs4waGN68TKH1m8
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
After every action, the page diff is checked for a newly appeared subtree ≥ 10K chars of minified HTML. A Playwright geometry probe (
elementFromPointsampling, viewport coverage, inert siblings, scroll lock) then classifies it: overlaying (modal/drawer — page behind not actionable) or inline region (soft navigation — area of interest, page still usable). Detection is fully structural — no AI in the path, no class-name selector heuristics.Key changes
overlay.tsis now the single overlay-detection module:findAppearedSubRoot,probeRegionCoverage+classifyRegionCoverage,Overlay.fromSubRoot.Overlaygainsroot,present, anddrawer/regiontypes;detectedkeeps meaning "verified overlaying".region_<name>), so modal open and close record transitions — visible to dead-loop detection. NewbaseHashkeeps the research cache keyed to the page....collapsed (12000 chars)..., an opened region reportsdrawer "Edit User" opened, scope: aside.detail-panelplus the region's snapshot (pageDiff.areaOfInterest).<focus_scope>carries the concrete root selector for verified overlays; inline regions get a softer<area_of_interest>block that leaves page navigation actionable.<state>distinguishesmodal:(overlaying, with root) fromregion:(inline).root: <selector>frontmatter; records withrootload only while a matching region is open.extractVisibleOverlayHtml,OVERLAY_SELECTORS,Action.captureOverlayHtml, theoverlayHtmlchain, and Driller's private extractor (Driller now reads nested overlays frompageDiff.htmlParts).Trade-off (accepted): an overlay already open at the very first capture with no ARIA role isn't detected until the next action — in exchange for deleting class-name pattern matching that only worked on sites that name their CSS a certain way.
Spec:
docs/superpowers/specs/2026-08-29-region-states-design.md· Plan:docs/superpowers/plans/2026-08-29-region-states.mdTests
areaOfInterest, StateManager region transitions, experiencerootwrite/gating, Pilot state context.🤖 Generated with Claude Code
https://claude.ai/code/session_01TkmQDF4DkphEYoy71twQNx