Skip to content

Empty chat redesign#1287

Merged
yujonglee merged 16 commits intomainfrom
empty-chat-redesign
Aug 4, 2025
Merged

Empty chat redesign#1287
yujonglee merged 16 commits intomainfrom
empty-chat-redesign

Conversation

@duckduckhero
Copy link
Contributor

@duckduckhero duckduckhero commented Aug 4, 2025

Summary by cubic

Redesigned the empty chat state with new quick action buttons, improved analytics tracking, and updated prompts. Added support for custom STT model uploads, improved tool calling in chat, and enabled Hebrew language support.

  • New Features

    • Added drag-and-drop UI for uploading custom STT models.
    • Introduced new chat quick actions: shorten summary, important Q&As, next meeting prep, and add more quotes.
    • Enabled Hebrew as a supported language.
  • Improvements

    • Enhanced chat tool calling logic for better multi-keyword session search.
    • Updated chat system prompt for clearer tool usage and markdown formatting.
    • Improved analytics event tracking for chat quick actions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 4, 2025

📝 Walkthrough

Walkthrough

This update enhances chat quick action buttons with analytics tracking and adds new quick actions. It introduces a multi-keyword session search tool integrated into AI message streaming. The drag-and-drop upload feature for custom STT model files is disabled by commenting out related code. Hebrew language support is added in settings, language conversion code, and localization files. AI system prompt instructions are updated to include tool usage guidance.

Changes

Cohort / File(s) Change Summary
Chat Quick Actions & Analytics
apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx
Added analytics event tracking to quick action buttons, updated prompts and labels, and introduced two new quick actions.
AI Streaming & Multi-keyword Search Tool
apps/desktop/src/components/right-panel/hooks/useChatLogic.ts,
packages/utils/src/ai.ts
Added a multi-keyword session search tool with parallel keyword searches, integrated stopping condition, and exported stepCountIs utility.
STT Model Drag-and-Drop Disabled
apps/desktop/src/components/settings/components/ai/stt-view.tsx
Commented out drag-and-drop file upload feature for custom STT models, including related imports, state, handlers, and UI.
Hebrew Language Support
apps/desktop/src/components/settings/views/general.tsx,
crates/language/src/lib.rs
Added Hebrew ("he") to supported languages in settings and language conversion mappings.
Localization Updates (English & Korean)
apps/desktop/src/locales/en/messages.po,
apps/desktop/src/locales/ko/messages.po
Added new translation entries for chat quick actions, marked obsolete entries, and updated source reference line numbers.
AI System Prompt Documentation
crates/template/assets/ai_chat_system.jinja
Revised AI response format instructions and added a new section detailing the multi-keyword session search tool usage.

Sequence Diagram(s)

Multi-keyword Session Search Tool Integration

sequenceDiagram
    participant User
    participant ChatUI
    participant useChatLogic
    participant AIEngine
    participant SessionSearchTool

    User->>ChatUI: Clicks quick action or sends prompt
    ChatUI->>useChatLogic: Handle user input
    useChatLogic->>AIEngine: Stream message (with tools)
    AIEngine->>SessionSearchTool: Call search_sessions_multi_keywords(keywords)
    SessionSearchTool->>SessionSearchTool: Search sessions for each keyword
    SessionSearchTool->>AIEngine: Return merged, sorted results
    AIEngine->>useChatLogic: Provide AI response (may include tool results)
    useChatLogic->>ChatUI: Display AI response
Loading

STT Model Drag-and-Drop Upload (Disabled)

sequenceDiagram
    participant User
    participant STTView
    participant TauriAPI
    participant UI

    User->>STTView: Attempts drag and drop (feature disabled)
    Note right of STTView: Drag-and-drop handlers and UI are commented out
    STTView-->>User: No action or feedback for drag-and-drop
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • expand-supported-language-options #923: Modifies the ordering and composition of the supported languages array in general settings; related by touching the same language configuration area but does not add new languages.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 baa0eca and 4a9a029.

📒 Files selected for processing (1)
  • crates/language/src/lib.rs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • crates/language/src/lib.rs
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch empty-chat-redesign

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 generate unit tests to generate unit tests for 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: 0

🧹 Nitpick comments (1)
apps/desktop/src/components/settings/components/ai/stt-view.tsx (1)

254-315: Fix typo and consider additional file validation.

The drag-and-drop implementation is well-structured with proper error handling and user feedback. However, there's a typo in the error message.

Apply this diff to fix the typo:

-        "Please drop a valid STT model file (Comming Soon)",
+        "Please drop a valid STT model file (Coming Soon)",

Consider adding file size validation to prevent users from uploading extremely large files that could cause issues.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4c58610 and 3ae39d1.

📒 Files selected for processing (9)
  • apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx (2 hunks)
  • apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (2 hunks)
  • apps/desktop/src/components/settings/components/ai/stt-view.tsx (6 hunks)
  • apps/desktop/src/components/settings/views/general.tsx (1 hunks)
  • apps/desktop/src/locales/en/messages.po (19 hunks)
  • apps/desktop/src/locales/ko/messages.po (19 hunks)
  • crates/language/src/lib.rs (4 hunks)
  • crates/template/assets/ai_chat_system.jinja (2 hunks)
  • packages/utils/src/ai.ts (1 hunks)
🧰 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/settings/views/general.tsx
  • packages/utils/src/ai.ts
  • apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx
  • apps/desktop/src/components/right-panel/hooks/useChatLogic.ts
  • crates/language/src/lib.rs
  • apps/desktop/src/components/settings/components/ai/stt-view.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). (4)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: ci
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci (macos, macos-latest)
🔇 Additional comments (21)
packages/utils/src/ai.ts (1)

7-7: LGTM! Clean addition of AI utility export.

The addition of stepCountIs to the export statement is straightforward and follows the existing pattern. This export supports the new multi-keyword session search tool functionality mentioned in the PR objectives.

apps/desktop/src/locales/en/messages.po (1)

347-349: LGTM! Proper localization support for new chat features.

The new translation entries for "Add more quotes", "Important Q&As", "Next meeting prep", and "Shorten summary" correctly support the new quick action buttons in the chat empty state. The obsolete entries indicate proper cleanup of removed UI elements.

Also applies to: 878-880, 1048-1050, 1360-1362

apps/desktop/src/components/settings/components/ai/stt-view.tsx (1)

469-500: LGTM! Clean UI implementation for custom model upload.

The custom model upload UI provides clear visual feedback with proper drag states, loading indicators, and helpful instructions. The styling and UX are consistent with the rest of the component.

apps/desktop/src/components/settings/views/general.tsx (1)

74-74: LGTM! Hebrew language support added.

The addition of Hebrew ("he") to the supported languages array is straightforward and aligns with the broader Hebrew language support being implemented across the application.

apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx (2)

21-30: LGTM! Well-implemented analytics integration.

The analytics integration properly checks for userId availability before sending events, preventing unnecessary API calls. The callback structure maintains good performance with useCallback optimization.


70-104: LGTM! Improved quick action buttons with analytics tracking.

The updated quick action buttons provide more specific and actionable prompts while properly tracking user interactions. The new "Next meeting prep" and "Add more quotes" actions expand the utility of the chat feature.

apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (2)

10-10: LGTM: Clean import addition.

The addition of stepCountIs to the existing import maintains good organization and supports the new stopping condition functionality.


317-374: Well-implemented multi-keyword search tool with good aggregation logic.

The search_sessions_multi_keywords tool implementation is solid:

  • Proper input validation with min/max keyword constraints (3-5 keywords)
  • Efficient parallel search execution using Promise.all
  • Smart result aggregation using a Map to avoid duplicates
  • Meaningful sorting by keyword match count
  • Clear return structure with both results and summary statistics

The conditional activation for non-HyprLocal connections and the stepCountIs(3) stopping condition are appropriate for controlling tool execution scope.

apps/desktop/src/locales/ko/messages.po (5)

17-17: Source reference updated appropriately.

The source reference has been updated to reflect the new location in the codebase structure.


347-349: New translatable string added for Korean locale.

The "Add more quotes" message has been added but remains untranslated (empty msgstr). This is expected for new strings that haven't been localized yet.


877-880: New translatable strings for chat quick actions.

The "Important Q&As" message has been added but remains untranslated. This aligns with the new quick action buttons mentioned in the AI summary.


1048-1050: Additional chat quick action string added.

The "Next meeting prep" message follows the same pattern as other new quick action strings - properly formatted but awaiting translation.


632-634: Properly marked obsolete message.

The "Create agenda" message has been correctly marked as obsolete with the #~ prefix, indicating it's no longer used in the codebase.

crates/template/assets/ai_chat_system.jinja (2)

90-91: Improved clarity on markdown block usage.

The refined instructions clearly distinguish when to use markdown blocks (for note rewrites) vs when not to use them (for informational responses). The warning about avoiding empty markdown blocks is a good addition to prevent formatting issues.


147-158: Excellent tool calling guidance with clear examples.

The new "[Tool Calling]" section provides comprehensive guidance for the search_sessions_multi_keywords tool:

  • Clear description of when and how to use the tool
  • Good examples contrasting what to do vs what not to do
  • Encourages proactive tool usage for better user experience
  • Emphasizes smart combination of results rather than raw data dumping

This aligns perfectly with the tool implementation and will help ensure the AI provides meaningful, synthesized responses rather than just listing search results.

crates/language/src/lib.rs (6)

72-72: Hebrew language mapping added consistently.

The Hebrew (ISO639::He) to Whisper language conversion follows the established pattern and maintains consistency with other language mappings.


140-140: Consistent placement in conversion logic.

The Hebrew case is properly placed in the match statement for the TryInto implementation, maintaining alphabetical ordering with other languages.


183-183: Bidirectional conversion properly implemented.

The reverse conversion from Whisper language to internal Language type correctly includes Hebrew, ensuring complete bidirectional support.


251-251: Reverse mapping maintains consistency.

The Hebrew mapping in the reverse direction follows the same pattern and maintains the conversion integrity.


303-303: Deepgram integration includes Hebrew support.

Hebrew is properly added to the Deepgram language options, extending external service integration capabilities.


344-344: Hebrew transcript text properly localized.

The Hebrew translation "טקסט מוצג" (displayed text) is provided for the transcript text method, completing the Hebrew language support across all text representations.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

5 issues found across 9 files • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

- Suggestion of a new version of the meeting note (in markdown format) based on user's request.
- Information
- Suggestion of a new version of the meeting note (in markdown block format, inside ``` blocks) based on user's request. However, be careful not to create an empty markdown block.
- Information (when it's not rewriting the note, it shouldn't be inside the `blocks. Only re-written version of the note should be inside the` blocks.)
Copy link

Choose a reason for hiding this comment

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

The phrase 'it shouldn't be inside the blocks. Only re-written version of the note should be inside the blocks.' is missing closing backticks and is unclear. It should explicitly state 'it shouldn't be inside the triple backtick () code blocks. Only re-written versions of the note should be inside the triple backtick () code blocks.'

Prompt for AI agents
Address the following comment on crates/template/assets/ai_chat_system.jinja at line 91:

<comment>The phrase &#39;it shouldn&#39;t be inside the `blocks. Only re-written version of the note should be inside the` blocks.&#39; is missing closing backticks and is unclear. It should explicitly state &#39;it shouldn&#39;t be inside the triple backtick (```) code blocks. Only re-written versions of the note should be inside the triple backtick (```) code blocks.&#39;</comment>

<file context>
@@ -87,8 +87,8 @@ Your response would be highly likely to be paragraphs with combined information
 
 Your response would mostly be either of the two formats:
 
-- Suggestion of a new version of the meeting note (in markdown format) based on user&#39;s request.
-- Information
+- Suggestion of a new version of the meeting note (in markdown block format, inside ``` blocks) based on user&#39;s request. However, be careful not to create an empty markdown block.
+- Information (when it&#39;s not rewriting the note, it shouldn&#39;t be inside the `blocks. Only re-written version of the note should be inside the` blocks.)
 
 [Example 1]
</file context>
Suggested change
- Information (when it's not rewriting the note, it shouldn't be inside the `blocks. Only re-written version of the note should be inside the` blocks.)
- Information (when it's not rewriting the note, it shouldn't be inside the triple backtick (```) code blocks. Only re-written versions of the note should be inside the triple backtick (```) code blocks.)

const targetPath = `${modelsDir}/${file.name}`;

// Read the file content as array buffer
const fileContent = await file.arrayBuffer();
Copy link

Choose a reason for hiding this comment

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

Reading the whole model file into memory before writing can exhaust memory for large (>800 MB) models; use a streaming copy instead.

Prompt for AI agents
Address the following comment on apps/desktop/src/components/settings/components/ai/stt-view.tsx at line 293:

<comment>Reading the whole model file into memory before writing can exhaust memory for large (&gt;800 MB) models; use a streaming copy instead.</comment>

<file context>
@@ -243,6 +251,69 @@ export function STTView({
     onError: console.error,
   });
 
+  const handleDragOver = useCallback((e: React.DragEvent) =&gt; {
+    e.preventDefault();
+    e.stopPropagation();
+    setIsDragOver(true);
+  }, []);
+
</file context>

)
: (
<p className="text-gray-500 text-sm">
Drag and drop your own STT mode file (.ggml or .bin format)
Copy link

Choose a reason for hiding this comment

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

Typo in helper text: "STT mode file" should be "STT model file".

Prompt for AI agents
Address the following comment on apps/desktop/src/components/settings/components/ai/stt-view.tsx at line 496:

<comment>Typo in helper text: &quot;STT mode file&quot; should be &quot;STT model file&quot;.</comment>

<file context>
@@ -392,6 +466,39 @@ export function STTView({
         &lt;/div&gt;
       &lt;/div&gt;
 
+      &lt;div className=&quot;max-w-2xl&quot;&gt;
+        &lt;h3 className=&quot;text-sm font-semibold mb-3 text-gray-700&quot;&gt;
+          Custom
+        &lt;/h3&gt;
+        &lt;div
+          className={cn(
</file context>
Suggested change
Drag and drop your own STT mode file (.ggml or .bin format)
+ Drag and drop your own STT model file (.ggml or .bin format)

const fileName = file.name.toLowerCase();
if (!fileName.endsWith(".bin") && !fileName.endsWith(".ggml")) {
await message(
"Please drop a valid STT model file (Comming Soon)",
Copy link

Choose a reason for hiding this comment

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

Typo in user-facing string: "Comming" should be "Coming".

Prompt for AI agents
Address the following comment on apps/desktop/src/components/settings/components/ai/stt-view.tsx at line 280:

<comment>Typo in user-facing string: &quot;Comming&quot; should be &quot;Coming&quot;.</comment>

<file context>
@@ -243,6 +251,69 @@ export function STTView({
     onError: console.error,
   });
 
+  const handleDragOver = useCallback((e: React.DragEvent) =&gt; {
+    e.preventDefault();
+    e.stopPropagation();
+    setIsDragOver(true);
+  }, []);
+
</file context>
Suggested change
"Please drop a valid STT model file (Comming Soon)",
+ "Please drop a valid STT model file (Coming Soon)",

}, [onFocusInput]);

const handleButtonClick = useCallback((prompt: string) => (e: React.MouseEvent) => {
const handleButtonClick = useCallback((prompt: string, analyticsEvent: string) => (e: React.MouseEvent) => {
Copy link

Choose a reason for hiding this comment

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

userId is referenced inside the useCallback but is missing from the dependency array, so the memoized handleButtonClick may use a stale userId value and send incorrect analytics data. (Based on your team's feedback about always including all hook dependencies to avoid stale closures.)

Prompt for AI agents
Address the following comment on apps/desktop/src/components/right-panel/components/chat/empty-chat-state.tsx at line 21:

<comment>`userId` is referenced inside the `useCallback` but is missing from the dependency array, so the memoized `handleButtonClick` may use a stale `userId` value and send incorrect analytics data. (Based on your team&#39;s feedback about always including all hook dependencies to avoid stale closures.)</comment>

<file context>
@@ -1,19 +1,31 @@
+import { commands as analyticsCommands } from &quot;@hypr/plugin-analytics&quot;;
 import { commands as windowsCommands } from &quot;@hypr/plugin-windows&quot;;
 import { Badge } from &quot;@hypr/ui/components/ui/badge&quot;;
 import { Trans } from &quot;@lingui/react/macro&quot;;
 import { memo, useCallback } from &quot;react&quot;;
 
+import { useHypr } from &quot;@/contexts&quot;;
+
 interface EmptyChatStateProps {
</file context>

@yujonglee yujonglee merged commit d15b220 into main Aug 4, 2025
6 of 7 checks passed
@yujonglee yujonglee deleted the empty-chat-redesign branch August 4, 2025 04:16
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

Comments