-
Notifications
You must be signed in to change notification settings - Fork 614
fix: implement separate drag zones for enabled/disabled providers #671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: implement separate drag zones for enabled/disabled providers #671
Conversation
WalkthroughThe provider settings UI was refactored to display enabled and disabled providers as two separate draggable lists, each with its own drag-and-drop constraints. Supporting localization strings for "enabled" and "disabled" were added across multiple languages. Provider order logic was updated to respect user drag-and-drop preferences and persist ordering after enable/disable actions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ModelProviderSettings.vue
participant settingsStore
User->>ModelProviderSettings.vue: Drag provider within enabled/disabled list
ModelProviderSettings.vue->>settingsStore: updateProvidersOrder(newOrder)
settingsStore->>settingsStore: Update providerOrder, persist changes
User->>ModelProviderSettings.vue: Toggle provider enabled/disabled
ModelProviderSettings.vue->>settingsStore: updateProviderStatus(providerId, enable)
settingsStore->>settingsStore: optimizeProviderOrder(providerId, enable)
settingsStore->>settingsStore: Update providerOrder, persist changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
♻️ Duplicate comments (3)
src/renderer/src/i18n/ru-RU/settings.json (1)
206-208: Duplicate of the remark made for the French file – consider centralising the genericenabled/disabledstrings incommon.json.src/renderer/src/i18n/ja-JP/settings.json (1)
206-208: Same observation as in the French file: move the generic status labels to a sharedcommon.status.*entry to avoid repetition.src/renderer/src/i18n/en-US/settings.json (1)
206-208: As noted earlier, centraliseenabled/disabledincommon.jsonso they can be reused globally and maintained in one place.
🧹 Nitpick comments (3)
src/renderer/src/i18n/fr-FR/settings.json (1)
206-208: Extract generic status labels into sharedcommonnamespace
enabled/disabledare generic status words that are likely to be reused outside the provider context.
Putting them undercommon.status.enabled/common.status.disabledincommon.jsonavoids copy-pasting the same keys into every module and keeps translations DRY across the whole UI.If you agree, migrate the keys to
common.json(all locales) and update the component code to referencet('common.status.enabled')/t('common.status.disabled').src/renderer/src/stores/settings.ts (1)
268-286: Consider caching providerOrder indices for performanceThe sorting function looks up indices in
providerOrdermultiple times. For better performance with large provider lists, consider pre-computing these indices.- const sortProviders = (providerList: LLM_PROVIDER[], useAscendingTime: boolean) => { + const sortProviders = (providerList: LLM_PROVIDER[], useAscendingTime: boolean) => { + // Pre-compute order indices for O(1) lookup + const orderIndexMap = new Map<string, number>(); + providerOrder.value.forEach((id, index) => orderIndexMap.set(id, index)); + return providerList.sort((a, b) => { - const aOrderIndex = providerOrder.value.indexOf(a.id) - const bOrderIndex = providerOrder.value.indexOf(b.id) + const aOrderIndex = orderIndexMap.get(a.id) ?? -1 + const bOrderIndex = orderIndexMap.get(b.id) ?? -1 if (aOrderIndex !== -1 && bOrderIndex !== -1) { return aOrderIndex - bOrderIndex }src/renderer/src/components/settings/ModelProviderSettings.vue (1)
215-239: Move handlers correctly implement drag restrictions.The logic effectively prevents cross-zone dragging. Consider that the check for
draggedProvider.enablestatus might be redundant since enabled/disabled providers are already filtered into their respective lists, but the defensive approach ensures robustness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
src/renderer/src/components/settings/ModelProviderSettings.vue(3 hunks)src/renderer/src/i18n/en-US/settings.json(1 hunks)src/renderer/src/i18n/fa-IR/settings.json(1 hunks)src/renderer/src/i18n/fr-FR/settings.json(1 hunks)src/renderer/src/i18n/ja-JP/settings.json(1 hunks)src/renderer/src/i18n/ko-KR/settings.json(1 hunks)src/renderer/src/i18n/ru-RU/settings.json(1 hunks)src/renderer/src/i18n/zh-CN/settings.json(1 hunks)src/renderer/src/i18n/zh-HK/settings.json(1 hunks)src/renderer/src/i18n/zh-TW/settings.json(1 hunks)src/renderer/src/stores/settings.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
src/renderer/src/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/i18n.mdc)
src/renderer/src/**/*: All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Use the 'vue-i18n' framework for all internationalization in the renderer
Ensure all user-visible text in the renderer uses the translation system
Files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/i18n/ko-KR/settings.jsonsrc/renderer/src/stores/settings.ts
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Use English for logs and comments
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
src/renderer/src/**/*.vue
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/renderer/src/**/*.vue: Use Composition API for all Vue 3 components
Use Tailwind CSS with scoped styles for styling
Organize components by feature in src/renderer/src/
Follow existing component patterns in src/renderer/src/ when creating new UI components
Use Composition API with proper TypeScript typing for new UI components
Implement responsive design with Tailwind CSS for new UI components
Add proper error handling and loading states for new UI componentsUse scoped styles to prevent CSS conflicts between components
Files:
src/renderer/src/components/settings/ModelProviderSettings.vue
src/renderer/src/**/*.{ts,tsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/renderer/src/**/*.{ts,tsx,vue}: Use Pinia for frontend state management
Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
src/renderer/**/*.{vue,ts,js,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
渲染进程代码放在
src/renderer
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.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
Implement proper state management with Pinia
Utilize Vue Router for navigation and route management
Leverage Vue's built-in reactivity system for efficient data handling
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
src/renderer/**/*.{ts,tsx,vue}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
src/renderer/**/*.{ts,tsx,vue}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use TypeScript for all code; prefer types over interfaces.
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.
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
src/renderer/**/*.{vue,ts}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
Implement lazy loading for routes and components.
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
src/renderer/**/*.{ts,vue}
📄 CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
src/renderer/**/*.{ts,vue}: Use useFetch and useAsyncData for data fetching.
Implement SEO best practices using Nuxt's useHead and useSeoMeta.
Files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Strict type checking enabled for TypeScript
**/*.{ts,tsx}: 始终使用 try-catch 处理可能的错误
提供有意义的错误信息
记录详细的错误日志
优雅降级处理
日志应包含时间戳、日志级别、错误代码、错误描述、堆栈跟踪(如适用)、相关上下文信息
日志级别应包括 ERROR、WARN、INFO、DEBUG
不要吞掉错误
提供用户友好的错误信息
实现错误重试机制
避免记录敏感信息
使用结构化日志
设置适当的日志级别
Files:
src/renderer/src/stores/settings.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/development-setup.mdc)
**/*.{js,jsx,ts,tsx}: 使用 OxLint 进行代码检查
Log和注释使用英文书写
Files:
src/renderer/src/stores/settings.ts
src/{main,renderer}/**/*.ts
📄 CodeRabbit Inference Engine (.cursor/rules/electron-best-practices.mdc)
src/{main,renderer}/**/*.ts: Use context isolation for improved security
Implement proper inter-process communication (IPC) patterns
Optimize application startup time with lazy loading
Implement proper error handling and logging for debugging
Files:
src/renderer/src/stores/settings.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
Implement proper state persistence for maintaining data across sessions
Use getters for computed state properties
Utilize actions for side effects and asynchronous operations
Keep the store focused on global state, not component-specific data
Files:
src/renderer/src/stores/settings.ts
🧠 Learnings (33)
📚 Learning: applies to src/renderer/src/i18n/common.json : shared translation keys must be placed in 'src/render...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/i18n/*.json : maintain consistent structure across all translation files...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/i18n/*.json : when adding new translations, add shared keys to 'common.j...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/**/* : all user-facing strings must use i18n keys (avoid hardcoded user-...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/**/* : All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/i18n/*.json : regularly check for unused translation keys in i18n files...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/**/* : ensure all user-visible text in the renderer uses the translation...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/**/* : Ensure all user-visible text in the renderer uses the translation system
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/i18n/*.json : each language must have a separate json file in 'src/rende...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Each language must have a separate JSON file in 'src/renderer/src/i18n/'
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/i18n/*.json : translation key naming must use dot-separated hierarchy, l...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/i18n/*.json : language files must be located in 'src/renderer/src/i18n/'...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Language files must be located in 'src/renderer/src/i18n/' directory
Applied to files:
src/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.json
📚 Learning: applies to src/renderer/src/**/* : use the 'vue-i18n' framework for all internationalization in the ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
Applied to files:
src/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.json
📚 Learning: applies to src/renderer/**/*.{vue} : use provide/inject for dependency injection when appropriate....
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use provide/inject for dependency injection when appropriate.
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : use the composition api for better code organ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.817Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/**/*.{vue} : leverage ref, reactive, and computed for reactive state managem...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/**/*.{vue} : use composition api and declarative programming patterns; avoid...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/src/**/*.vue : organize components by feature in src/renderer/src/...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.790Z
Learning: Applies to src/renderer/src/**/*.vue : Organize components by feature in src/renderer/src/
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/src/**/*.vue : use composition api with proper typescript typing for new ui ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.790Z
Learning: Applies to src/renderer/src/**/*.vue : Use Composition API with proper TypeScript typing for new UI components
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : implement proper state persistence for...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Implement proper state persistence for maintaining data across sessions
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vuesrc/renderer/src/stores/settings.ts
📚 Learning: applies to src/renderer/**/*.{vue} : use shadcn vue, radix vue, and tailwind for components and styl...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use Shadcn Vue, Radix Vue, and Tailwind for components and styling.
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : leverage vue's built-in reactivity system for...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.817Z
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/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/**/*.{vue} : use <script setup> syntax for concise component definitions....
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : use getters for computed state propert...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use getters for computed state properties
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to **/*.tsx : 使用错误边界捕获渲染错误...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.702Z
Learning: Applies to **/*.tsx : 使用错误边界捕获渲染错误
Applied to files:
src/renderer/src/components/settings/ModelProviderSettings.vue
📚 Learning: applies to src/main/presenter/configpresenter/providers.ts : add provider configuration in configpre...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.790Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration in configPresenter/providers.ts when adding a new LLM provider
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : implement corestream method foll...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.790Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Implement coreStream method following standardized event interface in LLM provider files
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : provider implementations should ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield events asynchronously using the async generator pattern.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : provider implementations must us...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations must use a `coreStream` method that yields standardized stream events to decouple the main loop from provider-specific details.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : provider files should implement ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider files should implement helper methods such as `formatMessages`, `convertToProviderTools`, `parseFunctionCalls`, and `prepareFunctionCallPrompt` as needed for provider-specific logic.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : provider implementations should ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should aggregate and yield usage events as part of the standardized stream.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : utilize actions for side effects and a...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Utilize actions for side effects and asynchronous operations
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : each file in `src/main/presenter...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Each file in `src/main/presenter/llmProviderPresenter/providers/*.ts` should handle interaction with a specific LLM API, including request/response formatting, tool definition conversion, native/non-native tool call management, and standardizing output streams to a common event format.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : provider implementations should ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Provider implementations should yield text events in the standardized format.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : when a provider supports native ...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider supports native function calling, MCP tools must be converted to the provider's format (e.g., using `convertToProviderTools`) and included in the API request.
Applied to files:
src/renderer/src/stores/settings.ts
📚 Learning: applies to src/main/presenter/llmproviderpresenter/providers/*.ts : create provider file in src/main...
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.790Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Create provider file in src/main/presenter/llmProviderPresenter/providers/ when adding a new LLM provider
Applied to files:
src/renderer/src/stores/settings.ts
🧬 Code Graph Analysis (1)
src/renderer/src/stores/settings.ts (1)
src/shared/presenter.d.ts (1)
LLM_PROVIDER(471-485)
🔇 Additional comments (8)
src/renderer/src/stores/settings.ts (1)
1429-1458: LGTM! Proper separation of drag zones implementedThe updated logic correctly handles drag-and-drop within separate enabled/disabled zones while maintaining the constraint that enabled providers appear before disabled ones.
src/renderer/src/i18n/zh-CN/settings.json (1)
206-207: LGTM! Correct Chinese translations addedThe translations "已启用" (enabled) and "已禁用" (disabled) are accurate and properly placed within the provider section.
src/renderer/src/i18n/zh-TW/settings.json (1)
206-207: LGTM! Correct Traditional Chinese translations addedThe translations "已啟用" (enabled) and "已停用" (disabled) are accurate Traditional Chinese translations and properly placed within the provider section.
src/renderer/src/i18n/ko-KR/settings.json (1)
206-207: LGTM! Correct Korean translations addedThe translations "활성화됨" (enabled) and "비활성화됨" (disabled) are accurate Korean translations and properly placed within the provider section.
src/renderer/src/i18n/zh-HK/settings.json (1)
206-207: LGTM! Translation keys follow the established pattern.The new localization entries correctly provide Traditional Chinese translations for the enabled/disabled provider states, maintaining consistency with the existing structure.
src/renderer/src/i18n/fa-IR/settings.json (1)
206-207: LGTM! Persian translations are accurate.The new localization entries correctly provide Persian translations for the enabled/disabled provider states, maintaining consistency across all language files.
src/renderer/src/components/settings/ModelProviderSettings.vue (2)
4-89: Well-structured template implementation.The separation into enabled/disabled draggable zones is cleanly implemented with appropriate visual distinctions and i18n support. The combination of
group="providers"with move handlers effectively restricts cross-zone dragging.
147-162: Computed properties correctly maintain provider order.The getter/setter pattern properly filters providers by status while preserving the complete order when updating. The merge logic ensures drag operations in one zone don't affect the order in the other zone.
The provider drag-and-drop functionality was broken due to conflicts between drag ordering and timestamp-based sorting. When users dragged providers between enabled/disabled regions, they would immediately jump back to their original positions.
The current logic is as follows:
Summary by CodeRabbit
New Features
Improvements