fix: forward textarea styles to BaseInput and correct typings#82
fix: forward textarea styles to BaseInput and correct typings#82QDyanbing wants to merge 1 commit intoreact-component:masterfrom
Conversation
Walkthrough升级了 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 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 |
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! 此 PR 旨在解决 Highlights
🧠 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. Changelog
Activity
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. 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
|
There was a problem hiding this comment.
Code Review
本次 PR 旨在修复 TextArea 组件的样式透传问题。核心改动包括:将 styles 属性从 TextArea 透传至 BaseInput 组件,修正了 TextAreaProps['styles'] 的 TypeScript 类型以继承 CommonInputProps['styles'],并更新了测试用例以覆盖 allowClear 场景下的 classNames 和 styles。这些改动解决了 styles.clear 等语义化样式不生效的问题,并完善了类型定义。从代码层面看,改动是直接且有效的。
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 46: The dependency bump for "@rc-component/input" in package.json was
changed to "~1.2.1"; before merging, inspect the 1.2.1 changelog/commit diff
(via npm view, GitHub tags/releases, or the package repo) to confirm the patch
only contains the intended style-propagation fix and no breaking or behavioral
changes; if any unexpected changes exist, either pin to the previous version,
add compensating code (e.g., adjust style props handling in components
referencing the Input component), or document the risk in the PR description
referencing "@rc-component/input" and the specific 1.2.1 release notes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 718dc6f9-46bf-4b7b-affd-7b26c9126e78
⛔ Files ignored due to path filters (1)
tests/__snapshots__/index.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (4)
package.jsonsrc/TextArea.tsxsrc/interface.tstests/index.spec.tsx
| }, | ||
| "dependencies": { | ||
| "@rc-component/input": "~1.2.0", | ||
| "@rc-component/input": "~1.2.1", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
@rc-component/input 1.2.1 changelog release notes TextArea BaseInput styles clear suffix
💡 Result:
- There is no
@rc-component/input@1.2.1release in the upstreamreact-component/inputGitHub Releases list. The latest scoped release shown there is@rc-component/input@1.1.2(Nov 10), so there are no 1.2.1 changelog/release notes for@rc-component/input. [1] - What
@rc-component/input@1.1.2release notes contain: only maintenance items (version bump, switching focus util torc-util, deps cleanup,classnames→clsx, dev-deps bumps). Nothing specifically calling out TextArea, BaseInput, styles, allowClear, suffix, etc. [1] - If you’re actually looking for the TextArea/BaseInput “styles / allowClear / suffix” behavior, that API is reflected in the type surface:
BaseInputProps/CommonInputPropsexposesuffix,allowClear, plusclassNamesandstylesfor affix/prefix/suffix wrappers. [2]rc-textarea’sTextAreaprops explicitly pickallowClearandsuffixfromrc-input’sBaseInputProps. [3]
If you confirm whether you meant rc-input@1.2.1 (unscoped) vs @rc-component/input, I can pull the exact matching release/tag notes for the right package.
Sources: [1] [2] [3]
🏁 Script executed:
# 查看 package.json 第 46 行及其周围上下文
cat -n package.json | sed -n '40,55p'Repository: react-component/textarea
Length of output: 702
🏁 Script executed:
# 使用 npm 或 registry API 查询 `@rc-component/input` 的所有发布版本
npm view `@rc-component/input` versions --json 2>/dev/null | tail -20 || echo "npm view failed, trying alternative method"Repository: react-component/textarea
Length of output: 147
依赖升级方向正确,建议确认 1.2.1 版本的具体变更内容。
@rc-component/input 从 ~1.2.0 升级至 ~1.2.1 系 patch 版本更新,与本次样式透传修复目标一致。建议在合并前确认该版本的变更内容(可通过 npm 或源代码仓库查看),确保无隐式行为回归。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` at line 46, The dependency bump for "@rc-component/input" in
package.json was changed to "~1.2.1"; before merging, inspect the 1.2.1
changelog/commit diff (via npm view, GitHub tags/releases, or the package repo)
to confirm the patch only contains the intended style-propagation fix and no
breaking or behavioral changes; if any unexpected changes exist, either pin to
the previous version, add compensating code (e.g., adjust style props handling
in components referencing the Input component), or document the risk in the PR
description referencing "@rc-component/input" and the specific 1.2.1 release
notes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #82 +/- ##
=======================================
Coverage 99.00% 99.00%
=======================================
Files 3 3
Lines 201 201
Branches 62 61 -1
=======================================
Hits 199 199
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
背景
这个 PR 修复了 rc-textarea 中一个样式透传问题。
修改内容
Summary by CodeRabbit
Bug Fixes
Tests