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

chore: merge branch 'next' into 'dev-harmony' #2577

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Conversation

Alex-huxiyang
Copy link
Collaborator

@Alex-huxiyang Alex-huxiyang commented Sep 9, 2024

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 新功能

    • 新增 clickable 属性到 Cell 组件,提供点击样式反馈。
    • 新增 beforeUpload 函数,允许在文件上传前进行自定义逻辑处理。
    • 增强 PullToRefresh 组件,支持根据平台条件渲染内容。
    • 新增 Dialog 组件交互功能,提升弹窗组件的用户体验。
  • 错误修复

    • 修复 Uploader 组件的文件上传逻辑,确保在上传前正确处理文件。
    • 修复 Sticky 组件的样式更新逻辑,确保在属性变化时及时更新。
  • 文档

    • 更新文档,添加 clickablebeforeUpload 属性的描述,提升开发者使用体验。

Copy link

coderabbitai bot commented Sep 9, 2024

Walkthrough

此次更改涉及多个组件的改进,包括Uploader组件的beforeUpload功能的引入,允许在文件上传前进行自定义处理。此外,Cell组件增加了clickable属性,增强了用户交互体验。CHANGELOG.md文件更新了多个版本的变更记录,确保文档与最新代码保持一致。整体上,这些更改提升了组件的灵活性和可用性。

Changes

文件路径 更改摘要
.husky/commit-msg 移除shebang行和sourcing命令,仅保留commitlint命令。
CHANGELOG.md 更新v2.6.18和v2.6.17版本的变更记录,添加新功能和修复的描述。
package.json 更新多个依赖的版本,包括@nutui/icons-reactjscodeshift等。
src/packages/cell/cell.taro.tsx CellProps接口中添加clickable属性,修改渲染逻辑以支持可点击状态。
src/packages/cell/cell.scss 添加&-clickable类和&-clickable:active样式规则,增强可点击单元的样式。
src/packages/uploader/uploader.taro.tsx UploaderProps接口中添加beforeUpload回调函数,允许在文件上传前进行处理。
src/packages/uploader/uploader.tsx 简化disabled状态的控制流,确保在无有效文件时重置输入值。
src/packages/popup/demos/h5/demo7.tsx 引入新的对话框功能,增强用户交互。
src/packages/pulltorefresh/demo.taro.tsx 添加条件渲染逻辑,根据平台能力显示不同的演示组件。

Possibly related issues

Possibly related PRs

Poem

🐰 在草地上跳跃,快乐无比,
新功能来临,像春风拂面,
点击的单元,上传的梦,
一切变得更加灵动,
兔子欢呼,舞动着小脚,
代码更新,欢声笑语,
让我们一起庆祝,新的旅途开始! 🌼

Tip

New features:

  • Possibly related PRs: The walkthrough comment now includes a list of potentially related PRs to help you recall past context.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs in the walkthrough comment. You can also provide custom labeling instructions in the UI or configuration file.

Notes:

  • Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c5d5157 and 261b08e.

Files selected for processing (3)
  • src/packages/cell/cell.harmony.css (1 hunks)
  • src/packages/cell/cell.scss (1 hunks)
  • src/packages/cell/cell.taro.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/packages/cell/cell.scss
  • src/packages/cell/cell.taro.tsx
Additional comments not posted (3)
src/packages/cell/cell.harmony.css (3)

80-82: 审查通过:活跃状态的透明度设置

.nut-cell:active 的样式通过设置透明度为0.7来指示活跃状态,这是一种常见的UI反馈方式。此更改可以增强用户的交互体验。


83-85: 审查通过:可点击元素的光标设置

.nut-cell-clickable 的样式通过将光标更改为指针,清晰地标示了元素的可交互性。这是符合用户体验最佳实践的。


86-99: 审查通过:增强交互的伪元素样式

.nut-cell-clickable::before 的样式通过绝对定位和透明度设置为0的伪元素,为可能的动态视觉效果提供了基础。建议通过实际交互验证这些效果以确保其符合设计预期。

请运行以下脚本来验证交互效果:


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

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

Comment on lines +6 to +12
const [list] = useState([1, 2, 3, 4, 5, 6, 7])
const [show, SetShow] = useState(false)
const [toastMsg, SetToastMsg] = useState('')
const toastShow = (msg: any) => {
SetToastMsg(msg)
SetShow(true)
}
Copy link

Choose a reason for hiding this comment

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

建议修改状态设置函数的命名并验证事件处理逻辑。

状态设置函数 SetShowSetToastMsg 应遵循驼峰命名规则,建议改为 setShowsetToastMsg。同时,请确认事件处理逻辑符合 React 最佳实践。

Also applies to: 19-47

Comment on lines +472 to +482
if (beforeUpload) {
beforeUpload(new Array<File>().slice.call(_files)).then(
(f: Array<File> | boolean) => {
const _files: File[] = filterFiles(new Array<File>().slice.call(f))
if (!_files.length) res.tempFiles = []
readFile(_files)
}
)
} else {
readFile(_files)
}
Copy link

Choose a reason for hiding this comment

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

集成 beforeUpload 函数

beforeUpload 函数已被成功集成到 InternalUploader 组件中,允许在上传过程前执行自定义逻辑。请确保添加相应的单元测试来验证这一新功能的正确实现。

是否需要我帮助编写单元测试代码或在GitHub上跟踪此任务?

Also applies to: 489-499

@xiaoyatong xiaoyatong merged commit a41fd45 into dev-harmony Sep 9, 2024
@Alex-huxiyang Alex-huxiyang deleted the hxy/mergeNext branch October 25, 2024 10:09
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