Skip to content

Conversation

@yoyo837
Copy link
Member

@yoyo837 yoyo837 commented Dec 4, 2025

Summary by CodeRabbit

  • Chores

    • 更新项目依赖,采用新的模块版本。
  • Refactor

    • 改进组件的类型定义,提升代码的类型安全性和准确性。

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
picker Ready Ready Preview Comment Dec 4, 2025 4:01am

@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

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.

工作流概述

将项目依赖从 rc-overflow 迁移至 @rc-component/overflow,并更新相应的导入语句和类型注解以保持兼容性。

变更内容

组别 / 文件 变更摘要
依赖迁移
package.json
添加依赖 @rc-component/overflow@^1.0.0;移除依赖 rc-overflow@^1.3.2
导入更新
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx
将 Overflow 导入路径从 rc-overflow 更改为 @rc-component/overflow;新增 React 中 MouseEventHandler 的类型导入;将 renderSelector 中的 onClose 参数类型细化为 MouseEventHandler<HTMLSpanElement>

预估代码审查工作量

🎯 1 (简单) | ⏱️ ~5 分钟

  • 检查依赖版本兼容性,确保 @rc-component/overflow@^1.0.0 与现有代码兼容
  • 验证导入路径变更在所有相关文件中的一致性
  • 确认类型注解的精确性和潜在的类型安全改进

🐰 从旧包跳到新包,
依赖更新真良好!
导入路径换一换,
类型更紧准没错,
溢出组件焕新生! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 拉取请求标题清晰准确地总结了主要变更内容:从rc-overflow迁移到@rc-component/overflow。标题简洁明了,能够让团队成员快速理解这次变更的目的。
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch drop-rc-overflow

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yoyo837, 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 focuses on updating the project's dependency management by replacing the legacy rc-overflow package with its modern, scoped counterpart, @rc-component/overflow. This ensures the project leverages the latest component versions and aligns with current development practices. Additionally, a minor but important type refinement for mouse event handlers has been introduced to improve code clarity and type safety.

Highlights

  • Dependency Migration: The project has migrated from using the rc-overflow package to the @rc-component/overflow scoped package, updating the dependency in package.json and the import paths in relevant source files.
  • Type Refinement: The type definition for MouseEventHandler has been refined in MultipleDates.tsx to be more specific, now explicitly typing it as MouseEventHandler<HTMLSpanElement>.
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 replaces the rc-overflow dependency with @rc-component/overflow. The changes are mostly straightforward, but I've identified a critical type issue that will likely cause a compilation error, and a high-severity risk of a regression related to the maxTagCount prop's 'responsive' value. Please see my comments for details and suggestions.


// ========================= Item =========================
function renderSelector(content: React.ReactNode, onClose?: React.MouseEventHandler) {
function renderSelector(content: React.ReactNode, onClose?: MouseEventHandler<HTMLSpanElement>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

While making the onClose handler's type more specific to MouseEventHandler<HTMLSpanElement> is a good intention, it creates a type conflict. The renderSelector function is called from renderItem with an onClose handler whose event argument is typed as React.MouseEvent (which defaults to MouseEvent<Element>). An argument of type MouseEvent<Element> is not assignable to a parameter of type MouseEvent<HTMLSpanElement>, which will likely cause a TypeScript compilation error. To fix this, you can revert this change.

Suggested change
function renderSelector(content: React.ReactNode, onClose?: MouseEventHandler<HTMLSpanElement>) {
function renderSelector(content: React.ReactNode, onClose?: React.MouseEventHandler) {

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.80%. Comparing base (43bb0a8) to head (6f0778d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #953   +/-   ##
=======================================
  Coverage   98.80%   98.80%           
=======================================
  Files          65       65           
  Lines        2680     2680           
  Branches      719      739   +20     
=======================================
  Hits         2648     2648           
  Misses         29       29           
  Partials        3        3           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@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 (2)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (2)

7-10: MultipleDatesProps 只从 PickerProps 中挑出 maxTagCount 没问题,但可以考虑透传泛型。

目前写成 Pick<PickerProps, 'maxTagCount'> 在类型上是可行的;如果想让 DateType 一路贯通、在未来 PickerProps 对该字段做泛型约束时更稳妥,可改为:

-export interface MultipleDatesProps<DateType extends object = any> extends Pick<
-  PickerProps,
+export interface MultipleDatesProps<DateType extends object = any> extends Pick<
+  PickerProps<DateType>,
   'maxTagCount'
 > {

属于可选的类型增强,不影响当前功能。


39-39: renderSelector 中 onClose 类型收窄为 MouseEventHandler 更贴合实际 DOM 元素。

这一收窄与下方 className={${selectionCls}-item-remove}<span> 完全对应,有利于类型检查;进一步统一的话,可以让 renderItem 里的 onClose 也显式使用同一类型并去掉可选参数,例如:

-    const onClose = (event?: React.MouseEvent) => {
-      if (event) event.stopPropagation();
+    const onClose: MouseEventHandler<HTMLSpanElement> = (event) => {
+      event.stopPropagation();
       onRemove(date);
     };

这能让调用与 React 的事件签名完全一致。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43bb0a8 and 6f0778d.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (1)
src/PickerInput/SinglePicker.tsx (1)
  • PickerProps (102-104)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test / react component workflow
🔇 Additional comments (2)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (1)

2-4: Overflow 引用切换到新包,同时使用 type-only 引入 MouseEventHandler 很合适。

Overflow@rc-component/overflow 引入与 package.json 中的依赖一致,import type { MouseEventHandler } 也避免了多余的运行时代码,整体改动干净且对外行为不变。

package.json (1)

111-116: Migration from rc-overflow to @rc-component/overflow is complete and correct.

The new @rc-component/overflow dependency is properly declared in package.json and actively imported in source code. No lingering references to the old rc-overflow package were found in the codebase.

@afc163 afc163 changed the title chore: drop rc-overflow refactor: migrate rc-overflow to @rc-component/overflow Dec 4, 2025
@afc163 afc163 merged commit ef3564b into master Dec 4, 2025
13 checks passed
@afc163 afc163 deleted the drop-rc-overflow branch December 4, 2025 04:32
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.

3 participants