-
-
Notifications
You must be signed in to change notification settings - Fork 198
fix: typo #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: typo #500
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough仅在 src/Tooltip.tsx 中更新了 TooltipProps.overlayClassName 的 JSDoc 文档,调整弃用指引示例为使用字符串而非对象;无类型签名、运行时或控制流变更。 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @WLyKan, 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!
此拉取请求旨在纠正 Tooltip
组件中 overlayClassName
属性的 JSDoc 注释中的一个排版错误。它更新了 classNames
示例的 root
属性值,以正确反映其应为字符串而非对象,从而提高了文档的准确性。
Highlights
- JSDoc 示例修正: 修正了
src/Tooltip.tsx
文件中overlayClassName
属性的 JSDoc 注释,将classNames={{ root: {} }}
的示例用法更新为classNames={{ root: '' }}
,以明确root
属性应为字符串类型。
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
-
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. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
这个 PR 修正了 TooltipProps
接口中 overlayClassName
属性 JSDoc 注释里的一个错误。旧的注释中,建议使用的 classNames={{ root: {} }}
示例是错误的,因为 root
属性应该是一个字符串。本次修改将其更正为 classNames={{ root: '' }}
,这与 TooltipClassNames
类型定义一致,能够为开发者提供正确的指引。这是一个很好的修正。
There was a problem hiding this 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 (1)
src/Tooltip.tsx (1)
35-35
: 示例更具可读性的小改动(可选)当前示例使用空字符串,容易被理解为“占位而非实际 class”。建议在示例里给出非空占位值,提高可读性。
应用如下 diff:
- /** @deprecated Please use `classNames={{ root: '' }}` */ + /** @deprecated Please use `classNames={{ root: 'your-class' }}` */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Tooltip.tsx
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: thinkasany
PR: react-component/tooltip#484
File: src/Popup.tsx:20-25
Timestamp: 2024-11-28T13:00:19.052Z
Learning: `overlayInnerClassName` 属性在 `Popup.tsx` 中是供内部使用的,已经通过 `classNames.inner` 在现有的测试用例中得到验证,无需单独添加测试。
📚 Learning: 2024-11-28T13:00:19.052Z
Learnt from: thinkasany
PR: react-component/tooltip#484
File: src/Popup.tsx:20-25
Timestamp: 2024-11-28T13:00:19.052Z
Learning: `overlayInnerClassName` 属性在 `Popup.tsx` 中是供内部使用的,已经通过 `classNames.inner` 在现有的测试用例中得到验证,无需单独添加测试。
Applied to files:
src/Tooltip.tsx
🔇 Additional comments (1)
src/Tooltip.tsx (1)
35-36
: JSDoc 示例改为字符串 — 同意合并,需确认仓内示例已更新与 TooltipClassNames.root 的 string 类型及 popupClassName={classNames(...)} 用法一致,变更可合并。已尝试全仓搜索旧写法,但 rg 未搜索任何文件,无法验证是否仍有示例使用对象写法。在合并前运行下列脚本以确认仓内是否仍有 classNames={{ root: {...} }} 或空对象示例:
#!/bin/bash set -euo pipefail # 1) 反模式:classNames={{ root: { ... } }} rg -n --hidden --no-ignore -S -C2 'classNames\s*=\s*\{\s*root\s*:\s*\{' || true # 2) 空对象示例:classNames={{ root: {} }} rg -n --hidden --no-ignore -S -C2 'classNames\s*=\s*\{\s*root\s*:\s*\{\s*\}\s*\}' || true # 3) 推荐字符串写法(单/双引号) rg -n --hidden --no-ignore -S -C1 "classNames\\s*=\\s*\\{\\s*root\\s*:\\s*'[^']*'\\s*\\}" || true rg -n --hidden --no-ignore -S -C1 'classNames\s*=\s*\{\s*root\s*:\s*"[^"]*"\s*\}' || true # 若仍无输出,使用 --debug 排查原因 if ! rg --hidden --no-ignore -n 'classNames' >/dev/null 2>&1; then echo "rg 未搜索到任何文件;在本地运行 'rg --debug <pattern>' 排查原因。" fi
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #500 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 33 33
Branches 12 12
=========================================
Hits 33 33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
classNames 中的 root 的值应该是字符串,而不是对象
Summary by CodeRabbit