Skip to content

Conversation

@IsDyh01
Copy link
Contributor

@IsDyh01 IsDyh01 commented Nov 10, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • [✅] 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

#1293

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English
🇨🇳 Chinese

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

Preview is ready

@dosubot dosubot bot added the enhancement New feature or request label Nov 10, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @IsDyh01, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a user experience enhancement to the SlotTextArea component by adding a clear button to 'tag' type slots. This allows users to easily remove individual tags, improving the interactivity and manageability of slotted content within the input field. The change involves both UI modifications and the underlying logic to handle slot removal and state updates.

Highlights

  • New Feature: Tag Slot Clear Button: A clear button (represented by a 'CloseOutlined' icon) has been added to 'tag' type slots within the SlotTextArea component, allowing users to remove individual tags directly from the input area.
  • Slot Removal Logic: A new function, removeTagSlot, was implemented to handle the complete removal process of a tag slot. This includes removing the DOM element, updating the internal slot configuration and values, and triggering the onChange callback to reflect the updated content.
  • Snapshot Test Update: The snapshot test for demo-extend.test.ts.snap has been updated to reflect the new UI structure of tag slots, which now includes the clear button.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new feature to allow clearing/removing 'tag' type slots in the Sender component. A new function removeTagSlot is added to handle the removal logic, and a close button is added to the tag slot's UI. The implementation is mostly correct and covers all necessary state updates. However, I've found a significant type-safety issue related to event handling that could lead to runtime errors for consumers of this component. My review comments provide suggestions to fix this.

Comment on lines +228 to +230
onClick={(e) => {
removeTagSlot(node.key as string, e as unknown as EventType);
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Following the change in removeTagSlot, the onClick handler should be updated to not pass the event object. The event from onClick is a MouseEvent, which is incompatible with the EventType expected by onChange.

Suggested change
onClick={(e) => {
removeTagSlot(node.key as string, e as unknown as EventType);
}}
onClick={() => {
removeTagSlot(node.key as string);
}}

@codecov
Copy link

codecov bot commented Nov 10, 2025

Bundle Report

Changes will increase total bundle size by 10.04kB (0.25%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
x-markdown-array-push 3.96MB 10.04kB (0.25%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: x-markdown-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
mermaid.min.js 10.04kB 3.96MB 0.25%

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.18%. Comparing base (8815a87) to head (a616827).

Files with missing lines Patch % Lines
packages/x/components/sender/SlotTextArea.tsx 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1317      +/-   ##
==========================================
+ Coverage   94.16%   94.18%   +0.02%     
==========================================
  Files         141      141              
  Lines        3670     3700      +30     
  Branches     1008     1039      +31     
==========================================
+ Hits         3456     3485      +29     
- Misses        212      213       +1     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kimteayon
Copy link
Collaborator

您好 关闭功能需要配置以及文档

@IsDyh01
Copy link
Contributor Author

IsDyh01 commented Nov 11, 2025

image tag类型新增一个isClearable属性吗

@kimteayon
Copy link
Collaborator

kimteayon commented Nov 11, 2025

image tag类型新增一个isClearable属性吗

和antd 一致 allowClear

@kimteayon
Copy link
Collaborator

这个先稍等下、sender的词槽模式准备重构下逻辑

@IsDyh01
Copy link
Contributor Author

IsDyh01 commented Nov 20, 2025

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants