Skip to content

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Dec 5, 2025

Summary by CodeRabbit

  • New Features

    • Right-click context menu for workspace files: Open, Reveal in file manager, Insert Path
    • Click a file or choose "Insert Path" to append a formatted/relative path into the chat input
    • Open files/folders with the system default apps and reveal them in the OS file manager
    • New path-formatting and relative-path utilities exposed to the renderer
    • Added translations for the new context menu across locales
  • Bug Fixes

    • Improved workspace state tracking for more reliable file loading and refreshes

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Walkthrough

Adds context-menu file actions to the ACP workspace UI, event plumbing to append formatted file paths into the chat editor, two presenter methods (openFile, revealFileInFolder), two preload utilities (toRelativePath, formatPathForInput), i18n entries, and minor store state to track last successful workdir.

Changes

Cohort / File(s) Summary
Main presenter + types
src/main/presenter/acpWorkspacePresenter/index.ts, src/shared/types/presenters/acp-workspace.d.ts
Added openFile(filePath: string): Promise<void> and revealFileInFolder(filePath: string): Promise<void> to the AcpWorkspace presenter; both validate paths, normalize, call electron.shell APIs, log errors, and do not throw.
Preload API
src/preload/index.ts, src/preload/index.d.ts
Added toRelativePath(filePath: string, baseDir?: string): string and formatPathForInput(filePath: string): string to window.api; implemented relative-path safety checks and quoting/escaping rules for editor input.
Renderer — workspace file UI
src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue, src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue, src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
Introduced context menu for file nodes (open, reveal, insert path); added and propagated append-pathappend-file-path events; file actions call presenter or emit path insertion.
Renderer — chat integration
src/renderer/src/components/ChatView.vue
Listens for append-file-path; added toRelativePath and formatFilePathForEditor helpers (using window.api) and handleAppendFilePath to compute, format, append path to chat input and refocus editor.
Store logic
src/renderer/src/stores/acpWorkspace.ts
Added internal lastSuccessfulWorkdir state; update on successful refresh, avoid clearing file tree for failures matching last successful workdir, and reset on workdir change or clear.
i18n
src/renderer/src/i18n/{da-DK,en-US,fa-IR,fr-FR,ja-JP,ko-KR,pt-BR,ru-RU,zh-CN,zh-HK,zh-TW}/chat.json
Added acp.workspace.files.contextMenu with insertPath, openFile, and revealInFolder translations; minor punctuation/formatting adjustments where needed.
Other / manifest
package.json
Listed in manifest section; no behavioral changes reported in summary.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant UI as AcpWorkspaceFileNode (renderer)
    participant FilesView as AcpWorkspaceFiles / AcpWorkspaceView (renderer)
    participant Chat as ChatView (renderer)
    participant Preload as Preload API (window.api)
    participant Presenter as AcpWorkspacePresenter (main)
    participant System as System (electron.shell)

    User->>UI: Right-click or click file node
    UI->>UI: Show context menu (open / reveal / insert)
    alt Insert path
        UI->>FilesView: emit('append-path', filePath)
        FilesView->>FilesView: forward as emit('append-file-path', filePath)
        FilesView->>Chat: emit('append-file-path', filePath)
        Chat->>Preload: toRelativePath(filePath, currentWorkdir)
        Preload-->>Chat: relativeOrOriginalPath
        Chat->>Preload: formatPathForInput(result)
        Preload-->>Chat: formattedPath
        Chat->>Chat: append formattedPath to editor input and refocus
    else Open / Reveal
        UI->>Presenter: openFile(filePath) / revealFileInFolder(filePath)
        Presenter->>Presenter: isPathAllowed + normalize
        Presenter->>System: shell.openPath() / shell.showItemInFolder()
        System-->>Presenter: result / error
        Presenter-->>UI: swallow/log errors (no throw)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on:
    • Presenter path validation/normalization and non-throwing error handling.
    • Preload relative-path edge cases (path traversal, absolute vs relative results) and quoting/escaping correctness.
    • Event typings and propagation: append-pathappend-file-path across components.
    • lastSuccessfulWorkdir update/clear semantics to avoid stale/incorrect tree clears.
    • Consistency of i18n structural edits across locales.

Possibly related PRs

Poem

🐰
I nibble paths and hop with glee,
Menus unfold on each file tree,
Insert, reveal, or open with cheer,
I tuck the path into the chat near,
Multilingual hops for all to see.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add file context actions' accurately describes the main changes—adding context menu actions (open, reveal, insert) for files in the ACP workspace component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 bugfix/0.5.2

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b1580c and 53facf6.

📒 Files selected for processing (1)
  • src/preload/index.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/preload/index.ts

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.

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 (6)
src/renderer/src/stores/acpWorkspace.ts (1)

56-88: Guard refresh updates by workdir as well as conversation to avoid stale trees

The new lastSuccessfulWorkdir handling correctly avoids blanking the tree on transient failures. There’s still a pre‑existing race where rapid workdir changes within the same conversation can cause an older refresh to overwrite the tree for the latest workdir. You can harden this by also checking the current workdir before mutating state:

 const refreshFileTree = async () => {
   const workdir = currentWorkdir.value
   const conversationIdBefore = chatStore.getActiveThreadId()

@@
   isLoading.value = true
   try {
@@
-      // Guard against race condition: only update if still on the same conversation
-      if (chatStore.getActiveThreadId() === conversationIdBefore) {
+      // Guard against race conditions: require same conversation and same workdir
+      if (
+        chatStore.getActiveThreadId() === conversationIdBefore &&
+        currentWorkdir.value === workdir
+      ) {
         fileTree.value = result
         lastSuccessfulWorkdir.value = workdir
       }
     } catch (error) {
       console.error('[AcpWorkspace] Failed to load file tree:', error)
-      if (chatStore.getActiveThreadId() === conversationIdBefore) {
-        if (lastSuccessfulWorkdir.value !== workdir) {
-          fileTree.value = []
-        }
-      }
+      if (
+        chatStore.getActiveThreadId() === conversationIdBefore &&
+        currentWorkdir.value === workdir
+      ) {
+        if (lastSuccessfulWorkdir.value !== workdir) {
+          fileTree.value = []
+        }
+      }
     } finally {
-      if (chatStore.getActiveThreadId() === conversationIdBefore) {
+      if (
+        chatStore.getActiveThreadId() === conversationIdBefore &&
+        currentWorkdir.value === workdir
+      ) {
         isLoading.value = false
       }
     }
   }
src/renderer/src/i18n/da-DK/chat.json (1)

110-115: Danish context menu structure is correct; consider minor copy tweak

The acp.workspace.files.contextMenu block has the right keys and wiring. If you want slightly more idiomatic command labels, you might consider adjusting casing/imperative form, e.g. changing "openFile": "åbne fil" to "openFile": "Åbn fil" to match typical button/command phrasing.

src/renderer/src/components/ChatView.vue (1)

110-111: Consider escaping existing quotes in file paths.

The current implementation wraps paths with spaces in quotes but doesn't handle paths that already contain quote characters. This could lead to malformed paths like ""path with "quotes".txt".

Apply this diff to handle quotes properly:

-const formatFilePathForEditor = (filePath: string) =>
-  /\s/.test(filePath) ? `"${filePath}"` : filePath
+const formatFilePathForEditor = (filePath: string) => {
+  if (/\s/.test(filePath)) {
+    // Escape existing double quotes before wrapping
+    const escaped = filePath.replace(/"/g, '\\"')
+    return `"${escaped}"`
+  }
+  return filePath
+}
src/main/presenter/acpWorkspacePresenter/index.ts (2)

77-94: Consider using structured logging utilities.

The method correctly implements security checks and error handling, but uses console.warn and console.error for logging.

As per coding guidelines, use structured logging with logger.error(), logger.warn(), logger.info(), logger.debug() methods from logging utilities for better log management and monitoring.

Apply this pattern to use structured logging:

+import logger from '@/logger' // Adjust import path as needed
+
 async revealFileInFolder(filePath: string): Promise<void> {
   if (!this.isPathAllowed(filePath)) {
-    console.warn(`[AcpWorkspace] Blocked reveal attempt for unauthorized path: ${filePath}`)
+    logger.warn('[AcpWorkspace] Blocked reveal attempt for unauthorized path', { filePath })
     return
   }

   const normalizedPath = path.resolve(filePath)

   try {
     shell.showItemInFolder(normalizedPath)
   } catch (error) {
-    console.error(`[AcpWorkspace] Failed to reveal path: ${normalizedPath}`, error)
+    logger.error('[AcpWorkspace] Failed to reveal path', { normalizedPath, error })
   }
 }

96-115: Consider using structured logging utilities.

The method correctly implements security checks and properly handles both shell.openPath's error string return value and thrown exceptions.

As per coding guidelines, use structured logging with logger.error(), logger.warn() methods from logging utilities.

Apply this pattern to use structured logging:

+import logger from '@/logger' // Adjust import path as needed
+
 async openFile(filePath: string): Promise<void> {
   if (!this.isPathAllowed(filePath)) {
-    console.warn(`[AcpWorkspace] Blocked open attempt for unauthorized path: ${filePath}`)
+    logger.warn('[AcpWorkspace] Blocked open attempt for unauthorized path', { filePath })
     return
   }

   const normalizedPath = path.resolve(filePath)

   try {
     const errorMessage = await shell.openPath(normalizedPath)
     if (errorMessage) {
-      console.error(`[AcpWorkspace] Failed to open path: ${normalizedPath}`, errorMessage)
+      logger.error('[AcpWorkspace] Failed to open path', { normalizedPath, errorMessage })
     }
   } catch (error) {
-    console.error(`[AcpWorkspace] Failed to open path: ${normalizedPath}`, error)
+    logger.error('[AcpWorkspace] Failed to open path', { normalizedPath, error })
   }
 }
src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue (1)

141-159: Consider using structured logging and user-facing error feedback.

Both handlers correctly use try-catch and call presenter methods via IPC, but have opportunities for improvement:

  1. Structured logging: Replace console.error with structured logging utilities (as per coding guidelines).
  2. User feedback: Consider showing user-friendly error messages when file operations fail, rather than silent logging.

Example improvement for handleOpenFile:

+import { useToast } from '@/composables/useToast' // Adjust import as needed
+import logger from '@/logger' // Adjust import as needed
+
+const { toast } = useToast()
+
 const handleOpenFile = async () => {
   if (props.node.isDirectory) {
     return
   }

   try {
     await acpWorkspacePresenter.openFile(props.node.path)
   } catch (error) {
-    console.error(`[AcpWorkspace] Failed to open file: ${props.node.path}`, error)
+    logger.error('[AcpWorkspace] Failed to open file', { path: props.node.path, error })
+    toast.error(t('chat.acp.workspace.files.errors.failedToOpen'))
   }
 }

Apply similar pattern to handleRevealInFolder.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14ba271 and df9e5d7.

📒 Files selected for processing (18)
  • src/main/presenter/acpWorkspacePresenter/index.ts (2 hunks)
  • src/renderer/src/components/ChatView.vue (3 hunks)
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue (5 hunks)
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue (3 hunks)
  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue (2 hunks)
  • src/renderer/src/i18n/da-DK/chat.json (1 hunks)
  • src/renderer/src/i18n/en-US/chat.json (1 hunks)
  • src/renderer/src/i18n/fa-IR/chat.json (1 hunks)
  • src/renderer/src/i18n/fr-FR/chat.json (1 hunks)
  • src/renderer/src/i18n/ja-JP/chat.json (1 hunks)
  • src/renderer/src/i18n/ko-KR/chat.json (1 hunks)
  • src/renderer/src/i18n/pt-BR/chat.json (1 hunks)
  • src/renderer/src/i18n/ru-RU/chat.json (1 hunks)
  • src/renderer/src/i18n/zh-CN/chat.json (1 hunks)
  • src/renderer/src/i18n/zh-HK/chat.json (1 hunks)
  • src/renderer/src/i18n/zh-TW/chat.json (1 hunks)
  • src/renderer/src/stores/acpWorkspace.ts (4 hunks)
  • src/shared/types/presenters/acp-workspace.d.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (33)
src/renderer/src/i18n/**/*.json

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

src/renderer/src/i18n/**/*.json: Translation key naming convention: use dot-separated hierarchical structure with lowercase letters and descriptive names (e.g., 'common.button.submit')
Maintain consistent key-value structure across all language translation files (zh-CN, en-US, ko-KR, ru-RU, zh-HK, fr-FR, fa-IR)

Files:

  • src/renderer/src/i18n/ru-RU/chat.json
  • src/renderer/src/i18n/fa-IR/chat.json
  • src/renderer/src/i18n/ja-JP/chat.json
  • src/renderer/src/i18n/en-US/chat.json
  • src/renderer/src/i18n/fr-FR/chat.json
  • src/renderer/src/i18n/zh-CN/chat.json
  • src/renderer/src/i18n/pt-BR/chat.json
  • src/renderer/src/i18n/da-DK/chat.json
  • src/renderer/src/i18n/ko-KR/chat.json
  • src/renderer/src/i18n/zh-HK/chat.json
  • src/renderer/src/i18n/zh-TW/chat.json
src/**/*

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

New features should be developed in the src directory

Files:

  • src/renderer/src/i18n/ru-RU/chat.json
  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/i18n/fa-IR/chat.json
  • src/renderer/src/i18n/ja-JP/chat.json
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/i18n/en-US/chat.json
  • src/renderer/src/i18n/fr-FR/chat.json
  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/i18n/zh-CN/chat.json
  • src/renderer/src/i18n/pt-BR/chat.json
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/i18n/da-DK/chat.json
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/i18n/ko-KR/chat.json
  • src/renderer/src/i18n/zh-HK/chat.json
  • src/renderer/src/stores/acpWorkspace.ts
  • src/renderer/src/i18n/zh-TW/chat.json
src/renderer/**

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

Use lowercase with dashes for directories (e.g., components/auth-wizard)

Files:

  • src/renderer/src/i18n/ru-RU/chat.json
  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/i18n/fa-IR/chat.json
  • src/renderer/src/i18n/ja-JP/chat.json
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/i18n/en-US/chat.json
  • src/renderer/src/i18n/fr-FR/chat.json
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/i18n/zh-CN/chat.json
  • src/renderer/src/i18n/pt-BR/chat.json
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/i18n/da-DK/chat.json
  • src/renderer/src/i18n/ko-KR/chat.json
  • src/renderer/src/i18n/zh-HK/chat.json
  • src/renderer/src/stores/acpWorkspace.ts
  • src/renderer/src/i18n/zh-TW/chat.json
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use English for logs and comments (Chinese text exists in legacy code, but new code should use English)

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.vue: Use Vue 3 Composition API for all components instead of Options API
Use Tailwind CSS with scoped styles for component styling

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
src/renderer/**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

src/renderer/**/*.vue: All user-facing strings must use i18n keys via vue-i18n for internationalization
Ensure proper error handling and loading states in all UI components
Implement responsive design using Tailwind CSS utilities for all UI components

src/renderer/**/*.vue: Use composition API and declarative programming patterns; avoid options API
Structure files: exported component, composables, helpers, static content, types
Use PascalCase for component names (e.g., AuthWizard.vue)
Use Vue 3 with TypeScript, leveraging defineComponent and PropType
Use template syntax for declarative rendering
Use Shadcn Vue, Radix Vue, and Tailwind for components and styling
Implement responsive design with Tailwind CSS; use a mobile-first approach
Use Suspense for asynchronous components
Use <script setup> syntax for concise component definitions
Prefer 'lucide:' icon family as the primary choice for Iconify icons
Import Icon component from '@iconify/vue' and use with lucide icons following pattern '{collection}:{icon-name}'

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
src/renderer/src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

src/renderer/src/**/*.{vue,ts,tsx}: All user-facing strings must use i18n keys with vue-i18n framework in the renderer
Import and use useI18n() composable with the t() function to access translations in Vue components and TypeScript files
Use the dynamic locale.value property to switch languages at runtime
Avoid hardcoding user-facing text and ensure all user-visible text uses the i18n translation system

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/**/*.{vue,js,ts}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Renderer process code should be placed in src/renderer (Vue 3 application)

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

src/renderer/src/**/*.{vue,ts,tsx,js,jsx}: Use the Composition API for better code organization and reusability in Vue.js applications
Implement proper state management with Pinia in Vue.js applications
Utilize Vue Router for navigation and route management in Vue.js applications
Leverage Vue's built-in reactivity system for efficient data handling

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/src/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

Use scoped styles to prevent CSS conflicts between Vue components

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
src/renderer/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

src/renderer/**/*.{ts,tsx,vue}: Write concise, technical TypeScript code with accurate examples
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid enums; use const objects instead
Use arrow functions for methods and computed properties
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

Vue 3 app code in src/renderer/src should be organized into components/, stores/, views/, i18n/, lib/ directories with shell UI in src/renderer/shell/

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/**/*.{ts,vue}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

src/renderer/**/*.{ts,vue}: Use useFetch and useAsyncData for data fetching
Leverage ref, reactive, and computed for reactive state management
Use provide/inject for dependency injection when appropriate
Use Iconify/Vue for icon implementation

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

src/renderer/src/**/*.{ts,tsx,vue}: Use TypeScript with Vue 3 Composition API for the renderer application
All user-facing strings must use vue-i18n keys in src/renderer/src/i18n

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/src/components/**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

src/renderer/src/components/**/*.vue: Use Tailwind for styles in Vue components
Vue component files must use PascalCase naming (e.g., ChatInput.vue)

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
src/**/*.{ts,tsx,vue,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier with single quotes, no semicolons, and 100 character width

Files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Enable and maintain strict TypeScript type checking for all files

**/*.{ts,tsx}: Always use try-catch to handle possible errors in TypeScript code
Provide meaningful error messages when catching errors
Log detailed error logs including error details, context, and stack traces
Distinguish and handle different error types (UserError, NetworkError, SystemError, BusinessError) with appropriate handlers in TypeScript
Use structured logging with logger.error(), logger.warn(), logger.info(), logger.debug() methods from logging utilities
Do not suppress errors (avoid empty catch blocks or silently ignoring errors)
Provide user-friendly error messages for user-facing errors in TypeScript components
Implement error retry mechanisms for transient failures in TypeScript
Avoid logging sensitive information (passwords, tokens, PII) in logs

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
src/main/presenter/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Organize core business logic into dedicated Presenter classes, with one presenter per functional domain

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
src/main/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Use EventBus from src/main/eventbus.ts for main-to-renderer communication, broadcasting events via mainWindow.webContents.send()

src/main/**/*.ts: Use EventBus pattern for inter-process communication within the main process to decouple modules
Use Electron's built-in APIs for file system and native dialogs instead of Node.js or custom implementations

src/main/**/*.ts: Electron main process code belongs in src/main/ with presenters in presenter/ (Window/Tab/Thread/Mcp/Config/LLMProvider) and eventbus.ts for app events
Use the Presenter pattern in the main process for UI coordination

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Do not include AI co-authoring information (e.g., 'Co-Authored-By: Claude') in git commits

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
**/*.{js,ts,jsx,tsx,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

Write logs and comments in English

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
{src/main/presenter/**/*.ts,src/renderer/**/*.ts}

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

Implement proper inter-process communication (IPC) patterns using Electron's ipcRenderer and ipcMain APIs

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/renderer/src/stores/acpWorkspace.ts
src/main/**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Main process code for Electron should be placed in src/main

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use OxLint for linting JavaScript and TypeScript files

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx}: Use camelCase for variable and function names in TypeScript files
Use PascalCase for type and class names in TypeScript
Use SCREAMING_SNAKE_CASE for constant names

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use EventBus for inter-process communication events

Files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/shared/types/presenters/acp-workspace.d.ts
  • src/renderer/src/stores/acpWorkspace.ts
src/shared/**/*.d.ts

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

Define type definitions in shared/*.d.ts files for objects exposed by the main process to the renderer process

Files:

  • src/shared/types/presenters/acp-workspace.d.ts
src/shared/**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Shared type definitions and utilities between main and renderer processes should be placed in src/shared

Files:

  • src/shared/types/presenters/acp-workspace.d.ts
src/shared/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Shared types and utilities should be placed in src/shared/

Files:

  • src/shared/types/presenters/acp-workspace.d.ts
src/renderer/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Use the usePresenter.ts composable for renderer-to-main IPC communication to call presenter methods directly

Files:

  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/pinia-best-practices.mdc)

src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx}: Use modules to organize related state and actions in Pinia stores
Implement proper state persistence for maintaining data across sessions in Pinia stores
Use getters for computed state properties in Pinia stores
Utilize actions for side effects and asynchronous operations in Pinia stores
Keep Pinia stores focused on global state, not component-specific data

Files:

  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

Use TypeScript for all code; prefer types over interfaces

Files:

  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/**/stores/*.ts

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

Use Pinia for state management

Files:

  • src/renderer/src/stores/acpWorkspace.ts
src/renderer/src/stores/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use Pinia for state management

Files:

  • src/renderer/src/stores/acpWorkspace.ts
🧠 Learnings (25)
📚 Learning: 2025-11-25T05:26:43.510Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-11-25T05:26:43.510Z
Learning: Applies to src/renderer/src/i18n/**/*.json : Maintain consistent key-value structure across all language translation files (zh-CN, en-US, ko-KR, ru-RU, zh-HK, fr-FR, fa-IR)

Applied to files:

  • src/renderer/src/i18n/ru-RU/chat.json
  • src/renderer/src/i18n/fa-IR/chat.json
  • src/renderer/src/i18n/ja-JP/chat.json
  • src/renderer/src/i18n/en-US/chat.json
  • src/renderer/src/i18n/zh-CN/chat.json
  • src/renderer/src/i18n/ko-KR/chat.json
  • src/renderer/src/i18n/zh-HK/chat.json
  • src/renderer/src/i18n/zh-TW/chat.json
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/*.vue : Structure files: exported component, composables, helpers, static content, types

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:27:45.545Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:27:45.545Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability in Vue.js applications

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:27:45.545Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:27:45.545Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Leverage Vue's built-in reactivity system for efficient data handling

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:26:43.510Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-11-25T05:26:43.510Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx} : Import and use useI18n() composable with the t() function to access translations in Vue components and TypeScript files

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:26:24.867Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:26:24.867Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs instead of Node.js or custom implementations

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue
  • src/main/presenter/acpWorkspacePresenter/index.ts
📚 Learning: 2025-11-25T05:26:43.510Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-11-25T05:26:43.510Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx} : Avoid hardcoding user-facing text and ensure all user-visible text uses the i18n translation system

Applied to files:

  • src/renderer/src/i18n/fr-FR/chat.json
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:26:24.867Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:26:24.867Z
Learning: Applies to {src/main/presenter/**/*.ts,src/renderer/**/*.ts} : Implement proper inter-process communication (IPC) patterns using Electron's ipcRenderer and ipcMain APIs

Applied to files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:28:20.513Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.513Z
Learning: Applies to src/main/**/*.ts : Electron main process code belongs in `src/main/` with presenters in `presenter/` (Window/Tab/Thread/Mcp/Config/LLMProvider) and `eventbus.ts` for app events

Applied to files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
📚 Learning: 2025-11-25T05:26:11.312Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:26:11.312Z
Learning: Applies to src/main/presenter/mcpPresenter/**/*.ts : Register new MCP tools in `mcpPresenter/index.ts` after implementing them in `inMemoryServers/`

Applied to files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
📚 Learning: 2025-11-25T05:28:20.513Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.513Z
Learning: Applies to src/main/**/*.ts : Use the Presenter pattern in the main process for UI coordination

Applied to files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
📚 Learning: 2025-11-25T05:26:11.312Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:26:11.312Z
Learning: Applies to src/renderer/**/*.ts : Use the `usePresenter.ts` composable for renderer-to-main IPC communication to call presenter methods directly

Applied to files:

  • src/main/presenter/acpWorkspacePresenter/index.ts
  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/*.{ts,vue} : Use Iconify/Vue for icon implementation

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/composables/*.ts : Use VueUse for common composables and utility functions

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/*.vue : Import Icon component from 'iconify/vue' and use with lucide icons following pattern '{collection}:{icon-name}'

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:28:20.513Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.513Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Use TypeScript with Vue 3 Composition API for the renderer application

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/*.vue : Use Vue 3 with TypeScript, leveraging defineComponent and PropType

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/*.vue : Use <script setup> syntax for concise component definitions

Applied to files:

  • src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue
  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:26:11.312Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:26:11.312Z
Learning: Applies to **/*.{ts,tsx,js,jsx,vue} : Use English for logs and comments (Chinese text exists in legacy code, but new code should use English)

Applied to files:

  • src/renderer/src/i18n/zh-CN/chat.json
📚 Learning: 2025-11-25T05:28:20.513Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.513Z
Learning: Applies to src/renderer/src/components/**/*.vue : Vue component files must use PascalCase naming (e.g., `ChatInput.vue`)

Applied to files:

  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/**/*.{ts,vue} : Leverage ref, reactive, and computed for reactive state management

Applied to files:

  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:28:04.454Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.454Z
Learning: Applies to src/renderer/(components|composables)/**/*.{ts,vue} : Utilize Nuxt's auto-imports feature for components and composables

Applied to files:

  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:27:45.545Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:27:45.545Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Utilize Vue Router for navigation and route management in Vue.js applications

Applied to files:

  • src/renderer/src/components/ChatView.vue
📚 Learning: 2025-11-25T05:27:20.067Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:27:20.067Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Implement proper state persistence for maintaining data across sessions in Pinia stores

Applied to files:

  • src/renderer/src/stores/acpWorkspace.ts
📚 Learning: 2025-11-25T05:27:20.067Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:27:20.067Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Keep Pinia stores focused on global state, not component-specific data

Applied to files:

  • src/renderer/src/stores/acpWorkspace.ts
🧬 Code graph analysis (1)
src/main/presenter/acpWorkspacePresenter/index.ts (1)
test/mocks/electron.ts (1)
  • shell (25-27)
⏰ 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). (1)
  • GitHub Check: build-check (x64)
🔇 Additional comments (23)
src/renderer/src/stores/acpWorkspace.ts (1)

22-22: lastSuccessfulWorkdir tracking/reset behavior looks consistent

Defining lastSuccessfulWorkdir in store state, clearing it in clearData, and resetting it whenever currentWorkdir actually changes gives you a clean, global (non–component-specific) indicator of the last good tree, which aligns well with how this Pinia store is used. No issues from a state‑management perspective.

Based on learnings, this keeps the store focused on global ACP workspace state rather than per‑component concerns.

Also applies to: 158-164, 219-222

src/renderer/src/i18n/ja-JP/chat.json (1)

110-115: Context menu entries are structurally consistent with other locales

The new acp.workspace.files.contextMenu keys (insertPath, openFile, revealInFolder) match the structure used in other locales, and JSON remains valid.

Based on learnings, this keeps the i18n key structure aligned across languages.

src/renderer/src/i18n/en-US/chat.json (1)

110-115: English labels for file context menu match intended actions

openFile, revealInFolder, and insertPath are added under acp.workspace.files.contextMenu with clear, concise English labels; structure matches other locales.

src/renderer/src/i18n/zh-HK/chat.json (1)

110-115: HK Chinese context menu keys align with global i18n structure

The added contextMenu block under acp.workspace.files uses the same keys as other locales and appropriate Traditional Chinese strings. JSON is well‑formed.

Based on learnings, this keeps the i18n structure consistent across locales.

src/renderer/src/i18n/zh-TW/chat.json (1)

110-115: TW Chinese file context menu translations look correct

The acp.workspace.files.contextMenu entries mirror other locales’ keys with suitable Traditional Chinese (TW) wording; structure is consistent.

src/renderer/src/i18n/zh-CN/chat.json (1)

110-115: Simplified Chinese context menu entries are consistent and clear

openFile, revealInFolder, and insertPath are added under acp.workspace.files.contextMenu with accurate Simplified Chinese labels; key structure matches other locales.

Based on learnings, this maintains consistent i18n key hierarchy.

src/renderer/src/i18n/fa-IR/chat.json (1)

110-115: fa-IR context menu entries correctly mirror new file actions

The new contextMenu under acp.workspace.files uses the same keys as other locales with appropriate Persian translations; JSON remains valid and consistent.

Based on learnings, this keeps the i18n structure aligned across locales.

src/renderer/src/i18n/ko-KR/chat.json (1)

110-115: LGTM! Translation structure is consistent.

The contextMenu additions follow the dot-separated hierarchical naming convention and maintain consistency across all language files as required by the coding guidelines.

src/renderer/src/i18n/ru-RU/chat.json (1)

110-115: LGTM! Translation structure is consistent.

The contextMenu additions follow the proper naming convention and maintain consistency with other locale files.

src/renderer/src/components/ChatView.vue (2)

15-19: LGTM! Event binding is properly wired.

The event handler correctly receives the file path from AcpWorkspaceView and processes it through the new handleAppendFilePath method.


113-129: LGTM! Path handling logic is sound.

The implementation correctly:

  • Computes relative paths from the current workdir
  • Falls back to absolute paths when relative path would go outside workdir (starts with ..)
  • Properly formats and inserts the path into the chat input
  • Restores focus after insertion
src/renderer/src/i18n/pt-BR/chat.json (1)

110-115: LGTM! Translation structure is consistent.

The contextMenu additions maintain the required key-value structure across all language files.

src/shared/types/presenters/acp-workspace.d.ts (1)

103-113: LGTM! Well-documented API additions.

The new methods are properly documented and extend the presenter interface consistently. The names clearly convey their purpose and align with the file context menu actions added in the UI.

src/renderer/src/i18n/fr-FR/chat.json (1)

110-115: LGTM! Translation structure is consistent.

The French translations follow the proper hierarchical structure and maintain consistency with other locale files.

src/renderer/src/components/acp-workspace/AcpWorkspaceFiles.vue (3)

35-35: LGTM! Event binding is properly wired.

The append-path event from AcpWorkspaceFileNode is correctly bound to the handleAppendPath handler.


57-59: LGTM! Event emission is properly typed.

The defineEmits declaration correctly types the append-path event with a string payload, following Vue 3 Composition API best practices.


78-80: LGTM! Event forwarding is clean.

The handleAppendPath method correctly forwards the file path from child to parent components without unnecessary transformation.

src/renderer/src/components/acp-workspace/AcpWorkspaceView.vue (2)

26-26: LGTM! Event transformation is properly implemented.

The inline emit correctly transforms the internal append-path event to the public append-file-path event, establishing a clear API boundary for external consumers like ChatView.vue.


47-49: LGTM! Public event API is well-defined.

The append-file-path event is properly typed and establishes a clear public API for this component, which is consumed by ChatView.vue to insert file paths into the chat input.

src/main/presenter/acpWorkspacePresenter/index.ts (1)

2-2: LGTM! Correct use of Electron's built-in shell API.

The import follows the coding guideline to use Electron's built-in APIs for file system operations.

src/renderer/src/components/acp-workspace/AcpWorkspaceFileNode.vue (3)

68-90: LGTM! Proper use of composables and i18n.

The imports and composable usage follow project patterns:

  • useI18n() for internationalization (as per learnings)
  • usePresenter() for renderer-to-main IPC communication (as per learnings)
  • Proper shadcn component imports

59-59: LGTM! Correct event propagation pattern.

The event bubbling correctly propagates the append-path event from child nodes through the recursive component tree.


35-47: All three i18n translation keys are properly defined across all supported languages.

Verification confirms the context menu items use correctly defined i18n keys that exist in all 11 language files (da-DK, en-US, fa-IR, fr-FR, ja-JP, ko-KR, pt-BR, ru-RU, zh-CN, zh-HK, zh-TW):

  • chat.acp.workspace.files.contextMenu.openFile
  • chat.acp.workspace.files.contextMenu.revealInFolder
  • chat.acp.workspace.files.contextMenu.insertPath

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df9e5d7 and 7b1580c.

📒 Files selected for processing (3)
  • src/preload/index.d.ts (1 hunks)
  • src/preload/index.ts (2 hunks)
  • src/renderer/src/components/ChatView.vue (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/ChatView.vue
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use English for logs and comments (Chinese text exists in legacy code, but new code should use English)

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Enable and maintain strict TypeScript type checking for all files

**/*.{ts,tsx}: Always use try-catch to handle possible errors in TypeScript code
Provide meaningful error messages when catching errors
Log detailed error logs including error details, context, and stack traces
Distinguish and handle different error types (UserError, NetworkError, SystemError, BusinessError) with appropriate handlers in TypeScript
Use structured logging with logger.error(), logger.warn(), logger.info(), logger.debug() methods from logging utilities
Do not suppress errors (avoid empty catch blocks or silently ignoring errors)
Provide user-friendly error messages for user-facing errors in TypeScript components
Implement error retry mechanisms for transient failures in TypeScript
Avoid logging sensitive information (passwords, tokens, PII) in logs

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Do not include AI co-authoring information (e.g., 'Co-Authored-By: Claude') in git commits

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
**/*.{js,ts,jsx,tsx,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

Write logs and comments in English

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
src/**/*

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

New features should be developed in the src directory

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
src/preload/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Secure IPC bridge should be implemented in src/preload/ with contextIsolation enabled

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
src/**/*.{ts,tsx,vue,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier with single quotes, no semicolons, and 100 character width

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use OxLint for linting JavaScript and TypeScript files

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx}: Use camelCase for variable and function names in TypeScript files
Use PascalCase for type and class names in TypeScript
Use SCREAMING_SNAKE_CASE for constant names

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use EventBus for inter-process communication events

Files:

  • src/preload/index.ts
  • src/preload/index.d.ts
🧠 Learnings (2)
📚 Learning: 2025-11-25T05:28:20.513Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.513Z
Learning: Applies to src/preload/**/*.ts : Secure IPC bridge should be implemented in `src/preload/` with contextIsolation enabled

Applied to files:

  • src/preload/index.ts
  • src/preload/index.d.ts
📚 Learning: 2025-11-25T05:26:24.867Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/electron-best-practices.mdc:0-0
Timestamp: 2025-11-25T05:26:24.867Z
Learning: Applies to src/main/**/*.ts : Use Electron's built-in APIs for file system and native dialogs instead of Node.js or custom implementations

Applied to files:

  • src/preload/index.ts
🧬 Code graph analysis (1)
src/preload/index.ts (1)
scripts/rebrand.js (1)
  • filePath (325-325)
⏰ 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). (1)
  • GitHub Check: build-check (x64)
🔇 Additional comments (2)
src/preload/index.d.ts (1)

14-15: LGTM! Type declarations are correct.

The type signatures for the new preload API methods are properly defined and consistent with the implementation. The optional marking (?) follows the established pattern for other methods like openExternal.

src/preload/index.ts (1)

1-1: LGTM! Path import is appropriate.

The path module import is necessary for the new path manipulation utilities and is properly available in the preload context.

@zerob13 zerob13 merged commit a6c4494 into dev Dec 5, 2025
2 of 3 checks passed
zerob13 added a commit that referenced this pull request Dec 8, 2025
* fix: keep last file list

* feat(acp-workspace): add file context actions

* fix(acp-workspace): move path helpers to preload

* fix(preload): allow empty relative path

* fix(preload): escape quotes when formatting paths
zerob13 added a commit that referenced this pull request Dec 8, 2025
* feat: Hebrew (he-IL) Translation

* feat: add workspace view to acp agents (#1158)

* feat: add workspaceview for acp agent

* feat: support workspace dirs

* fix: workspace file refresh

* fix: tool call status

* fix: review refactor

* chore: update readme

* fix: add file context actions (#1160)

* fix: keep last file list

* feat(acp-workspace): add file context actions

* fix(acp-workspace): move path helpers to preload

* fix(preload): allow empty relative path

* fix(preload): escape quotes when formatting paths

* chore: update docs

* fix: Multiple Issues Affecting Conversation Flow and Model Settings (#1166)

* fix: #1164 support maxtoken 2

* fix: mcp tool panel close btn #1163

* fix: #1162 file content in converation

* fix(search-assistant): exclude acp models

* fix: #1072 thinkcontent respects the global font size set

* feat: add new i18n translation
zerob13 added a commit that referenced this pull request Dec 12, 2025
* fix: Multiple Issues Affecting Conversation Flow and Model Settings (#1166)

* fix: #1164 support maxtoken 2

* fix: mcp tool panel close btn #1163

* fix: #1162 file content in converation

* fix(search-assistant): exclude acp models

* fix: #1072 thinkcontent respects the global font size set

* feat: Hebrew (he-IL) Translation (#1157)

* feat: Hebrew (he-IL) Translation

* feat: add workspace view to acp agents (#1158)

* feat: add workspaceview for acp agent

* feat: support workspace dirs

* fix: workspace file refresh

* fix: tool call status

* fix: review refactor

* chore: update readme

* fix: add file context actions (#1160)

* fix: keep last file list

* feat(acp-workspace): add file context actions

* fix(acp-workspace): move path helpers to preload

* fix(preload): allow empty relative path

* fix(preload): escape quotes when formatting paths

* chore: update docs

* fix: Multiple Issues Affecting Conversation Flow and Model Settings (#1166)

* fix: #1164 support maxtoken 2

* fix: mcp tool panel close btn #1163

* fix: #1162 file content in converation

* fix(search-assistant): exclude acp models

* fix: #1072 thinkcontent respects the global font size set

* feat: add new i18n translation

* feat: add custom font setting (#1167)

* feat(settings): add font customization controls

* feat: change font with monaco

* chore: remove log and remove unuse key

* fix: linux font parse

* feat: use font-list to get font

* fix: font setting not work on settings page (#1169)

* style: unify scroll bar style (#1173)

* feat: acp init and process manage (#1171)

* feat: init acp process on select

* feat: warm up acp process on new thread

* fix: reuse warmup process

* fix: vue warning

* chore: add plan for acp debug panel

* feat: add debugview for acp

* feat: add i18n for debug

* fix: code review

* fix: ai review

* fix: Shutdown may skip releasing warmup‑only processes due to using warmupKey instead of agentId.

* chore: update markdown renderer

* chore: update mermaid node

* Merge commit from fork

* chore: update markstream-vue to version 0.0.3-beta.3
fix link renderer
feat html_inline render

* fix: increase button size for web content limit adjustment

* fix: close app kill all acp processes (#1175)

* fix: close app kill all acp processes

* fix: disable tool call merge

* fix: handle uncatch error

* fix: remove redundant type

* feat: add  shell to powerpack (#1178)

* chore(powerpack): randomize shell workdir

* feat: exclusive inmem server in terminal display

* fix: add sandbox in shell script

---------

Co-authored-by: xiaomo <wegi866@gmail.com>
Co-authored-by: Simon He <674949287@qq.com>
Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com>
@zerob13 zerob13 deleted the bugfix/0.5.2 branch December 13, 2025 06:59
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