mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
feat(spec): no-op LongPress and Scroll in web runtime
This commit is contained in:
1 parent
66b2877f9f
commit
8efcfbce51
1 file changed
+18
@@ -337,6 +337,14 @@ const runtime = {
|
|||||||
doubleTap(p: { on: unknown }): unknown {
|
doubleTap(p: { on: unknown }): unknown {
|
||||||
return { kind: "DoubleTap", on: p.on };
|
return { kind: "DoubleTap", on: p.on };
|
||||||
},
|
},
|
||||||
|
longPress(): unknown {
|
||||||
|
// Why: web has no long-press gesture for v1; the factory returns null so LongPress() calls no-op.
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
scroll(): unknown {
|
||||||
|
// Why: web has no native scroll gesture for v1; the factory returns null so Scroll() calls no-op.
|
||||||
|
return null;
|
||||||
|
},
|
||||||
inputText(p: { into: unknown; text: string }): unknown {
|
inputText(p: { into: unknown; text: string }): unknown {
|
||||||
return { kind: "InputText", into: p.into, text: p.text };
|
return { kind: "InputText", into: p.into, text: p.text };
|
||||||
},
|
},
|
||||||
@@ -357,6 +365,8 @@ const runtime = {
|
|||||||
},
|
},
|
||||||
taps: { __sanderlingActionGenerator: true, __sanderlingKind: "taps" } as ActionGeneratorHandle,
|
taps: { __sanderlingActionGenerator: true, __sanderlingKind: "taps" } as ActionGeneratorHandle,
|
||||||
doubleTaps: { __sanderlingActionGenerator: true, __sanderlingKind: "doubleTaps" } as ActionGeneratorHandle,
|
doubleTaps: { __sanderlingActionGenerator: true, __sanderlingKind: "doubleTaps" } as ActionGeneratorHandle,
|
||||||
|
longPresses: { __sanderlingActionGenerator: true, __sanderlingKind: "longPresses" } as ActionGeneratorHandle,
|
||||||
|
scrolls: { __sanderlingActionGenerator: true, __sanderlingKind: "scrolls" } as ActionGeneratorHandle,
|
||||||
typing: { __sanderlingActionGenerator: true, __sanderlingKind: "typing" } as ActionGeneratorHandle,
|
typing: { __sanderlingActionGenerator: true, __sanderlingKind: "typing" } as ActionGeneratorHandle,
|
||||||
swipes: { __sanderlingActionGenerator: true, __sanderlingKind: "swipes" } as ActionGeneratorHandle,
|
swipes: { __sanderlingActionGenerator: true, __sanderlingKind: "swipes" } as ActionGeneratorHandle,
|
||||||
waitOnce: { __sanderlingActionGenerator: true, __sanderlingKind: "waitOnce" } as ActionGeneratorHandle,
|
waitOnce: { __sanderlingActionGenerator: true, __sanderlingKind: "waitOnce" } as ActionGeneratorHandle,
|
||||||
@@ -458,6 +468,10 @@ function resolveGenerator(handle: ActionGeneratorHandle): unknown {
|
|||||||
return randomInput();
|
return randomInput();
|
||||||
case "swipes":
|
case "swipes":
|
||||||
return randomSwipe();
|
return randomSwipe();
|
||||||
|
case "longPresses":
|
||||||
|
case "scrolls":
|
||||||
|
// Why: web has no long-press or native scroll gesture for v1; both no-op.
|
||||||
|
return null;
|
||||||
case "waitOnce":
|
case "waitOnce":
|
||||||
return { kind: "Wait", durationMillis: 500 };
|
return { kind: "Wait", durationMillis: 500 };
|
||||||
case "pressKey":
|
case "pressKey":
|
||||||
@@ -619,6 +633,10 @@ function serializeAction(action: unknown): unknown {
|
|||||||
duration_millis: obj.durationMillis ?? 250,
|
duration_millis: obj.durationMillis ?? 250,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
case "LongPress":
|
||||||
|
case "Scroll":
|
||||||
|
// Why: web has no long-press or native scroll gesture for v1; drop the action.
|
||||||
|
return null;
|
||||||
case "PressKey":
|
case "PressKey":
|
||||||
return { kind: "PressKey", key: obj.key };
|
return { kind: "PressKey", key: obj.key };
|
||||||
case "Wait":
|
case "Wait":
|
||||||
|
|||||||
Reference in new issue
Block a user