Skip to content

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

Merged
merged 5 commits into from
Jun 27, 2025

Conversation

Simon-He95
Copy link
Contributor

@Simon-He95 Simon-He95 commented Jun 26, 2025

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.

  • Include screenshots or GIFs if applicable to visually demonstrate the changes.
  • Explain the reasoning behind the UI/UX decisions and how they improve the user experience of the desktop application.

Platform Compatibility Notes
If this PR has specific platform compatibility considerations (Windows, macOS, Linux), please describe them here.

  • Are there any platform-specific behaviors or code adjustments?
  • Have you tested on all relevant platforms?

Additional context
Add any other context about the pull request here.


Pull Request Description (中文)

你的功能请求是否与某个问题有关?请描述一下。
请对问题进行清晰扼要的描述。
*例如:我增加了 [...] 的功能 *

请描述你希望的解决方案
请对你希望实现的效果进行清晰扼要的描述。

桌面应用程序的 UI/UX 更改
如果此 PR 引入了 UI/UX 更改,请详细描述它们。

  • 如果适用,请包含屏幕截图或 GIF 以直观地演示更改。
  • 解释 UI/UX 决策背后的原因,以及它们如何改善桌面应用程序的用户体验。

平台兼容性注意事项
如果此 PR 具有特定的平台兼容性考虑因素(Windows、macOS、Linux),请在此处描述。

  • 是否有任何平台特定的行为或代码调整?
  • 你是否已在所有相关平台上进行过测试?

附加背景
在此处添加关于此 Pull Request 的任何其他背景信息。

Summary by CodeRabbit

  • New Features

    • Added dynamic search history placeholders in the chat input with keyboard navigation and tab completion.
    • Introduced localized hints for the history placeholder across multiple languages.
  • Chores

    • Removed debug logs and cleaned up comments in search history management.
  • Refactor

    • Simplified error handling in floating button event processing without changing user experience.

Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

The 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

File(s) Change Summary
src/renderer/src/components/ChatInput.vue Added dynamic search history placeholder with navigation and insertion support; refactored keydown and update logic; added Vue nextTick import.
src/renderer/src/i18n/*/chat.json (all listed locales) Added new localization key "historyPlaceholder" with appropriate translated values; fixed JSON syntax commas.
src/main/presenter/floatingButtonPresenter/index.ts Simplified error handling by removing unused error parameter in catch block for floating button click event.
src/renderer/src/lib/searchHistory.ts Removed a comment and debug log statement; no functional changes to search history logic.

Possibly related PRs

Poem

🐇 A hop, a skip through history’s past,
Arrows guide me, placeholders cast,
Tab to fill, Escape to flee,
Chat input dances dynamically!
Floating buttons catch no error’s call,
Clean code bounces, standing tall! 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3eada3 and 20b961d.

📒 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 20b961d and 3c17ab8.

📒 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.

@zerob13 zerob13 merged commit e62e298 into ThinkInAIXYZ:dev Jun 27, 2025
2 checks passed
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