Zero icon indicating copy to clipboard operation
Zero copied to clipboard

tool mention

Open hiheyhello123 opened this issue 7 months ago • 2 comments

Summary by CodeRabbit

  • New Features

    • Introduced tool mention functionality in the editor, allowing users to mention and interact with tools using a suggestion dropdown.
    • Added a searchable, keyboard-navigable mention list with rich rendering for tool mentions.
  • Bug Fixes

    • Improved keyboard event handling in the command palette to prevent unintended propagation and ensure consistent shortcut behavior.
    • Prevented editor submission when popover elements (such as mention lists) are visible.
  • Chores

    • Updated dependencies to support new mention and tooltip features.
    • Updated a core team member’s display information.

hiheyhello123 avatar Jun 15 '25 21:06 hiheyhello123

"""

Walkthrough

This update introduces a tool mention feature to the mail app's rich text editor, allowing users to trigger tool suggestions with '@' and select from a list. It adds supporting components, updates editor extensions, and integrates Tippy.js and Tiptap mention dependencies. Additional minor changes include updating a contributor's username and package manager version.

Changes

File(s) Change Summary
apps/mail/components/create/mention-extension.tsx, apps/mail/components/create/mention-list.tsx Added new React-based mention extension and suggestion list components for tool mentions in the editor.
apps/mail/components/create/extensions.ts Integrated the new tool mention extension into the editor's default extensions.
apps/mail/components/create/ai-chat.tsx Blocked Enter key submission when popover elements are visible in the AI chat editor.
apps/mail/components/context/command-palette-context.tsx Enhanced keyboard event handling to stop propagation and use capture phase for command palette shortcuts.
apps/mail/app/(full-width)/contributors.tsx Renamed a core team member from "needlexo" to "dumbneedle" and updated related references.
apps/mail/package.json Added Tippy.js and Tiptap mention/suggestion dependencies for editor enhancements.
package.json Updated pnpm version from 10.11.0 to 10.12.1.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Editor
  participant MentionExtension
  participant MentionList (Tippy.js)
  participant Tool

  User->>Editor: Types '@' + query
  Editor->>MentionExtension: Detects trigger
  MentionExtension->>MentionList: Shows filtered tool suggestions
  User->>MentionList: Navigates/selects tool
  MentionList->>MentionExtension: Command callback with selected tool
  MentionExtension->>Tool: Calls onToolMention, executes tool
  MentionList-->>MentionExtension: Closes suggestion popup

Possibly related PRs

  • Mail-0/Zero#389: Updates core team member usernames and roles in a related contributors component.
  • Mail-0/Zero#823: Modifies contributors list, including renaming and reordering, directly affecting the same data structures.

Suggested reviewers

  • ahmetskilinc
  • needleXO

Poem

In the meadow of code, a new feature appears,
Tool mentions now bloom—give the editor cheers!
With Tippy.js magic and Tiptap delight,
Suggestions pop up, making typing so light.
A bunny hops by, with a wink and a grin:
"Try the new tools—let productivity begin!"
🐇✨ """


📜 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 ec2bfb4a8b6ea2c0cf53174b7c0d4b0146f1cbfa and ffc959d6a4d6a2ac293405192455df6698540f2c.

📒 Files selected for processing (4)
  • apps/mail/components/create/ai-chat.tsx (2 hunks)
  • apps/mail/components/create/extensions.ts (3 hunks)
  • apps/mail/components/create/mention-extension.tsx (1 hunks)
  • apps/mail/components/create/mention-list.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/mail/components/create/ai-chat.tsx
  • apps/mail/components/create/extensions.ts
  • apps/mail/components/create/mention-list.tsx
  • apps/mail/components/create/mention-extension.tsx
✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

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.

coderabbitai[bot] avatar Jun 15 '25 21:06 coderabbitai[bot]

Merge activity

  • Jun 25, 9:01 PM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Jun 25, 9:01 PM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..

graphite-app[bot] avatar Jun 25 '25 21:06 graphite-app[bot]

This PR has merge conflicts and has been open for more than 3 days. It will be automatically closed. Please resolve the conflicts and reopen the PR if you'd like to continue working on it.

github-actions[bot] avatar Aug 07 '25 07:08 github-actions[bot]