-
Notifications
You must be signed in to change notification settings - Fork 447
fix(ChatInput): when hasMentionSuggestion select not use searchHistory #560
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
Conversation
WalkthroughThe changes add a dynamic search history placeholder feature to the chat input component, enabling navigation through past queries with arrow keys and insertion via Tab. Localization files are updated with a new placeholder string. The floating button presenter's error handling is simplified by removing the unused error parameter. Minor cleanup occurs in the search history utility. Changes
Possibly related PRs
Poem
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/presenter/floatingButtonPresenter/index.ts
(1 hunks)src/renderer/src/components/ChatInput.vue
(1 hunks)src/renderer/src/lib/searchHistory.ts
(0 hunks)
💤 Files with no reviewable changes (1)
- src/renderer/src/lib/searchHistory.ts
🧰 Additional context used
📓 Path-based instructions (6)
`src/**/*`: 所有新功能应该在 src 目录下开发
src/**/*
: 所有新功能应该在 src 目录下开发
📄 Source: CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
List of files the instruction was applied to:
src/main/presenter/floatingButtonPresenter/index.ts
src/renderer/src/components/ChatInput.vue
`src/main/**/*`: 主进程代码放在 src/main
src/main/**/*
: 主进程代码放在 src/main
📄 Source: CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
List of files the instruction was applied to:
src/main/presenter/floatingButtonPresenter/index.ts
`src/renderer/src/**/*.{js,ts,vue}`: All user-facing strings must use i18n keys; avoid hardcoded user-visible text.
src/renderer/src/**/*.{js,ts,vue}
: All user-facing strings must use i18n keys; avoid hardcoded user-visible text.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/i18n.mdc)
List of files the instruction was applied to:
src/renderer/src/components/ChatInput.vue
`src/renderer/**/*`: 渲染进程代码放在 src/renderer
src/renderer/**/*
: 渲染进程代码放在 src/renderer
📄 Source: CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
List of files the instruction was applied to:
src/renderer/src/components/ChatInput.vue
`src/renderer/src/**/*.{vue,ts,tsx,js,jsx}`: Use scoped styles to prevent CSS conflicts between components
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}
: Use scoped styles to prevent CSS conflicts between components
📄 Source: CodeRabbit Inference Engine (.cursor/rules/vue-best-practices.mdc)
List of files the instruction was applied to:
src/renderer/src/components/ChatInput.vue
`src/renderer/**/*`: Apply all code style, structure, naming, TypeScript, syntax, UI, performance, and Nuxt-specific guidelines to all files recursively under src/renderer.
src/renderer/**/*
: Apply all code style, structure, naming, TypeScript, syntax, UI, performance, and Nuxt-specific guidelines to all files recursively under src/renderer.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
List of files the instruction was applied to:
src/renderer/src/components/ChatInput.vue
🧠 Learnings (3)
📓 Common learnings
Learnt from: neoragex2002
PR: ThinkInAIXYZ/deepchat#550
File: src/renderer/src/stores/chat.ts:1011-1035
Timestamp: 2025-06-21T15:49:17.044Z
Learning: In src/renderer/src/stores/chat.ts, the user prefers to keep both `text` and `content` properties in the `handleMeetingInstruction` function's `sendMessage` call, even though they are redundant, rather than removing the `content` property.
src/main/presenter/floatingButtonPresenter/index.ts (2)
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-06-23T13:05:24.495Z
Learning: Always use try-catch blocks to handle potentially failing operations in TypeScript or JavaScript code, and provide meaningful error messages.
Learnt from: neoragex2002
PR: ThinkInAIXYZ/deepchat#550
File: src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts:250-252
Timestamp: 2025-06-21T15:48:29.950Z
Learning: In the meeting server implementation (src/main/presenter/mcpPresenter/inMemoryServers/meetingServer.ts), when multiple tabs have the same title, the user prefers to let the code silently select the first match without adding warnings or additional ambiguity handling.
src/renderer/src/components/ChatInput.vue (1)
Learnt from: neoragex2002
PR: ThinkInAIXYZ/deepchat#550
File: src/renderer/src/stores/chat.ts:1011-1035
Timestamp: 2025-06-21T15:49:17.044Z
Learning: In src/renderer/src/stores/chat.ts, the user prefers to keep both `text` and `content` properties in the `handleMeetingInstruction` function's `sendMessage` call, even though they are redundant, rather than removing the `content` property.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-check (x64)
🔇 Additional comments (1)
src/renderer/src/components/ChatInput.vue (1)
690-691
: LGTM! Excellent refactoring for readability.The extraction of the conditional logic into the
hasMentionSuggestion
constant significantly improves code readability and makes the intent clearer. This aligns perfectly with the PR objective of properly handling mention suggestion behavior.
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: 0
🧹 Nitpick comments (1)
src/renderer/src/i18n/fr-FR/chat.json (1)
14-14
: Translation wording may mislead users about the “Tab” key.
"(Appuyez sur l'onglet pour remplir)"
literally refers to “the tab (of a browser window)”.
For keyboard hints, French UI strings generally use “Tab” or “touche Tabulation” (e.g. “Appuyez sur Tab”). Consider updating to avoid confusion:-"historyPlaceholder": "(Appuyez sur l'onglet pour remplir)" +"historyPlaceholder": "(Appuyez sur Tab pour remplir)"If consistency with other locales is required, check the equivalent English/Chinese strings and align wording.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
src/renderer/src/components/ChatInput.vue
(7 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/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)
✅ Files skipped from review due to trivial changes (8)
- src/renderer/src/i18n/ko-KR/chat.json
- src/renderer/src/i18n/ja-JP/chat.json
- src/renderer/src/i18n/zh-CN/chat.json
- src/renderer/src/i18n/zh-HK/chat.json
- src/renderer/src/i18n/zh-TW/chat.json
- src/renderer/src/i18n/en-US/chat.json
- src/renderer/src/i18n/fa-IR/chat.json
- src/renderer/src/i18n/ru-RU/chat.json
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/ChatInput.vue
🧰 Additional context used
📓 Path-based instructions (3)
`src/**/*`: 所有新功能应该在 src 目录下开发
src/**/*
: 所有新功能应该在 src 目录下开发
📄 Source: CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
List of files the instruction was applied to:
src/renderer/src/i18n/fr-FR/chat.json
`src/renderer/**/*`: 渲染进程代码放在 src/renderer
src/renderer/**/*
: 渲染进程代码放在 src/renderer
📄 Source: CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
List of files the instruction was applied to:
src/renderer/src/i18n/fr-FR/chat.json
`src/renderer/**/*`: Apply all code style, structure, naming, TypeScript, syntax, UI, performance, and Nuxt-specific guidelines to all files recursively under src/renderer.
src/renderer/**/*
: Apply all code style, structure, naming, TypeScript, syntax, UI, performance, and Nuxt-specific guidelines to all files recursively under src/renderer.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/vue-shadcn.mdc)
List of files the instruction was applied to:
src/renderer/src/i18n/fr-FR/chat.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-check (x64)
🔇 Additional comments (1)
src/renderer/src/i18n/fr-FR/chat.json (1)
13-13
: Trailing comma restores valid JSON – good catch.Adding the comma after
promptFilesErrorDesc
fixes the invalid JSON that would break runtime loading of the locale file.
Pull Request Description
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
*For example: I'm always frustrated when [...] *
Describe the solution you'd like
A clear and concise description of what you want to happen.
UI/UX changes for Desktop Application
If this PR introduces UI/UX changes, please describe them in detail.
Platform Compatibility Notes
If this PR has specific platform compatibility considerations (Windows, macOS, Linux), please describe them here.
Additional context
Add any other context about the pull request here.
Pull Request Description (中文)
你的功能请求是否与某个问题有关?请描述一下。
请对问题进行清晰扼要的描述。
*例如:我增加了 [...] 的功能 *
请描述你希望的解决方案
请对你希望实现的效果进行清晰扼要的描述。
桌面应用程序的 UI/UX 更改
如果此 PR 引入了 UI/UX 更改,请详细描述它们。
平台兼容性注意事项
如果此 PR 具有特定的平台兼容性考虑因素(Windows、macOS、Linux),请在此处描述。
附加背景
在此处添加关于此 Pull Request 的任何其他背景信息。
Summary by CodeRabbit
New Features
Chores
Refactor