Skip to content

Conversation

@ComputelessComputer
Copy link
Collaborator

Overview

  • Added error variant for banner component
  • Implemented local Speech-to-Text (STT) connection status display

  • Enhanced banner with new error state visualization
  • Integrated connection status indicator for local STT functionality

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

📝 Walkthrough

Walkthrough

Propagates local STT connection and server status into the sidebar banner system, adds two STT-specific banners (loading/unreachable) and refines missing-STT conditions for local models, and introduces an optional variant on banners to apply error-specific border/shadow styling.

Changes

Cohort / File(s) Change Summary
Banner component & types
apps/desktop/src/components/main/sidebar/banner/component.tsx, apps/desktop/src/components/main/sidebar/banner/types.ts
Added optional `variant?: "default"
Banner wiring / registry
apps/desktop/src/components/main/sidebar/banner/index.tsx, apps/desktop/src/components/main/sidebar/banner/registry.tsx
index.tsx uses useSTTConnection, derives sttServerStatus and isLocalSttModel, updates hasSttConfigured logic and includes new values in memo deps; createBannerRegistry signature and BannerRegistryParams now accept sttServerStatus and isLocalSttModel, registry adds stt-loading and stt-unreachable banners and refines missing-STT conditions.
STT settings UI
apps/desktop/src/components/settings/ai/stt/select.tsx
Consumes STT connection/status, derives isUnreachable and isNotConfigured, updates background/error UI states and messaging to surface distinct unreachable vs not-configured cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Verify hasSttConfigured branching for local vs cloud models in index.tsx.
  • Confirm sttServerStatus / isLocalSttModel are passed to all createBannerRegistry call sites and included in memo dependency arrays.
  • Review new registry banner conditions (stt-loading, stt-unreachable) and ensure they don't conflict with existing banner ordering/visibility.
  • Check styling change in component.tsx for regression in other banner variants and accessibility (contrast).

Possibly related PRs

Suggested reviewers

  • yujonglee

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
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.
Title check ⚠️ Warning The title mentions 'toasts' and 'connection status' but the changes focus on banner variants and STT connection status, without implementing toast notifications. Update the title to reflect the actual changes: 'Add error variant to banner and display local STT connection status' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description is related to the changeset, covering both the error variant addition and local STT status implementation across multiple files.
✨ 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/add-banner-error-variant

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-storybook ready!

Name Link
🔨 Latest commit c6b31a4
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/694117d6ad54640007c9b80e
😎 Deploy Preview https://deploy-preview-2332--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.

@netlify
Copy link

netlify bot commented Dec 16, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit c6b31a4
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/694117d6e9dd880008b1b500
😎 Deploy Preview https://deploy-preview-2332--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.

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/index.tsx (1)

100-101: Potential unnecessary re-renders from unused dependency.

sttServerStatus is included in the useMemo dependency array, but it's not actually used in any banner logic within createBannerRegistry (as noted in the registry.tsx review). This means the registry will be recreated whenever sttServerStatus changes, even though it has no effect on which banner is shown.

Consider one of the following:

  1. Remove from dependencies until it's actually used in banner logic:
   [
     isAuthenticated,
     hasLLMConfigured,
     hasSttConfigured,
-    sttServerStatus,
     isLocalSttModel,
     isAiTranscriptionTabActive,
     isAiIntelligenceTabActive,
     handleSignIn,
     handleOpenLLMSettings,
     handleOpenSTTSettings,
   ],
  1. Add a banner that uses sttServerStatus to display connection errors (see suggestions in registry.tsx review), which would justify its inclusion here.
📜 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 97c3485.

📒 Files selected for processing (4)
  • apps/desktop/src/components/main/sidebar/banner/component.tsx (1 hunks)
  • apps/desktop/src/components/main/sidebar/banner/index.tsx (4 hunks)
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx (4 hunks)
  • apps/desktop/src/components/main/sidebar/banner/types.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces

Files:

  • apps/desktop/src/components/main/sidebar/banner/types.ts
**/*.{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/main/sidebar/banner/types.ts
  • apps/desktop/src/components/main/sidebar/banner/index.tsx
  • apps/desktop/src/components/main/sidebar/banner/component.tsx
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx
🧬 Code graph analysis (1)
apps/desktop/src/components/main/sidebar/banner/index.tsx (1)
apps/desktop/src/hooks/useSTTConnection.ts (1)
  • useSTTConnection (13-128)
⏰ 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). (3)
  • GitHub Check: Redirect rules - hyprnote-storybook
  • GitHub Check: Header rules - hyprnote-storybook
  • GitHub Check: Pages changed - hyprnote-storybook
🔇 Additional comments (4)
apps/desktop/src/components/main/sidebar/banner/types.ts (1)

16-16: LGTM! Clean type extension.

The optional variant field is well-designed with an appropriate union type and maintains backward compatibility with existing banners that don't specify a variant.

apps/desktop/src/components/main/sidebar/banner/component.tsx (1)

20-23: LGTM! Proper conditional styling implementation.

The variant-based styling is correctly implemented using cn with an array as specified in the coding guidelines. The error variant provides clear visual distinction with red border and shadow.

apps/desktop/src/components/main/sidebar/banner/index.tsx (1)

38-48: LGTM! Well-structured STT connection logic.

The differentiation between local and non-local STT models is clear and correct:

  • Local models (hyprnote, non-cloud) only need a connection
  • Other models need provider, model, AND connection

This properly handles the different configuration requirements for each model type.

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

52-53: Banner correctly suppressed for local STT; connection status shown via Listen button tooltip.

The condition does suppress the "missing-stt" banner when a local STT model is selected (isLocalSttModel=true), even if the server isn't running (hasSttConfigured=false due to sttConnection being null).

However, users are notified through other UI elements:

  1. Listen button tooltip (in useListenButtonState): Shows "Transcription model not available." when !sttConnection, with an actionable "Configure" button
  2. Settings health indicator: Displays explicit server status ("Local server status: unavailable/loading/ready")

Note: The sttServerStatus parameter is passed to createBannerRegistry but never used in any banner condition—it appears to be dead code.

This appears intentional: the banner system handles initial setup (no model selected), while the Listen button provides real-time feedback about connection issues for configured models.

@ComputelessComputer ComputelessComputer force-pushed the feat/add-banner-error-variant branch from 97c3485 to f140090 Compare December 16, 2025 07:43
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

📜 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 f140090 and 8e92637.

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

📄 CodeRabbit inference engine (AGENTS.md)

Format using dprint fmt from the root. Do not use cargo fmt.

Files:

  • apps/desktop/src/components/settings/ai/stt/select.tsx
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx
**/*.{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.
Never do manual state management for form/mutation. Use useForm from tanstack-form and useQuery/useMutation from tanstack-query for 99% cases.

Files:

  • apps/desktop/src/components/settings/ai/stt/select.tsx
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx
**/*.{ts,tsx,rs,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

By default, avoid writing comments at all. If you write one, it should be about 'Why', not 'What'.

Files:

  • apps/desktop/src/components/settings/ai/stt/select.tsx
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: If there are many classNames with conditional logic, use cn (import from @hypr/utils). 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
🧬 Code graph analysis (1)
apps/desktop/src/components/settings/ai/stt/select.tsx (1)
apps/desktop/src/hooks/useSTTConnection.ts (1)
  • useSTTConnection (13-122)
⏰ 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). (3)
  • 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 (1)

198-214: LGTM!

The conditional error messages correctly handle mutually exclusive states - isNotConfigured requires missing provider/model while isUnreachable requires them to be set. The targeted messaging improves UX by distinguishing configuration issues from server failures.

apps/desktop/src/components/main/sidebar/banner/registry.tsx (3)

37-60: LGTM!

The loading banner appropriately shows during STT server startup with clear visual feedback via the animated text.


61-83: LGTM!

The unreachable banner correctly uses the new error variant and provides actionable guidance to configure transcription.


55-100: Potential gap when sttServerStatus is undefined.

When isLocalSttModel is true but sttServerStatus is undefined (e.g., query still loading or returned null), no banner displays:

  • stt-loading requires sttServerStatus === "loading"
  • stt-unreachable requires sttServerStatus === "unreachable"
  • missing-stt requires !isLocalSttModel

This leaves a brief window where users see no feedback while the status query initializes.

Consider whether this gap is acceptable UX, or if you'd prefer a fallback:

     condition: () =>
-      !hasSttConfigured && !isLocalSttModel && !isAiTranscriptionTabActive,
+      !hasSttConfigured && 
+      (!isLocalSttModel || sttServerStatus === undefined) && 
+      !isAiTranscriptionTabActive,

This would show the generic missing-stt banner while status is unknown, then switch to the specific loading/unreachable banner once status resolves.

@ComputelessComputer ComputelessComputer force-pushed the feat/add-banner-error-variant branch from 8e92637 to c6a264a Compare December 16, 2025 08:08
@ComputelessComputer ComputelessComputer changed the title feat(banner): add error variant and local STT connection status Show toasts based on local stt connection status Dec 19, 2025
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