Skip to content

feat(voice): in-place STT model download + retry in Voice Dictation panel#771

Closed
jwalin-shah wants to merge 1 commit into
tinyhumansai:mainfrom
jwalin-shah:feat/voice-intel-setup-ux
Closed

feat(voice): in-place STT model download + retry in Voice Dictation panel#771
jwalin-shah wants to merge 1 commit into
tinyhumansai:mainfrom
jwalin-shah:feat/voice-intel-setup-ux

Conversation

@jwalin-shah
Copy link
Copy Markdown
Contributor

Summary

Replace the "Open Local AI Model" redirect in the Voice Dictation settings panel with an inline, in-place STT model setup: download CTA → live progress → actionable error with retry. Frontend-only, surgical, reuses existing core RPCs (openhuman.local_ai_download_asset and openhuman.local_ai_downloads_progress).

Problem

Issue #632: when the local STT model is missing, the Voice Dictation panel shows an amber warning and a single Open Local AI Model button. That redirect drops the user out of the Voice Intelligence flow into a much larger debug/admin panel. There is no in-panel progress, no error copy, no recovery path if a download fails, and the user has to manually navigate back to verify Voice is ready.

Solution

In app/src/components/settings/panels/VoicePanel.tsx the disabled-state block is replaced with a new SttSetupBlock that renders one of three states from the same data sources the panel already polls (openhuman.local_ai_assets_status + openhuman.local_ai_downloads_progress):

  • Idle — "Voice Dictation needs the local STT model" card with a primary Download STT model button and a soft Advanced (Local AI) fallback link.
  • Progress — live card showing percent, downloaded / total MB, speed, ETA, and a pulse while core is in the installing phase.
  • Error — red card surfacing the error (either the thrown RPC error or stt.warning / stt.state from core) with a Retry download button that calls the same trigger RPC again — downloads resume because the core already supports resume.

Panel readiness still derives from the same source of truth (assets.stt.state === "ready" && voiceStatus.stt_available), so as soon as core finishes the download the voice form enables itself on the next 2s poll. No manual refresh, no redirect.

Three new Vitest cases added alongside the existing three:

  • Idle CTA is shown and old "Open Local AI Model" redirect is gone.
  • Clicking "Download STT model" calls openhumanLocalAiDownloadAsset('stt') and transitions to the progress card when core starts reporting an active download.
  • When the trigger RPC rejects, the error card appears with a Retry button; clicking Retry fires the RPC again and clears the error state.

Out of scope (intentionally deferred)

  • LocalAIStep (onboarding) / Home bootstrap / LocalModelPanel UX — same class of fix, tracked separately. This PR only touches Voice Dictation settings.
  • Rust / core changes — no new RPCs, no change to download resume semantics, no new schemas. If a follow-up wants cancel/pause it should add those to core first.
  • Cancel / pause controls — not in scope for the first slice.
  • TTS model setup — Voice Dictation only depends on STT today; TTS download still flows through the existing advanced panel.
  • Onboarding copy / trust messaging — PR feat(onboarding,ui): trust-first onboarding + Button primitive + honest privacy surface #759 owns that surface; no overlap with the files touched here.
  • E2E spec — this slice is fully covered by the existing Vitest harness; an E2E is only worth adding once more Voice flows land on top.

Submission Checklist

  • yarn compile (tsc --noEmit) clean
  • yarn lint clean
  • yarn test:unit — 466 passed, 2 skipped (5 in VoicePanel.test.tsx, all green)
  • Prettier clean on changed files
  • No Rust changes, no new dependencies, no CI changes
  • No overlap with PR feat(onboarding,ui): trust-first onboarding + Button primitive + honest privacy surface #759 file list (different panel, different test file)
  • Debug logs namespaced [voice-intel] / [VoicePanel:stt], no secrets/PII
  • Manual smoke on a built .app bundle with a missing STT model — not performed in this subagent run; please verify before merging.

Addresses #632

cc @Al629176 — auto-drafted by a subagent, please review carefully.

…anel

When the local STT asset is missing, the Voice Dictation settings panel
previously displayed a dead-end amber warning with an "Open Local AI
Model" button that redirected users out of the flow. Issue tinyhumansai#632 called
this out: setup should be resolvable in place, with progress and a
working retry path.

This change replaces that redirect with an inline setup block that:

- Shows a "Download STT model" CTA that calls
  openhuman.local_ai_download_asset({ capability: "stt" }) directly.
- Switches to a live progress card (percent, MB/total, speed, ETA)
  driven by the existing openhuman.local_ai_downloads_progress poll.
- Renders a clear, actionable error state with a "Retry download"
  button if the trigger RPC rejects or core reports a failed/degraded
  download (including the stt.warning string from core).
- Keeps "Advanced (Local AI)" as a soft secondary link rather than a
  forced handoff, so power users can still open the full Local Model
  panel if they want to.

Panel readiness still derives from the same source of truth
(assets.stt.state === "ready" && voiceStatus.stt_available), so as soon
as the core finishes the download the form enables itself on the next
2s poll — no manual refresh, no redirect.

All changes are frontend-only. No new Rust commands, no new plugins, no
schema changes. Tests cover the idle CTA, progress transition, and
failure -> retry path via the existing Vitest harness.

Addresses tinyhumansai#632
@jwalin-shah jwalin-shah requested a review from a team April 22, 2026 07:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@jwalin-shah has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 39 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 39 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e54da5b4-a2b5-4324-9251-62db4c3cc197

📥 Commits

Reviewing files that changed from the base of the PR and between 100b5b7 and 3c36c6a.

📒 Files selected for processing (2)
  • app/src/components/settings/panels/VoicePanel.tsx
  • app/src/components/settings/panels/__tests__/VoicePanel.test.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jwalin-shah
Copy link
Copy Markdown
Contributor Author

Withdrawn for human review + second-opinion pass. Will reopen once reviewed.

@jwalin-shah jwalin-shah deleted the feat/voice-intel-setup-ux branch April 23, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants