Skip to content

Commit 09320ad

Browse files
committed
refactor(scroll): collapse --until onto the one route that runs it
1 parent d588ec0 commit 09320ad

14 files changed

Lines changed: 521 additions & 1010 deletions

File tree

packages/capture-kit/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@
118118
"types": "./src/snapshot/scroll-edge-state.ts",
119119
"default": "./src/snapshot/scroll-edge-state.ts"
120120
},
121-
"./scroll-until-visible": {
122-
"types": "./src/snapshot/scroll-until-visible.ts",
123-
"default": "./src/snapshot/scroll-until-visible.ts"
124-
},
125121
"./snapshot-chrome": {
126122
"types": "./src/snapshot-chrome.ts",
127123
"default": "./src/snapshot-chrome.ts"

packages/capture-kit/src/snapshot/__tests__/scroll-until-visible.test.ts

Lines changed: 0 additions & 152 deletions
This file was deleted.

packages/capture-kit/src/snapshot/scroll-edge-state.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ export async function captureScrollEdgeState(params: {
3737
}
3838
}
3939

40+
/**
41+
* Is there hidden content left at this edge? The same question `runScrollEdgePasses` loops on,
42+
* exposed for callers with their own stop condition (`scroll --until`) so both read one signal.
43+
*/
44+
export async function canScrollFurtherAtEdge(
45+
nodes: readonly (RawSnapshotNode | SnapshotNode)[],
46+
edge: ScrollEdge,
47+
): Promise<boolean> {
48+
const { analyzeScrollEdgeState } = await import('./scroll-edge-state/selection.ts');
49+
return analyzeScrollEdgeState(nodes, edge).canScroll;
50+
}
51+
4052
export async function runScrollEdgePasses<TResult>(params: {
4153
edge: ScrollEdge;
4254
captureState: (scope?: string) => Promise<ScrollEdgeState>;

packages/capture-kit/src/snapshot/scroll-until-visible.ts

Lines changed: 0 additions & 164 deletions
This file was deleted.

packages/selectors/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@
6868
"types": "./src/selector-pipeline.ts",
6969
"default": "./src/selector-pipeline.ts"
7070
},
71-
"./scroll-until-match": {
72-
"types": "./src/scroll-until-match.ts",
73-
"default": "./src/scroll-until-match.ts"
74-
},
7571
"./selector-pipeline-policy": {
7672
"types": "./src/selector-pipeline-policy.ts",
7773
"default": "./src/selector-pipeline-policy.ts"

0 commit comments

Comments
 (0)