You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Android reports that the app moved to the background during active dictation, finish the recording and put the transcript in the original editable draft. The mobile caller chooses the policy and the controller handles the transition. This keeps preparation cancellation and the existing iOS interruption behavior.
Verification
The controller regression covers a live transcript that becomes available when capture stops, a single draft insert and cleanup, and the existing interruption message when the recording is discarded.
Macroscope's review found this PR approvable — Android dictation now stops and preserves its transcript when the app backgrounds instead of discarding it. The change reuses existing transcription, draft-validation, and resource-cleanup behavior.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
The mobile provider now selects a finish or discard policy when the app moves to the background. The voice input controller applies that policy during recording. Tests cover both outcomes.
Changes: Background recording policy
Layer / File(s)
Summary
Apply and test background recording policies packages/client-runtime/src/voice-input/controller.ts, apps/mobile/src/features/voice-input/VoiceInputProvider.tsx, packages/client-runtime/src/voice-input/controller.test.ts
The controller now requires a "finish" or "discard" policy. During recording, "finish" stops and finishes the recording; the existing interruption path handles other cases. The provider selects "finish" on Android and "discard" on other platforms. Tests cover commit, interruption error, recording deletion, and preparation cancellation.
On Android, backgrounding the app during dictation now finishes the recording and appends the transcript to the draft instead of discarding it. Other platforms keep their current discard behavior. No concrete merge-blocking risk was found; device validation is still pending.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: on Android, dictation is preserved when the app moves to the background. The changeset passes an activeRecording policy ("finish" on Android) to appMovedToBackground, …
Linked Issues check
[#45859] The issue requires that dictation already recorded before an external interruption is kept, becomes editable text in the same composer, keeps existing draft text, and waits for the user to se…
Out of Scope Changes check
All changes connect to the #45859 fix. The VoiceInputProvider.tsx change selects the Android policy at the background callback. The controller.ts change adds the activeRecording policy parameter…
Description check
The description follows most of the template. It has a clear problem link (Fixes #45859) and a Change explanation that covers the Android background policy, the controller handoff, and the preserved p…
Full details: Title check
Explanation
The title names the main change: on Android, dictation is preserved when the app moves to the background. The changeset passes an activeRecording policy ("finish" on Android) to appMovedToBackground, and the PR objectives describe the same outcome. The title follows conventional commit form and is specific enough for a teammate scanning history.
Full details: Linked Issues check
Explanation
[#45859] The issue requires that dictation already recorded before an external interruption is kept, becomes editable text in the same composer, keeps existing draft text, and waits for the user to send. The reviewed head changes VoiceInputProvider.tsx so that Android passes "finish" to appMovedToBackground. The controller change in controller.ts calls this.stop() when the policy is "finish" and state.phase === "recording". The existing Stop path then transcribes the take and commits the text to the original draft. The PR does not change the send behavior, so the user still sends manually. The regression test in controller.test.ts covers the "finish" and "discard" policies and checks the commit and error results. Two limits remain. First, the change applies to Android only, which matches the issue area. Second, device validation is pending, so the exact timer-triggered lifecycle event is not confirmed on a phone. The recorder-error path and the recording-time limit (#42754) are not changed. The issue names these as separate concerns, so their absence does not fail this requirement.
Full details: Out of Scope Changes check
Explanation
All changes connect to the #45859 fix. The VoiceInputProvider.tsx change selects the Android policy at the background callback. The controller.ts change adds the activeRecording policy parameter and the finish branch. The controller.test.ts changes add tests for both policies and pass "finish" in the existing preparation-cancellation test. The summary also reports a Platform.OS mock and a shared mock recorder helper in VoiceInputProvider.test.ts. These support the new Android branch tests. The PR does not change the recorder-error path or the recording-limit logic. No unrelated feature or refactor appears in the reviewed changes. One unverified point: the appMovedToBackground signature now requires an argument. This review did not search for other call sites, so type-check coverage of those call sites is not confirmed by this assessment.
Full details: Description check
Explanation
The description follows most of the template. It has a clear problem link (Fixes #45859) and a Change explanation that covers the Android background policy, the controller handoff, and the preserved preparation cancellation and iOS interruption behavior. It also has a Verification section with specific tests and a device reproduction note. Two parts are weak. The Scope section does not state the bug is a bug, and the issue link is present but the section heading is absent. The Problem section is missing: the description does not state the expected behavior in its own heading, only implies it through the Change text. The model/harness line is present. Overall the description is mostly complete, so it passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45859
When Android reports that the app moved to the background during active dictation, finish the recording and put the transcript in the original editable draft. The mobile caller chooses the policy and the controller handles the transition. This keeps preparation cancellation and the existing iOS interruption behavior.
Verification
check:changedpassed.Implemented with GPT-6.2 Sol in Codex. The revised approach was reviewed by GPT-6.2 Sol (Medium).