fix(mobile): keep screen awake during dictation #12227
main fromrefs/pull/12227/head·merged by juliusmarminge View on GitHubAutomatic 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
ExpoKeepAwake57.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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
2bf78d8Macroscope'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).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.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
apps/mobile/package.jsonapps/mobile/src/features/voice-input/useVoiceInputController.tsdocs/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.mdThe 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:
t3dotggMerge Risk: ⚪ Minimal · up to
2bf78The 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 name Status Explanation Resolution Docstring Coverage ⚠️ Warning 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 … Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (4 passed)
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: keeping the screen awake during mobile dictation. Description check ✅ Passed The 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 ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check 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.juliusmarminge merged thisdd9528a
juliusmarminge closed this
Sign in to join this conversation.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result:
2bf78d8· Source CI: successScenario 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.