You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b97e14
Browse filesBrowse the repository at this point in the historyBrowse files
fix(scroll): refuse an unreadable capture before scroll top/bottom decides (#3736)
* fix(scroll): refuse an unreadable capture before scroll top/bottom decides
`scroll bottom` coerced a failed or sparse capture to an empty tree, which
the edge analyzer reads as "no hidden content below", so it reported
"Already at bottom" about a screen it never saw.
Both scroll loops now run on one `runScrollPasses` loop in capture-kit:
observe, refuse an unreadable observation, ask the caller's stop
condition, then spend a pass. The daemon defines the refusal once
(`scrollCaptureRefusal`, built on `sparseCaptureQuality`) and both
`scroll top`/`scroll bottom` and `scroll --until` pass it in, so an
edge scroll now fails with `scroll_edge_capture_unreadable` instead of
an edge verdict.
Fixes#2468
* refactor(scroll): keep the backend's sparse reason and one scope owner
Check sparse quality before the empty-tree refusal, so a backend that
ships no nodes with a sparse verdict (the Android helper's presentation
failure) reports its own reason rather than a generic no-capture.
Read refused observations through one `isScrollEdgeRefused` guard, and
hand the edge loop's scope to `settleAfterPass` so the daemon no longer
tracks a second copy.
* fix(scroll): keep the capture refusal inside scroll-until
The separate scroll-capture-refusal module added one eagerly evaluated
module to every daemon entry, which the eager-closure budget rejects.
Define the refusal in scroll-until.ts, which scroll-runtime already
imports, so both loops share it at no extra load cost.
* fix(scroll): keep the sparse reason when a capture omits its tree
A capture with no nodes field and a sparse verdict reported a generic no-capture. Check sparse quality against an empty tree first, so the backend's reason survives whether the tree is empty or missing.
`scroll ${edge} reached the safety limit before the snapshot showed the edge`,
173
246
{
@@ -176,21 +249,13 @@ export async function runScrollEdgePasses<TResult>(params: {
176
249
passes,
177
250
hint: 'The scoped scroll container still reports hidden content. Run scroll <dir> --until <selector> to stop on the element you are after, or snapshot -i to inspect the current state.',
`scroll ${edge} could not read the screen: ${refusal.detail}`,
350
+
{
351
+
reason: 'scroll_edge_capture_unreadable',
352
+
edge,
353
+
captureRefusal: refusal.reason,
354
+
hint:
355
+
refusal.reason==='no-capture'
356
+
? 'Run snapshot -i to see whether the app is producing an accessibility tree at all, and retry once it does.'
357
+
: 'The accessibility tree came back sparse, so it cannot show whether content remains. Run screenshot, inspect the image, and navigate by coordinates until snapshot -i reports a full tree.',
0 commit comments