Files
callstack__agent-device/contracts/fixtures/snapshot-presentation-conformance.json
T

228 lines
5.9 KiB
JSON
Raw Normal View History

{
"version": 1,
"viewport": { "x": 0, "y": 0, "width": 320, "height": 240 },
"cases": [
{
"name": "cumulative scroll clip carries into the presented rect",
"projection": "regular",
"scope": null,
"nodes": [
{
"index": 0,
"type": "Application",
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"index": 1,
"type": "ScrollView",
"label": "Outer",
"rect": { "x": 16, "y": 20, "width": 180, "height": 180 },
"depth": 1,
"parentIndex": 0,
"hittable": false
},
{
"index": 2,
"type": "ScrollView",
"label": "Inner",
"rect": { "x": 80, "y": 60, "width": 100, "height": 80 },
"depth": 2,
"parentIndex": 1,
"hittable": false
},
{
"index": 3,
"type": "Button",
"label": "Partially visible",
"rect": { "x": 150, "y": 110, "width": 100, "height": 60 },
"depth": 3,
"parentIndex": 2,
"hittable": true
}
],
"expected": [
{
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"label": "Outer",
"rect": { "x": 16, "y": 20, "width": 180, "height": 180 },
"depth": 1,
"parentIndex": 0,
"hittable": false
},
{
"label": "Inner",
"rect": { "x": 80, "y": 60, "width": 100, "height": 80 },
"depth": 2,
"parentIndex": 1,
"hittable": false
},
{
"label": "Partially visible",
"rect": { "x": 150, "y": 110, "width": 30, "height": 30 },
"depth": 3,
"parentIndex": 2,
"hittable": true
}
]
},
{
"name": "raw projection preserves the helper-reported frame",
"projection": "raw",
"scope": null,
"nodes": [
{
"index": 0,
"type": "Application",
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"index": 1,
"type": "ScrollView",
"label": "Outer",
"rect": { "x": 16, "y": 20, "width": 180, "height": 180 },
"depth": 1,
"parentIndex": 0,
"hittable": false
},
{
"index": 2,
"type": "Button",
"label": "Partially visible",
"rect": { "x": 150, "y": 80, "width": 100, "height": 40 },
"depth": 2,
"parentIndex": 1,
"hittable": true
}
],
"expected": [
{
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"label": "Outer",
"rect": { "x": 16, "y": 20, "width": 180, "height": 180 },
"depth": 1,
"parentIndex": 0,
"hittable": false
},
{
"label": "Partially visible",
"rect": { "x": 150, "y": 80, "width": 100, "height": 40 },
"depth": 2,
"parentIndex": 1,
"hittable": true
}
]
},
{
"name": "viewport edge clips while preserving positive actionability",
"projection": "regular",
"scope": null,
"nodes": [
{
"index": 0,
"type": "Application",
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"index": 1,
"type": "Button",
"label": "Edge",
"rect": { "x": 300, "y": 100, "width": 40, "height": 40 },
"depth": 1,
"parentIndex": 0,
"hittable": true
}
],
"expected": [
{
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"label": "Edge",
"rect": { "x": 300, "y": 100, "width": 20, "height": 40 },
"depth": 1,
"parentIndex": 0,
"hittable": true
}
]
},
{
"name": "scope re-roots the presented subtree after clipping",
"projection": "regular",
"scope": "settings",
"nodes": [
{
"index": 0,
"type": "Application",
"label": "App",
"rect": { "x": 0, "y": 0, "width": 320, "height": 240 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"index": 1,
"type": "ScrollView",
"label": "Settings",
"rect": { "x": 20, "y": 20, "width": 280, "height": 180 },
"depth": 1,
"parentIndex": 0,
"hittable": false
},
{
"index": 2,
"type": "Button",
"label": "Save",
"rect": { "x": 30, "y": 40, "width": 100, "height": 44 },
"depth": 2,
"parentIndex": 1,
"hittable": true
}
],
"expected": [
{
"label": "Settings",
"rect": { "x": 20, "y": 20, "width": 280, "height": 180 },
"depth": 0,
"parentIndex": null,
"hittable": false
},
{
"label": "Save",
"rect": { "x": 30, "y": 40, "width": 100, "height": 44 },
"depth": 1,
"parentIndex": 0,
"hittable": true
}
]
}
]
}