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(pulltorefresh): 真机体验优化 #2905

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

oasis-cloud
Copy link
Collaborator

@oasis-cloud oasis-cloud commented Dec 30, 2024

不加 catchmove 的时候,拖动会出现页面一起被拉下来的情况

Summary by CodeRabbit

  • 包名和版本更新

    • 包名从 @nutui/nutui-react-taro 更改为 @dongdesign/components
    • 版本从 3.0.0-beta.10 降级到 3.0.0-beta.0
    • 移除了发布配置
  • 组件优化

    • Loading 组件的 Lottie 属性从 autoplay 更新为 autoPlay
    • Lottie 组件增加环境适配性,优化不同平台的 canvas 渲染
    • PullToRefresh 组件新增 catchMove 属性,改善触摸事件处理

Copy link

coderabbitai bot commented Dec 30, 2024

变更概述

概览

此次拉取请求涉及多个文件的修改,主要包括包配置、组件演示和组件实现。主要变更包括更新包名和版本、修改 Lottie 组件的环境渲染逻辑、调整 Loading 组件的属性,以及为 PullToRefresh 组件添加触摸事件处理。

变更

文件 变更摘要
package.json 包名从 @nutui/nutui-react-taro 更改为 @dongdesign/components,版本从 3.0.0-beta.10 更新到 3.0.0-beta.0,移除 publishConfig 配置
src/packages/loading/demos/taro/demo1.tsx lottiePropsautoplay 属性更改为 autoPlay
src/packages/lottie/mp.taro.tsx 引入 getEnv,根据环境条件调整 Canvas 渲染逻辑
src/packages/pulltorefresh/pulltorefresh.taro.tsx View 组件添加 catchMove 属性

可能相关的 PR

建议标签

3.x

建议审阅者

  • xiaoyatong

诗歌

🐰 代码跳跃,变更飞舞
组件重生,版本更新
兔子微笑,技术进化
开源之路,永不停歇!
🚀 代码的魔法,在此绽放


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 the 3.x label Dec 30, 2024
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)
package.json (1)

2-3: 包名和版本变更需同步更新文档

重命名为 @dongdesign/components 并修改版本号后,需确保项目文档、README 等同步更新;若在 CI/CD 发布流水线中依赖旧包名,也需要一并更新。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 04df7ef and 107cada.

📒 Files selected for processing (4)
  • package.json (2 hunks)
  • src/packages/loading/demos/taro/demo1.tsx (1 hunks)
  • src/packages/lottie/mp.taro.tsx (2 hunks)
  • src/packages/pulltorefresh/pulltorefresh.taro.tsx (1 hunks)
🔇 Additional comments (4)
src/packages/loading/demos/taro/demo1.tsx (1)

28-28: 注意 autoPlay 属性的兼容性

更名为 autoPlay 符合多数组件对属性大小写的约定,但请确认下游组件及第三方库对该写法的兼容性,确保不会影响动画正常播放。

src/packages/pulltorefresh/pulltorefresh.taro.tsx (1)

179-179: 添加 catchMove 属性以优化真机下的交互体验

catchMove 能有效防止在下拉刷新时页面整体被拖动,改善在真机上的使用体验;请确保不会影响到外层滚动区域,不然可能导致与父组件的滚动冲突。

src/packages/lottie/mp.taro.tsx (2)

4-4: 新增 getEnv 导入以判断运行环境

在 Taro 中通过 getEnv 判断环境是常见做法,可更好地兼容不同小程序平台与 H5 环境,做法合理。


85-106: 依据不同环境切换 <canvas> 属性

通过 getEnv() 判断平台并分别使用 canvasIdcanvas-id,以及相应的禁止滚动属性,是适配多平台的有效方案。请注意保持兼容性测试,避免合并后在特定平台出现绘制或滚动问题。

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui-react-taro",
"version": "3.0.0-beta.10",
"name": "@dongdesign/components",
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个先改回去~~

@pull-request-size pull-request-size bot added size/S and removed size/M labels Dec 31, 2024
Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.97%. Comparing base (04df7ef) to head (707e409).
Report is 4 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2905   +/-   ##
==========================================
  Coverage      85.97%   85.97%           
==========================================
  Files            277      277           
  Lines          18692    18692           
  Branches        2769     2769           
==========================================
  Hits           16070    16070           
  Misses          2617     2617           
  Partials           5        5           

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

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

Successfully merging this pull request may close these issues.

2 participants