-
Notifications
You must be signed in to change notification settings - Fork 280
feat(pulltorefresh): v15 #2898
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(pulltorefresh): v15 #2898
Conversation
概述演练此拉取请求主要修改了 变更
可能相关的 PR
建议标签
诗歌
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #2898 +/- ##
===========================================
Coverage 85.97% 85.97%
===========================================
Files 273 277 +4
Lines 18492 18692 +200
Branches 2736 2769 +33
===========================================
+ Hits 15898 16070 +172
- Misses 2589 2617 +28
Partials 5 5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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 (5)
src/packages/pulltorefresh/demos/h5/demo1.tsx (1)
19-19
: 为下拉刷新展示 Lottie 动画
在renderIcon
中直接使用 Lottie,可减少状态分支逻辑并保持视觉统一。但需要注意动画文件大小与加载性能,确保在移动端仍能快速渲染。src/packages/pulltorefresh/demos/h5/demo2.tsx (2)
20-20
: 使用 whitePull 动画代替原有图标
在下拉刷新时提供更连贯的动画表现,但要注意在网络不佳环境下的加载情况,必要时可添加本地缓存机制。
31-31
: 更改文字颜色以配合深色背景
将字体设置为白色后,更易与深色背景区分。请确认与其它 UI 风格保持一致。src/packages/pulltorefresh/demos/taro/demo3.tsx (1)
26-26
: 使用 Lottie 展示拉动刷新动画
将两张图片合并为一段动画可统一用户体验,并减少条件渲染。但需要确保动画在 Taro 环境下正常播放。src/packages/pulltorefresh/demos/taro/demo1.tsx (1)
30-30
: 采用 Lottie 统一替换下拉刷新图标
在多端保持一致的交互动画,可提升用户对拉动书写的理解与视觉感受。确保该段动画文件大小合适,不影响页面加载性能。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/packages/pulltorefresh/demos/h5/demo1.tsx
(2 hunks)src/packages/pulltorefresh/demos/h5/demo2.tsx
(3 hunks)src/packages/pulltorefresh/demos/taro/demo1.tsx
(2 hunks)src/packages/pulltorefresh/demos/taro/demo3.tsx
(2 hunks)src/packages/pulltorefresh/pulltorefresh.scss
(1 hunks)src/packages/pulltorefresh/pulltorefresh.taro.tsx
(1 hunks)src/packages/pulltorefresh/pulltorefresh.tsx
(1 hunks)
🔇 Additional comments (9)
src/packages/pulltorefresh/demos/h5/demo1.tsx (1)
2-3
: 引入 Lottie 动画库增强界面交互效果
更换静态资源为 Lottie 动画能使下拉刷新动画更具流畅度与吸引力,同时保持与其他 demo 文件一致的实现方式。
src/packages/pulltorefresh/demos/h5/demo2.tsx (1)
2-3
: 新增对 Lottie 与 whitePull 资源的引入
与之前 demo 一致,更换为 Lottie 动画可统一交互体验并减少维护繁琐度。
src/packages/pulltorefresh/demos/taro/demo3.tsx (2)
2-3
: 导入 Taro 原生组件与 Lottie
与 H5 版本类似,引入 Lottie 可复用同样的动画资源,减少多端维护成本。
6-6
: 引入 lightPull 动画资源
通过统一的动画文件路径管理,可以便于后续维护或替换相应动画。
src/packages/pulltorefresh/demos/taro/demo1.tsx (2)
2-3
: 集成 Taro 组件与 PullToRefresh、Lottie
将原先的静态图标替换为 Lottie,减少手动管理各种拉动状态图标的复杂度。
6-6
: 追加 lightPull 动画文件
确保与其他 demo 中使用的动画文件名称及路径保持一致,避免后续出现维护混乱或不一致的问题。
src/packages/pulltorefresh/pulltorefresh.taro.tsx (1)
42-42
: 将 headHeight
从固定数值改为加法表达式后更灵活
本次变更将 headHeight
从 50
更新为 64 + 16
,相当于统一使用了 80
,让拉动区域更大,有利于增强用户体验。此调整在不同场景下适用性更高。
src/packages/pulltorefresh/pulltorefresh.tsx (1)
46-46
: 与 Taro 版本保持一致性
这里同样将 headHeight
从固定写死改为 64 + 16
,保证了与 Taro 端的 PullToRefresh
组件的默认值一致,增强了跨端一致性。
src/packages/pulltorefresh/pulltorefresh.scss (1)
12-12
: 颜色变量替换以提升可读性
将 .nut-pulltorefresh-head-content
的文字颜色从 $color-title
改为 $color-text-help
,有助于在主题或视觉层次区分上保持一致,也能在暗色/浅色主题之间拥有更灵活的适配。
@@ -43,7 +43,7 @@ const defaultProps = { | |||
completeText: '', | |||
completeDelay: 500, | |||
disabled: false, | |||
headHeight: 50, | |||
headHeight: 64 + 16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
旁边加个注释
Summary by CodeRabbit
新功能
样式调整
兼容性