Repository navigation
feat(expect): add toBeInViewport for web and mobile - #2011
Conversation
🟢 e2e web: 95 passedAll 95 tests in 43 files
Tested by e2e 0.24.0 · 1m 14s · web · run artifacts |
🟢 e2e web agent: 34 passed35 agent steps · 26 replayed from cache · 25 model calls · 133.7k tokens (94% cached) · $0.0053 All 34 tests in 5 files
Tested by e2e 0.24.0 · 1m 40s · web · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 32 model calls · 186.0k tokens (89% cached) · $0.0094 All 20 tests in 1 file
Tested by e2e 0.24.0 · 5m 51s · android-emulator · run artifacts |
🟢 e2e ios: 60 passed, 1 skippedAll 61 tests in 7 files
Tested by e2e 0.24.0 · 6m 40s · ios-simulator · run artifacts |
🟢 e2e android: 61 passed, 1 skippedAll 62 tests in 7 files
Tested by e2e 0.24.0 · 10m 9s · android-emulator · run artifacts |
c7123ea to
cc66ae3
Compare
🟢 e2e ios agent: 1 flaky, 20 passed, 1 skipped25 agent steps · 12 replayed from cache · 61 model calls · 556.3k tokens (83% cached) · $0.0369
|
| Test | Agent | Time | |
|---|---|---|---|
| tests-agent/scenarios.e2e.ts · 1 flaky, 20 passed, 1 skipped | 25 steps · 61 calls | 8m 32s | |
| 🟢 | act completes Login Form | 1 step | 39.6s |
| 🟢 | act completes Infinite Scroll List | 1 step | 34.8s |
| 🟢 | act completes Modal Flow | 1 step | 10.8s |
| 🟢 | act completes Bottom Tabs | 1 step | 7.7s |
| 🟢 | act completes Text Input Variations | 1 step | 12.1s |
| 🟢 | act completes Broken Accessibility | 2 steps · 8 calls | 37.8s |
| 🟢 | act completes Vision Only | 2 steps · 6 calls | 24.4s |
| act completes Gestures (2 failed attempts first) | 1 step · 8 calls | 34.3s | |
| 🟢 | act completes Async States | 1 step · 9 calls | 31.7s |
| 🟢 | act completes Debounced Search | 1 step · 1 call | 29.3s |
| 🟢 | act completes Flattened Registration Form | 2 steps · 1 call | 26.9s |
| 🟢 | act completes Flattened Login | 2 steps · 13 calls | 1m 7s |
| 🟢 | act completes Sticky Chrome Target | 1 step | 13.3s |
| 🟢 | act completes WebView Accessibility | 1 step | 12.2s |
| 🟢 | act completes Permission Prompt | 1 step | 11.8s |
| 🟢 | act completes Photo Picker | 1 step · 2 calls | 28.2s |
| 🟢 | act completes Product Catalog | 1 step | 10.6s |
| 🟢 | act completes Error Recovery | 1 step | 9.4s |
| 🟢 | act completes Choice Controls | 1 step · 5 calls | 32.2s |
| 🟢 | act completes Stripe PaymentSheet | 1 step · 8 calls | 27.7s |
| 🟢 | act completes Apple Pay | 1 step | 11.2s |
| ⏭️ | act completes Apple Pay Billing Address (skipped: the CI simulator's Apple Pay sheet skips the billing-address step, so the scenario cannot be completed there) |
Tested by e2e 0.24.0 · 9m 54s · ios-simulator · run artifacts
kdy1
left a comment
There was a problem hiding this comment.
Note
This text was drafted with AI and posted after human approval.
- Harness: T3 Code (Claude Code harness)
- AI agents: Claude Opus 5.5 (claude-opus-5-5), coordinator in T3 Code, GPT-6.2 Astra (gpt-6.2-astra), Review Once subagent via Codex, GPT-6.2 Sol (gpt-6.2-sol), Review Once subagent via Codex, Claude Opus 5.5 (claude-opus-5-5), Review Once subagent via Claude, Claude Sonnet 5.5 (claude-sonnet-5-5), Review Once subagent via Claude
Thanks, the matcher works as described on the cases I ran (testbed controls.e2e.ts 21/21, web viewport-intersection + lifecycle 35/35, e2e unit 210/210, mobile engine unit 256/256 at cc66ae3b).
I'm requesting changes for one P2 in the web measure, explained inline on packages/web/src/surface.ts. A fully visible element that the page replaces on every frame reads as outside the viewport, so .not.toBeInViewport() passes on it. I reproduced it in Chromium (20/20 samples { intersects: false, ratio: 0 }) and checked a 5-line fix (20/20 NODE_STALE, existing tests still pass).
The other 5 inline comments are P3. None of them would block on its own. Because the P2 needs another iteration anyway, I'm asking for them in the same round. If you prefer to leave one for a follow-up, say so in the thread.
6 inline comments in total.
michal-e2e
left a comment
There was a problem hiding this comment.
Note
Drafted with AI (Claude Code and Codex in T3 Code; Claude Opus 5.5, with GPT-6.2 Astra, GPT-6.2 Sol and Claude Fable 5.2 as second readers), checked and posted by me.
@KrzysztofMoch, this adds to @kdy1's review at the same commit (cc66ae3b4). On the stale read at the read step, of kdy1's two options I would narrow the description. I did not rerun kdy1's P2. Two more things need changing, and I add one case to kdy1's mobile screen-size comment.
Must fix
-
packages/e2e/schema/fixtures/engine-manifest-v1.invalid.json:1: the invalid fixture is unchanged, thoughAGENTS.mdasks a wire change to edit both fixtures. It already fails on older rules, so deleting the new one (engine/viewportIntersectionrequiresengine/observe) leaves every schema test green; I ran that. Replace it with{"name":"android","version":"0.1.0","spiVersion":1,"methods":["engine/viewportIntersection"]}, as #1633 did forreadStyle. Tried: the fixture test passes, and removing the rule now fails it. Therefusedlist atengine-protocol.test.ts:539already covers the old fixture's actions case, but nothing else checks itsisolation: "attempt", so addexpect(validate({ ...base, methods: ['engine/observe'], isolation: 'attempt' })).toBe(false);after that loop. -
packages/e2e/tests/unit/expect-viewport.test.ts:61: two claims in your description are only partly tested: the existing tests miss three cases, and the mutants under them pass this PR's tests. "ratio: 0works the same as leavingratioout" is tested only on an engine that reports a ratio (line 34); on one that reports onlyintersects, as mobile does,const minimum = ratiopasses, though{ ratio: 0 }on a device then fails withUNSUPPORTED_CAPABILITY. "An engine answer outside the contract isENGINE_FAILURE" is tested only withratio: 2; dropping the negative-ratio or the non-boolean-intersectscheck passes. Addawait expectFixture(visiblePart).toBeInViewport({ ratio: 0 });after line 63, and loop the test at line 120 over{ intersects: true, ratio: 2 },{ intersects: false, ratio: -0.1 }and{ intersects: 'yes' }(intersects: falsekeeps the negative row failing on the range check alone if you add kdy1's consistency check). Tried: all 9 tests pass and each of the three mutants fails one.
Adding to kdy1's mobile screen-size comment
surface.ts:1310: kdy1 names foldables; after the public device.fold(), the check can still measure against the old screen size. On the fake device (not a foldable emulator): Android at 412x915, one observe, fold('open'), then a capture at 841x701 with a button at x: 600 measured { intersects: false }. Whatever fix you pick there, please add a fold case beside the fold test at engine.test.ts:2639.
Optional
.changeset/viewport-matcher.md:14: on a device,ratio > 0fails withUNSUPPORTED_CAPABILITYonly once the node is on screen; off screen,.notpasses, as your test at line 72 expects.docs/reference/expect.mdxalready says "once the node is on screen"; the changeset andskills/e2e/references/writing-tests.md:413could say the same (thenpnpm plugins:sync).docs/reference/errors.mdx:151: theUNSUPPORTED_CAPABILITYrow has none of the new causes (noviewportIntersection,ratio > 0with no reported ratio, a node with no reportable bounds).- Tests for two more surviving mutants: a mobile node on screen lower than the screen is wide, such as below
y: 390on the 390x844 test screen (computing its height against the width passes today), and a zero-height web element (droppingbox.height <= 0passes today).
Verified
- On the merge base (
e88153b2f), the new testbed test fails through the built CLI withexpect(...).not.toBeInViewport is not a function, and the PR'sexpect-viewport.test.tscopied onto that build fails 9 of 9. - Mutation testing at
cc66ae3b4, each mutant run against this PR's own tests: 42 mutants, 22 killed by an assertion, 14 survived, 6 unconfirmed: 5 made a test fail without a failed assertion, and 1 passed the unit tests and failed the new testbed test's message assertion. The survivors I ask tests for are under the two must-fix items and the last optional bullet. - Mobile from CI at this head, not run here: "sticky chrome" passed on iOS and Android.
Not run: a foldable emulator; iOS and Android locally; Lightpanda, where the new controls.e2e.ts test calls scrollIntoView, which docs/integrations/lightpanda.mdx lists as a no-op.
The engine contract, the schema and the mobile peer range are code-owner paths, so the approval is @okwasniewski's.
cc66ae3 to
611bc6a
Compare
|
@michal-e2e thanks, all of it is in 10a438f. Must fix
Fold
Optional
Stale read: I fixed it in code rather than narrowing the description.
[claude-opus-5-5] responding on behalf of KrzysztofMoch |
10a438f to
8377566
Compare
michal-e2e
left a comment
There was a problem hiding this comment.
Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.
Reviewed at 83775666e (merge base d53602a84, main). It merges cleanly with main at 634d06047.
Thanks @KrzysztofMoch, every must-fix from my last review and kdy1's comments is fixed, and the rebase onto #1883 kept both fixture rules. I found nothing blocking, so I'm approving this commit. The engine contract, the manifest schema and its fixtures are code-owner paths, so @okwasniewski's sign-off is still his to give.
Must fix: none.
Optional
- Your changeset bumps
e2e,@e2e-dev/core,@e2e-dev/weband@e2e-dev/mobile, but not@e2e-dev/desktop.CONTRIBUTING.md("Engine contract") says a change to the engine contract bumps "every engine together in one release, with a changeset for each". I missed this last round. The pending changesets for #1883 (a new engine action) and #1962 (thereadonlynode state) do not list desktop either, and desktop has pending changesets of its own, so it ships in the same release anyway. Adding"@e2e-dev/desktop": patchfollows the rule as written..changeset/viewport-matcher.md:5 - A tiny positive share prints as 0. With no
ratio,describeRatioreturns the three-decimal rounding, so a failing.not.toBeInViewport()on a share of0.00025saysobserved: 0 of its box inside the viewport. Print the share in full when it rounds to 0 but is above 0.packages/e2e/src/expect/async.ts:588 - Can we add a mobile test with a zero-size rect inside the screen (
{ x: 10, y: 300, width: 0, height: 0 }, expects{ intersects: false }) and one that straddles the bottom edge (expects{ intersects: true })? Changingwidth > 0 && height > 0to>= 0passes every test today.packages/mobile/src/surface.ts:1344 docs/reference/engine.mdxsaystoBeInViewportwithratio > 0"then fails withUNSUPPORTED_CAPABILITY". The changeset andexpect.mdxalready add "once the node is on screen"; the same qualifier fits here.docs/reference/engine.mdx:456
Verified
- Each earlier must-fix at
83775666e: the mobile measure confirms the capture's own size throughviewportFor(fold and resize tests), the invalid fixture fails only onengine/viewportIntersectionwithoutengine/observe,ratio: 0and five out-of-contract answers are tested, the changeset wording is fixed, a node replaced after it is observed is stale on web, size and ratio come from one observer entry, a stale read is sampled again, contradictory answers areENGINE_FAILURE, and0.99975prints in full. - The rebase:
git range-diffshows nine of eleven commits unchanged; the rest is a comment line from #1883 and the fixture conflict. #1883's duplicate payload case moved into an inline test that still assertsuniqueItemsat/actions, and the new test assertscontainsat/methods. - Suites at
83775666e, run here:pnpm checkandpnpm testpass, the testbed passes (608 passed, 1 skipped), including "toBeInViewport follows the scroll position, and no match is outside the viewport", and the web benchmark passes (95). The web agent suite from its recordings fails the same 8 tests on this PR and on its merge based53602a84, each a step with no recording that calls the model without a key here (MODEL_PROVIDER_FAILED); CI'sweb agentjob, which has the key, passes at this head. - CI's
specjobs at this head were cancelled at the 15-minute limit. Main's ownspecruns hit the same limit at the same time (45164506047, 45157201606). It needs a rerun before merge. - Merged with main at
64d5be8bblocally: the PR's e2e unit files (320 passed), the mobile engine unit tests (285 passed), the web viewport integration test (5 passed) andpnpm typecheckall pass. Main has moved one commit since (#2096), touching none of this PR's files. - Mutation testing: 26 mutants over the branches this PR adds or changes, 17 killed by a failing assertion, run with each mutant applied to
83775666e. Every mutant that undoes one of the fixes above is killed. One more fails another way:ratio: 0read as a share makes the newratio: 0line throwUNSUPPORTED_CAPABILITY. Eight survive: the zero-size mobile rect above; two that give the same answer as the head (the firstisConnectedand thegetClientRectschecks, now covered by the checks in the observer callback); and five from last round on code that did not change (the superseded-locate check, the float tolerance, the 0 to 1 clamp, and the mobile left and top clips). Two more mutants remove main's schema rules that the rebased tests now carry (isolation: 'attempt'refused,actionsunique); both are killed. - New tests and the mutant that kills each: the contract test (negative ratio, ratio above 1, contradictory answers, non-boolean
intersects), the rounding test,readViewportstale (two mutants), the resized-screen and fold tests (measure against the known screen, binding without its capture size), theLowernode (height against width), the ticker test (no detach check in the callback),#flat(no height check), the new schema test (rule removed), theisolation: 'attempt'line, and the rewritten duplicate payload test (uniqueItemsremoved). Theratio: 0line fails another way, as above.
Not run
- Mobile locally. CI's iOS and Android deterministic and agentic jobs pass at this head (run 45164027996), including the sticky chrome test that uses
toBeInViewport. - A foldable emulator:
device.fold('open')on a Pixel Fold, thentoBeInViewport()on a node past the closed screen's edge. - Lightpanda:
pnpm --filter @e2e-dev/testbed run test:lightpanda. The new testbed test scrolls, which the Lightpanda page lists as a no-op.
For the maintainer
- Release order: core is
0.24.0with only patch changesets pending for it, and the engines' peers read>=0.25.0(set on main by #1962). Which core version this ships in is yours to settle. - Still open from last round: a node with no box (web reads
display: noneas outside, mobile throws),ratioon a device refused only once the node is on screen, and no Lightpanda row.
The findings are mine; the approval of the code-owner paths is @okwasniewski's.
8377566 to
e678ba4
Compare
e678ba4 to
b7e6884
Compare
…ection Reworks the imported matcher so each engine measures what it can honestly report, instead of the harness comparing a node box with a second observation's viewport. - Engines get an optional `viewportIntersection(ref)` member (`viewport-intersection` capability, `engine/viewportIntersection` on the protocol). The harness reads the match and measures that ref once per poll sample, inside the read window. - The web engine measures with an IntersectionObserver, as Playwright does, so scroll containers, overflow ancestors, and frames clip the box. - The mobile engine answers only whether the node is on screen: agent-device reports bounds already clipped, so `ratio` there is UNSUPPORTED_CAPABILITY. - No match reads as outside the viewport, so `.not` passes for a node a device left out of its tree. A node that goes stale before it is measured is sampled again rather than read as gone. Co-authored-by: Anmol202005 <183815727+Anmol202005@users.noreply.github.com>
…at cannot measure Also drops the schema rule that required engine/locate beside engine/viewportIntersection (the client may build locate itself), adds the capability to the web lifecycle test and to the docs' capability lists.
- mobile: refuse a node whose window has no known place on the screen, and measure against the confirmed screen, not a capture's own size - web: measure inside readingTab, and dispose a handle when the operation aborts - test defineEngine's locate requirement and the resolveLocators path - docs: strictness list, zero-size difference from Playwright, page-world note
- web: clamp the measured ratio to 0..1 in the page - skill: list toBeInViewport among the matchers that accept zero matches
Reviewed with Gemini 4 Neon against the code: ratio 0 works on mobile and only ratio > 0 is refused, a missing box on the web reads as outside while missing bounds or screen position is UNSUPPORTED_CAPABILITY, and an out-of-range ratio is INVALID_ARGUMENT.
- web: an element replaced before the observer fires is NODE_STALE, not outside, and the zero-size check reads the observer's own entry, so the box and the ratio come from one frame - core: a ref superseded between the resolve and the read is a stale sample the poll never evaluates, like one stale at the measure, so `.not` cannot pass on either race; tryRead's other callers are unchanged - mobile: the measure confirms a capture whose size is not the known screen's through viewportFor, as observe does, so a resized screen is picked up without an observe - core: reject an engine answer whose ratio contradicts intersects - expect: print a share in full when rounding would show the threshold as met - changeset: drop the 0.24.1 floor sentence; main's floors are 0.25.0
…nd flat boxes From michal-e2e's review: the invalid manifest fixture now fails on the viewportIntersection rule alone, ratio 0 runs on an engine that reports no share, the contract test covers every refused answer, a mobile fold measures against the new screen, and a zero-height web element reads as outside. The changeset, skill, and errors reference name when ratio is refused on a device.
run_code calls the real expect since #1998, which removed the matcher allowlist this branch extended. Check that the matcher works there.
b7e6884 to
382c210
Compare
michal-e2e
left a comment
There was a problem hiding this comment.
Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.
Reviewed at 382c21060 (merge base 757d1dbd4). The rebase carried over the manifest and stale-reference fixes. The new MCP test exercises the matcher through run_code.
Must fix: none.
Optional
- Add a viewport assertion that should fail in the MCP test, such as
.not.toBeInViewport()on the visible button. The current success cases catch a missing matcher and pass when the MCP wrapper returns success without invoking it. Checking forASSERTION_FAILEDwould cover what the caller sees when the assertion fails. MCP test - The MCP session's matcher list omits
toBeInViewport. Consider naming it in the API text agents see when they open a session. MCP API description - The engine reference says that
toBeInViewportwithratio > 0“then fails withUNSUPPORTED_CAPABILITY.” The matcher can decide the assertion when the engine reports that the node is outside. Add “when the node intersects the viewport” to match the behavior the test covers. Engine reference · Assertion test
Verified
-
The built MCP server ran the matcher through
run_codeagainst a real button and a missing match. The new test failed on the merge base because the matcher was missing. It also failed when I removed MCP's access to the matcher on this head. -
The manifest schema accepted the new method with observation and rejected it without observation. The valid and invalid fixtures cover those cases. The separate duplicate-action check still passed. The package declarations add an optional engine method and an assertion method. The wire protocol stays at version 1.
-
Local
pnpm check,pnpm testandpnpm test:web-benchmarkpassed. The new viewport test passed on the testbed. A separate iframe test timed out on the first testbed run, then passed in the full rerun and on the merge base. -
The strict-cache web agent benchmark failed in the same eight cases on the head and base. Five reported missing AI Gateway authentication and three failed judgment assertions.
-
The packed candidate runner passed its Chromium smoke test with the published web engine. The reverse compatibility check could not run because npm had no stable runner in the candidate web engine's declared peer range.
-
The compiler caught changes that accepted a string ratio, required a string timeout or accepted the unsupported
thresholdoption. All new viewport type assertions rejected the corresponding changed declaration. -
The full e2e package suite passed with the MCP matcher replaced by a no-op, including the new integration test. The compiled matcher works on this head. The gap is in what the MCP test would catch.
-
Runtime mutation checks ran 42 distinct patches. Thirty failed by assertion, nine passed the tested files and three failed through an expected runtime error. The two new tests without an assertion failure still caught changed behavior. The type mutations ran separately.
New runtime tests and the mutations that reached them
- e2e mcp run_code measures a node against the viewport with toBeInViewport — MCP01-matcher-unavailable
- defineEngine rejects viewportIntersection without locate: it measures located nodes — target-define
- toBeInViewport passes on any area inside by default and compares the share with ratio — target-ratio
- toBeInViewport reads no match and a box outside as outside the viewport — target-absence
- Polls until the node enters the viewport — target-poll-budget ended the assertion after one read.
- toBeInViewport refuses ratio on an engine that measures only the visible part of a box, even under .not — target-no-ratio
- toBeInViewport fails at once when the engine cannot measure the node, even under .not — target-no-capability
- toBeInViewport samples a node that went stale before it was measured again instead of reading it as gone — N04-measure-stale-false, N05-async-stale-evaluable, N07-observed-no-stale-text
- Measures a secure field — target-secure-refusal rejected the field.
- toBeInViewport fails on an engine answer outside the contract or one that contradicts itself — M04d-check-no-boolean, M05-check-ratio-low, M06-check-ratio-high, N01-check-no-consistency
- toBeInViewport prints a share that falls short of ratio in full when rounding would show it as met — N06-describe-ratio-rounded
- toBeInViewport rejects an invalid ratio and unknown options before reading — target-invalid-ratio
- readViewport reads a ref superseded between the resolve and the read as stale, not as gone — N02-readone-stale-false, N03-readviewport-no-early-stale
- engine-manifest-v1 schema rejects the invalid fixture for viewportIntersection without engine/observe — M27-schema-no-observe-requirement
- location answers whether a located node is on the screen, never the share agent-device clipped away — X05-height-uses-width
- location measures against a resized screen once the device confirms it, without waiting for an observe — N12-screen-from-known, N13-binding-no-capture-size, X05-height-uses-width
- location refuses to say whether a node is in the viewport when its window has no known place on the screen — target-mobile-origin
- device fixture measures toBeInViewport against the unfolded screen after fold — N12-screen-from-known, N13-binding-no-capture-size
- viewport intersection on the web engine measures the share of the box the viewport and clipping ancestors leave — target-web-unclipped
- viewport intersection on the web engine reads an element with no box or an empty one as outside — N09-no-width-check, N10-no-height-check
- viewport intersection on the web engine measures a password field like any other element — target-web-password
- viewport intersection on the web engine follows scrolling, and a removed element is stale — target-web-removed
- viewport intersection on the web engine reads an element the page replaces every frame as stale, never as outside — N08-no-callback-detached-check
Not run locally
pnpm test:mobile-benchmarkstayed queued because the host's simulator and emulator were reserved by other reviews. The GitHub Actions logs show the new sticky-chrome viewport case passing on iOS and Android.
For the maintainer
- The engine contract release rule calls for a changeset for each engine. Desktop already has a pending patch in the same release and the viewport changeset omits it. Please decide whether to add Desktop to this changeset. Release rule · Viewport changeset
The engine contract and manifest paths are for @okwasniewski to approve.
Playwright suites lean on
toBeInViewport()to check that something is on screen without scrolling to it: a sticky bar, a toast, the first field of a form. e2e had no equivalent (#1295). #1303 added one, but it compared the node's box with a viewport taken from a second observation, and that answer is wrong on both engines:overflowand scroll-container clipping, which Playwright'sIntersectionObservercheck takes into account..not.toBeInViewport()could never pass.This replaces #1303 and keeps @Anmol202005's commits, tests, and docs as the base.
How
Each engine now measures what it can actually report, through a new optional engine member:
It adds the
viewport-intersectioncapability and theengine/viewportIntersectionprotocol method, and requireslocate. A poll sample is the usual locate and read, then one measure of that ref, all inside theReadWindow. There is no second observation.IntersectionObserver, the same check Playwright makes, insidereadingTab. An element with no box or a zero-size box counts as outside.observeconfirms (a resized screen is checked with the device), sotoBeInViewport({ ratio: 0.5 })fails withUNSUPPORTED_CAPABILITYinstead of reporting a fake 100%.ratio: 0works the same as leavingratioout. If the capture couldn't place the app's window on the screen, or the node has no bounds, it fails closed..notcan't pass on a navigation race. On web, an element the page replaces before the observer fires counts as stale too..not.ratiocontradictsintersects, isENGINE_FAILURE.ratiooutside 0..1 isINVALID_ARGUMENT.reference/expect,engine,engine-protocol, andtest, plus the Playwright migration guide andskills/e2e/.run_coderuns the realexpectsince feat(mcp): run JavaScript in run_code #1998, sotoBeInViewportworks there with no change of its own.@e2e-dev/weband@e2e-dev/mobileneed the next core release.mainalready raised their floors to>=0.25.0, which covers it.engine/locatealongsideengine/viewportIntersection, becauseconnectEngine({ resolveLocators: true })buildslocateon the client.defineEngineenforces the pairing, and tests cover both paths.Issue
Closes #1295. Supersedes #1303.
Verified
Ran it locally: yes
.notbefore scroll 1.1 s, in view after scroll,{ ratio: 0.5 }refused withUNSUPPORTED_CAPABILITYtests/controls.e2e.tsobserved: outside the viewportviewport-intersection.test.tsoverflow: hidden0.5, scrolled away in a scroller 0, half clipped by an iframe 0.5,display: noneand zero width 0, password field measured, removed nodeNODE_STALEpnpm test:web-benchmarkpnpm check, fullpnpm test(every package)The web demo below runs through the built CLI. It walks a fully visible card, a card half clipped by
overflow: hidden({ ratio: 0.5 }passes,{ ratio: 0.6 }fails withobserved: 0.5 of its box), a row scrolled away inside a scroll container, a footnote 2300px down the page, and a missing match.{ ratio: 0.6 }refusedscrollIntoViewFresh-context review: one Claude pass, then three rounds each with Claude Fable 5.2 and Gemini 4 Neon. Rounds 2 and 3 found nothing critical or important. Two findings were declined, with reasons:
ratiobefore the node appears would need a new up-front engine field.Made by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, driven from T3 Code. Reviews by Claude Fable 5.2 and Gemini 4 Neon.Co-authored-by: Anmol202005 183815727+Anmol202005@users.noreply.github.com
Web demo (Chromium, built CLI):
web-to-be-in-viewport-demo.mp4
iOS 26.5 simulator, mobile benchmark "sticky chrome":
ios-sticky-chrome.mp4
Android API 36 emulator, same test:
android-sticky-chrome.mp4