Skip to content

feat: add web voice input and optional auto-send - #12893

Open
Dwite wants to merge 2 commits into
pingdotgg:mainfrom
Dwite:t3code/voice-input-send-mode
Open

Dwite wants to merge 2 commits into
pingdotgg:mainfrom
Dwite:t3code/voice-input-send-mode

Conversation

@Dwite

@Dwite Dwite commented Sep 21, 2026

Copy link
Copy Markdown

Add voice input to supported web browsers and an optional immediate-send setting on web and iPhone. The default inserts recognized text into the composer for review. Enabling immediate sending submits the full composer message through the normal send path.

Surface Before After
iPhone Microphone inserts text for review Same default, with optional immediate sending
Web No built-in microphone Start, finish, and cancel voice input; review by default or send immediately
Desktop app No speech-recognition service Explicit unsupported state; this PR does not add a desktop transcription service

The settings are device-local and off by default:

  • Web: Settings → General → Send voice input immediately.
  • iPhone: Settings → Keyboard & voice → Voice input → Send immediately.

Both new tasks and existing threads use their existing send checks, attachments, and connection paths. Recognition replaces the selection captured when recording starts. Sending waits for the committed text to render. A blocked send stays in the composer and is not retried later automatically. Cancellation, errors, empty results, and stale drafts never send. Switching threads or hiding the browser page cancels web recognition.

Web uses the browser's SpeechRecognition API, requires HTTPS or localhost, and reports unsupported clients and permission/service errors. The browser may send audio to its speech service; the microphone tooltip, setting, and user guide explain this. No API key, new transcription backend, or provider-adapter changes are required.

Web comparison and demos

Web settings before and after

Default: insert into the composer · Opt-in: send immediately

The web videos visibly label simulated browser speech-result events. The actual composer and send paths run against an isolated backend. New-thread and existing-thread submissions received the expected agent replies. These captures do not verify microphone audio or the browser vendor's recognition service.

iPhone settings comparison and demos

iPhone settings before and after

Find the setting Default: off Enabled
Settings entry Review before sending Send immediately enabled

Before video · After video

iPhone settings navigation and toggle demo

Captured on the iPhone 17 Pro simulator, iOS 26.5. The before capture uses the original settings/navigation source. These videos show the settings flow, not speech recognition. Recording pauses were shortened.

Validation: 258 focused tests passed across browser voice input, iPhone voice input, shared draft insertion, settings contracts, and settings search. Web and mobile typechecks passed. Targeted lint completed with warnings. The iOS development-client build passed. Browser UI checks covered default insertion, recording submission lock, immediate sending in new and existing threads, cancellation at a 390px viewport, and preference persistence after reload. iPhone UI checks covered default-off, toggling, and persistence after app restart. Native microphone recognition remains unverified on both surfaces.

Model: GPT-6. Harness: Codex.

Summary by CodeRabbit

  • New Features
    • Added voice input to web and mobile composers.
    • Added an optional “Send voice input immediately” setting, off by default.
    • Voice transcripts can be inserted into drafts or submitted automatically when sending is allowed.
    • Added controls for starting, stopping, canceling, and reviewing voice input.
    • Renamed keyboard settings to “Keyboard & voice” on mobile.
  • Documentation
    • Added guidance covering browser requirements, cancellation behavior, and mobile voice-input settings.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 21, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f222475

Macroscope's review found this PR approvable — The PR adds an explicitly opt-in, device-local voice auto-send option while preserving the existing review-first default and existing submission checks. The new controller behavior is narrowly scoped and covered by focused tests; the remaining changes are settings wiring, documentation, and test-only dependencies.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 259de3b0-4012-4d3c-af8e-02c4a81b5dee

📥 Commits

Reviewing files that changed from the base of the PR and between f222475 and a2e4b3b.

📒 Files selected for processing (12)
  • apps/web/src/components/chat/ChatComposer.tsx
  • apps/web/src/components/settings/SettingsPanels.tsx
  • apps/web/src/components/settings/settingsSearch.ts
  • apps/web/src/voice-input/ComposerVoiceInput.tsx
  • apps/web/src/voice-input/browserVoiceInput.test.ts
  • apps/web/src/voice-input/browserVoiceInput.ts
  • apps/web/src/voice-input/useBrowserVoiceInput.test.tsx
  • apps/web/src/voice-input/useBrowserVoiceInput.ts
  • docs/user/composer.md
  • packages/client-runtime/src/voice-input/index.ts
  • packages/contracts/src/settings.test.ts
  • packages/contracts/src/settings.ts

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


📝 Walkthrough

Walkthrough

The pull request adds browser voice input and immediate-send settings for web and mobile composers. It adds settings contracts, recording lifecycle handling, composer integration, mobile submission guards, tests, and documentation.

Changes

Voice input and immediate submission

Layer / File(s) Summary
Immediate-send settings contract
packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts, apps/mobile/src/persistence/mobile-preferences.ts, packages/client-runtime/src/voice-input/index.ts
Adds the voiceInputSendImmediately setting to client contracts and mobile preference sanitization. Re-exports resolveTranscriptCommit.
Mobile voice submission
apps/mobile/src/features/settings/*, apps/mobile/src/features/voice-input/useVoiceInputController.ts, apps/mobile/src/features/threads/*, apps/mobile/src/Stack.tsx
Adds the mobile setting, captures it when recording starts, and submits only matching transcripts through existing send and task-start checks.
Browser voice controller
apps/web/src/voice-input/browserVoiceInput.ts, apps/web/src/voice-input/browserVoiceInput.test.ts
Adds browser support detection, speech-recognition lifecycle handling, transcript commits, cancellation, timeouts, single-controller enforcement, and error states.
Browser composer integration
apps/web/src/voice-input/*, apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/components/settings/*
Adds the browser voice hook and controls. The composer handles immediate submission, disabled states, lifecycle cancellation, and voice errors. Settings expose and index the new option.
Validation and documentation
apps/mobile/src/features/voice-input/useVoiceInputController.test.ts, apps/mobile/package.json, apps/web/src/voice-input/useBrowserVoiceInput.test.tsx, docs/user/composer.md
Adds mobile test dependencies and coverage for mobile and browser voice-input behavior. Documents web and iPhone settings and submission behavior.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Settings
  participant VoiceInput
  participant Composer
  participant Submit
  User->>Settings: Enable immediate sending
  Settings->>VoiceInput: Provide voiceInputSendImmediately
  User->>VoiceInput: Start and finish recording
  VoiceInput->>Composer: Commit transcript
  VoiceInput->>Composer: Request submission when eligible
  Composer->>Submit: Send the composed message
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to a2e4b

The voice-input setting and controls have no remaining actionable issue in the reviewed changes.

🚥 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 16 functions across 19 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main changes: browser voice input and optional immediate sending. It is concise and relevant to the changeset.
Description check ✅ Passed The description clearly explains the feature, behavior, supported platforms, settings, UI changes, limitations, validation, and evidence. It does not use the template headings or checklist, but it pro…
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 16 functions across 19 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Sep 21, 2026
@Dwite Dwite changed the title feat(mobile): add voice input auto-send setting feat: add web voice input and optional auto-send Sep 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant