feat(verifier): decode a container-only scroll

Claude-Session: https://claude.ai/code/session_01A5KmftdEJ49A9z5mF5ESrX
This commit is contained in:
pj committed 2026-08-12 23:51:01 +05:30
1 parent 73f387f8bd
commit 70573a319e
2 files changed
+8

No files matched your search

+1
View File
@@ -464,6 +464,7 @@ func DecodeAction(raw json.RawMessage) (Action, error) {
case "Scroll":
return Action{
Kind: ActionKindScroll,
On: wire.Selector,
Direction: wire.Direction,
FromX: wire.FromX,
FromY: wire.FromY,
+7
View File
@@ -47,6 +47,13 @@ func TestDecodeAction_AllKinds(t *testing.T) {
raw: `{"kind":"Scroll","direction":"down","fromX":1,"fromY":2,"toX":3,"toY":4,"durationMillis":100}`,
want: Action{Kind: ActionKindScroll, Direction: "down", FromX: 1, FromY: 2, ToX: 3, ToY: 4, DurationMillis: 100},
},
{
// An author names the container and leaves the drag to the runner,
// which needs the selector to size it against the right bounds.
name: "Scroll with a container and no endpoints",
raw: `{"kind":"Scroll","direction":"up","selector":"id:list","fromX":0,"fromY":0,"toX":0,"toY":0,"durationMillis":250}`,
want: Action{Kind: ActionKindScroll, On: "id:list", Direction: "up", DurationMillis: 250},
},
{
name: "PressKey",
raw: `{"kind":"PressKey","key":"back"}`,