Skip to content

Fix toast message issues + Changed the ThankYou Note #1196

Merged
duckduckhero merged 4 commits intomainfrom
fix-toast-message-issues
Jul 23, 2025
Merged

Fix toast message issues + Changed the ThankYou Note #1196
duckduckhero merged 4 commits intomainfrom
fix-toast-message-issues

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

📝 Walkthrough

Walkthrough

The changes replace the previous logic for detecting downloaded models by removing the listDownloadedModels query and introducing two new boolean queries, sttModelExists and llmModelExists, to check for the existence of STT and LLM models. Button labels in the toast notification are updated, and the thank-you message is expanded with additional context.

Changes

File(s) Change Summary
apps/desktop/src/components/toast/model-download.tsx Replaces listDownloadedModels query with sttModelExists and llmModelExists boolean queries; updates effect logic and button labels.
crates/db-user/assets/thank-you.md Expands thank-you message with additional context and rearranges invitation to join Discord.

Sequence Diagram(s)

sequenceDiagram
    participant UI as ModelDownloadNotification
    participant Query as QueryClient

    UI->>Query: sttModelExists()
    Query-->>UI: Boolean (STT model exists)

    UI->>Query: llmModelExists()
    Query-->>UI: Boolean (LLM model exists)

    UI->>UI: Update UI and button labels based on existence flags
    Note right of UI: Initiate download or dismiss as before
Loading

Estimated code review effort

2 (~15 minutes)

Possibly related PRs


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b248535 and 6d29702.

📒 Files selected for processing (1)
  • apps/desktop/src/components/toast/model-download.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/components/toast/model-download.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). (3)
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci
  • GitHub Check: ci (windows, windows-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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 (2)
apps/desktop/src/components/toast/model-download.tsx (2)

62-78: Consider extracting hard-coded model names to constants.

The STT model names are hard-coded in the query function, which makes maintenance difficult if model names change in the future.

+const STT_MODEL_NAMES = [
+  "QuantizedTiny",
+  "QuantizedTinyEn", 
+  "QuantizedBase",
+  "QuantizedBaseEn",
+  "QuantizedSmall",
+  "QuantizedSmallEn",
+  "QuantizedLargeTurbo"
+] as const;

 const sttModelExists = useQuery({
   queryKey: ["stt-model-exists"],
   queryFn: async () => {
-    const results = await Promise.all([
-      localSttCommands.isModelDownloaded("QuantizedTiny"),
-      localSttCommands.isModelDownloaded("QuantizedTinyEn"),
-      localSttCommands.isModelDownloaded("QuantizedBase"),
-      localSttCommands.isModelDownloaded("QuantizedBaseEn"),
-      localSttCommands.isModelDownloaded("QuantizedSmall"),
-      localSttCommands.isModelDownloaded("QuantizedSmallEn"),
-      localSttCommands.isModelDownloaded("QuantizedLargeTurbo"),
-    ]);
+    const results = await Promise.all(
+      STT_MODEL_NAMES.map(modelName => localSttCommands.isModelDownloaded(modelName))
+    );

     return results.some(Boolean);
   },
   refetchInterval: 3000,
 });

80-91: Extract hard-coded LLM model names to constants.

Similar to the STT models, the LLM model names should be extracted to constants for better maintainability.

+const LLM_MODEL_NAMES = [
+  "Llama3p2_3bQ4",
+  "HyprLLM"
+] as const;

 const llmModelExists = useQuery({
   queryKey: ["llm-model-exists"],
   queryFn: async () => {
-    const results = await Promise.all([
-      localLlmCommands.isModelDownloaded("Llama3p2_3bQ4"),
-      localLlmCommands.isModelDownloaded("HyprLLM"),
-    ]);
+    const results = await Promise.all(
+      LLM_MODEL_NAMES.map(modelName => localLlmCommands.isModelDownloaded(modelName))
+    );

     return results.some(Boolean);
   },
   refetchInterval: 3000,
 });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d9ae83 and b248535.

📒 Files selected for processing (2)
  • apps/desktop/src/components/toast/model-download.tsx (3 hunks)
  • crates/db-user/assets/thank-you.md (1 hunks)
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit Configuration File

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • apps/desktop/src/components/toast/model-download.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit Configuration File

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • apps/desktop/src/components/toast/model-download.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). (3)
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci
🔇 Additional comments (2)
apps/desktop/src/components/toast/model-download.tsx (1)

120-124: LGTM! Button label improvements enhance UX.

The updated button labels ("Download Models" and "Download Model") are more concise and clearer than the previous versions.

crates/db-user/assets/thank-you.md (1)

1-5: Excellent UX improvement with contextual messaging.

The expanded thank-you message provides valuable context about the model download process and gives users meaningful activities during the wait time. The flow from acknowledgment → suggested activities → community engagement is well-structured.

@duckduckhero duckduckhero merged commit 03bc579 into main Jul 23, 2025
7 of 8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jul 27, 2025
@ComputelessComputer ComputelessComputer deleted the fix-toast-message-issues branch December 14, 2025 15:21
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