Skip to content

refactor: all use rail #305

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

Merged
merged 3 commits into from
Apr 17, 2025
Merged

refactor: all use rail #305

merged 3 commits into from
Apr 17, 2025

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Apr 17, 2025

Summary by CodeRabbit

  • 文档

    • 更新了 README 和示例文档,将进度条相关属性名由 trailColor/trailWidth 统一更名为 railColor/railWidth,并调整了描述说明。
  • 新特性

    • 进度条组件属性由 trailColor/trailWidth 更名为 railColor/railWidth,接口更清晰统一。
  • 测试

    • 测试用例同步更新,确保与新属性名 railColor/railWidth 保持一致。

Copy link

vercel bot commented Apr 17, 2025

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

Name Status Preview Comments Updated (UTC)
progress ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2025 6:41am

Copy link

coderabbitai bot commented Apr 17, 2025

Walkthrough

本次变更统一将进度条相关属性中的“trail”重命名为“rail”,涉及属性名、描述、CSS 类名、变量名及相关文档。具体包括组件 CircleLine 的属性 trailWidth/trailColor 重命名为 railWidth/railColor,接口定义、默认属性、测试用例和文档说明同步更新。所有变更仅为命名调整,无任何业务逻辑或功能上的修改。

Changes

文件/路径 变更摘要
README.md 进度条 API 属性表中的 trailWidth/trailColor 改为 railWidth/railColor,并同步描述。
docs/examples/gap.tsx 示例代码中 trailWidth 属性更名为 railWidth
src/Circle/index.tsx 组件属性、变量、CSS 类名等从 trail* 改为 rail*
src/Line.tsx 组件属性、变量、CSS 类名等从 trail* 改为 rail*
src/common.ts defaultPropstrail* 属性名更名为 rail*
src/interface.ts ProgressProps 接口中 trail* 属性更名为 rail*
tests/index.spec.js 测试用例中 trailColor 属性更名为 railColor
tests/semantic.spec.tsx 测试断言 CSS 类名由 -trail 改为 -rail

Poem

🐰
rail 替 trail,名字焕新颜,
圆圈与直线,都换了新装扮。
代码文档测试,齐步走向前,
小兔挥挥手,进度条更规范!

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 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 85f59c5 and 6130b25.

📒 Files selected for processing (1)
  • README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • README.md

🪧 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.
  • @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 Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.38%. Comparing base (9b7899e) to head (6130b25).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #305   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files           7        7           
  Lines         162      162           
  Branches       51       50    -1     
=======================================
  Hits          161      161           
  Misses          1        1           

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

README.md Outdated
@@ -83,16 +83,16 @@ export default () => (
<td>Stroke color.</td>
</tr>
<tr>
<td>trailWidth</td>
<td>rrailWidth</td>

Choose a reason for hiding this comment

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

Suggested change
<td>rrailWidth</td>
<td>railWidth</td>

README.md Outdated
<td>Number</td>
<td>1</td>
<td>Width of the trail stroke. Unit is percentage of SVG canvas size. Trail is always centered relative to actual progress path. If trailWidth is not defined, it is the same as strokeWidth.</td>
<td>Width of the rrail stroke. Unit is percentage of SVG canvas size. Rail is always centered relative to actual progress path. If railWidth is not defined, it is the same as strokeWidth.</td>

Choose a reason for hiding this comment

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

Suggested change
<td>Width of the rrail stroke. Unit is percentage of SVG canvas size. Rail is always centered relative to actual progress path. If railWidth is not defined, it is the same as strokeWidth.</td>
<td>Width of the rail stroke. Unit is percentage of SVG canvas size. Rail is always centered relative to actual progress path. If railWidth is not defined, it is the same as strokeWidth.</td>

Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b7899e and 85f59c5.

⛔ Files ignored due to path filters (2)
  • tests/__snapshots__/conic.spec.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/index.spec.js.snap is excluded by !**/*.snap
📒 Files selected for processing (8)
  • README.md (1 hunks)
  • docs/examples/gap.tsx (1 hunks)
  • src/Circle/index.tsx (4 hunks)
  • src/Line.tsx (2 hunks)
  • src/common.ts (1 hunks)
  • src/interface.ts (1 hunks)
  • tests/index.spec.js (3 hunks)
  • tests/semantic.spec.tsx (1 hunks)
🔇 Additional comments (16)
docs/examples/gap.tsx (1)

82-82: 属性名称更新符合项目重构目标

trailWidth 修改为 railWidth 与当前 PR 的重构目标一致,统一了 Circle 组件中与进度条相关属性的命名约定。

tests/semantic.spec.tsx (1)

29-29: CSS 选择器更新正确

将测试中的 CSS 选择器从 .rc-progress-circle-trail 更新为 .rc-progress-circle-rail,与组件类名的重命名保持一致。

tests/index.spec.js (3)

182-182: 属性名称统一更新

trailColor 更新为 railColor,符合当前重构中的命名规范统一。


202-202: 属性名称统一更新

trailColor 更新为 railColor,符合当前重构中的命名规范统一。


218-218: 属性名称统一更新

trailColor 更新为 railColor,符合当前重构中的命名规范统一。

src/interface.ts (2)

6-6: 接口属性名称更新

ProgressProps 接口中的 trailWidth 属性重命名为 railWidth,保持了命名的一致性。


12-12: 接口属性名称更新

ProgressProps 接口中的 trailColor 属性重命名为 railColor,保持了命名的一致性。

src/common.ts (1)

10-11: 变量命名更新符合设计意图

trailColortrailWidth 重命名为 railColorrailWidth 的修改统一了进度条背景部分的命名规范,使术语更加一致,有助于提高代码可读性。

src/Line.tsx (3)

18-19: props 解构中的命名更改

trailColortrailWidth 重命名为 railColorrailWidth,与整体重命名策略保持一致。


60-60: CSS 类名一致性更新

将类名从 ${prefixCls}-line-trail 更改为 ${prefixCls}-line-rail,确保了 CSS 类名与属性命名保持一致。


63-64: 更新 SVG 属性使用新命名

将 SVG 路径属性中的 stroke={trailColor}strokeWidth={trailWidth || strokeWidth} 更新为 stroke={railColor}strokeWidth={railWidth || strokeWidth},确保了整个组件中命名的一致性。

README.md (1)

92-95: 属性名和描述更新

trailColor 更新为 railColor 并相应地更新了描述文本,保持了文档与代码的一致性。

src/Circle/index.tsx (4)

23-26: 组件 props 解构中的命名更改

trailWidthtrailColor 重命名为 railWidthrailColor,与整体重命名策略保持一致。


71-71: 更新函数参数使用新命名

getCircleStyle 函数调用中的参数 trailColor 更新为 railColor,确保了函数调用与函数定义的一致性。


132-132: 更新条件表达式使用新命名

在条件表达式中将 trailColor 更新为 railColor,保持代码一致性。


184-190: 更新 SVG 圆形元素的类名和属性

这段代码完成了三处更改:

  1. 将类名从 ${prefixCls}-circle-trail 更新为 ${prefixCls}-circle-rail
  2. stroke={trailColor} 更新为 stroke={railColor}
  3. strokeWidth={trailWidth || strokeWidth} 更新为 strokeWidth={railWidth || strokeWidth}

所有更改都保持了命名的一致性。

@zombieJ zombieJ merged commit 2cd1135 into master Apr 17, 2025
10 checks passed
@zombieJ zombieJ deleted the rail branch April 17, 2025 06:44
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