Skip to content

Conversation

@EmilyyyLiu
Copy link
Contributor

统一添加自定义class 前缀
关联issue #6960

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Preview is ready

@gemini-code-assist
Copy link

Summary of Changes

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

此拉取请求旨在增强 Ant Design Mobile 中 ListCheckList 相关组件的样式定制能力。通过引入统一的 prefixCls 机制,开发者现在可以更灵活地控制这些组件的 CSS 类名前缀,从而更好地集成到具有自定义主题或命名约定的项目中。这一改动提高了组件的可配置性和可维护性,同时确保了向后兼容性。

Highlights

  • 统一自定义类名前缀: 为 ListListItemCheckListCheckListItem 组件引入了统一的自定义 prefixCls 机制,允许开发者通过 ConfigProvider 或组件属性设置自定义类名前缀。
  • 移除硬编码的类名前缀: 移除了 CheckListItemCheckListListItemList 组件中硬编码的 classPrefix 常量,转而使用 useConfig 钩子动态获取类名前缀。
  • 扩展组件属性: 在 CheckListItemPropsCheckListPropsListItemPropsListProps 中添加了 prefixCls 属性,以支持组件级别的类名前缀定制。
  • 更新测试用例: 更新了 CheckListList 组件的测试用例,以验证 ConfigProvider 和组件属性设置的 prefixCls 能够正确生效,并覆盖了优先级逻辑。
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.

@dosubot dosubot bot added the feature label Oct 23, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

npm i https://pkg.pr.new/ant-design/ant-design-mobile/antd-mobile@6975

commit: 71c5fbd

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 introduces a unified approach to providing custom class prefixes for the CheckList and List components, enhancing styling flexibility and consistency. The changes involve modifying the CheckList, CheckListItem, and List components to utilize the useConfig hook for retrieving the class prefix, allowing for customization through the ConfigProvider. Additionally, the corresponding tests have been updated to ensure the correct application of the custom prefixes.

import classNames from 'classnames'
import { CheckListValue } from '.'

const classPrefix = `adm-check-list-item`

Choose a reason for hiding this comment

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

medium

This constant is no longer used after the changes and should be removed to avoid confusion and improve code clarity. It's important to remove dead code to maintain a clean and understandable codebase.

import { mergeProp } from '../../utils/with-default-props'
import { useConfig } from '../config-provider'

const classPrefix = `adm-list-item`

Choose a reason for hiding this comment

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

medium

This constant is no longer used after the changes and should be removed to avoid confusion and improve code clarity. It's important to remove dead code to maintain a clean and understandable codebase.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.95%. Comparing base (bfde19d) to head (71c5fbd).

Files with missing lines Patch % Lines
src/components/list/list-item.tsx 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           feature    #6975   +/-   ##
========================================
  Coverage    92.95%   92.95%           
========================================
  Files          337      337           
  Lines         7368     7372    +4     
  Branches      1871     1871           
========================================
+ Hits          6849     6853    +4     
- Misses         483      511   +28     
+ Partials        36        8   -28     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant