Skip to content

🐛 修复提及菜单中回车意外发送消息的问题#233

Merged
A-kirami merged 4 commits into
A-kirami:mainfrom
KomoriDev:fix/mention
Apr 19, 2025
Merged

🐛 修复提及菜单中回车意外发送消息的问题#233
A-kirami merged 4 commits into
A-kirami:mainfrom
KomoriDev:fix/mention

Conversation

@KomoriDev

Copy link
Copy Markdown
Contributor

这个 PR 带来了什么样的更改?

  • 错误修复
  • 新功能
  • 文档/注释
  • 代码格式
  • 代码重构
  • 测试用例
  • 性能优化
  • 外观样式
  • 项目构建
  • 依赖环境
  • 持续集成/部署
  • 其他,请描述:

这个 PR 是否存在破坏性变更?

  • 是的,并已在 issue #___ 号中获得批准
  • 没有

描述

动机和背景

resolve #232

其他信息

检查工作

  • 我对我的代码进行了注释,特别是在难以理解的部分
  • 我的更改需要更新文档,并且已对文档进行了相应的更改
  • 我添加了测试并且已经在本地通过,以证明我的修复补丁或新功能有效
  • 我已检查并确保更改没有与其他打开的 Pull Requests 重复

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@KomoriDev - 我已经查看了你的更改 - 这里有一些反馈:

总体评论

  • 考虑将 tribute 事件监听器逻辑提取到一个单独的可组合函数中,以获得更好的组织。
以下是我在审查期间查看的内容
  • 🟢 一般问题:一切看起来都很好
  • 🟢 安全性:一切看起来都很好
  • 🟢 测试:一切看起来都很好
  • 🟢 复杂性:一切看起来都很好
  • 🟢 文档:一切看起来都很好

Sourcery 对于开源是免费的 - 如果你喜欢我们的评论,请考虑分享它们 ✨
帮助我更有用!请点击每个评论上的 👍 或 👎,我将使用反馈来改进你的评论。
Original comment in English

Hey @KomoriDev - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider extracting the tribute event listener logic into a separate composable function for better organization.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sourcery-ai

sourcery-ai Bot commented Apr 19, 2025

Copy link
Copy Markdown

Sourcery 评审指南

此拉取请求修复了一个 bug,即在提及菜单中按 Enter 键会无意中发送消息。此修复包括跟踪提及菜单的活动状态,并在菜单处于活动状态时阻止发送消息。

未生成图表,因为更改看起来很简单,不需要可视化表示。

文件级别更改

变更 详情 文件
修复了在提及菜单中按 Enter 键会意外发送消息的问题。
  • 添加了一个响应式变量 isMentionMenuActive 来跟踪提及菜单的活动状态。
  • 向 inputRef 添加了事件监听器,以便在提及菜单处于活动状态时将 isMentionMenuActive 设置为 true,在不活动时设置为 false。
  • 修改了 onEnter 函数,以防止在提及菜单处于活动状态时发送消息。
src/components/chat/ChatBoxInputBox.vue

针对关联问题的评估

问题 目标 已解决 说明
#232 当提及菜单处于活动状态时,按 Enter 键不应发送消息。
#232 当通过“@”字符激活时,提及菜单应正常工作。

可能关联的问题


提示和命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 通过回复审查评论,要求 Sourcery 从审查评论创建一个 issue。您也可以回复带有 @sourcery-ai issue 的审查评论来从中创建一个 issue。
  • 生成拉取请求标题: 在拉取请求标题中的任何位置写入 @sourcery-ai 以随时生成标题。您也可以在拉取请求上评论 @sourcery-ai title 以随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中的任何位置写入 @sourcery-ai summary 以随时在您想要的任何位置生成 PR 摘要。您也可以在拉取请求上评论 @sourcery-ai summary 以随时(重新)生成摘要。
  • 生成审查员指南: 在拉取请求上评论 @sourcery-ai guide 以随时(重新)生成审查员指南。
  • 解决所有 Sourcery 评论: 在拉取请求上评论 @sourcery-ai resolve 以解决所有 Sourcery 评论。如果您已经解决了所有评论并且不想再看到它们,这将非常有用。
  • 驳回所有 Sourcery 审查: 在拉取请求上评论 @sourcery-ai dismiss 以驳回所有现有的 Sourcery 审查。如果您想重新开始新的审查,这将特别有用 - 不要忘记评论 @sourcery-ai review 以触发新的审查!
  • 为 issue 生成行动计划: 在 issue 上评论 @sourcery-ai plan 以为其生成行动计划。

自定义您的体验

访问您的 仪表板 以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查员指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获得帮助

Original review guide in English

Reviewer's Guide by Sourcery

This pull request addresses a bug where pressing the Enter key within the mention menu would inadvertently send a message. The fix involves tracking the active state of the mention menu and preventing message sending when the menu is active.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Fixes an issue where pressing Enter in the mention menu would send a message unexpectedly.
  • Added a reactive variable isMentionMenuActive to track the mention menu's active state.
  • Added event listeners to the inputRef to set isMentionMenuActive to true when the mention menu is active and false when it is inactive.
  • Modified the onEnter function to prevent sending messages when the mention menu is active.
src/components/chat/ChatBoxInputBox.vue

Assessment against linked issues

Issue Objective Addressed Explanation
#232 When the mention menu is active, pressing Enter should not send the message.
#232 The mention menu should function correctly when activated by the '@' character.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@A-kirami A-kirami added the bug Something isn't working label Apr 19, 2025
@github-project-automation github-project-automation Bot moved this to 🆕 New in Matcha Project Apr 19, 2025
@A-kirami
A-kirami merged commit dce9db2 into A-kirami:main Apr 19, 2025
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Matcha Project Apr 19, 2025
@KomoriDev
KomoriDev deleted the fix/mention branch April 19, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

BUG: 输入框 @mention 激活时回车键意外触发消息发送

2 participants