Skip to content

feat: ✨ 将 Tabbar 和 Badge 设置为标准盒子模型#1036

Merged
Moonofweisheng merged 1 commit intomasterfrom
fix/tabbar-box-model
May 6, 2025
Merged

feat: ✨ 将 Tabbar 和 Badge 设置为标准盒子模型#1036
Moonofweisheng merged 1 commit intomasterfrom
fix/tabbar-box-model

Conversation

@Moonofweisheng
Copy link
Copy Markdown
Owner

@Moonofweisheng Moonofweisheng commented May 6, 2025

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

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

🔗 相关 Issue

#705 #536

💡 需求背景和解决方案

将 Tabbar 和 Badge 设置为标准盒子模型

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

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

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

Summary by CodeRabbit

  • 样式

    • 优化了深色主题下徽章和标签栏组件的 box-sizing 样式,提升了显示效果和一致性。
  • 杂项

    • 移除了部分开发依赖项(npm-run-all 和 puppeteer)。
    • 规范了 TypeScript 类型导入语法,使类型导入更清晰。
    • 更新了 ESLint 配置,增强了类型导入一致性规则。

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying wot-design-uni with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2f53145
Status: ✅  Deploy successful!
Preview URL: https://75f4f1ae.wot-design-uni.pages.dev
Branch Preview URL: https://fix-tabbar-box-model.wot-design-uni.pages.dev

View logs

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2025

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 6, 2025 2:05pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2025

Walkthrough

本次变更主要涉及前端项目的代码风格和样式优化。更新了 ESLint 配置以强制类型导入一致性,移除了部分开发依赖,调整了部分 TypeScript 类型导入语法,并在若干 SCSS 文件中为特定元素添加了 box-sizing: content-box; 样式,以优化组件的布局表现。

Changes

文件或文件组 变更摘要
.eslintrc.js 新增 @typescript-eslint/consistent-type-imports 规则,调整文件头注释和路径格式。
package.json 移除了 npm-run-allpuppeteer 两个开发依赖。
src/env.d.ts
src/pages/configProvider/Index.vue
类型导入语法改为 import type,明确仅用作类型用途。
src/uni_modules/wot-design-uni/components/wd-badge/index.scss .wot-theme-dark .badge__content 增加 box-sizing: content-box;,优化内容盒模型。
src/uni_modules/wot-design-uni/components/wd-tabbar/index.scss .wot-theme-dark .tabbar__placeholder.tabbar--default.tabbar--fixed.tabbar--safe 增加 box-sizing: content-box;

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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2025

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit 2f53145
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/681a173e1b67ae0008f3ac32
😎 Deploy Preview https://deploy-preview-1036--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 site configuration.

@petercat-assistant
Copy link
Copy Markdown

Walkthrough

此PR将Tabbar和Badge组件设置为标准盒子模型,调整了相关样式以确保一致性。此外,更新了TypeScript的导入方式以提高代码一致性。

Changes

文件 概要
.eslintrc.js 添加了@typescript-eslint/consistent-type-imports规则以确保一致的类型导入风格。
package.json, pnpm-lock.yaml 移除了不必要的依赖项npm-run-allpuppeteer
src/env.d.ts, src/pages/configProvider/Index.vue 更新了TypeScript导入语法为type导入。
src/uni_modules/wot-design-uni/components/wd-badge/index.scss, src/uni_modules/wot-design-uni/components/wd-tabbar/index.scss box-sizing设置为content-box以实现标准盒子模型。


@include e(content) {
display: inline-block;
box-sizing: content-box;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ensure that setting box-sizing: content-box; does not break existing layout expectations, as this change can affect the sizing of elements.

height: $-tabbar-height;

@include e(placeholder) {
box-sizing: content-box;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ensure that setting box-sizing: content-box; does not break existing layout expectations, as this change can affect the sizing of elements.


@include when(fixed) {
@include when(safe) {
box-sizing: content-box;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ensure that setting box-sizing: content-box; does not break existing layout expectations, as this change can affect the sizing of elements.

Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (4)
.eslintrc.js (1)

40-40: 确认禁用多单词组件名称规则
已将 vue/multi-word-component-names 全局关闭。若仅在部分目录需要关闭,建议使用注释或覆盖配置以免影响整个项目。

src/uni_modules/wot-design-uni/components/wd-badge/index.scss (1)

20-20: 建议添加注释说明此处覆写 box-sizing

box-sizing: content-box 是浏览器的默认值,仅当全局样式将盒模型统一设为 border-box 时才需要显式覆盖。建议在此处添加注释,说明为什么要强制将盒模型设置为 content-box,以便后续维护时能快速理解此处覆写的原因。

src/uni_modules/wot-design-uni/components/wd-tabbar/index.scss (2)

19-19: 建议添加注释说明此处覆写 box-sizing

.tabbar__placeholder 中显式设置 box-sizing: content-box 目的是覆盖项目全局可能的 border-box 配置。请在此处补充注释,说明为何要覆写盒模型,以提升样式可读性和可维护性。


43-43: 建议添加注释说明此处覆写 box-sizing

.tabbar--defaultfixed + safe 情况下再次覆写 box-sizing,建议补充注释解释此处覆盖的必要性,避免后续修改时误删该声明。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 901c754 and 2f53145.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .eslintrc.js (2 hunks)
  • package.json (0 hunks)
  • src/env.d.ts (1 hunks)
  • src/pages/configProvider/Index.vue (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-badge/index.scss (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-tabbar/index.scss (2 hunks)
💤 Files with no reviewable changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Redirect rules - wot-design-uni
  • GitHub Check: Header rules - wot-design-uni
  • GitHub Check: Pages changed - wot-design-uni
  • GitHub Check: ESLint Check
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
.eslintrc.js (2)

4-7: 此处仅为头部注释更新,无需更改。


41-48: 启用一致的类型导入
新增的 @typescript-eslint/consistent-type-imports 规则可显著提高类型导入的一致性,并结合 inline-type-imports 便于自动修复。

src/pages/configProvider/Index.vue (1)

124-124: 使用 type 关键字进行类型导入
已将 Action 标记为类型导入,符合新的 ESLint 配置,建议同步更新其余纯类型导入至该风格以保持一致。

src/env.d.ts (1)

13-13: 统一类型导入 DefineComponent
DefineComponent 改为类型导入语法,确保与 ESLint consistent-type-imports 规则一致,提升可读性和维护性。

@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 91.05%. Comparing base (901c754) to head (2f53145).

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1036      +/-   ##
==========================================
+ Coverage   84.83%   91.05%   +6.21%     
==========================================
  Files         215       10     -205     
  Lines       17277      380   -16897     
  Branches     2747       61    -2686     
==========================================
- Hits        14657      346   -14311     
+ Misses       2620       34    -2586     
Flag Coverage Δ
h5 91.05% <ø> (+6.21%) ⬆️
wd-action-sheet ?
wd-backtop ?
wd-badge 100.00% <ø> (ø)
wd-button ?
wd-calendar ?
wd-calendar-view ?
wd-card ?
wd-cell ?
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 89.21% <ø> (ø)
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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2025

组件测试摘要 (H5 平台)

测试时间: Tue May 6 14:08:29 UTC 2025

测试结果

组件 状态 覆盖率
wd-badge ✅ 通过 100%
wd-tabbar ✅ 通过 88.94%

@Moonofweisheng Moonofweisheng merged commit 7f2ccb2 into master May 6, 2025
13 checks passed
@Moonofweisheng Moonofweisheng deleted the fix/tabbar-box-model branch May 6, 2025 14:09
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