Skip to content

Conversation

steven-mpawulo
Copy link

@steven-mpawulo steven-mpawulo commented Aug 20, 2025

Adds user context so that it is factored into meeting summary in regards to this issue #1327


Summary by cubic

Adds user context to personalize enhanced meeting summaries and introduces a Settings > User Context page to save and use it. Addresses #1327 by factoring user details into the enhance system prompt.

  • New Features
    • New Settings tab: User Context (textarea with Save + toast feedback).
    • Persists context via Tauri store (store.json, key: user_context).
    • Editor enhance flow loads context and passes it to enhance.system template.
    • Updated enhance.system.jinja to include userContext in generation.
    • Added tab type and icon wiring (TabIcon, types, routing, labels).
    • Minor VS Code formatter config for TSX.

Copy link

coderabbitai bot commented Aug 20, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a new "User Context" settings tab and view (persisted in the Tauri store), surfaces that value into the editor enhance flow by passing userContext into the enhance.system Jinja template, adds tab plumbing (type/icon/routes), updates the template to conditionally render userContext, and fixes a VSCode settings JSON entry.

Changes

Cohort / File(s) Summary
VSCode settings
.vscode/settings.json
Adds a [typescriptreact] block setting editor.defaultFormatter to vscode.typescript-language-features and fixes JSON structure by closing rust-analyzer.cargo.extraEnv.
Editor enhance integration
apps/desktop/src/components/editor-area/index.tsx
Adds @tauri-apps/plugin-store load usage and getUserContext() helper; loads user_context and passes its string value as userContext into the enhance.system template render call.
Settings UI: tab plumbing
apps/desktop/src/components/settings/components/tab-icon.tsx, apps/desktop/src/components/settings/components/types.ts, apps/desktop/src/routes/app.settings.tsx
Adds "user-context" tab type, imports/renders User icon, appends { name: "user-context", icon: User } to TABS, maps the tab title, and renders the new view in routes.
Settings UI: user-context view
apps/desktop/src/components/settings/views/user-context.tsx
New React component that loads/saves user_context from Tauri store, displays value in a textarea, supports save with loading state and toasts, and logs errors.
Template update
crates/template/assets/enhance.system.jinja
Adds "User Context" input description and conditional block to render trimmed {{ userContext }} when provided.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant S as Settings View
  participant T as Tauri Store
  Note over S: Mount / Load
  S->>T: load("store.json") / get("user_context")
  T-->>S: { value } or null
  U->>S: Edit textarea + Click Save
  S->>T: set("user_context", { value }) + save()
  T-->>S: success / error
  S-->>U: show toast (saved / error)
Loading
sequenceDiagram
  autonumber
  participant E as Editor Enhance Flow
  participant T as Tauri Store
  participant TMP as enhance.system Template
  Note over E: Prepare system prompt
  E->>T: load("store.json") / get("user_context")
  T-->>E: { value } or null
  E->>TMP: render({ userContext: <string|null>, ... })
  TMP-->>E: rendered system prompt
  Note over E: Continue existing enhance pipeline
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between eec7167 and b32e5b4.

📒 Files selected for processing (1)
  • apps/desktop/src/components/settings/views/user-context.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/components/settings/views/user-context.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

@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 (5)
.vscode/settings.json (1)

24-26: TSX formatter override looks good; consider mirroring for .ts files.

If you also want VSCode to use the built-in TypeScript formatter for .ts files (not just .tsx), add a matching [typescript] override for consistency. Otherwise, TypeScript files will continue to use dprint while TSX uses the TS plugin.

crates/template/assets/enhance.system.jinja (1)

56-59: Relocate and guard the new “User Context” block to avoid empty injections and to align with the “Inputs” section.

  • “User Context (txt)” appears under “About Raw Notes,” but it’s an input, not a raw-notes attribute. Move it under “# Inputs Provided by the user.”
  • Wrap the printed context in a conditional so “Here is the User Context:” isn’t shown when empty.
  • Minor: trim whitespace on the injected value.

Apply:

 # Inputs Provided by the user
@@
 - Meeting Information (txt)
 - Raw Note (txt)
 - Meeting Transcript (txt)
+ - User Context (txt)
@@
- - User Context (txt)
-
-The User Context contains important background details about the user, such as their role, company, ongoing projects, style/tone preferences, and domain terminology.
-You must always take this into account when generating enhanced notes to make them more relevant and personalized.
-
-Here is the User Context:
-{{ userContext}}
+The User Context contains important background details about the user, such as their role, company, ongoing projects, style/tone preferences, and domain terminology.
+You must always take this into account when generating enhanced notes to make them more relevant and personalized.
+
+{% if userContext %}
+Here is the User Context:
+{{ userContext | trim }}
+{% endif %}

Also applies to: 66-73

apps/desktop/src/components/settings/views/user-context.tsx (3)

43-51: Trim input before saving and improve the empty-input check/message.

Prevents saving whitespace-only content and provides a clearer toast. Also reuse the trimmed value when persisting.

-      if (!textAreaRef?.current?.value) {
-        showUserContextToast("Failed to save user context");
+      const value = textAreaRef.current?.value?.trim();
+      if (!value) {
+        showUserContextToast("Please enter some content before saving.");
         setIsLoading(false);
         return;
       }
 
-      store.set("user_context", { value: textAreaRef?.current?.value });
+      store.set("user_context", { value });
       await store.save();

72-77: Prefill the textarea with the existing value (don’t use placeholder for stored data).

Using placeholder to show saved content forces users to retype. Prefer defaultValue (or controlled value) and a simple placeholder string.

-      <Textarea
-        className="h-full"
-        ref={textAreaRef}
-        placeholder={`${userContext?.value || "Enter details about yourself"}`}
-      >
-      </Textarea>
+      <Textarea
+        className="h-full"
+        ref={textAreaRef}
+        placeholder="Enter details about yourself"
+        defaultValue={userContext?.value ?? ""}
+      />

32-57: Consider consolidating setIsLoading(false) with a finally block.

Reduces repetition and ensures loading state resets on all paths without scattering calls. Functionality remains unchanged.

-  const handleSave = async () => {
-    try {
-      setIsLoading(true);
+  const handleSave = async () => {
+    setIsLoading(true);
+    try {
       let store = await getStore();
 
       if (!store) {
         showUserContextToast("Failed to retrieve user store");
-        setIsLoading(false);
         return;
       }
 
       const value = textAreaRef.current?.value?.trim();
       if (!value) {
         showUserContextToast("Please enter some content before saving.");
-        setIsLoading(false);
         return;
       }
 
       store.set("user_context", { value });
       await store.save();
       showUserContextToast("User context saved successfully");
-      setIsLoading(false);
     } catch (error) {
-      setIsLoading(false);
       console.log("Failed to save user context with error ", error);
+    } finally {
+      setIsLoading(false);
     }
   };
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 84a0c86 and 3abb431.

📒 Files selected for processing (7)
  • .vscode/settings.json (1 hunks)
  • apps/desktop/src/components/editor-area/index.tsx (2 hunks)
  • apps/desktop/src/components/settings/components/tab-icon.tsx (2 hunks)
  • apps/desktop/src/components/settings/components/types.ts (3 hunks)
  • apps/desktop/src/components/settings/views/user-context.tsx (1 hunks)
  • apps/desktop/src/routes/app.settings.tsx (3 hunks)
  • crates/template/assets/enhance.system.jinja (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/components/tab-icon.tsx
  • apps/desktop/src/components/settings/views/user-context.tsx
  • apps/desktop/src/routes/app.settings.tsx
  • apps/desktop/src/components/editor-area/index.tsx
  • apps/desktop/src/components/settings/components/types.ts
🧬 Code Graph Analysis (3)
apps/desktop/src/components/settings/views/user-context.tsx (2)
packages/ui/src/components/ui/toast.tsx (1)
  • toast (67-86)
packages/ui/src/components/ui/button.tsx (1)
  • Button (37-89)
apps/desktop/src/routes/app.settings.tsx (1)
apps/desktop/src/components/settings/views/user-context.tsx (1)
  • UserContext (7-90)
apps/desktop/src/components/editor-area/index.tsx (2)
plugins/connector/src/ext.rs (2)
  • store (140-141)
  • store (144-145)
plugins/connector/src/commands.rs (10)
  • store (108-109)
  • store (120-121)
  • store (132-133)
  • store (177-178)
  • store (200-201)
  • store (223-224)
  • store (246-247)
  • store (280-281)
  • store (303-304)
  • store (326-327)
🔇 Additional comments (5)
apps/desktop/src/routes/app.settings.tsx (1)

22-22: User Context tab wiring is correct.

Import, title mapping, and conditional render all look consistent with the Tab union and TABS list.

Also applies to: 75-76, 146-146

apps/desktop/src/components/settings/components/tab-icon.tsx (1)

12-12: Icon support for “user-context” is correctly added.

Import + switch case render are consistent with the existing icon pattern.

Also applies to: 60-61

apps/desktop/src/components/settings/components/types.ts (1)

12-12: Tab type and TABS entry for “user-context” look good.

Union extension and TABS addition are coherent and match the icon wiring elsewhere.

Also applies to: 27-29, 42-42

apps/desktop/src/components/editor-area/index.tsx (1)

25-25: New store import is appropriate.

The plugin-store import is used only for getUserContext and is scoped appropriately.

apps/desktop/src/components/settings/views/user-context.tsx (1)

5-5: Remove unused default React import

Your apps/desktop/src/components/settings/views/user-context.tsx is already on the automatic JSX runtime ("jsx": "react-jsx" in apps/desktop/tsconfig.json) and there’s no reference to the React identifier in the file. You can simplify the import:

- import React, { useEffect, useRef, useState } from "react";
+ import { useEffect, useRef, useState } from "react";

[nit]

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.

1 issue found across 7 files

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


let customInstruction = selectedTemplate?.description;

let userContext = await getUserContext() || "";
Copy link

Choose a reason for hiding this comment

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

getUserContext returns an object but the code passes the whole object instead of its value string

Prompt for AI agents
Address the following comment on apps/desktop/src/components/editor-area/index.tsx at line 469:

<comment>getUserContext returns an object but the code passes the whole object instead of its `value` string</comment>

<file context>
@@ -448,11 +466,14 @@ export function useEnhanceMutation({
 
       let customInstruction = selectedTemplate?.description;
 
+      let userContext = await getUserContext() || &quot;&quot;;
+
       const systemMessage = await templateCommands.render(
</file context>
Suggested change
let userContext = await getUserContext() || "";
let userContext = (await getUserContext())?.value ?? "";

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