Skip to content

Conversation

@edokeh
Copy link
Contributor

@edokeh edokeh commented Oct 15, 2025

Summary by CodeRabbit

  • 新功能
    • 数字键盘“确认”按键支持多行文案显示,可保留换行以呈现更长或分段提示,提升交互表达能力。
  • 文档
    • 示例页新增演示条目,展示带有多行确认文案与隐藏关闭按钮的键盘用法,便于比较与测试不同交互。
  • 样式
    • 优化确认键文本的换行与布局处理,确保包含换行符的文案按预期分行显示并保持视觉一致性。

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Preview is ready

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 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

Walkthrough

本次变更在数字键盘示例中增加一个触发项与第二个键盘实例以演示多行确认文案,并在样式中为确认键添加 white-space: pre-line 以保留换行渲染(不改动导出声明)。

Changes

Cohort / File(s) Summary
Demo 增补:多行确认文案
src/components/number-keyboard/demos/demo1.tsx
调整导入顺序;新增一个 List.Item 用于触发名为 demo7 的示例;新增第二个 NumberKeyboard 实例(用于 demo7),设置 showCloseButton={false}confirmText: '先签约\n再转入' 来展示多行确认文案。
样式:确认键换行处理
src/components/number-keyboard/number-keyboard.less
为确认键样式增加 white-space: pre-line,使包含换行的确认文本按行渲染显示。

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as 用户
  participant List as Demo 列表
  participant NK as NumberKeyboard
  Note over User,List: 点击示例项以展示相应键盘
  User->>List: 点击 "demo7"
  List->>NK: 设置 visible = 'demo7'
  NK-->>User: 显示数字键盘(确认键文本支持多行)
  User->>NK: 输入并点击确认
  NK-->>List: 触发确认回调(携带输入)
  Note over NK: 确认键文本按 pre-line 保留换行
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • afc163
  • zombieJ

Poem

小兔敲键跑又停,
确认文案分两行。
先签约,随后转入,
pre-line 轻轻放行。
小改一处,界面欢欣 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 标题简洁地表明了本次变更的核心功能:让数字键盘的 confirmText 支持换行展示,准确且聚焦。
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 fe29068 and 7c6e0f1.

📒 Files selected for processing (1)
  • src/components/number-keyboard/demos/demo1.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/number-keyboard/demos/demo1.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: compressed-size
  • GitHub Check: build preview
  • GitHub Check: size
  • GitHub Check: check

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 @edokeh, 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!

此拉取请求引入了一项新功能,允许 NumberKeyboard 组件的确认按钮文本支持换行显示。通过在样式中添加 white-space: pre-line; 属性,并更新了演示文件以展示这一新功能,提升了组件在显示多行确认信息时的灵活性和用户体验。

Highlights

  • 数字键盘确认文本支持换行: 为数字键盘组件的 confirmText 属性增加了对换行符的支持,允许确认按钮的文本多行显示。
  • 样式更新: 在 number-keyboard.less 中为确认按钮添加了 white-space: pre-line; 样式,以正确渲染换行文本。
  • 新增演示示例: 在 demo1.tsx 中新增了一个演示示例,展示了 confirmText 如何使用换行符来创建多行文本。
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

此 PR 旨在为 NumberKeyboard 组件的 confirmText 属性添加换行支持。通过为确认按钮添加 white-space: pre-line; 样式,实现方式是正确的。然而,在演示文件中存在一个错误:新添加的 NumberKeyboard 实例使用了不正确的 visible 条件,导致它与现有键盘冲突,并且无法响应正确的触发事件。我已经对此提出了具体的修改建议。

@coderabbitai coderabbitai bot requested review from afc163 and zombieJ October 15, 2025 06:59
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 15, 2025

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

commit: 7c6e0f1

@coderabbitai coderabbitai bot added feature size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 15, 2025
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.95%. Comparing base (c55c5a3) to head (7c6e0f1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6957   +/-   ##
=======================================
  Coverage   92.95%   92.95%           
=======================================
  Files         337      337           
  Lines        7354     7354           
  Branches     1830     1866   +36     
=======================================
  Hits         6836     6836           
  Misses        510      510           
  Partials        8        8           

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

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 15, 2025
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 c55c5a3 and fe29068.

📒 Files selected for processing (2)
  • src/components/number-keyboard/demos/demo1.tsx (3 hunks)
  • src/components/number-keyboard/number-keyboard.less (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/number-keyboard/demos/demo1.tsx (2)
src/components/number-keyboard/number-keyboard.tsx (1)
  • NumberKeyboard (52-278)
src/components/number-keyboard/demos/demo2.tsx (1)
  • visible (5-58)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: compressed-size
  • GitHub Check: build preview
  • GitHub Check: check
  • GitHub Check: size
🔇 Additional comments (4)
src/components/number-keyboard/number-keyboard.less (1)

123-123: 变更合理,支持确认按钮多行文案展示。

添加 white-space: pre-line 可以正确保留换行符,使确认按钮支持多行文本展示。实现方式符合预期。

src/components/number-keyboard/demos/demo1.tsx (3)

1-3: 导入语句调整无问题。

导入语句的调整不影响功能,代码整洁度良好。


69-71: 新增演示项正常。

新增的列表项用于展示确认按钮文案换行功能,符合 PR 目标。


124-124: 注释说明很有帮助。

关于 JSX 中字符串字面量换行符处理的注释很实用,能帮助其他开发者避免常见错误。

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. size:S This PR changes 10-29 lines, ignoring generated files. labels Oct 15, 2025
onInput={actions.onInput}
onDelete={actions.onDelete}
showCloseButton={false}
confirmText={'先签约\n再转入'} // {'\n'} 可以而 '\n' 不行,后者会被转义为 '\\n'
Copy link
Member

Choose a reason for hiding this comment

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

confirmText 支持 ReactNode 吧,这样子直接:

confirmText={<div>...</div>}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哈哈哈考虑过,不过这样无障碍标签就没法弄了,又要新开 props

从最小变更角度这么改最好,而且我们目前业务需求上也只是想要文案换行,暂无更多复杂样式

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

Labels

feature size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants