Skip to content

fix(ios): classify tapSeries/dragSeries/keyboardReturn as interaction commands#643

Merged
thymikee merged 2 commits into
refactor/ios-runner-command-traitsfrom
fix/ios-runner-classify-series
Jun 1, 2026
Merged

fix(ios): classify tapSeries/dragSeries/keyboardReturn as interaction commands#643
thymikee merged 2 commits into
refactor/ios-runner-command-traitsfrom
fix/ios-runner-classify-series

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Jun 1, 2026

Draft / stacked on #642. Behavior change — do not merge until #642 has merged and baked, and the checklist below is green. Base will retarget to main once #642 lands.

What

Reclassify three commands as interaction commands in the CommandTraits table introduced by #642, so they get the foreground-guard + stabilization preflight:

  • tapSeries — series form of tap (already an interaction command)
  • dragSeries — series form of drag (already an interaction command)
  • keyboardReturn — sibling of keyboardDismiss (already an interaction command)

Why

All three were missing from the historical isInteractionCommand switch — a drift the single-source-of-truth table makes visible. Their single-shot / sibling forms already pay the preflight; the series/sibling forms should behave consistently.

Behavior change

These commands now re-activate a backgrounded target to foreground and pay the stabilization delays (firstInteractionAfterActivateDelay, postSnapshotInteractionDelay) before running. That's the point — but it's why this is split out from the pure refactor.

mouseClick deliberately excluded

mouseClick is the remaining interaction-omission candidate but is macOS-only, and the foreground guard interacts with bespoke macOS activate() handling (see the screenshot path). It needs a macOS smoke check before reclassifying — tracked as a separate follow-up, not included here.

Verification (blocking before un-drafting)

  • e2e: tapSeries works after backgrounding the target app (gains foreground guard)
  • e2e: dragSeries works after backgrounding the target app
  • e2e: keyboardReturn keyboard/focus readiness unchanged
  • perf harness: no regression on hot tap/drag paths from the added preflight
  • xcodebuild build-for-testing green

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Size Report

Metric Base Current Diff
JS raw 1.1 MB 1.1 MB 0 B
JS gzip 357.7 kB 357.7 kB 0 B
npm tarball 458.3 kB 458.5 kB +147 B
npm unpacked 1.5 MB 1.5 MB +235 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.7 ms 27.5 ms -0.2 ms
CLI --help 42.5 ms 42.9 ms +0.4 ms

Top changed chunks: no changes in the largest emitted chunks.

… commands

tapSeries and dragSeries are the series forms of tap/drag (already interaction
commands); keyboardReturn is the sibling of keyboardDismiss (already an
interaction command). All three were missing from the historical
isInteractionCommand switch — a drift the new CommandTraits table (#642) makes
visible. Classifying them as interaction commands gives them the foreground-guard
+ stabilization preflight that their single-shot/sibling forms already get.

Behavior change: these three commands now re-activate a backgrounded target to
foreground and pay the stabilization delays before running. Ships separately from
the CommandTraits refactor (#642) and should land after that bakes.

mouseClick left unchanged: macOS-only and the foreground guard interacts with
bespoke macOS activation, so it needs a macOS smoke check first.
@thymikee thymikee force-pushed the fix/ios-runner-classify-series branch from 63ba51f to ff1f2e9 Compare June 1, 2026 14:01
@thymikee thymikee marked this pull request as ready for review June 1, 2026 15:07
@thymikee thymikee merged commit a8b03eb into refactor/ios-runner-command-traits Jun 1, 2026
12 checks passed
@thymikee thymikee deleted the fix/ios-runner-classify-series branch June 1, 2026 15:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-01 15:07 UTC

thymikee added a commit that referenced this pull request Jun 1, 2026
…cation (#642)

* refactor(ios): single CommandTraits table for runner command classification

Replace the three hand-maintained switches in RunnerTests+Lifecycle.swift
(isInteractionCommand / isReadOnlyCommand / isRunnerLifecycleCommand) with one
source of truth: CommandType.traits, an exhaustive switch returning a
CommandTraits struct (interaction / readOnly / lifecycle axes), collocated with
CommandType in RunnerTests+Models.swift.

Pure refactor: every command's classification is reproduced verbatim, and the
three predicates become one-line lookups with unchanged signatures, so call
sites are untouched. The exhaustive switch makes it a compile error to add a
CommandType without classifying it, closing the drift that historically let
tapSeries/dragSeries/keyboardReturn fall out of isInteractionCommand.

readOnly is a 3-state enum (.always/.never/.conditional); .conditional preserves
alert's action-dependent read-only behavior, resolved in isReadOnlyCommand.
Classification feeds ADR-0002 session invalidation (the read-only retry that
nulls currentApp/currentBundleId), so behavior is intentionally unchanged.

Adds the "Runner command traits" term to CONTEXT.md.

* docs(ios): note CommandTraits.readOnly .conditional is alert-only (review follow-up)

* fix(ios): classify tapSeries/dragSeries/keyboardReturn as interaction commands (#643)

* fix(ios): classify tapSeries/dragSeries/keyboardReturn as interaction commands

tapSeries and dragSeries are the series forms of tap/drag (already interaction
commands); keyboardReturn is the sibling of keyboardDismiss (already an
interaction command). All three were missing from the historical
isInteractionCommand switch — a drift the new CommandTraits table (#642) makes
visible. Classifying them as interaction commands gives them the foreground-guard
+ stabilization preflight that their single-shot/sibling forms already get.

Behavior change: these three commands now re-activate a backgrounded target to
foreground and pay the stabilization delays before running. Ships separately from
the CommandTraits refactor (#642) and should land after that bakes.

mouseClick left unchanged: macOS-only and the foreground guard interacts with
bespoke macOS activation, so it needs a macOS smoke check first.

* test: cover iOS runner series commands in perf harness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant