Skip to content

Comments

fix: textarea 鸿蒙适配#3037

Merged
irisSong merged 1 commit intojdf2e:feat_v3.xfrom
xiaoyatong:fix-textarea-h-0303
Mar 4, 2025
Merged

fix: textarea 鸿蒙适配#3037
irisSong merged 1 commit intojdf2e:feat_v3.xfrom
xiaoyatong:fix-textarea-h-0303

Conversation

@xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented Mar 3, 2025

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 样式
    • 优化了错误信息和字符计数的展示方式,确保界面视觉效果的一致性。
  • 重构
    • 统一了多个平台演示组件的命名,简化了示例展示,同时保持现有功能不变。

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2025

Walkthrough

本次 PR 调整了文本区域组件的展示结构与命名。主要修改在于:将错误信息从 <h2> 元素切换为 <View> 组件,同时统一各 demo 文件中组件的命名(将 Demo1、Demo2、… 重命名为 Demo),更新了相应的函数声明和默认导出。另外,在 taro 版本的 textarea 组件中,将字符计数的展示元素由 Text 替换为 View,其业务逻辑均未发生变化。

Changes

文件 更改概要
src/packages/textarea/demo.taro.tsx 修改错误显示:将 <h2> 替换为 <View>,样式仍使用 h2 类名。
src/packages/textarea/demos/h5/demo1.tsx
...
src/packages/textarea/demos/h5/demo9.tsx
统一重命名 demo 组件:将组件名从 Demo1/2/3… 改为 Demo,更新函数声明与默认导出,部分文件去除不必要的片段包装。
src/packages/textarea/demos/taro/demo1.tsx
...
src/packages/textarea/demos/taro/demo9.tsx
统一重命名 taro demo 组件:将组件命名由 Demo1/2/3… 改为 Demo,更新函数声明与默认导出,简化部分组件结构。
src/packages/textarea/textarea.taro.tsx 替换字符计数显示组件:移除 @tarojs/components 中的 Text,改用 View 渲染字符计数,同时更新相关 import。

Suggested reviewers

  • irisSong

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 6697e45 and 65a55ba.

📒 Files selected for processing (20)
  • src/packages/textarea/demo.taro.tsx (1 hunks)
  • src/packages/textarea/demos/h5/demo1.tsx (2 hunks)
  • src/packages/textarea/demos/h5/demo2.tsx (1 hunks)
  • src/packages/textarea/demos/h5/demo3.tsx (1 hunks)
  • src/packages/textarea/demos/h5/demo4.tsx (1 hunks)
  • src/packages/textarea/demos/h5/demo5.tsx (2 hunks)
  • src/packages/textarea/demos/h5/demo6.tsx (1 hunks)
  • src/packages/textarea/demos/h5/demo7.tsx (1 hunks)
  • src/packages/textarea/demos/h5/demo8.tsx (2 hunks)
  • src/packages/textarea/demos/h5/demo9.tsx (1 hunks)
  • src/packages/textarea/demos/taro/demo1.tsx (2 hunks)
  • src/packages/textarea/demos/taro/demo2.tsx (1 hunks)
  • src/packages/textarea/demos/taro/demo3.tsx (1 hunks)
  • src/packages/textarea/demos/taro/demo4.tsx (1 hunks)
  • src/packages/textarea/demos/taro/demo5.tsx (2 hunks)
  • src/packages/textarea/demos/taro/demo6.tsx (1 hunks)
  • src/packages/textarea/demos/taro/demo7.tsx (1 hunks)
  • src/packages/textarea/demos/taro/demo8.tsx (2 hunks)
  • src/packages/textarea/demos/taro/demo9.tsx (1 hunks)
  • src/packages/textarea/textarea.taro.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (15)
  • src/packages/textarea/demo.taro.tsx
  • src/packages/textarea/demos/h5/demo9.tsx
  • src/packages/textarea/demos/h5/demo3.tsx
  • src/packages/textarea/demos/h5/demo5.tsx
  • src/packages/textarea/demos/h5/demo4.tsx
  • src/packages/textarea/demos/h5/demo8.tsx
  • src/packages/textarea/demos/taro/demo8.tsx
  • src/packages/textarea/demos/taro/demo3.tsx
  • src/packages/textarea/textarea.taro.tsx
  • src/packages/textarea/demos/taro/demo4.tsx
  • src/packages/textarea/demos/taro/demo1.tsx
  • src/packages/textarea/demos/taro/demo2.tsx
  • src/packages/textarea/demos/taro/demo9.tsx
  • src/packages/textarea/demos/h5/demo1.tsx
  • src/packages/textarea/demos/h5/demo2.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (6)
src/packages/textarea/demos/taro/demo5.tsx (1)

4-4: 组件命名更改为统一风格

将函数组件名从 Demo5 改为 Demo,保持了演示组件命名的一致性,有助于维护和理解代码库。这是一个很好的重构改进。

Also applies to: 15-15

src/packages/textarea/demos/h5/demo6.tsx (1)

4-5: 组件结构简化并统一命名

改动将函数组件从 Demo6 重命名为 Demo,并简化了组件结构,移除了不必要的 Fragment 包装。这提高了代码的清晰度和一致性。

Also applies to: 7-7

src/packages/textarea/demos/taro/demo6.tsx (1)

4-5: 统一命名和简化结构

这些变更与 H5 版本中的更改一致,将组件名从 Demo6 改为 Demo,并简化了 JSX 结构。保持 Taro 版本和 H5 版本的一致性是一个好习惯。

Also applies to: 7-7

src/packages/textarea/demos/taro/demo7.tsx (2)

4-4: 组件命名统一并改进格式

将函数组件从 Demo7 重命名为 Demo,使命名与其他演示组件保持一致。JSX 结构也进行了适当调整,保持了良好的缩进格式。

这些更改是 PR 中统一命名的一部分,有助于提高代码库的一致性和可维护性。

Also applies to: 6-11, 14-14


1-15: 关于 HarmonyOS 适配的疑问

PR 标题提到了"textarea 鸿蒙适配",但当前文件的更改主要是组件命名和结构优化。是否有其他未包含在此次审查中的代码变更直接解决了鸿蒙系统的适配问题?

src/packages/textarea/demos/h5/demo7.tsx (1)

4-14: 组件命名规范化和结构简化

我注意到你将组件名从 Demo7 改为了 Demo,并且移除了可能存在的 JSX 片段包装,直接返回 TextArea 组件。这样的标准化命名有助于保持代码的一致性,简化的结构也更加清晰。

你的修改与鸿蒙系统适配的关系是什么?是否这些看似简单的改动解决了鸿蒙系统上的特定渲染问题?

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
  • @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 action:review This PR needs more reviews (less than 2 approvals) label Mar 3, 2025
@xiaoyatong xiaoyatong requested a review from irisSong March 3, 2025 07:59
@github-actions github-actions bot added the 3.x Target branch 3.x label Mar 3, 2025
@codecov
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.05%. Comparing base (6697e45) to head (65a55ba).
Report is 1 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3037   +/-   ##
==========================================
  Coverage      86.05%   86.05%           
==========================================
  Files            281      281           
  Lines          18255    18255           
  Branches        2749     2749           
==========================================
  Hits           15709    15709           
  Misses          2541     2541           
  Partials           5        5           

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

@irisSong irisSong merged commit 827ab5c into jdf2e:feat_v3.x Mar 4, 2025
8 checks passed
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:review This PR needs more reviews (less than 2 approvals) size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants