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

fix: jdharmonycpp version and dd attribute are updated #2997

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

irisSong
Copy link
Collaborator

@irisSong irisSong commented Feb 17, 2025

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 杂项
    • 优化了依赖配置,移除了一些冗余设置,并升级了平台插件版本以提升系统稳定性和兼容性。
    • 调整了多个 UI 组件在文档中的展示设置,部分组件将不再显示,同时改善了布局组件的排序,提升了文档的清晰度。
    • 更新了按钮子元素的样式,确保文本不换行,从而改善结果页面的视觉呈现。
    • 在导航栏中新增了条件样式,以适应不同平台的布局需求。

Copy link

coderabbitai bot commented Feb 17, 2025

Walkthrough

该拉取请求对多个配置文件进行了调整。主要改动包括:

  • packages/nutui-taro-demo/config/index.js 中的 harmony 配置内移除 ohPackage 区块和其依赖;
  • packages/nutui-taro-demo/package.json 中升级 @jdtaro/plugin-platform-jdharmony-cpp 的版本;
  • src/config.json 中调整组件配置,重新排序 “布局组件” 中的 Col 组件,并将多个组件的 dd 属性从 true 修改为 false

Changes

文件 变更说明
packages/…/config/index.js 移除了 harmony 配置中 ohPackage 区块及其依赖定义
packages/…/package.json 将依赖 @jdtaro/plugin-platform-jdharmony-cpp 的版本从 0.1.4-alpha.3 更新为 0.1.22
src/config.json 在“布局组件”中移除后重新添加 Col 组件,同时将多个组件的 dd 属性从 true 改为 false
src/packages/cell/demos/taro/demo3.tsx 移除了 View 组件的 lineHeight 属性,新增 height 属性设置为 pxTransform(20)
src/packages/navbar/demos/taro/demo3.tsx 新增 harmony 函数以条件性地应用 View 组件的边距样式
src/packages/resultpage/resultpage.scss 新增样式规则 .nut-button-children 以防止文本换行

Possibly related PRs

Suggested reviewers

  • xiaoyatong
  • oasis-cloud

Poem

我是一只快乐的小兔,
代码森林里跳跃不停步,
删除冗余显得格外轻巧,
版本升级如春风拂面柔,
配置重组散发新奇光芒,
同伴们共庆丰收的快乐时光!
🐰🌟


📜 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 860df42 and db8f5ed.

📒 Files selected for processing (1)
  • src/config.json (15 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/config.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test
  • GitHub Check: build

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:

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

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. (Beta)
  • @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.

@github-actions github-actions bot added action:review This PR needs more reviews (less than 2 approvals) 3.x Target branch 3.x labels Feb 17, 2025
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.79%. Comparing base (cd48165) to head (db8f5ed).
Report is 8 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2997   +/-   ##
==========================================
  Coverage      85.79%   85.79%           
==========================================
  Files            281      281           
  Lines          18527    18527           
  Branches        2810     2810           
==========================================
  Hits           15896    15896           
  Misses          2626     2626           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

🧹 Nitpick comments (1)
src/config.json (1)

173-174: 格式调整:新增空白行

此处在“布局组件”包数组前增加了一行空白,用于增强文件的可读性,建议整个文件的格式保持一致。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cd48165 and 85e3871.

📒 Files selected for processing (3)
  • packages/nutui-taro-demo/config/index.js (0 hunks)
  • packages/nutui-taro-demo/package.json (1 hunks)
  • src/config.json (17 hunks)
💤 Files with no reviewable changes (1)
  • packages/nutui-taro-demo/config/index.js
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (17)
packages/nutui-taro-demo/package.json (1)

63-63: 更新依赖版本:@jdtaro/plugin-platform-jdharmony-cpp 升级至 0.1.22

该依赖版本已从 "0.1.4-alpha.3" 升级到 "0.1.22"。请确认新版本在项目中没有引入不兼容变化,并检查相关文档以了解新特性。

src/config.json (16)

226-237: 重新排序“Col”组件

在“布局组件”部分中,Col 组件被重新添加并定位在此处,请确认其排序和显示逻辑符合预期,同时检查是否需要更新该组件的 dd 属性(目前仍为 true)。


293-304: 更新 BackTop 组件的文档显示属性

BackTop 组件的 dd 属性已从原来的 true 修改为 false,这表示该组件将不会在文档中展示。请确认这符合设计需求。


305-316: 更新 Elevator 组件的文档显示属性

Elevator 组件的 dd 属性已修改为 false,确保该修改反映了组件在文档中不予展示的意图。


317-328: 更新 FixedNav 组件的文档显示属性

FixedNav 组件的 dd 属性已改为 false,如此设置符合隐藏该组件文档展示的需求,请确认无遗漏。


503-513: 更新 Calendar 组件的文档显示属性

在“数据录入”分组中,Calendar 组件的 dd 属性已从 true 修改为 false,建议核对该调整是否与后续文档管理策略一致。


695-705: 更新 PickerView 组件的文档显示属性

PickerView 组件的 dd 已更新为 false,表明该组件不再在组件文档中展示。请确认这种调整符合整体的组件展示策略。


733-744: 更新 Range 组件的文档显示属性

Range 组件的 dd 属性现设为 false,确保此变更与文档配置更新保持一致,建议审查所有数据录入组件的展示设置。


821-831: 更新 Uploader 组件的文档显示属性

Uploader 组件的 dd 已更新为 false,确保该组件在组件文档中隐藏符合业务需求。


915-927: 更新 InfiniteLoading 组件的文档显示属性

InfiniteLoading 组件的 dd 属性改为 false,这意味着自动加载组件在文档中不再显示。请确认这种隐藏行为符合预期。


965-977: 更新 Notify 组件的文档显示属性

Notify 组件的 dd 属性已从 true 调整为 false,请确认该修改是为了在文档中隐藏消息通知组件,并与其他反馈组件保持一致。


993-1004: 更新 PullToRefresh 组件的文档显示属性

PullToRefresh 组件的 dd 属性现设为 false,确保下拉刷新组件不显示在文档中,该调整符合整体的组件展示设置。


1005-1016: 更新 Skeleton 组件的文档显示属性

Skeleton 组件的 dd 属性已更新为 false,表明骨架屏组件不会在文档中展示,请确认这一改动符合设计要求。


1017-1028: 更新 Swipe 组件的文档显示属性

Swipe 组件的 dd 现已调整为 false,确保滑动手势组件不在文档中展示,该改动与其他组件的设置保持一致。


1204-1206: 更新 Lottie 组件的文档显示属性

在“展示组件”中,Lottie 组件的 dd 属性已修改为 false,确认该调整后组件将不在文档中展示。


1259-1268: 请确认 Step 组件的文档显示设置

Step 组件的 dd 属性依然为 true,虽然本次PR多数组件的 dd 属性均已更新为 false。请确认是否希望该组件继续在文档中显示,如果需要隐藏,建议调整为 false。


1271-1281: 请确认 Steps 组件的文档显示设置

Steps 组件的 dd 属性当前为 true,与多数组件的更新方向不同。请检查该设置是否符合组件展示的整体规划。

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

🧹 Nitpick comments (4)
src/packages/cell/demos/taro/demo3.tsx (3)

11-22: 标题部分样式调整建议

建议将重复使用的样式属性抽取为公共样式对象,以提高代码复用性和可维护性。

建议应用以下修改:

+const commonViewStyle = {
+  display: 'flex',
+  alignItems: 'center',
+  flexDirection: 'row',
+  height: pxTransform(20),
+}

const Demo3 = () => {
  return (
    <Cell
      title={
-        <View
-          style={{
-            display: 'flex',
-            alignItems: 'center',
-            flexDirection: 'row',
-            height: pxTransform(20),
-          }}
-        >
+        <View style={commonViewStyle}>

24-37: 描述部分样式优化建议

当前实现中,描述部分的样式与标题部分有重叠的属性。建议复用相同的样式属性,仅添加特定的样式差异。

建议按如下方式重构:

const Demo3 = () => {
+  const descriptionStyle = {
+    ...commonViewStyle,
+    fontSize: pxTransform(12),
+    color: '#505259',
+  }

  return (
    <Cell
      description={
-        <View
-          style={{
-            display: 'flex',
-            flexDirection: 'row',
-            alignItems: 'center',
-            fontSize: pxTransform(12),
-            color: '#505259',
-            height: pxTransform(20),
-          }}
-        >
+        <View style={descriptionStyle}>

34-36: 文本样式建议

建议将重复使用的文本样式提取为常量,以保持一致性。

建议应用以下修改:

+const textStyle = {
+  fontSize: pxTransform(12),
+}

+const highlightStyle = {
+  ...textStyle,
+  color: 'red',
+}

-          <Text style={{ color: 'red', fontSize: pxTransform(12) }}>1</Text>
+          <Text style={highlightStyle}>1</Text>
src/packages/navbar/demos/taro/demo3.tsx (1)

18-23: 考虑将重复的 View 组件抽象为可复用组件

当前的 View 组件实现在代码中重复出现。建议将其抽象为一个独立的组件以提高代码的可维护性。

建议如下重构:

+const EditButton = () => {
+  const marginStyle = harmony() ? { marginRight: 16 } : {}
+  return (
+    <View
+      onClick={(e) => Taro.showToast({ title: '编辑' })}
+      style={marginStyle}
+    >
+      编辑
+    </View>
+  )
+}

 const Demo3 = () => {
-  const marginStyle = harmony() ? { marginRight: 16 } : {}
   // ...
   right={
     <>
-      <View
-        onClick={(e) => Taro.showToast({ title: '编辑' })}
-        style={marginStyle}
-      >
-        编辑
-      </View>
+      <EditButton />
       <More onClick={(e) => Taro.showToast({ title: 'icon' })} />
     </>
   }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 85e3871 and 860df42.

📒 Files selected for processing (3)
  • src/packages/cell/demos/taro/demo3.tsx (2 hunks)
  • src/packages/navbar/demos/taro/demo3.tsx (2 hunks)
  • src/packages/resultpage/resultpage.scss (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (3)
src/packages/resultpage/resultpage.scss (1)

38-40: 建议:检查和完善新增的按钮子元素样式

新增加的 .nut-button-children 样式通过设置 white-space: nowrap 防止按钮内文本换行,有助于保持布局的一致性。请确认该修改符合整体设计要求,并建议对常用浏览器进行兼容性测试,以确保在所有环境下表现正常。

src/packages/navbar/demos/taro/demo3.tsx (2)

49-54: 重复实现,请参考上述重构建议

这里的实现与之前的 View 组件完全相同,进一步证实了需要将其抽象为可复用组件的必要性。


6-6:

❓ Verification inconclusive

平台特定样式的实现看起来不错!

代码逻辑清晰,通过 harmony() 函数优雅地处理了平台特定的样式需求。

建议验证 harmony() 函数在不同平台上的行为是否符合预期。可以运行以下脚本检查实现:

Also applies to: 11-11


🏁 Script executed:

#!/bin/bash
# 描述:检查 harmony 函数的实现
ast-grep --pattern 'export function harmony() {
  $$$
}'

Length of output: 58


平台特定样式验证建议

代码中通过 harmony() 实现的样式调整逻辑总体看起来没有问题,但当前自动检查未能捕捉到 harmony() 函数的具体实现,可能是因为该函数的定义方式采用了箭头函数或其他形式。请务必手动核查以下内容:

  • 确认 harmony() 的定义方式
    检查 @/utils/platform-taroharmony() 函数的具体实现,确保它确实按预期提供平台相关的逻辑判断。

  • 进一步验证建议
    建议运行如下命令,以搜索项目中所有可能的 harmony() 定义,帮助验证其实现形式:

    # 搜索项目中所有关于 harmony 定义的代码(支持 function 与箭头函数写法)
    rg -n -e 'export\s+(const|function)\s+harmony'

请根据检查结果确认 harmony() 函数是否满足不同平台的样式需求,并确保代码稳定可靠。

@github-actions github-actions bot added action:merge This PR has received sufficient approvals (2+ approvals) and is ready to merge and removed action:review This PR needs more reviews (less than 2 approvals) labels Feb 18, 2025
@oasis-cloud oasis-cloud merged commit 063c3aa into jdf2e:feat_v3.x Feb 18, 2025
8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 19, 2025
20 tasks
oasis-cloud pushed a commit to oasis-cloud/nutui-react that referenced this pull request Feb 20, 2025
* fix:  jdharmonycpp version and dd attribute are updated

* fix: modify component adaptation problems

* fix: steps 未适配
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Target branch 3.x action:merge This PR has received sufficient approvals (2+ approvals) and is ready to merge size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants