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 0e99f4d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(scroll): name what a scroll observed and read an edge off one tree
Two pieces the directional-scroll answer needs, with no behavior change on its own.
`movement` is the vocabulary a scroll uses to say what happened to the surface: `moved`,
`at-edge`, `unchanged` when the visible content did not change, and `unobserved` when the
command could not compare anything. It is absent when the runtime cannot read a screen at
all, so a caller never has to guess whether a missing claim means "did not move".
`readScrollEdgeState` is the one pure door into the edge analyzer — the question
`canScrollFurtherAtEdge` and `scrollSurfaceFingerprint` already ask, exposed with the frame
of the container that answer was taken on. Without `containerRect`, `canScroll: false`
cannot distinguish content that ends here from a tree that named no container, and a caller
checking whether its gesture landed inside the list has nothing to check against.
return`Already at ${edge}; no hidden content ${edge==='bottom' ? 'below' : 'above'} detected`;
182
217
}
183
218
if(edge)return`Scrolled to ${edge} with ${passes}${direction} passes`;
219
+
constverticalEdge=verticalEdgeFor(direction);
220
+
if(movement==='at-edge'&&verticalEdge){
221
+
// The same honesty the zero-pass branch above holds: the analyzer reports no hidden content
222
+
// DETECTED, which is not a claim that the content provably ends here. A horizontal scroll has
223
+
// no edge signal to report, so it falls through to the distance it was asked for.
224
+
return`Scrolled ${direction} and no hidden content ${
225
+
verticalEdge==='bottom' ? 'below' : 'above'
226
+
} was detected`;
227
+
}
228
+
if(movement==='unchanged'){
229
+
return`Scrolled ${direction} and the visible content did not change`;
230
+
}
184
231
if(pixels!==undefined)return`Scrolled ${direction} by ${honoredPixels??pixels}px`;
185
232
if(amount!==undefined){
186
233
returnhonoredPixels===undefined
@@ -199,13 +246,37 @@ function buildScrollEdgeNoProgressError(edge: ScrollEdge, passes: number): AppEr
199
246
reason: 'scroll_edge_no_progress',
200
247
edge,
201
248
passes,
202
-
hint:
203
-
`The scroll is not reaching this container. If a field is focused, dismiss the keyboard first; if it is nested inside another scroller, target it directly with scroll <dir> --until <selector>. `+
204
-
`Some lists ignore synthesized scrolls — a raw drag moves them: swipe x1 y1 x2 y2 started inside the list.`,
0 commit comments