Repository navigation
fix(web): keep dictating when the tab or app goes to the background - #11
Merged
Merged
Conversation
Hiding the page (switching browser tabs, opening a link, switching apps) stopped the recording and sent it for transcription. Recording now continues while the page is hidden, and the screen wake lock is taken again when the page becomes visible. Hiding the page while the microphone is still starting behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Martin's report: dictation stopped as soon as he switched to another browser tab or opened a link (e.g. levels.fyi) while still talking.
Existing systems changed
apps/web/src/voice-input/VoiceInputControl.tsx): the page becoming hidden no longer ends a recording.visibilitychange→ hidden calledcontroller.stop()while recording, so switching tabs, opening a link in a new tab, or switching apps stopped the recording and sent the partial audio for transcription. The browser itself keeps capturing: in both Chromium and Firefox 158 the microphone track stays live and audio keeps arriving while the tab is in the background. Martin's diagnostics on 2026-10-25 09:02:19 UTC show exactly this:visibility: hiddenandphase: transcribingin the same millisecond.Verifiable outcome
Local dev server with a fake ElevenLabs key (transcription fails with "rejected the API key", which shows the audio reached the server). Real tab switch in one window: record ~3 s, open and activate a second tab for ~9 s, switch back, record ~2 s more, press Stop.
Stop · 0:13), one 15.9 s recording, wake lock re-granted on return.Not verified on Android: the emulator's display hung under load, so Firefox/Chrome for Android background capture and screen-lock behaviour still need a check on the phone.
🤖 Generated with Claude Code