Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): keep screen awake during dictation #12227

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/12227/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Automatic screen lock during a long iPhone voice recording backgrounds the app and discards the audio. The user loses the dictation.

The shared mobile voice-input hook now keeps the screen awake only while recording. Each recording gets its own keep-awake tag, which is released after activation finishes even if the session ends immediately. Both new-task and existing-thread composers use the hook. The iPhone voice-input guide now explains when normal screen sleep resumes.

Verification:

  • 25 focused voice-input tests pass.
  • Mobile TypeScript typecheck and targeted format checks pass.
  • iOS prebuild and CocoaPods autolinking found ExpoKeepAwake 57.0.2. The native build stopped during pod installation because the Mac Mini ran out of disk space. A simulator launch is still unverified. Apple's on-device transcription is unavailable in simulators, so a full spoken-dictation reproduction requires a supported physical iPhone.

Evidence: This change affects the idle timer, not rendered UI. Before/after screenshots would show the same recording screen and cannot demonstrate whether automatic lock is disabled. The controller's focused tests cover recording, cancellation, interruption, and completion. Native autolinking succeeded, but a working simulator client and physical-device idle-timer check remain unverified. .

Summary by CodeRabbit

  • New Features

    • The screen now stays awake while voice recording is in progress and returns to normal sleep behavior afterward.
  • Bug Fixes

    • Voice recording now reliably releases the screen wake lock, including when recording ends immediately or is interrupted.
  • Documentation

    • Updated iPhone voice-input guidance to clarify that canceling, leaving the screen, or audio interruptions discard the recording while preserving the draft.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change

    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—13.5 KiB—15.1 KiB✅
      CodexThread snapshot wire—7.1 KiB—7.3 KiB✅
      CodexLive turn WebSocket wire—6.5 KiB—7.8 KiB✅
      CodexLive turn WebSocket decoded—56.3 KiB—66.4 KiB✅
      CodexLive turn messages—10—21✅
      ClaudeTotal thread wire—13.5 KiB—15.1 KiB✅
      ClaudeThread snapshot wire—7.1 KiB—7.3 KiB✅
      ClaudeLive turn WebSocket wire—6.4 KiB—7.8 KiB✅
      ClaudeLive turn WebSocket decoded—57.0 KiB—66.4 KiB✅
      ClaudeLive turn messages—9—21✅

      Baseline: unavailable · PR result: 2bf78d8 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.9 KiB
      • Claude decoded thread snapshot: 114.6 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. Approvability

      Verdict: Approved at 2bf78d8

      Macroscope's review found this PR approvable — This is a narrowly scoped mobile fix that keeps the device awake only during active dictation and releases the keep-awake session when recording ends. The accompanying native dependency, lockfile, and documentation updates are directly limited to that behavior.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Team

      Run ID: 1cbb251d-7d4d-4d55-8fea-4f342cd0a245

      📥 Commits

      Reviewing files that changed from the base of the PR and between 0150c6a53b409ba3bcb45645709b649cf8708354 and 2bf78d832ac8676dedf81d06841d5ee5032196b0.

      ⛔ Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (3)
      • apps/mobile/package.json
      • apps/mobile/src/features/voice-input/useVoiceInputController.ts
      • docs/user/composer.md

      Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      The mobile voice-input controller now keeps the screen awake during recording. It uses tagged sessions and cleanup handling for recording transitions. The app adds the Expo dependency, and the composer documentation describes recording cancellation and screen behavior.

      Changes

      Voice recording wake-lock

      Layer / File(s)Summary
      Recording wake-lock integration
      apps/mobile/package.json, apps/mobile/src/features/voice-input/useVoiceInputController.ts, docs/user/composer.md
      The mobile app adds expo-keep-awake. The voice-input controller activates and deactivates a tagged keep-awake session around recording. The documentation describes recording disposal and screen sleep behavior.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to 2bf78

      The recording wake-lock integration has matching cleanup and complete dependency metadata, with no merge-blocking risk remaining.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 …Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main change: keeping the screen awake during mobile dictation.
      Description check✅ PassedThe description explains what changed, why it was needed, verification results, UI evidence, and remaining native-device verification limits. It omits the template headings and checklist, but it conta…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Full details: Docstring Coverage

      Explanation

      Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.)

      • Fix all pre-merge checks with AI
      ✨ Finishing Touches 💡 1
      📝 Generate docstrings 💡
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `t3code/keep-awake-during-dictation`

      Comment `@coderabbitai help` to get the list of available commands.
    6. juliusmarminge merged thisdd9528a

    7. juliusmarminge closed this

Sign in to join this conversation.