Skip to content

feat(stt): add local STT model status handling#2331

Closed
ComputelessComputer wants to merge 1 commit intomainfrom
feat/local-stt-model-status
Closed

feat(stt): add local STT model status handling#2331
ComputelessComputer wants to merge 1 commit intomainfrom
feat/local-stt-model-status

Conversation

@ComputelessComputer
Copy link
Collaborator

• Added local Speech-to-Text (STT) model status handling functionality
• Implemented status tracking for local STT models

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

📝 Walkthrough

Walkthrough

These changes enhance STT (speech-to-text) status awareness in the desktop UI. Two new banners—"stt-loading" and "stt-unreachable"—are added to the banner registry to display transcription model status conditionally. The settings component is updated to import connection awareness and reflect model configuration and server reachability states with conditional styling and error messaging.

Changes

Cohort / File(s) Summary
Banner Registry Updates
apps/desktop/src/components/main/sidebar/banner/registry.tsx
Added two new banner entries preceding existing banners: "stt-loading" displays a non-dismissible loading state for local STT models with "View status" action; "stt-unreachable" shows an error banner for failed transcription starts with "Configure transcription" action. Both include conditions checking local STT model, status flags, and AI transcription tab state.
STT Settings UI Enhancements
apps/desktop/src/components/settings/ai/stt/select.tsx
Integrated STT connection awareness via useSTTConnection hook. Added computed flags for isLocalSttModel, isUnreachable, and isNotConfigured. Updated component styling to use red background when model is unconfigured or unreachable. Added conditional error messages: "Transcription model is needed" and "Transcription model failed to start. Please try again."

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review condition logic for new banner visibility to ensure all flags align correctly (local STT model, status states, tab active state)
  • Verify STT status flag derivations accurately reflect connection state and configuration status
  • Confirm styling and error message conditional rendering matches intended UX flow

Possibly related PRs

Suggested reviewers

  • yujonglee

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding local STT model status handling, which is reflected in both modified files.
Description check ✅ Passed The description is related to the changeset, discussing local STT model status handling and tracking which aligns with the code modifications.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/local-stt-model-status

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.

@netlify
Copy link

netlify bot commented Dec 16, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 5caba66
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/694103b8380aaf0008b71938
😎 Deploy Preview https://deploy-preview-2331--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 16, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 5caba66
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/694103b86696090008ba15e7
😎 Deploy Preview https://deploy-preview-2331--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/desktop/src/components/main/sidebar/banner/registry.tsx (1)

34-41: Consider moving animate-ping to an indicator element.

The animate-ping animation on the text "loading" might reduce readability. Typically, this animation is applied to visual indicators (like dots or icons) while keeping text static.

Consider this alternative approach:

 description: (
   <>
     Transcription model is
-    <strong className="font-mono animate-ping text-amber-500">
-      loading
-    </strong>
+    <strong className="font-mono text-amber-500">
+      <span className="inline-block size-1.5 rounded-full bg-amber-500 animate-ping mr-1" />
+      loading
+    </strong>
     . This may take a moment.
   </>
 ),
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a69e20 and 5caba66.

📒 Files selected for processing (2)
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx (1 hunks)
  • apps/desktop/src/components/settings/ai/stt/select.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/desktop/src/components/settings/ai/stt/select.tsx
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Redirect rules - hyprnote-storybook
  • GitHub Check: Header rules - hyprnote-storybook
  • GitHub Check: Pages changed - hyprnote-storybook
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
🔇 Additional comments (4)
apps/desktop/src/components/settings/ai/stt/select.tsx (4)

18-18: LGTM!

The STT connection hook integration is clean and uses appropriate optional chaining for safe property access.

Also applies to: 39-40


42-48: LGTM!

The computed flags correctly identify local STT model usage, unreachable status, and missing configuration. The logic is clear and appropriately defensive.


90-95: LGTM!

The conditional styling correctly uses the cn utility with array syntax and appropriately applies error styling (red background) when configuration is missing or the service is unreachable.


224-240: LGTM!

The error message blocks provide clear, actionable feedback to users. The conditions are mutually exclusive by design (not configured requires missing config, while unreachable requires a configured local model), preventing conflicting messages.

Comment on lines +31 to +77
{
banner: {
id: "stt-loading",
description: (
<>
Transcription model is
<strong className="font-mono animate-ping text-amber-500">
loading
</strong>
. This may take a moment.
</>
),
primaryAction: {
label: "View status",
onClick: onOpenSTTSettings,
},
dismissible: false,
},
condition: () =>
isLocalSttModel &&
sttServerStatus === "loading" &&
!hasSttConfigured &&
!isAiTranscriptionTabActive,
},
{
banner: {
id: "stt-unreachable",
variant: "error",
description: (
<>
Transcription model{" "}
<strong className="font-mono text-red-500">failed to start</strong>.
Please try again.
</>
),
primaryAction: {
label: "Configure transcription",
onClick: onOpenSTTSettings,
},
dismissible: false,
},
condition: () =>
isLocalSttModel &&
sttServerStatus === "unreachable" &&
!hasSttConfigured &&
!isAiTranscriptionTabActive,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Undefined variables in banner conditions.

The condition functions reference isLocalSttModel and sttServerStatus, but these variables are not defined in this file, not passed as parameters, and not imported. This will cause a ReferenceError at runtime when the conditions are evaluated.

Apply this diff to add the missing parameters:

 type BannerRegistryParams = {
   isAuthenticated: boolean;
   hasLLMConfigured: boolean;
   hasSttConfigured: boolean;
+  isLocalSttModel: boolean;
+  sttServerStatus?: "loading" | "unreachable" | "running";
   isAiTranscriptionTabActive: boolean;
   isAiIntelligenceTabActive: boolean;
   onSignIn: () => void | Promise<void>;
   onOpenLLMSettings: () => void;
   onOpenSTTSettings: () => void;
 };

 export function createBannerRegistry({
   isAuthenticated,
   hasLLMConfigured,
   hasSttConfigured,
+  isLocalSttModel,
+  sttServerStatus,
   isAiTranscriptionTabActive,
   isAiIntelligenceTabActive,
   onSignIn,
   onOpenLLMSettings,
   onOpenSTTSettings,
 }: BannerRegistryParams): BannerRegistryEntry[] {

Then update the calling code to compute and pass these values (similar to how they're computed in select.tsx lines 42-47).

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In apps/desktop/src/components/main/sidebar/banner/registry.tsx around lines
31-77 the condition functions reference undefined variables (isLocalSttModel,
sttServerStatus, hasSttConfigured, isAiTranscriptionTabActive) causing runtime
ReferenceErrors; update the banner entries so each condition accepts those
values as parameters (e.g., condition: ({ isLocalSttModel, sttServerStatus,
hasSttConfigured, isAiTranscriptionTabActive }) => ...) and then update the
caller that evaluates these registry conditions to compute those four values
(following the logic in select.tsx lines 42-47) and pass them into condition
when checking whether to show each banner. Ensure signatures match across
registry and call sites so the variables are provided instead of referenced
globally.

@ComputelessComputer ComputelessComputer deleted the feat/local-stt-model-status branch December 16, 2025 07:45
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.

1 participant