Skip to content

Enable touch overlays by default for recordings#239

Closed
thymikee wants to merge 7 commits into
mainfrom
codex/show-touches-cleanup
Closed

Enable touch overlays by default for recordings#239
thymikee wants to merge 7 commits into
mainfrom
codex/show-touches-cleanup

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Mar 20, 2026

Summary

This PR adds touch visualization to screen recordings across supported platforms and makes the feature the default recording behavior.

From a user perspective:

  • record start now produces videos with touch overlays by default.
  • record start --hide-touches disables overlays for a given recording.
  • Android recordings use the platform tap-indicator setting during capture and restore the previous value on stop.
  • iOS recordings render overlays from agent-driven gesture data, so taps, swipes, scrolls, and related interactions are visible in the final video.
  • Saved/replayed scripts preserve record options such as --fps and --hide-touches.

API Changes

CLI/API behavior changed in a few concrete ways:

  • record moved from opt-in touch visualization to default-on touch visualization.
  • --show-touches was removed in favor of a single opt-out flag: --hide-touches.
  • record script serialization and replay now round-trip record-specific flags instead of dropping them.
  • iOS record responses/tests now consistently expose whether overlays were active through showTouches in the result payload.

Design

The implementation is intentionally split by responsibility:

  • Gesture capture/timing is recorded once and reused for iOS overlay rendering.
  • Android stays native at capture time by toggling the OS tap-indicator setting around recording lifecycle.
  • iOS keeps a shared overlay pipeline for simulator and physical device recordings, which avoids changing the recording workflow or requiring app relaunch/injection semantics.
  • Record-specific script parsing/formatting was extracted into shared helpers so save-script and replay stay in sync.
  • Recording start/stop platform logic was moved out of the main record-trace handler into focused helpers to reduce branching and make future maintenance lower-risk.

This keeps the user contract simple while preserving the existing session model and cross-platform recording flow.

Validation

  • pnpm typecheck
  • pnpm test:unit
  • pnpm test:smoke

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6498a6b8bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/dispatch.ts Outdated
Comment on lines +183 to +187
interactionResult = await interactor.doubleTap(targetX, targetY);
return;
}
if (holdMs > 0) await interactor.longPress(targetX, targetY, holdMs);
else await interactor.tap(targetX, targetY);
if (holdMs > 0) interactionResult = await interactor.longPress(targetX, targetY, holdMs);
else interactionResult = await interactor.tap(targetX, targetY);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve first gesture timing in repeated press loop

In the repeated press path, interactionResult is reassigned on each iteration, so for iOS runner-backed presses that do not use tapSeries (for example --count with --hold-ms or --jitter-px) the stored timing becomes the last gesture start. recordTouchVisualizationEvent then uses that single timestamp as the base and expands count/intervalMs, which shifts all synthesized overlay events later than the real touches. Capture the first timing (or per-gesture timings) instead of overwriting it each loop iteration.

Useful? React with 👍 / 👎.

Comment thread src/platforms/ios/recording-overlay.ts Outdated
if (fs.existsSync(bundledNeighborPath)) {
return bundledNeighborPath;
}
return path.resolve(path.dirname(bundledNeighborPath), '../../src/platforms/ios/recording-overlay.swift');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fix fallback path for iOS overlay Swift script

The fallback in resolveOverlayScriptPath resolves ../../src/platforms/ios/recording-overlay.swift relative to path.dirname(bundledNeighborPath). In dist runtime that directory is under dist/src/platforms/ios, so this computes dist/src/src/platforms/ios/... rather than the project src/platforms/ios/... path. If the adjacent bundled Swift file is absent (the scenario this fallback is meant to handle), touch-overlay export will fail because xcrun swift gets a non-existent script path.

Useful? React with 👍 / 👎.

@thymikee
Copy link
Copy Markdown
Member Author

Superseded by #245.

@thymikee thymikee closed this Mar 21, 2026
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