Skip to content

Conversation

@guoyunhe
Copy link
Contributor

@guoyunhe guoyunhe commented Jan 8, 2026

react-component/async-validator#21

@rc-component/[email protected] 新增了 tel 类型校验,@rc-component/field-form 同步支持

@vercel
Copy link

vercel bot commented Jan 8, 2026

@guoyunhe is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@gemini-code-assist
Copy link

Summary of Changes

Hello @guoyunhe, 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!

此拉取请求旨在为表单组件库添加对电话号码 (tel) 校验规则的支持。通过更新核心校验库依赖并相应地扩展类型定义和默认消息配置,确保了 tel 规则能够被正确识别和处理,从而提升了表单验证的灵活性和完整性。

Highlights

  • 依赖更新: 将 @rc-component/async-validator 依赖更新至 ^5.1.0 版本,以支持新的校验功能。
  • 新增 tel 校验规则: 在 src/interface.ts 中,RuleType 类型定义新增了 tel 选项,允许在表单校验中使用电话号码规则。
  • 校验消息接口扩展: 在 src/interface.ts 中,ValidateMessages 接口的 type 属性新增了 tel 字段,用于定义电话号码校验的错误消息。
  • 默认校验消息配置: 在 src/utils/messages.ts 中,defaultValidateMessages 对象新增了 tel 类型的默认校验消息模板。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (d474bf1) to head (09e736a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #775   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          19       19           
  Lines        1311     1311           
  Branches      329      329           
=======================================
  Hits         1305     1305           
  Misses          6        6           

☔ 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

@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

本次 PR 同步了上游依赖 @rc-component/async-validator 的更新,增加了 tel 类型的校验规则。代码变更清晰地反映了这一目的。

我有以下反馈:

主要问题:

  • 缺少测试: 本次变更没有包含对新 tel 校验规则的测试。为了确保功能正确并防止未来回归,在 tests/validate.test.tsx 中添加测试用例是至关重要的。请补充测试,覆盖有效和无效的电话号码场景。

次要建议:

  • 代码风格: 为了提高代码的可读性和可维护性,我建议将 interface.tsutils/messages.ts 中新增的属性按字母顺序排列。具体建议请见行级评论。

Comment on lines +339 to 341
tel?: ValidateMessage;
url?: ValidateMessage;
hex?: ValidateMessage;

Choose a reason for hiding this comment

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

medium

为了保持代码的可读性和可维护性,建议将 types 中的属性按字母顺序排列。

Suggested change
tel?: ValidateMessage;
url?: ValidateMessage;
hex?: ValidateMessage;
hex?: ValidateMessage;
tel?: ValidateMessage;
url?: ValidateMessage;

Comment on lines +25 to 27
tel: typeTemplate,
url: typeTemplate,
hex: typeTemplate,

Choose a reason for hiding this comment

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

medium

为了保持代码的可读性和可维护性,建议将 types 中的属性按字母顺序排列。

Suggested change
tel: typeTemplate,
url: typeTemplate,
hex: typeTemplate,
hex: typeTemplate,
tel: typeTemplate,
url: typeTemplate,

@zombieJ zombieJ merged commit 9b99e61 into react-component:master Jan 8, 2026
6 of 7 checks passed
@guoyunhe guoyunhe deleted the tel-validator branch January 8, 2026 07:41
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.

2 participants