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(pulltorefresh): 适配鸿蒙、RN、小程序、H5; RN scrollview 默认事件无法阻止 #2342

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

oasis-cloud
Copy link
Collaborator

@oasis-cloud oasis-cloud commented Jun 11, 2024

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 新功能

    • 引入了一个新的组件名称数组,支持更好的模块化设计和重用。
    • 更新了下拉刷新组件的功能,增强了用户体验和响应能力。
  • 样式

    • 对下拉刷新组件的CSS样式进行了更新,增加了新的类以提升视觉效果和可读性。
  • 文档

    • 更新了版本号,反映了下拉刷新组件的重大改进。

Copy link

coderabbitai bot commented Jul 22, 2024

Warning

Rate limit exceeded

@oasis-cloud has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 7 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 75498ca and c0eea7d.

Walkthrough

这次更改涉及多个文件的结构和功能更新,主要目的是提升组件的模块化和可复用性。文件中引入了新的组件和样式,同时优化了现有组件的功能,尤其是在用户交互和响应性方面。整体来看,这些改动将提升应用的用户体验和代码的可维护性。

Changes

文件 更改摘要
.../taro/adapted.js 新增模块,导出组件名称数组,提升组件管理的模块化设计。
.../app.config.ts 修改defineAppConfig函数调用的格式,影响代码格式无其他功能变更。
.../pulltorefresh/index.config.ts 修改navigationBarTitleText中的标题文本格式,影响显示风格。
.../pulltorefresh/index.tsx 从简单的按钮导出转变为导出更复杂的Demo组件,增强功能。
.../config.json PullToRefresh组件的版本号从2.0.0更新至3.0.0,反映重大更新。
.../pulltorefresh/demo.taro.tsx 更换<div><ScrollView>,使用Taro组件增强可滚动内容的功能。
.../pulltorefresh/demos/taro/demo1.tsx 优化通知逻辑,使用Taro的showToast替代自定义状态管理,简化代码。
.../pulltorefresh/demos/taro/demo2.tsx 移除未使用的Toast组件引入,新增pxTransform工具函数提升响应布局。
.../pulltorefresh/demos/taro/demo3.tsx 集成Taro原生的toast通知系统,替换自定义实现,简化状态管理。
.../pulltorefresh/pulltorefresh.harmony.css 更新CSS样式,新增多个类以提升可视化效果。
.../pulltorefresh/pulltorefresh.scss 优化CSS选择器的结构,提高可读性和可维护性,增加状态文本样式。
.../pulltorefresh/pulltorefresh.taro.tsx 增强组件的触控事件响应,优化定时器管理和样式逻辑,提升性能和清晰度。
.../pulltorefresh/pulltorefresh.tsx 使用classNames工具优化条件渲染,提升组件的可读性和灵活性。
.../utils/typings.ts 新增Timeout类型别名,增强类型安全。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PullToRefresh
    
    User->>PullToRefresh: 触发下拉刷新
    PullToRefresh->>PullToRefresh: 显示加载状态
    PullToRefresh->>Taro: 调用showToast显示通知
    PullToRefresh->>User: 完成刷新,更新内容
Loading

兔子在草地上欢快地跳跃,
组件更新如春风拂面,
用户体验愈加美好,
代码清晰如晨曦初现。
兔子舞蹈,歌声悦耳,
新功能如花般绽放,
祝贺改动,繁荣昌盛! 🐇🌼


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.

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

@@ -0,0 +1 @@
exports = module.exports = ["cell","cellgroup","overlay","button","switch","countdown","empty","price","tag","layout","row","col","space","grid","griditem","divider","image","resultpage","notify","pagination","swiper","textarea","indicator","pulltorefresh"];
Copy link

Choose a reason for hiding this comment

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

避免重新赋值全局变量。

重新赋值全局变量会覆盖关键功能。建议使用 module.exports 直接导出数组。

- exports = module.exports = ["cell","cellgroup","overlay","button","switch","countdown","empty","price","tag","layout","row","col","space","grid","griditem","divider","image","resultpage","notify","pagination","swiper","textarea","indicator","pulltorefresh"];
+ module.exports = ["cell","cellgroup","overlay","button","switch","countdown","empty","price","tag","layout","row","col","space","grid","griditem","divider","image","resultpage","notify","pagination","swiper","textarea","indicator","pulltorefresh"];
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
exports = module.exports = ["cell","cellgroup","overlay","button","switch","countdown","empty","price","tag","layout","row","col","space","grid","griditem","divider","image","resultpage","notify","pagination","swiper","textarea","indicator","pulltorefresh"];
module.exports = ["cell","cellgroup","overlay","button","switch","countdown","empty","price","tag","layout","row","col","space","grid","griditem","divider","image","resultpage","notify","pagination","swiper","textarea","indicator","pulltorefresh"];
Tools
Biome

[error] 1-1: A global variable should not be reassigned.

Assigning to a global variable can override essential functionality.

(lint/suspicious/noGlobalAssign)

Copy link
Collaborator

@xiaoyatong xiaoyatong left a comment

Choose a reason for hiding this comment

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

taro h5 下 第一个demo表现:
image

# Conflicts:
#	packages/nutui-taro-demo-rn/scripts/taro/adapted.js
#	packages/nutui-taro-demo-rn/src/app.config.ts
#	src/utils/use-touch.ts
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