fix(command-surface): allow batch gesture steps without readinessTimeoutMs

Merged
KH
1d ago
+64-3

Summary

Fixes #5275.

readCommonInput assigned undefined for every common field (including the retired readinessTimeoutMs row), and refuseRetiredInput rejected any own key via Object.hasOwn(record, key). When a batch gesture step was read and then re-read in the gesture daemon writer, that readinessTimeoutMs: undefined key caused INVALID_ARGS.

  • readCommonInput now skips undefined values instead of writing undefined own keys.
  • refuseRetiredInput now only refuses when Object.hasOwn(record, key) && record[key] !== undefined.

Before / after

await client.batch.run({
  steps: [{ command: 'gesture', input: { kind: 'fling', direction: 'up', origin: { x: 10, y: 20 }, distance: 400 } }],
});
  • Before: Throws INVALID_ARGS: Batch step 1 gesture input is invalid: readinessTimeoutMs was removed; add an explicit wait for the target before the interaction.
  • After: Accepted and dispatched. Passing an explicit readinessTimeoutMs (e.g. 5000) is still refused.

Validation

Tested at 6d89210e80:

  • vitest run --project unit-core packages/command-surface/src/__tests__/input-audience.test.ts packages/client/src/__tests__/index-gesture.test.ts: 2 passed (18 tests)
  • oxlint packages/command-surface packages/client --deny-warnings: 0 warnings, 0 errors
  • oxfmt --check on modified files: passed
  • tsc -b tsconfig.typecheck.json: passed

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.