@@ -3,13 +3,11 @@ import type { SnapshotNode } from '@agent-device/kernel/snapshot';
33import { createSnapshotVisibility } from './snapshot-visibility.ts' ;
44import { formatRole } from '@agent-device/kernel/snapshot' ;
55
6- function snapshotNodes (
7- nodes : Array < Omit < SnapshotNode , 'ref' | 'kind' > & { kind ?: string } > ,
8- ) : SnapshotNode [ ] {
6+ function snapshotNodes ( nodes : Array < Omit < SnapshotNode , 'ref' | 'kind' > > ) : SnapshotNode [ ] {
97 return nodes . map ( ( node ) => ( {
108 ref : `@e${ node . index } ` ,
11- kind : formatRole ( node . type ?? 'Element' ) ,
129 ...node ,
10+ kind : formatRole ( node . type ?? 'Element' ) ,
1311 } ) ) ;
1412}
1513
@@ -18,14 +16,12 @@ test('rootless effective visibility never resolves a target-dependent containing
1816 {
1917 index : 0 ,
2018 type : 'android.widget.FrameLayout' ,
21- kind : formatRole ( 'android.widget.FrameLayout' ) ,
2219 rect : { x : 0 , y : 0 , width : 1080 , height : 2400 } ,
2320 } ,
2421 ...Array . from ( { length : 64 } , ( _ , offset ) => ( {
2522 index : offset + 1 ,
2623 parentIndex : 0 ,
2724 type : 'android.widget.TextView' ,
28- kind : formatRole ( 'android.widget.TextView' ) ,
2925 rect : { x : 20 , y : offset * 30 , width : 200 , height : 24 } ,
3026 } ) ) ,
3127 ] ) ;
@@ -49,21 +45,18 @@ test('effective visibility keeps explicit-root and nearest-scroll clipping seman
4945 index : 1 ,
5046 parentIndex : 0 ,
5147 type : 'Button' ,
52- kind : formatRole ( 'Button' ) ,
5348 rect : { x : 120 , y : 20 , width : 20 , height : 20 } ,
5449 } ,
5550 {
5651 index : 2 ,
5752 parentIndex : 0 ,
5853 type : 'ScrollView' ,
59- kind : formatRole ( 'ScrollView' ) ,
6054 rect : { x : 0 , y : 0 , width : 50 , height : 50 } ,
6155 } ,
6256 {
6357 index : 3 ,
6458 parentIndex : 2 ,
6559 type : 'Button' ,
66- kind : formatRole ( 'Button' ) ,
6760 rect : { x : 0 , y : 60 , width : 20 , height : 20 } ,
6861 } ,
6962 ] ) ;
0 commit comments