Skip to content

Conversation

@yoyo837
Copy link
Member

@yoyo837 yoyo837 commented Dec 1, 2025

快照我没动,看上去很久没更新过了,可能没用了

Summary by CodeRabbit

发布说明

  • Chores
    • 将虚拟列表依赖从 rc-virtual-list 迁移到 @rc-component/virtual-list,并同步更新所有相关导入路径以保持一致性。
    • 升级测试相关的开发依赖以匹配最新测试环境需求。
  • Tests
    • 更新测试中对虚拟列表的模拟和引用,确保测试行为与原先保持一致。

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

@vercel
Copy link

vercel bot commented Dec 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
select Ready Ready Preview Comment Dec 2, 2025 3:46am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

将虚拟列表依赖从 rc-virtual-list 迁移到 @rc-component/virtual-list:更新 package.json、源文件与测试中的导入与 mock 路径,新增一个测试 mock 文件。未修改运行时逻辑或导出签名,仅调整模块解析路径。

Changes

内聚体 / 文件(s) 变更摘要
依赖管理
package.json
dependencies 中移除 rc-virtual-list,新增 @rc-component/virtual-list(^1.0.1);将 devDependenciesrc-test 从 ^7.0.9 升级到 ^7.1.2。
源码导入调整
src/BaseSelect/index.tsx, src/OptionList.tsx
将类型/组件的导入路径从 rc-virtual-list/lib/... 改为 @rc-component/virtual-list/lib/...(涉及 ScrollConfigScrollToListListRef 等类型/符号)。
测试与 Mock 更新
tests/OptionList.test.tsx, tests/Select.test.tsx, tests/__mocks__/rc-virtual-list.tsx, tests/__mocks__/@rc-component/virtual-list.tsx
更新测试中对虚拟列表的引用与 jest.mock 路径,从 rc-virtual-list/... 切换到 @rc-component/virtual-list/...;新增 tests/__mocks__/@rc-component/virtual-list.tsx,将 @rc-component/virtual-list/lib/mock 的默认导出重导出以供 jest 使用。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 变更模式一致、主要为路径替换与新增轻量 mock,检查点:
    • 核对 @rc-component/virtual-list@^1.0.1 是否导出与原包兼容的类型/符号(ScrollConfigScrollToListListRef)。
    • 验证测试中的 jest mock 路径与重导出文件能被正确解析并按预期工作。

Poem

🐰 包名换新衣,导入步轻盈,
小径改一改,代码任平静。
测试也随行,模仿不离灵,
小兔在仓库,摇尾祝合并。

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.
Title check ✅ Passed PR标题准确反映了主要变更内容,即将虚拟列表依赖从rc-virtual-list迁移到@rc-component/virtual-list。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 bump-namespace-virtual-list

📜 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 3fa8488 and 4bb0c14.

📒 Files selected for processing (1)
  • tests/__mocks__/@rc-component/virtual-list.tsx (1 hunks)
🔇 Additional comments (1)
tests/__mocks__/@rc-component/virtual-list.tsx (1)

1-3: Mock implementation follows the established @rc-component library pattern

The import path @rc-component/virtual-list/lib/mock is correct and consistent with existing mocks in the codebase (e.g., @rc-component/trigger/lib/mock). The simpler re-export approach is appropriate for this library.


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

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 performs a migration of the virtual list implementation from the rc-virtual-list package to the newer @rc-component/virtual-list. This change updates dependencies, import statements, and test configurations to align with the new component naming convention and leverage the latest version of the virtual list component within the @rc-component ecosystem, ensuring consistency and potential performance improvements.

Highlights

  • Dependency Update: The project has migrated its virtual list dependency from rc-virtual-list to the new @rc-component/virtual-list package, reflected in package.json.
  • Import Path Migration: All relevant source files (src/BaseSelect/index.tsx, src/OptionList.tsx) have been updated to import components and types from the new @rc-component/virtual-list package.
  • Test Configuration Adjustments: Test files (tests/OptionList.test.tsx, tests/Select.test.tsx, tests/__mocks__/rc-virtual-list.tsx) have been updated to correctly reference the new virtual list component, including changes to jest.mock paths and CSS class selectors.
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

@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 successfully migrates the project from rc-virtual-list to @rc-component/virtual-list. The dependency updates in package.json and import path changes across various TypeScript files (src/BaseSelect/index.tsx, src/OptionList.tsx, tests/Select.test.tsx, tests/__mocks__/rc-virtual-list.tsx) are correctly implemented. However, there is a critical issue in the test files where the CSS selector for the virtual list scrollbar class was updated incorrectly, which will cause tests to fail.

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.47%. Comparing base (18f176f) to head (4bb0c14).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1177      +/-   ##
==========================================
+ Coverage   99.41%   99.47%   +0.05%     
==========================================
  Files          31       31              
  Lines        1202     1332     +130     
  Branches      407      494      +87     
==========================================
+ Hits         1195     1325     +130     
  Misses          7        7              

☔ 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
Contributor

@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

♻️ Duplicate comments (1)
package.json (1)

54-56: 虚拟列表相关依赖版本请跟进至最新已采纳的建议

这里把依赖迁移到 @rc-component/virtual-list 并同步升级了 rc-overflowrc-test,方向是对的。上一轮已有 reviewer 建议把 @rc-component/virtual-list 调整为 ^1.0.1,建议参考该建议统一版本,并在升级后本地跑一遍全部测试以确认兼容性。

Also applies to: 79-79

🧹 Nitpick comments (1)
tests/__mocks__/rc-virtual-list.tsx (1)

1-3: rc-virtual-list 的 Jest mock 现在桥接到新包

这个 mock 仍挂在 rc-virtual-list 名字下,但内部改为从 @rc-component/virtual-list/lib/mock 重新导出,可以让遗留的 jest.mock('rc-virtual-list') 继续工作。建议检查仓库里是否还存在对 'rc-virtual-list' 的显式 mock/导入;若已全部迁移到 @rc-component/virtual-list,可以考虑删除该文件避免混淆。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18f176f and f3483b4.

⛔ Files ignored due to path filters (2)
  • tests/__snapshots__/Select.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/Tags.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • package.json (2 hunks)
  • src/BaseSelect/index.tsx (1 hunks)
  • src/OptionList.tsx (1 hunks)
  • tests/OptionList.test.tsx (1 hunks)
  • tests/Select.test.tsx (1 hunks)
  • tests/__mocks__/rc-virtual-list.tsx (1 hunks)
⏰ 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). (2)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
src/BaseSelect/index.tsx (1)

4-4: 虚拟列表类型导入路径已对齐新包

ScrollConfigScrollTo 的导入切换到 @rc-component/virtual-list/lib/List 与依赖迁移保持一致,类型使用方式未变,看起来是纯路径调整;请确认该包版本下仍导出同名类型,并跑一遍 TS 编译/测试确保无类型回归。

tests/Select.test.tsx (1)

12-12: 测试用的 ScrollConfig 类型源已更新为新虚拟列表包

这里的 ScrollConfig 类型导入已与源码中使用的 @rc-component/virtual-list/lib/List 对齐,保持了类型一致性;建议在依赖升级完成后跑一遍测试(含 TS 类型检查),确认该路径在当前版本下可用。

src/OptionList.tsx (1)

6-8: OptionList 虚拟列表依赖已成功切换到新命名空间

ListRefListScrollConfig 的导入已统一切到 @rc-component/virtual-list,与下方 listRef.current?.scrollToList<...> 的使用方式保持一致,属于无行为变化的迁移;请确认新包的默认导出和类型签名与旧版一致,并在本地跑一下与虚拟滚动相关的用例/快照。

tests/OptionList.test.tsx (1)

16-19: OptionList 测试的 VirtualList mock 已对齐到新包

jest.mock 目标和 jest.requireActual 的来源同时切换到 @rc-component/virtual-list,保持了原来“包裹真实实现并拦截 scrollTo”的测试行为;请确认 Jest 配置下该模块能正确解析,并跑一遍 OptionList/Select 相关测试,确保不会出现双重 mock 或解析失败的问题。

@afc163 afc163 changed the title migrate to @rc-component/virtual-list refactor: migrate to @rc-component/virtual-list Dec 2, 2025
@afc163 afc163 merged commit f77d8d8 into master Dec 2, 2025
12 checks passed
@afc163 afc163 deleted the bump-namespace-virtual-list branch December 2, 2025 03:49
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