Skip to content

Conversation

@Arktomson
Copy link

@Arktomson Arktomson commented Sep 25, 2025

Summary by CodeRabbit

  • 新功能

    • 引导浮层的关闭按钮现支持自定义类名与内联样式,便于品牌化与主题定制,兼容现有前缀类。
    • 扩展可用样式语义名,新增 “close”(保留 “mask”),可精细化定制关闭元素外观,向后兼容运行逻辑。
  • 测试

    • 增加关闭按钮相关测试,验证类名、样式、可见性与无障碍属性在多步场景下的行为。

@vercel
Copy link

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tour Ready Ready Preview Comment Oct 1, 2025 2:00am

@coderabbitai
Copy link

coderabbitai bot commented Sep 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

在 DefaultPanel 的关闭按钮上新增对 tourClassNames?.closestyles?.close 的应用;在接口中为 SemanticName 类型新增成员 'close';测试扩展以覆盖关闭按钮的类名、内联样式与可见性断言。无运行时控制流变更。

Changes

Cohort / File(s) Summary of Changes
关闭按钮样式钩子扩展
src/TourStep/DefaultPanel.tsx
关闭按钮由仅使用静态类名 ${prefixCls}-close 改为合成 className(包含可选的 tourClassNames?.close)并支持内联样式 styles?.close
类型:语义名扩展
src/interface.ts
扩展导出类型 SemanticName,新增成员 'close'(保留 'mask'),以允许为关闭按钮提供语义化 className/style。无运行时逻辑更改。
测试:关闭 UI 覆盖
tests/index.test.tsx
增加测试以验证关闭元素的存在、类名与样式传播(包含全局与 per-step 的 closeIcon 行为),并添加对应的查询与断言。仅测试扩展,无业务逻辑更改。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • zombieJ

Poem

我是小兔去巡视,
关钮披新衣笑意稠,
class 与 style 手牵手,
语义一加世界柔,
咔嚓关上梦更悠。 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 标题“feat: adapt semantic close”直接对应了此次合并请求的主要改动,即为关闭按钮引入语义化名称支持并更新组件与测试,准确概括了变更的核心内容。
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 5ab8cb8 and 33d8e86.

📒 Files selected for processing (1)
  • src/TourStep/DefaultPanel.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/TourStep/DefaultPanel.tsx

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Arktomson, 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!

This pull request enhances the customization options for the close button within tour steps. It introduces the ability to apply custom CSS classes and inline styles directly to the close button, and formally recognizes 'close' as a semantic element. This change provides developers with more control over the appearance and behavior of the tour step's close functionality.

Highlights

  • Close Button Customization: The close button in the DefaultPanel component now supports custom class names and inline styles, allowing for greater visual flexibility.
  • Semantic Recognition: The SemanticName type has been extended to include 'close', enabling semantic identification and potential targeting of the close button within the tour step.
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

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

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly adds support for semantic styling of the close button, allowing className and style customization. The implementation is consistent with existing patterns in the codebase. My main feedback is to add test coverage for this new feature to ensure its correctness and prevent future regressions.

Comment on lines 44 to 45
className={classNames(`${prefixCls}-close`, tourClassNames?.close)}
style={styles?.close}

Choose a reason for hiding this comment

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

medium

While the implementation for applying custom className and style to the close button is correct, this pull request is missing corresponding tests to verify the new functionality. Please add a test case to ensure that tourClassNames.close and styles.close are applied as expected. You could extend the existing 'support custom styles' test in tests/index.test.tsx for this.

@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.07%. Comparing base (c25065a) to head (33d8e86).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files          10       10           
  Lines         217      217           
  Branches       97       98    +1     
=======================================
  Hits          215      215           
  Misses          2        2           

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

@Arktomson
Copy link
Author

Arktomson commented Sep 27, 2025 via email

@li-jia-nan
Copy link
Member

同步一下上游分支

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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57c5573 and 5ab8cb8.

📒 Files selected for processing (1)
  • src/TourStep/DefaultPanel.tsx (1 hunks)

@li-jia-nan
Copy link
Member

同步一下上游分支吧

@vercel
Copy link

vercel bot commented Oct 9, 2025

@Arktomson is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@Arktomson
Copy link
Author

@coding-ice 合一下不

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.

3 participants