fix: make TagInput suggestion filter case-insensitive#941
Conversation
The suggestion dropdown still showed tags that only differed in casing from already-selected tags (e.g. showing 'openapiHA' when 'openapiha' was already selected). Selecting such a suggestion would then fail as a duplicate, creating a confusing UX. Follows up on the case-insensitive duplicate check added in ding113#940.
Summary of ChangesHello, 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 enhances the user experience of the Highlights
Using Gemini Code AssistThe 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
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 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. Footnotes
|
📝 Walkthrough概述本PR修改了标签输入组件中的重复标签检查逻辑,将原有的区分大小写的直接包含检查改为不区分大小写的比较。同时更新了package.json文件。 变更
代码审查工作量估算🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Code Review
The pull request successfully addresses the issue of case-sensitive duplicate tag suggestions by implementing a case-insensitive check. This change aligns the suggestion filtering with the duplicate check logic, improving the user experience by preventing the selection of functionally identical tags that only differ in casing.
Summary
Makes the TagInput suggestion filter case-insensitive to align with the duplicate check added in #940.
Problem
Follow-up to #940
PR #940 made the TagInput duplicate validation case-insensitive, but the suggestion dropdown filter was still using case-sensitive matching. This caused confusing UX where:
Solution
Update the suggestion filter to use case-insensitive comparison when checking if a suggestion is already selected:
Changes
src/components/ui/tag-input.tsxTesting
Manual Testing:
Checklist
Description enhanced by Claude AI