Skip to content
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

refactor: update content to panel #359

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

thinkasany
Copy link
Contributor

@thinkasany thinkasany commented Jan 8, 2025

Summary by CodeRabbit

  • 样式调整

    • 更新了面板内容组件的主 <div> 元素的类名,从 ${prefixCls}-content 改为 ${prefixCls}-panel
    • 更新了相关的活动和非活动状态类名,以反映新的命名约定。
    • 修改了样式表中的类名,以确保一致性。
  • 保持功能不变

    • 组件的渲染逻辑和核心行为保持不变。

Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
collapse ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 7:42am

Copy link

coderabbitai bot commented Jan 8, 2025

变更概述

步骤说明

PanelContent 组件的变更主要涉及渲染输出的类名修改。主 <div> 元素的类名从 ${prefixCls}-content 更新为 ${prefixCls}-panel,同时相关的活动和非活动状态类名也进行了相应的更新。这些修改主要集中在类名的重命名上,未改变组件的核心功能和渲染逻辑。

变更

文件 变更摘要
src/PanelContent.tsx <div> 元素类名从 ${prefixCls}-content 更改为 ${prefixCls}-panel,活动和非活动状态类名也相应更新。
assets/index.less 类名 &-content 更改为 &-panel,确保样式一致性。
assets/motion.less 类名 @{prefixCls}-content-hidden 更改为 @{prefixCls}-panel-hidden
docs/examples/_util/motionUtil.ts leavedClassName'rc-collapse-content-hidden' 更改为 'rc-collapse-panel-hidden'
src/Panel.tsx leavedClassName${prefixCls}-content-hidden 更改为 ${prefixCls}-panel-hidden
tests/index.spec.tsx 测试用例中的类名从 rc-collapse-content 更改为 rc-collapse-panel,确保与新类名一致。

可能相关的 PR

兔子庆祝诗

🐰 类名轻舞变换间
代码如诗韵悠然
一字之差显智慧
重构路上兔子欢
样式优雅新生焕 🎉


📜 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 f60e0cb and 4c499a1.

📒 Files selected for processing (6)
  • assets/index.less (2 hunks)
  • assets/motion.less (1 hunks)
  • docs/examples/_util/motionUtil.ts (1 hunks)
  • src/Panel.tsx (1 hunks)
  • src/PanelContent.tsx (1 hunks)
  • tests/index.spec.tsx (14 hunks)
✅ Files skipped from review due to trivial changes (1)
  • assets/index.less
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/PanelContent.tsx
🔇 Additional comments (4)
docs/examples/_util/motionUtil.ts (1)

18-18: 类名更新符合新的命名约定

更改后的类名与组件其他部分保持一致,维持了良好的语义化命名。

src/Panel.tsx (1)

104-104: CSSMotion组件类名更新正确

使用模板字符串动态生成的类名保持了一致性,并正确使用了prefixCls变量。

tests/index.spec.tsx (1)

55-55: 测试用例已全面更新以适应新的类名

所有测试断言都已更新,确保了测试覆盖率的完整性。特别注意:

  1. 面板状态检查已更新
  2. 类名断言已调整
  3. DOM查询选择器已修改

Also applies to: 85-91, 162-167, 238-238, 258-260, 275-275, 286-291, 300-307, 325-328, 359-359, 373-373, 390-395, 423-428, 430-430, 435-438, 505-513

assets/motion.less (1)

8-10: 样式定义保持一致性

类名更新后的样式规则保持不变,确保了视觉效果的一致性。


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.12%. Comparing base (cc9da67) to head (4c499a1).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #359   +/-   ##
=======================================
  Coverage   99.12%   99.12%           
=======================================
  Files           5        5           
  Lines         114      114           
  Branches       43       43           
=======================================
  Hits          113      113           
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -35,13 +35,14 @@ const PanelContent = React.forwardRef<
ref={ref}
className={classnames(
`${prefixCls}-content`,
customizeClassNames?.content,
Copy link
Member

Choose a reason for hiding this comment

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

顺序不太对,应该全部都是:

  • section
    • header
      • title
      • extra
    • body
      • content
    • footer

@thinkasany thinkasany changed the title feat: add content for Semantic refactor: update content to panel Jan 8, 2025
@zombieJ zombieJ merged commit 748ae23 into react-component:master Jan 9, 2025
9 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 9, 2025
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