Skip to content

Conversation

@zombieJ
Copy link
Member

@zombieJ zombieJ commented May 20, 2025

follow ant-design/ant-design#53328 to move to titlePlacement.

Summary by CodeRabbit

  • 文档
    • 更新了 Steps 组件的 API 文档,将属性名从 labelPlacement 更正为 titlePlacement。
  • 新特性
    • Steps 组件的属性名由 labelPlacement 改为 titlePlacement,用于控制步骤标题的排列方式。
  • 测试
    • 测试用例同步更新为使用 titlePlacement 属性,确保与组件属性一致。

@vercel
Copy link

vercel bot commented May 20, 2025

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

Name Status Preview Comments Updated (UTC)
steps ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2025 9:03am

@coderabbitai
Copy link

coderabbitai bot commented May 20, 2025

Walkthrough

本次更改将 Steps 组件相关的 prop 名称从 labelPlacement 统一更正为 titlePlacement,涉及文档、示例、组件实现和测试用例。原有的类型、默认值及逻辑未变,仅变量和属性名发生了调整,以准确反映 prop 的实际用途。

Changes

文件/路径 变更摘要
README.md 将 Steps 组件 API 文档中的 labelPlacement 更正为 titlePlacement。
docs/examples/alternativeLabel.jsx 示例代码中 prop 名称由 labelPlacement 改为 titlePlacement。
src/Steps.tsx StepsProps 接口、默认参数、内部变量及 CSS 类名相关的 labelPlacement 全部更名为 titlePlacement,逻辑不变。
tests/index.test.tsx 测试用例中 prop 及测试名由 labelPlacement 改为 titlePlacement,测试逻辑不变。

Poem

🐇
步骤标题换新装,
labelPlacement 说再见,
titlePlacement 站前方。
文档示例齐更新,
测试验证更名忙。
兔子挥笔庆一场!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/examples/alternativeLabel.jsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

src/Steps.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

tests/index.test.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 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 cf45dbb and a9360d8.

⛔ Files ignored due to path filters (1)
  • tests/__snapshots__/index.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • README.md (1 hunks)
  • docs/examples/alternativeLabel.jsx (1 hunks)
  • src/Steps.tsx (3 hunks)
  • tests/index.test.tsx (1 hunks)
🔇 Additional comments (7)
src/Steps.tsx (4)

58-58: 命名更改充分反映了属性的实际用途

labelPlacement 更改为 titlePlacement 更准确地表达了此属性的用途,因为它控制的是步骤标题的布局方式,而不是标签。这种更改使代码更加清晰和直观。


85-85: 参数解构中的默认值已正确更新

函数参数解构中的默认值保持为 'horizontal',与原来的行为一致,确保了API兼容性和预期行为。


105-106: 内部变量命名已同步更新

内部变量 mergeTitlePlacement 的命名和逻辑已与新的属性名称保持一致,同时保留了原有的条件判断逻辑,确保功能不变。


112-112: CSS类名已正确更新

CSS类名从 -label- 更改为 -title-,与属性名称变更保持一致,确保样式选择器正常工作。这种统一的命名方式有助于维护代码的一致性。

README.md (1)

87-87: 文档中的属性名称已正确更新

README文档中的属性名称已从 labelPlacement 更新为 titlePlacement,保持了属性的类型和描述不变,确保用户文档与代码实现保持一致。

docs/examples/alternativeLabel.jsx (1)

11-11: 示例代码中的属性名称已正确更新

示例代码中的属性名称已从 labelPlacement="vertical" 更新为 titlePlacement="vertical",确保示例能正确展示组件的用法。

tests/index.test.tsx (1)

55-57: 测试用例已同步更新属性名称

测试用例名称和测试内容已从 labelPlacement 更新为 titlePlacement,保证测试用例能正确验证组件的行为。这确保了代码修改后测试覆盖率不受影响。

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch titlePlacement
  • Post Copyable Unit Tests in Comment

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.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests 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.

@codecov
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cf45dbb) to head (a9360d8).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #373   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           73        73           
  Branches        31        30    -1     
=========================================
  Hits            73        73           

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

@zombieJ zombieJ merged commit 0dbccec into master May 20, 2025
13 checks passed
@zombieJ zombieJ deleted the titlePlacement branch May 20, 2025 09:20
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.

1 participant