Skip to content

lab(decision): target engine-proven scroll containers - #5

Draft
kvnloo wants to merge 20 commits into
mirror/decision-775-a1c14b75from
lab/decision-scroll-targets
Draft

kvnloo wants to merge 20 commits into
mirror/decision-775-a1c14b75from
lab/decision-scroll-targets

Conversation

@kvnloo

@kvnloo kvnloo commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Lab goal

Prototype the remaining scroll failure from e2e-inc#775 without adding a CSS/layout heuristic to the decision executor.

The live benchmark on e2e-inc#775 showed that the fingerprint fix recovers viewport scrolling, but nested-scroll scenarios still fail because the executor can only call:

ctx.actions.scroll('down')

even though the runner already supports:

ctx.actions.scroll('down', target)

The missing fact is which observed nodes are actually scroll surfaces.

Invariant

The executor should choose among scroll targets the engine has evidence for; it should never guess scrollability from a role, size, or DOM shape.

This branch adds an additive semantic state:

node.states?.scrollable === true
  • web: true only when computed overflow accepts user scrolling and the element's scroll extent exceeds its client box;
  • mobile: uses agent-device's existing isScrollableNodeLike classification;
  • decision: scroll_up / scroll_down keep the viewport as a candidate and add visible engine-proven scroll containers. With more than one candidate, the decision request asks a target question and dispatches the selected existing ctx.actions.scroll(direction, target).

No coordinates or node ids become durable authority; the target remains an id from the newest observation and the runner owns stale-ref handling.

Why separate from e2e-inc#775

e2e-inc#775 is already close to merge, and @guhcostan correctly identified nested scrolling as a design decision rather than something to slip into its stall-guard fix. This branch is intentionally a delta from e2e-inc#775 head a1c14b75 so the seam can be reviewed independently.

Coverage

  • decision element table: viewport + scroll-container candidates;
  • decision executor: emits scroll_down_target and dispatches the chosen node;
  • web integration: overflow geometry distinguishes a real scroll surface from overflow: hidden and content that fits;
  • mobile unit: iOS collection/table and Android list views publish scrollable.

Credit

This follows the live diagnosis from @okwasniewski and @guhcostan on e2e-inc#775. The existing targeted ExecutorActions.scroll(direction, target?) API does the actual work; this branch only exposes the missing platform evidence to the executor.

Verification

Not run in this GitHub connector environment. Before proposing upstream, run:

pnpm install --frozen-lockfile
pnpm build
pnpm --filter @e2e-dev/decision test
pnpm --filter @e2e-dev/web exec vitest run tests/integration/read-node-states.test.ts
pnpm --filter @e2e-dev/mobile exec vitest run tests/unit/nodes.test.ts
pnpm check

Then rerun the e2e-inc#775 live benchmark cases: infinite-scroll, virtualized-table, and sticky-chrome, and compare target choices / completion rate against a1c14b75.

@kvnloo kvnloo added the keep pr-janitor: never auto-close label Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep pr-janitor: never auto-close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant