Skip to content

Chat input fix + minor fixes #1337

Merged
duckduckhero merged 7 commits intomainfrom
chat-input-fix
Aug 13, 2025
Merged

Chat input fix + minor fixes #1337
duckduckhero merged 7 commits intomainfrom
chat-input-fix

Conversation

@duckduckhero
Copy link
Contributor

@duckduckhero duckduckhero commented Aug 13, 2025

Summary by cubic

Improved the chat input for better resizing and scrolling, fixed the Obsidian default URL setup in integrations, and added meeting participant emails to the share-by-email feature.

  • Bug Fixes

    • Chat input now uses a flexible, scrollable editor area.
    • Obsidian integration correctly stores the base URL even when set outside user input.
  • New Features

    • Share-by-email now includes participant names and emails in the message.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

📝 Walkthrough

Walkthrough

Updates chat input layout and editor behavior, adjusts right panel default sizing, seeds Obsidian base URL from form when missing on server, enhances email share to include participants and changes function signature, realigns locale source references, and adds a trailing newline to webhook OpenAPI spec.

Changes

Cohort / File(s) Summary of changes
Chat input layout and behavior
apps/desktop/src/components/right-panel/components/chat/chat-input.tsx
Increased editor max height, adjusted overflow and paragraph display, container uses flex/scroll, fixed bottom bar height, added placeholder overlay, passed initialContent and editable props.
Right panel sizing
apps/desktop/src/components/right-panel/index.tsx
Removed ResizablePanel defaultSize prop; relies on internal default sizing.
Integrations base URL seeding
apps/desktop/src/components/settings/views/integrations.tsx
Added effect to set base URL from form when server data is absent; extended effect dependencies.
Share email participants flow
apps/desktop/src/components/toolbar/buttons/share-button.tsx
Email export now fetches participants (with fallback), expands email() signature to accept participants, includes participant names/emails in body and recipients, URL-encodes subject/body, wrapped in try/catch.
Locales reference realignment
apps/desktop/src/locales/en/messages.po, apps/desktop/src/locales/ko/messages.po
Updated source location references only; no translation string changes.
OpenAPI formatting
plugins/webhook/openapi.json
Added trailing newline; no spec changes.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant UI as ShareButton
  participant S as SessionService
  participant P as ParticipantService
  participant M as MailClient

  U->>UI: Click "Share via Email"
  UI->>S: Load session content
  UI->>P: Fetch participants (bypass cache)
  alt Success
    P-->>UI: Participants list
  else Failure
    P-->>UI: Error
    UI->>UI: Proceed without participants
  end
  UI->>M: Open mailto with subject/body (+to if participants)
Loading
sequenceDiagram
  participant V as Integrations View
  participant F as Form
  participant Q as GetBaseUrl Query
  participant O as ObsidianCommands

  V->>F: Initialize and watch form
  V->>Q: Query base URL
  Q-->>V: isSuccess + data (possibly empty)
  V->>F: Read current form values
  alt No server base URL AND form has baseUrl
    V->>O: setBaseUrl(form.baseUrl)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 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.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chat-input-fix

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
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: 2

🔭 Outside diff range comments (1)
apps/desktop/src/components/right-panel/components/chat/chat-input.tsx (1)

206-244: Prop onKeyDown is unused; forward events or remove the prop

The component defines/destructures onKeyDown but never calls it, violating the “no unused variables” guideline and potentially regressing consumer behavior.

Forward the DOM keydown to the prop after your handling:

       const handleKeyDown = (event: KeyboardEvent) => {
         if (event.metaKey || event.ctrlKey) {
           if (["b", "i", "u", "k"].includes(event.key.toLowerCase())) {
             event.preventDefault();
             return;
           }
         }
 
         if (event.key === "Enter" && !event.shiftKey) {
           event.preventDefault();
 
           if (inputValue.trim()) {
             handleSubmit();
           }
         }
+        // Bubble up for consumers that need additional handling
+        try {
+          // Cast is safe for consumer APIs expecting React KeyboardEvent
+          (onKeyDown as any)?.(event);
+        } catch {
+          // intentionally no-op per codebase guidelines
+        }
       };

Alternatively, remove onKeyDown from ChatInputProps and all call sites.

🧹 Nitpick comments (3)
plugins/webhook/openapi.json (1)

1-407: Add global security to satisfy CKV_OPENAPI_4 and set a consistent default

Static analysis flags missing top-level security. You already set per-operation security; adding a global default makes intent explicit and satisfies the check. Operations can still override it (as they do for webhook_signature).

Apply this diff near the top-level (after info) to set a default API key requirement:

 {
   "openapi": "3.1.0",
   "info": {
     "title": "Webhook API Documentation",
     "description": "Webhook system for receiving real-time events",
     "contact": {
       "name": "API Support",
       "email": "api@example.com"
     },
     "license": {
       "name": ""
     },
     "version": "1.0.0"
   },
+  "security": [
+    { "api_key": [] }
+  ],
   "paths": {

If you prefer not to enforce global security, you can suppress CKV_OPENAPI_4 in CI. Confirm which approach you want so we can align CI with spec intent.

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

111-116: Seeding baseUrl on initial load looks correct; watch duplication risk

Seeding when getBaseUrl succeeds with empty data and the form already holds a value is sensible and scoped to first resolution. Verify this doesn’t race with the form.reset effect above and write twice to the backend.

If you find it re-fires on re-renders, guard with a ref to ensure one-time execution:

+  const seededRef = useRef(false);
   useEffect(() => {
     const subscription = form.watch((value, { name }) => {
       ...
     });
 
     // store initial base url even if it's not by the user
     const currentValues = form.getValues();
-    if (getBaseUrl.isSuccess && !getBaseUrl.data && currentValues.baseUrl) {
+    if (!seededRef.current && getBaseUrl.isSuccess && !getBaseUrl.data && currentValues.baseUrl) {
+      seededRef.current = true;
       obsidianCommands.setBaseUrl(currentValues.baseUrl);
     }
 
     return () => subscription.unsubscribe();
-  }, [form, getBaseUrl.isSuccess, getBaseUrl.data]);
+  }, [form, getBaseUrl.isSuccess, getBaseUrl.data]);

Also applies to: 118-118

apps/desktop/src/components/right-panel/components/chat/chat-input.tsx (1)

264-286: CSS nit: make display:block change intentional and drop redundant inline resets

Changing paragraphs to block fixes wrapping/line-break issues in the editor. Given that strong/em/u/h* resets also force display:inline, consider removing those display overrides unless you’ve seen regressions—they may fight semantic styling in future rich text modes.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5bc7946 and a890e32.

📒 Files selected for processing (7)
  • apps/desktop/src/components/right-panel/components/chat/chat-input.tsx (4 hunks)
  • apps/desktop/src/components/right-panel/index.tsx (0 hunks)
  • apps/desktop/src/components/settings/views/integrations.tsx (1 hunks)
  • apps/desktop/src/components/toolbar/buttons/share-button.tsx (3 hunks)
  • apps/desktop/src/locales/en/messages.po (14 hunks)
  • apps/desktop/src/locales/ko/messages.po (14 hunks)
  • plugins/webhook/openapi.json (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/desktop/src/components/right-panel/index.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/settings/views/integrations.tsx
  • apps/desktop/src/components/toolbar/buttons/share-button.tsx
  • apps/desktop/src/components/right-panel/components/chat/chat-input.tsx
🪛 Checkov (3.2.334)
plugins/webhook/openapi.json

[HIGH] 1-407: Ensure that the global security field has rules defined

(CKV_OPENAPI_4)

⏰ 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: cubic · AI code reviewer
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci (macos, macos-latest)
🔇 Additional comments (20)
plugins/webhook/openapi.json (1)

407-407: Trailing newline only — OK to merge

No semantic changes. Good housekeeping.

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

325-341: Good flex layout: editor grows and container scrolls

Switching overflow to the container and letting the editor area flex-grow addresses the input clipping issue. The overlay placeholder condition tied to isGenerating and input emptiness is a nice touch.


267-270: Max height increase to 80px: verify scroll behavior with long content

With overflow on the container, ensure parent panel has a constrained height so the editor actually scrolls. If parents are auto-sized, the scroll might not engage.

apps/desktop/src/components/toolbar/buttons/share-button.tsx (1)

448-452: Signature change: OK — ensure all call sites updated

exportHandlers.email now accepts optional participants and returns ExportResult. Calls above have been updated accordingly.

If there are other usages of exportHandlers.email, confirm they’re updated to the new signature.

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

410-416: Reference realignment only — no translation changes

Source-location updates look consistent with the Integrations UI changes. No action needed.

Also applies to: 451-458, 576-579, 592-596, 1060-1063, 1499-1506, 1641-1643

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

410-415: Refs updated for "API Key" — looks good

Only source references updated to include integrations.tsx:203; msgid/msgstr unchanged.


451-454: "Base Folder" reference moved — OK

Reference now points to integrations.tsx:252. No translation change.


455-458: "Base URL" reference moved — OK

Reference now points to integrations.tsx:179. No translation change.


576-579: "Connect with external tools..." reference realigned — OK

Reference updated to integrations.tsx:127. No translation change.


592-595: "Connect your Obsidian vault..." reference realigned — OK

Reference updated to integrations.tsx:139. No translation change.


898-902: Integrations key still references route/app.settings.tsx — verify intent

AI summary claims the app.settings.tsx reference was removed, but it still exists here alongside integrations.tsx:124. Confirm whether both locations intentionally reference the same msgid, or remove the obsolete reference if the string moved entirely.

If the string no longer appears in app.settings.tsx, consider cleaning refs by re-extracting Lingui messages to drop stale references.


1056-1059: "More integrations coming soon..." reference updated — OK

Reference updated to integrations.tsx:278. No translation change.


1145-1148: "Obsidian" reference updated — OK

Reference updated to integrations.tsx:136. No translation change.


1184-1187: "Optional base folder path..." reference updated — OK

Reference updated to integrations.tsx:261. No translation change.


1499-1502: "The base URL of your Obsidian server..." reference updated — OK

Reference updated to integrations.tsx:188. No translation change.


1503-1506: "The name of your Obsidian vault." reference updated — OK

Reference updated to integrations.tsx:237. No translation change.


1555-1558: "Turn on Obsidian integration..." reference updated — OK

Reference updated to integrations.tsx:156. No translation change.


1615-1618: "Vault Name" reference updated — OK

Reference updated to integrations.tsx:228. No translation change.


1640-1643: "We're working on adding more tools..." reference updated — OK

Reference updated to integrations.tsx:281. No translation change.


1684-1687: "Your API key for Obsidian local-rest-api plugin." reference updated — OK

Reference updated to integrations.tsx:213. No translation change.

Comment on lines +166 to +173
try {
// fetch participants directly, bypassing cache
const freshParticipants = await dbCommands.sessionListParticipants(param.id);
result = await exportHandlers.email(session, freshParticipants);
} catch (participantError) {
console.warn("Failed to fetch participants, sending email without them:", participantError);
result = await exportHandlers.email(session, undefined);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Replace try/catch with promise fallback to align with “no error handling” guideline

You only need a best-effort participant list. Avoid explicit try/catch and fallback via catch chain:

-      } else if (optionId === "email") {
-        try {
-          // fetch participants directly, bypassing cache
-          const freshParticipants = await dbCommands.sessionListParticipants(param.id);
-          result = await exportHandlers.email(session, freshParticipants);
-        } catch (participantError) {
-          console.warn("Failed to fetch participants, sending email without them:", participantError);
-          result = await exportHandlers.email(session, undefined);
-        }
+      } else if (optionId === "email") {
+        const freshParticipants = await dbCommands
+          .sessionListParticipants(param.id)
+          .catch(() => undefined);
+        result = await exportHandlers.email(session, freshParticipants);
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try {
// fetch participants directly, bypassing cache
const freshParticipants = await dbCommands.sessionListParticipants(param.id);
result = await exportHandlers.email(session, freshParticipants);
} catch (participantError) {
console.warn("Failed to fetch participants, sending email without them:", participantError);
result = await exportHandlers.email(session, undefined);
}
const freshParticipants = await dbCommands
.sessionListParticipants(param.id)
.catch(() => undefined);
result = await exportHandlers.email(session, freshParticipants);
🤖 Prompt for AI Agents
In apps/desktop/src/components/toolbar/buttons/share-button.tsx around lines
166-173, replace the explicit try/catch that fetches participants and falls back
to undefined with a promise-based fallback: call
dbCommands.sessionListParticipants(param.id) and let it resolve or, on
rejection, return undefined via .catch(...) so you can pass the resulting value
directly into exportHandlers.email(session, participants). Remove the try/catch
block and ensure the failure is best-effort (no logging or thrown error) and
email is still sent with undefined when participant fetch fails.

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

1 issue found across 7 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.

@duckduckhero duckduckhero merged commit d9d6524 into main Aug 13, 2025
8 checks passed
This was referenced Aug 15, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 2, 2025
@ComputelessComputer ComputelessComputer deleted the chat-input-fix branch December 14, 2025 15:22
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

Comments