Skip to content

Engine: a pointer action outside the screenshot is refused, and every scroll is confirmed, falling back to the scroll area's bar, never answering success for a scroll that moved nothing (#328) - #338

Merged
SSFSKIM merged 13 commits into
mainfrom
fix/328-scroll-confirm
Nov 9, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

#328 was filed as "AppKit drops a background scroll". The spike found that AppKit doesn't drop it. The engine answered success for scrolls that moved nothing, and for pointer actions aimed outside the window. Every one of main's 102 answered scroll cells said success. This PR makes both answers truthful:

  • A point outside the screenshot is refused. A click, a scroll, a drag's start and its end, at a point outside the screenshot, fail with pointOutsideScreenshot before anything is posted.
  • Every scroll is confirmed. The scroller under the point is read before and after the wheel:
    • It moved: success, with the measured move.
    • Already at its end: success, with atEnd and text saying so.
    • Nothing moved, but a real scroll area's bar can be set: the bar is written by the delta, which is what moves System Settings' content pane.
    • Otherwise: scrollUnconfirmed, never success.

The posted wheel itself is unchanged; it is the vendor's route.

Closes #328

The rules (design session rulings b1921fc3, 08d673c3, e70575e5 and 8d00d2ba; the spec's #328 Decision Log entry)

  1. The out-of-screenshot refusal covers every pointer action, including a drag's end. Dragging out of the window is now a stated limit (Feature: drop across windows (a drag whose end lies in another app's window or the desktop) — measure first #334).
  2. The confirm.
    • What is read: the hit's nearest scrolling boundary of any kind. That is an AXScrollArea, a page scroller (the top of a run of page-scroll advertisers, stopping at an element with its own bar), or an iframe's web area. When the hit's chain holds none, the deepest visible AXScrollArea whose frame contains the point. The measures are its bar, its content frame, a descendant in the viewport's middle band, and the hit itself, each by both edges where clipping applies.
    • How long: polled every 15 ms for up to 800 ms. Only a scroll that doesn't confirm pays the full window.
  3. The end.
    • At once, before the wheel: a bar at its end, a scroll area's content frame at its edge, or a bar within 0.03 of its end with the edge child wholly visible.
    • After the wheel: a bar within 0.03 of its end both before and after, with nothing moved and no readable geometry showing content beyond the viewport.
  4. The fallback writes only a real AXScrollArea's own settable bar, never within 0.03 of its end, and never in web content or past a clipping group.
  5. The service carries the record as cua/scroll, and the at-end note reaches the tool result's text.
  6. Docs: a paragraph in docs/cua-api/agent-cursor.md, carried by the docs test, parity's docs oracle, PROVENANCE.md and the surface inventory.

Plugin 0.27.13. #335 took 0.27.12.

Live proof (GitHub-hosted macOS 26.7.2: Safari, Chrome for Testing, Firefox, TextEdit, Finder, System Settings, plus AppKit, SwiftUI and Catalyst probe apps; main f859ce6 against the branch)

The evidence is in docs/evidence/2026-11-08-scroll-confirm/.

Gate or cell Main Branch
(a) clicks and drags at in-bounds points, including 0–2 px inside each edge and corner (360 + 208 cells) – 0 refused
Points past an edge (96) posted 96/96 refused, no page event
#324's below-the-window scrolls success, nothing moved refused pointOutsideScreenshot
(b) scrolls that really moved: nested overflow div (inside, and 3 pt below its top), iframe, horizontal scroller, rAF, delayed scripts, smooth, in Safari, Chrome and Firefox; the native apps; Catalyst success 0 false scrollUnconfirmed; first move p95 at most 472 ms
(c) divEnd (nested div at its end; the page scrolls by chaining) – moved, no bar written
System Settings' content pane success, nothing moved moves by the bar write, success
Ends: Probe328, TextEdit, Finder, Safari success, nothing moved atEnd at once, no write (3–77 ms)
Ends: Chrome and Firefox pages (no readable bar) success, nothing moved scrollUnconfirmed after the window
Settings' sidebar at its real bottom success, nothing moved 6/8 atEnd, no write; 2/8 a no-op bar write and scrollUnconfirmed (the limit below)

Runs:

The kit is probe/328-measure.

Cost

Case Main Branch
A moved scroll, native apps, Safari, Firefox 2–25 ms 31–92 ms
A moved scroll, Chrome 2–25 ms 188–247 ms (Chrome's accessibility tree trails its page by 150–200 ms)
Chrome's walk before the wheel – 8–133 nodes, 5–41 ms
At the end with a readable bar 2–25 ms 3–35 ms
No readable end, or nothing moved 2–25 ms about 885 ms
Settings' pane bar write 2–25 ms about 900 ms
A no-op write (the sidebar limit) 2–25 ms about 1.7 s

Limits

  • Dragging out of the window is refused (Feature: drop across windows (a drag whose end lies in another app's window or the desktop) — measure first #334, now a feature request).
  • Chrome's scripted, animated scrollers can outlast the 800 ms window. Chrome holds its accessibility frames until the animation settles; one cell missed in the A/B.
  • Chrome and Firefox pages at their end give no readable end, so they answer scrollUnconfirmed after the window.
  • A bar that misreports its own end can take a no-op write and answer scrollUnconfirmed after about 1.7 s. System Settings' sidebar is one: its AXContentSize flickers, and its bar reads 0.952–1.0 at the real bottom. Writing only on positive evidence that content continues is logged in tech-debt-tracker.md.
  • Settings' pane addressed by element answers an honest scrollUnconfirmed; the window scan runs only for a coordinate.

Tests and review

  • Engine: 1,055 tests, 1 skipped as before.
    • New: OutsideScreenshotTests holds 4, ScrollConfirmTests 35, and ScrollWheelUnchangedTests 1.
    • Focused node tests: 67/67.
    • A mutation script removes each of 90 rule parts in turn, and every unit-reachable one fails a test. The 3 survivors are live-only wiring, covered by the A/B.
  • reviewer-high: seven bounded rounds over f859ce6..ddcee92. Every finding was fixed before the next round, and round 7 was CORRECT.
    • Round 1: the fallback could write an outer bar past a nearer scroller, and a clipped nested hit read as unmoved.
    • Round 2: a trailing edge counted an unclipped resize.
    • Round 4: a zero-frame area could be chosen, nested page scrollers merged, and two false ends.
    • Round 6: the post-wheel end ignored contradicting geometry.
    • The hosted A/B found four more failures (Catalyst, Settings' pane, the sidebar's end, Chrome's walk cost), fixed in ca835ff and b1d5168.
  • CI: ci-gate on 458c17e (ddcee92 with main merged), all gates including parity-browser: GREEN, https://github.com/SSFSKIM/cua/actions/runs/42553051971. The head adds only the evidence folder, the Decision Log's hosted results and limit, and the tech-debt entry.

Sminos-Session: cursor235#b93055dd (cua on macbook)

… scroll is confirmed by its container under the point, with the bar as the fallback (refs #328)

The design session's ruling b1921fc3 on #328's spike:
- The refusal: the observed screenshot keeps its image's size, and screenshotPoint, which every coordinate passes (a
  click's, a scroll's, a drag's start and end), refuses a point outside 0 <= x < width, 0 <= y < height as
  pointOutsideScreenshot, before anything is read or posted. A drag's middle lies between its ends. A drag can no
  longer end outside the window (#334).
- The confirmation (ScrollConfirm.swift): the hit's container (the nearest AXScrollArea, else an AXScrollDownByPage
  ancestor or an AXWebArea) is read before the wheel: its bar on the axis, its content's frame, a descendant about 40%
  into the viewport (the spike's read-back), and the hit itself when it lies inside and is smaller (a nested scroller).
  After the post it is polled every 15 ms for up to 300 ms (named constants), stopping at the first move the asked way.
- The fallback: nothing moved, not at the end, the container's own bar settable: its AXValue written by
  delta / (content - viewport), AXContentSize where the content's frame does not scroll, nothing posted, then polled
  again with only the content, the descendant or the hit counting.
- The answers: moved, success with meta.scroll; at the end before and after, success with atEnd and a note; otherwise
  scrollUnconfirmed. The posted wheel is unchanged.
OutsideScreenshotTests 4, ScrollConfirmTests 20, ScrollWheelUnchangedTests 1; TuningTests' two coordinate tests aim
inside the image.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ote reaches the tool result's text (refs #328)

scroll joins the noted methods and scroll the optional input meta, reset per call. The new test also carries
scrollUnconfirmed and pointOutsideScreenshot through to the model with their sentence, name and meta; it fails without
either change.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…agraph in agent-cursor.md, plugin 0.27.11 (refs #328)

The entry records the corrected defect (#324's scrolls aimed below their windows, every scroll answered success), the
spike's findings, the refusal and where it sits, the confirmation, the fallback's conversion and its precision, the
answers, the costs, the limits (a drag out of the window, #334; a container with no bar cannot tell its end) and what
the hosted check must verify. The Design's Scroll and the Interfaces' error names and meta carry it. agent-cursor.md
gains a paragraph after the stale-point one; the docs test, repl-parity's docs oracle, PROVENANCE.md and the surface
inventory's Table 3 addition (2026-11-08, #328) carry it.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… fallback writes only that scroller's own bar, a clipped hit counts by its trailing edge, the window is 800 ms, and the end read before the wheel answers at once (refs #328)

The review of f859ce6..b228192 (P1, P2) and the design session's acceptance 08d673c3:
- P1 / gate (c): the container is found in one walk, nearest first: an AXScrollArea, an element advertising any page
  scroll, or an AXWebArea that is not its scroll area's own page. The fallback writes only that container's own bar, and
  not at all in web content (fallbackSkipped "web": browsers expose overflow divs, and Chrome iframes, as plain groups)
  or past a smaller element that does not hold the hit (fallbackSkipped "clipped": an unexposed scroller).
- P2: each element measure keeps both edges on the axis; a hit clipped at its scroller's top moves only its trailing
  edge.
- scrollConfirmWindowMs 800 (the hosted early read of gate b, run 42535468711).
- The container's bar at its end before the wheel: success at once with atEnd and endBefore, the wheel still posted,
  nothing polled or written; the note says only that what is at the point is scrolled as far as it goes.
pageScrollActions (Routes.swift) is shared. ScrollConfirmTests 22; the service test's at-end note follows the text.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…fallback rule, both edges, the 800 ms window and the end answered before the wheel (refs #328)

The at-end sentence in agent-cursor.md (and its docs test, parity's docs oracle and the surface inventory) now says the
result's text says so, not that nothing moved. The Interfaces' scroll meta gains endBefore and fallbackSkipped.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… pinned at a clipping edge, never for one that only grows (refs #328)

The re-review of e0c24b8 (one P2): any trailing-edge change counted, so content appended below the visible rows
during an unanswered upward wheel answered moved at an unchanged offset. Now the content's trailing edge never counts,
and the tracked descendant's or the hit's counts only while its leading edge sits pinned, within 0.5 pt, at a clipping
edge before and after (ScrollClips: the viewport's leading edge, and for the hit each ancestor's between it and the
container), its visible size changing the way the asked scroll clips it. The clipped-hit test now models the div it is
pinned at; testAnElementThatOnlyGrowsIsNoMove is the reviewer's case. The Decision Log's P2 line carries the
correction; mutate-328.py: 62 of 65 fail a test, the 3 live-only survive.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…e container, a pane with no container on its chain takes the deepest scroll area under the point, the end is told without the bar at 1, and the descendant walk costs 200 nodes (refs #328)

Run 42537713415 on e0c24b8 and the web pass 42540817002 on 8b5d314:
- Catalyst (gate b, 3 of 3 false scrollUnconfirmed): UIKit gives every row and label the page actions, so the label
  under the point was its own container. A page scroller is now the top of the run of ancestors that all advertise page
  scrolling, and every kind of container reads its first child as its content (the spike's contentOf): the table's
  first row moves where reused cells jump the other way.
- System Settings' content pane (gate c): its hit's chain holds no container. The deepest AXScrollArea in the window
  holding the point is taken (scrollAreaUnder, containerBy "window"), never a sibling nor an outer one; then the
  confirmation and the fallback run as usual.
- Settings' sidebar at its real end (gate c): its bar reads 0.976 to 0.986 there and its outline is clipped to the
  viewport. The end is also told by a content frame longer than the viewport reaching its edge within 1 pt, or by the
  bar within 0.05 of its end with the content's last child (first, scrolling up) inside the viewport's edge.
- Chrome's walk (96 to 202 ms before the wheel): budget 200, stopping at the first candidate 25 to 60% into the
  viewport.
ScrollConfirmTests 28 (6 new, two adjusted to the 1 pt end); mutate-328.py: 74 of 77 fail a test, the 3 live-only
survive. The Decision Log gains item 10, the A/B, and the Chrome animated-scroller limit.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ow scan selects only a visible one under the point, nested page scrollers with bars stay apart, and the bar-near-end rule needs a wholly visible edge child (refs #328)

Round 4 of review on 8b5d314..ca835ff (two P1s, two P2s), each narrowed rather than extended:
- P1: the window scan passes through empty-framed elements but selects a scroll area only when its own non-empty
  frame holds the point.
- P1: the page-scroller run stops at an element with a scroll bar of its own (a boundary), and the bar-write fallback
  runs only on an AXScrollArea container with its own settable bar, never on a page scroller or a web area.
- P2: the bar near its end (now within 0.03) tells the end only with the edge child wholly inside the viewport, and
  never over a scroll area's content frame running on past it.
- P2: a page scroller's or web area's first child is a movement probe only; the extent for the end and the
  conversion comes only from a scroll area's content frame or AXContentSize.
ScrollConfirmTests 33 (5 new); mutate-328.py: 82 of 85 fail a test, the 3 live-only survive. The Decision Log's
items 4, 5 and 10 carry the corrections.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… atEnd after the wheel, and the fallback never writes a bar near its end (refs #328)

The final hosted pass (run 42546633581 on b1d5168): Settings' sidebar reads 0.976 at its real bottom with its last row
clipped, so round 4's strict edge-child rule no longer called it the end, and the fallback wrote 1.0 and answered
scrollUnconfirmed after about 1.7 s, 8 of 8. The strict rule before the wheel stays. After the wheel, when nothing
moved within the window and the bar read within scrollBarNearEnd (0.03) of its end before and after, the answer is
success with atEnd and endBefore false; and the fallback never writes a bar already within 0.03 of its end.
ScrollConfirmTests 34; mutate-328.py: 86 of 89 fail a test, the 3 live-only survive. The Decision Log gains the line.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ent frame that shows content left beyond the viewport (refs #328)

Round 6 of review on 8c93f34 (one P2): a surface that ignores the wheel at offset 784 of 800, bar 0.98, answered
atEnd with 16 points left. The end judged after the wheel now applies only when no scroll-area content frame runs past
the viewport's edge in the scroll's direction by more than 1 point (scrollDocumentRunsOn; AXContentSize gives no
position); otherwise the answer is scrollUnconfirmed. The no-write guard near the end is unchanged, and Settings'
sidebar, whose outline is clipped to the viewport, still answers atEnd. ScrollConfirmTests 35; the round-6 mutation
fails its test.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…nfirm, plugin 0.27.13 (refs #328)

Conflicts resolved by keeping both sides: the plugin at 0.27.13 (the design session's ruling ccc119c9); PROVENANCE's
agent-cursor row names #318's amendment of the background-click paragraph and #328's paragraph; the surface inventory
keeps #318's Table 3 addition, then #328's; the Decision Log keeps #318's entry before #328's, since #318 merged first;
repl-parity's docs oracle names both additions, and its text equals the merged agent-cursor.md byte for byte.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…limit stated and option B logged as debt (refs #328)

Sminos-Session: cursor235#b93055dd (cua on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T03:13:53.883842Z 8d8289d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit 6baaa12 into main Nov 9, 2026
6 checks passed
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.

Pointer actions at coordinates outside the screenshot, and scrolls that moved nothing, answer success (false success)

1 participant