Skip to content

refactor: cell组件新增iconSIze属性 - #1088

Closed
shiangchin wants to merge 1 commit into
Moonofweisheng:masterfrom
shiangchin:master
Closed

shiangchin wants to merge 1 commit into
Moonofweisheng:masterfrom
shiangchin:master

Conversation

@shiangchin

@shiangchin shiangchin commented May 31, 2025 •

Copy link
Copy Markdown

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • [x ] 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项。⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 新功能
    • Cell 组件新增 iconSize 属性,可自定义图标大小。
  • 文档
    • 更新 Cell 组件文档,补充 iconSize 属性说明。

@vercel

vercel Bot commented May 31, 2025 •

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2025 11:09am

@netlify

netlify Bot commented May 31, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2cf3e88
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/683ae30ef5d52c0008192af4
😎 Deploy Preview https://deploy-preview-1088--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented May 31, 2025 •

Copy link
Copy Markdown

Walkthrough

本次更改为 Cell 组件增加了 iconSize 属性,允许通过该属性动态设置左侧图标的大小。文档、类型定义和组件实现均已同步更新,确保 iconSize 能正确传递给内部的 <wd-icon> 组件。

Changes

文件/路径 变更摘要
docs/component/cell.md 在属性表中新增 iconSize 属性的文档说明
src/uni_modules/wot-design-uni/components/wd-cell/types.ts 在 cellProps 类型定义中新增 iconSize 属性
src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue 将 iconSize 作为 size 传递给 <wd-icon> 组件

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CellComponent
    participant IconComponent

    User->>CellComponent: 设置 iconSize 属性
    CellComponent->>IconComponent: 传递 size=iconSize
    IconComponent-->>CellComponent: 按指定大小渲染图标
Loading

Suggested reviewers

  • Moonofweisheng

Poem

🐰
小兔挥笔写新篇,
图标尺寸随心变。
代码一行轻松加,
文档同步不拖拉。
组件灵活更美观,
一起点赞乐开颜!

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@petercat-assistant

Copy link
Copy Markdown

Walkthrough

此PR为cell组件新增了iconSize属性,允许用户自定义图标的字体大小。此更改涉及文档更新、类型定义更新以及组件实现的修改。

Changes

文件 概要
docs/component/cell.md 添加了iconSize属性的文档说明。
src/uni_modules/wot-design-uni/components/wd-cell/types.ts 在类型定义中新增了iconSize属性,默认值为16。
src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue 修改了组件实现,支持通过iconSize属性设置图标大小。

/**
* 图标大小
*/
iconSize: makeNumericProp(16),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The iconSize property is introduced with a default value of 16. Ensure that this default value aligns with the design specifications and does not cause any unexpected UI issues.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.59%. Comparing base (1938d92) to head (2cf3e88).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1088      +/-   ##
==========================================
+ Coverage   84.94%   89.59%   +4.64%     
==========================================
  Files         215        8     -207     
  Lines       17191      221   -16970     
  Branches     2707       31    -2676     
==========================================
- Hits        14603      198   -14405     
+ Misses       2588       23    -2565     
Flag Coverage Δ
h5 89.59% <100.00%> (+4.64%) ⬆️
wd-action-sheet ?
wd-backtop ?
wd-badge ?
wd-button ?
wd-calendar ?
wd-calendar-view ?
wd-card ?
wd-cell 89.59% <100.00%> (+0.95%) ⬆️
wd-cell-group ?
wd-checkbox ?
wd-checkbox-group ?
wd-circle ?
wd-col-picker ?
wd-collapse ?
wd-config-provider ?
wd-count-down ?
wd-count-to ?
wd-curtain ?
wd-datetime-picker ?
wd-datetime-picker-view ?
wd-divider ?
wd-drop-menu ?
wd-fab ?
wd-floating-panel ?
wd-form ?
wd-gap ?
wd-grid ?
wd-grid-item ?
wd-icon ?
wd-img ?
wd-img-cropper ?
wd-index-anchor ?
wd-index-bar ?
wd-input ?
wd-input-number ?
wd-keyboard ?
wd-layout ?
wd-loading ?
wd-loadmore ?
wd-message-box ?
wd-navbar ?
wd-navbar-capsule ?
wd-notice-bar ?
wd-notify ?
wd-number-keyboard ?
wd-overlay ?
wd-pagination ?
wd-password-input ?
wd-picker ?
wd-picker-view ?
wd-popover ?
wd-popup ?
wd-progress ?
wd-radio ?
wd-radio-group ?
wd-rate ?
wd-resize ?
wd-search ?
wd-segmented ?
wd-select-picker ?
wd-sidebar ?
wd-signature ?
wd-skeleton ?
wd-slider ?
wd-sort-button ?
wd-status-tip ?
wd-step ?
wd-steps ?
wd-sticky ?
wd-sticky-box ?
wd-swipe-action ?
wd-swiper ?
wd-swiper-nav ?
wd-switch ?
wd-tabbar ?
wd-table ?
wd-tabs ?
wd-tag ?
wd-text ?
wd-textarea ?
wd-toast ?
wd-tooltip ?
wd-transition ?
wd-upload ?
wd-video-preview ?
wd-watermark ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 1938d92 and 2cf3e88.

📒 Files selected for processing (3)
  • docs/component/cell.md (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-cell/types.ts (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Components (wd-cell)
🔇 Additional comments (2)
src/uni_modules/wot-design-uni/components/wd-cell/types.ts (1)

20-23: 新增属性实现正确

iconSize 属性的定义遵循了现有代码模式,使用 makeNumericProp(16) 设置合理的默认值,JSDoc 注释格式规范。

src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue (1)

15-15: 属性绑定实现正确

正确地将 iconSize 属性绑定到 wd-icon 组件的 size 属性上,实现了图标大小的动态控制。

Comment thread docs/component/cell.md
| title | 标题 | string | - | - | - |
| value | 右侧内容 | string | - | - | - |
| icon | 图标类名 | string | - | - | - |
| iconSize | 图标的字体大小 | string | - | inherit | - |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

修复文档与实现的类型不一致问题

文档中描述的类型和默认值与实际实现不符:

  • 文档显示:类型 string,默认值 "inherit"
  • 实际实现:makeNumericProp(16),类型为 number|string,默认值 16

请修正文档以匹配实际实现:

-| iconSize    | 图标的字体大小                 | string  | -       | inherit | -       |
+| iconSize    | 图标的字体大小                 | number \| string  | -       | 16 | -       |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| iconSize | 图标的字体大小 | string | - | inherit | - |
| iconSize | 图标的字体大小 | number \| string | - | 16 | - |
🤖 Prompt for AI Agents
In docs/component/cell.md at line 246, the documented type and default value for
iconSize are incorrect. Update the type to "number|string" and the default value
to 16 to match the actual implementation using makeNumericProp(16).

This branch was successfully deployed

1 active deployment
Preview — 2cf3e888 Deployed May 31, 2025 by vercel[bot]
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