Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(progress): 四端适配 #2325

Merged
merged 27 commits into from
Aug 12, 2024
Merged

feat(progress): 四端适配 #2325

merged 27 commits into from
Aug 12, 2024

Conversation

Alex-huxiyang
Copy link
Collaborator

@Alex-huxiyang Alex-huxiyang commented Jun 6, 2024

  • 新特性提交

Summary by CodeRabbit

  • 新功能

    • 根据环境类型动态渲染组件,提升不同环境下的显示效果。
    • 引入新的工具函数以动态计算样式,增强组件的适应性和可维护性。
  • 修复

    • 调整了 Progress 组件的背景颜色默认值为 #FF0F23,修复了颜色配置问题。
  • 样式

    • 简化 Progress 组件的颜色表示,统一颜色和背景属性设置。
    • 更新了一些组件的布局和样式,优化了进度条组件的显示。
    • 新增 CSS 样式,提升视觉效果和布局一致性。
    • 新增 .nut-hoverbutton-item-container 组件的样式。
  • 重构

    • 移除了不必要的 Cell 组件包裹,简化了组件结构。
    • 改进了观察可见性变化的逻辑,增强了代码的可读性和性能。

src/packages/progress/demo.taro.tsx Outdated Show resolved Hide resolved
src/packages/progress/demos/taro/demo2.tsx Outdated Show resolved Hide resolved
src/packages/progress/progress.scss Outdated Show resolved Hide resolved
src/packages/progress/progress.taro.tsx Show resolved Hide resolved
Copy link

coderabbitai bot commented Jul 15, 2024

## Walkthrough

这次变更主要涉及对 `Progress` 组件及其相关 `demo` 文件的优化,简化了组件结构,移除了不必要的 `Cell` 容器,并增强了样式的动态适应性。根据不同环境展示不同的组件,更新了一些 CSS 样式,提升了视觉效果和代码的简洁性,同时更新了版本号,以反映这些显著的改进。此外,还对一个脚本进行了修改,指定了 Git 仓库的克隆地址。

## Changes

| 文件路径                                      | 变更摘要                                                      |
| --------------------------------------------- | ------------------------------------------------------------ |
| src/packages/progress/demo.taro.tsx          | 修改了组件的渲染逻辑,使用 `web()` 判断环境,简化代码结构,移除 `Cell` 导入。 |
| src/packages/progress/demo.tsx               | 移除了对 `Cell` 组件的使用,简化代码结构。                   |
| src/packages/progress/demos/taro/demo4.tsx  | 新增 `Cell` 包裹 `Progress` 组件,更新了图片源。                |
| src/packages/progress/demos/taro/demo7.tsx  | 增加条件渲染 `Toast` 组件,更新按钮样式,使用 `Text` 组件。   |
| src/packages/progress/progress.taro.tsx      | 更新组件结构,使用 Taro 的 `<View>` 组件,新增样式计算函数。  |
| src/config.json                               | 更新了 `Progress` 组件的版本号,从 `2.0.0` 改为 `3.0.0`|
| src/styles/variables.scss                     | 修改了 `$progress-color` 变量的值,改为固态颜色。              |
| src/styles/variables-jmapp.scss              | 修改了 `$progress-text-background` 变量的值。                    |
| scripts/harmony/clone-jdharmony.js           | 更新 `cloneJdHarmony` 函数中的 `remote` 变量,指定 Git 仓库。  |

## Poem

> 在代码行间游走,  
> 组件变化如潮涌。  
> 环境判断巧调度,  
> 风格简洁更出众。  
> CSS 色彩新调整,  
> 进度条上焕然新✨。

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

src/packages/progress/progress.scss Show resolved Hide resolved
src/packages/progress/progress.tsx Show resolved Hide resolved
src/packages/progress/progress.taro.tsx Outdated Show resolved Hide resolved
src/packages/progress/progress.taro.tsx Outdated Show resolved Hide resolved
src/packages/progress/demos/h5/demo6.tsx Outdated Show resolved Hide resolved
src/packages/progress/demos/taro/demo2.tsx Outdated Show resolved Hide resolved
src/packages/progress/demos/taro/demo6.tsx Show resolved Hide resolved
src/packages/progress/demos/taro/demo7.tsx Outdated Show resolved Hide resolved
src/packages/progress/progress.taro.tsx Outdated Show resolved Hide resolved
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: 0

Outside diff range, codebase verification and nitpick comments (1)
src/config.json (1)

1047-1047: 版本号不一致

src/config.json 文件中,Progress 组件的版本号已更新为 3.0.0,但在 scripts/properties.json 文件中仍然存在多个 2.0.0 版本的引用。请确保所有文件中的 Progress 组件版本号都更新为 3.0.0 以保持一致性。

  • scripts/properties.json 中的以下行需要更新:
    • "版本号": "2.0.0"
Analysis chain

版本号更新

Progress 组件的版本号从 2.0.0 更新到了 3.0.0。请确保所有相关文档和依赖项也同步更新,以避免版本不一致的问题。

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all references to the Progress component have been updated to version 3.0.0.

# Test: Search for the Progress component version. Expect: Only occurances of version 3.0.0.
rg --type json -A 5 $'"Progress"'

Length of output: 2522

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

Outside diff range, codebase verification and nitpick comments (1)
src/packages/image/image.harmony.css (1)

Line range hint 31-38:
更新 RTL 支持以反映新的类名。

RTL 支持更改应更新以反映新的类名,以保持一致性。

- [dir=rtl] .nut-image .nut-img-loading,
- .nut-rtl .nut-image .nut-img-loading {
+ [dir=rtl] .nut-image-loading,
+ .nut-rtl .nut-image-loading {
  left: auto;
  right: 0;
}
- [dir=rtl] .nut-image .nut-img-error,
- .nut-rtl .nut-image .nut-img-error {
+ [dir=rtl] .nut-image-error,
+ .nut-rtl .nut-image-error {
  left: auto;
  right: 0;
}

<Cell align="center">
<Progress percent={value} />
<span style={{ margin: '0 5px' }}>{value}%</span>
<View style={{ width: '90%', marginRight: pxTransform(5) }}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

为啥包一层

@@ -39,10 +39,12 @@
top: $progress-text-position-top;
bottom: $progress-text-position-bottom;
transition: all 0.4s;
transform: translate(-50%);
// transform: translate(-50%);
Copy link
Collaborator

Choose a reason for hiding this comment

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

去掉后看下其他端的影响~~
可以使用条件编译处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants