Merged
docs: upgrade README and README_en to v0.4.2 template #24
docs: upgrade README and README_en to v0.4.2 template #24
Merged
gbwAdd on 5 days ago
gbw
gbw
5 days ago

变更类型

请在对应类型(请勿多选)前打 √,仅可选择一项:

变更内容

  • 简要描述本次变更的具体内容、解决的问题;
  • 若为破坏性变更,请详细说明:
    • 影响范围(哪些 API/配置/功能被修改);
    • 用户适配方案(旧版→新版的替换步骤)

本 PR 为纯文档变更,无破坏性变更。

修改说明

按 CPF-RN usage-docs 库 v0.4.2 模板(2026-11 现行模板口径),将 master 分支 README.md 升级为 v0.4.2 完整版结构,并新建 README_en.md,中英双语同步。

主要修改

  1. 模板版本行:原 master README.md 为上游原版 README,重写为 v0.4.2 完整文档(zh > 模板版本:v0.4.2,en > Template version: v0.4.2),新建 README_en.md。
  2. 顶部语言切换链接:[English](./README_en.md) | **简体中文**(en 版镜像 **English** | [简体中文](./README.md))。
  3. 顶部版本映射表:全量映射表:ohos ~ 0.17.0 → 0.77.* /0.82.(br_rnoh0.77)、~ 0.16.1 → 0.72.(br_rnoh0.72)、tpl 废弃行 <= 0.16.1-0.0.4@deprecated 收尾;发布信息/源码地址链接统一 AtomGit(tpl 行保留 GitHub deprecated)。
  4. 内容底稿:以 br_rnoh0.77 分支(最新线,一份代码服务 0.77/0.82 两条 RN 线)既有 v0.4.2 文档为底稿,简介/下载安装/兼容性验证行/使用示例/接口说明(属性表 34 项+API 表 10 项)/目录结构沿用该分支落地数据。
  5. 现行模板口径对齐:接口说明 TIP 中文化(zh "平台"列 /"OpenHarmony平台支持"列为 "是"…"部分支持";en 引号 + Yes/No/Partially);属性表列名 HarmonyOS平台支持→OpenHarmony平台支持;zh 表格值 No/Yes→否/是(44 处);兼容性句改「本文档内容基于以下版本验证通过:」;en 章节标题对齐模板(Constraints/Example/Available APIs/Other/How to Contribute);目录树 3 反引号、HarmonyOS 注释→OpenHarmony。
  6. 开源协议修正:master 分支 LICENSE 文件与上游 npm 元数据均为 BSD-3-Clause(072/077 分支文档原写 MIT),本 PR 按 LICENSE 文件实情写 The BSD 3-Clause License (BSD-3-Clause),并指向上游 license.txt(原 072/077 链接 blob/master/LICENSE 为死链,上游实际文件名为 license.txt,已实测 200)。

检视意见修复

  • 无(单次提交)。

测试步骤

  1. 在 PR Files changed 页查看 zh / en README 双语渲染效果(版本映射表、接口表、代码块、章节结构中英文一致);
  2. 数据核对:映射表版本号经 npm registry 实测(0.72-stable=0.16.2、latest=0.17.0);Releases / 分支 tree / npm / 上游 license.txt 等外链实测可达(200);
  3. 一致性核对:目录结构与 br_rnoh0.77 分支源码逐一比对一致。

测试情况

纯文档变更,仅涉及 README.md / README_en.md,以下自动化与功能测试项不适用:

合入前自检

关联 Issue

likedislike
Pull Request has been successfully merged by openharmony_ci.
(Thank you for gbw's contribution.)
gbwgbw
5 days ago Associated issue: 升级rntpc_react-native-material-textfield的master分支README到0.4.2模板
cpf-managercpf-managerCollaborators
5 days ago Added label: AI检视中
gbw
gbw
5 days ago Comments:

start build

likedislike
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

感谢提交 Pull Requests!
Thanks for submitting a pull request.

likedislike
openharmony_ciopenharmony_ciCollaborators
5 days ago Added label: dco检查成功
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

首次触发
门禁构建开始,包含静态检查,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6b09093c64650f998b921341/runlist

likedislike
openharmony_ciopenharmony_ciCollaborators
5 days ago Added label: 静态检查失败
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

代码门禁未通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6b09093c64650f998b921341/runlist

静态检查:

# check type result report
1 codeCheck noPass >>>

likedislike
cpf-manager
cpf-managerCollaborators5 days agoStart code review3
README.md
Outdated
@@ -133,0 +238,4 @@
238+| disabled | Boolean | false | 否 | iOS/Android | 是 | 文本框是否禁用(禁用后无法输入和交互) |
239+| editable | Boolean | true | 否 | iOS/Android | 是 | 文本框内容是否可编辑 |
240+| multiline | Boolean | false | 否 | iOS/Android | 是 | 文本框是否支持多行输入 |
241+| contentInset | Object | { top: 16, label: 4, input: 8, left: 0, right: 0, bottom: 8 } | 否 | iOS/Android | 是 | 文本框内容内边距配置对象(控制文本与边框的间距) |
cpf-manager
cpf-manager5 days agoComments:

【AI-Review】【一般】【基础代码问题】【常量问题】
● 问题: contentInset 属性的默认值文档列出了 bottom: 8,但源码 src/components/field/index.js 第 125-131 行的 contentInset 定义只有 { top: 16, label: 4, input: 8, left: 0, right: 0 },不存在 bottom 字段。源码中 contentInset 的使用处(第 443-447 行访问 top/label/input,第 651-657 行访问 top/right/input/left)也从未访问 bottom。FilledTextField 和 OutlinedTextField 的 contentInset 覆写(src/components/field-filled/index.js、src/components/field-outlined/index.js)同样不含 bottom。

● 影响: 用户参照文档设置 contentInset={{ bottom: 16 }} 期望调整底部内边距,但该属性不会被读取,布局行为与预期不符。

● 建议: 将默认值改为 { top: 16, label: 4, input: 8, left: 0, right: 0 },移除不存在的 bottom: 8。README_en.md 第 241 行有同样问题,需一并修正。

likedislike
System
System MessageSystem
5 days ago Comments:

changed this line on f1de1234 view diff detail

likedislike
gbw
gbw
5 days ago Comments:

感谢检视,意见属实。文档默认值误含 bottom: 8,本仓源码 static contentInset = { top: 16, label: 4, input: 8, left: 0, right: 0 }(src/components/field/index.js:125-131)无 bottom 字段,Filled/Outlined 覆写及所有访问点也均不含 bottom。已在最新提交修复:接口表 contentInset 默认值改为 { top: 16, label: 4, input: 8, left: 0, right: 0 },README_en.md 已同步修改。

likedislike
cpf-manager
cpf-managerCollaborators5 days agoStart code review3
README_en.md
Outdated
@@ -0,0 +238,4 @@
238+| disabled | Boolean | false | No | iOS/Android | Yes | Text field availability |
239+| editable | Boolean | true | No | iOS/Android | Yes | Whether text field content can be edited |
240+| multiline | Boolean | false | No | iOS/Android | Yes | Whether the text field supports multiline input |
241+| contentInset | Object | { top: 16, label: 4, input: 8, left: 0, right: 0, bottom: 8 } | No | iOS/Android | Yes | Layout configuration object for content insets |
cpf-manager
cpf-manager5 days agoComments:

【AI-Review】【一般】【基础代码问题】【常量问题】
● 问题: The documented default value for contentInset includes bottom: 8, but the source code at src/components/field/index.js:125-131 defines contentInset as { top: 16, label: 4, input: 8, left: 0, right: 0 } with no bottom field. The bottom property is never accessed anywhere in the source code (lines 443-447 access top/label/input; lines 651-657 access top/right/input/left). FilledTextField and OutlinedTextField overrides also omit bottom.

● 影响: Users following the documentation may set contentInset={{ bottom: 16 }} expecting to adjust bottom padding, but the property has no effect.

● 建议: Remove bottom: 8 from the default value, change to { top: 16, label: 4, input: 8, left: 0, right: 0 }.

likedislike
System
System MessageSystem
5 days ago Comments:

changed this line on f1de1234 view diff detail

likedislike
gbw
gbw
5 days ago Comments:

Thanks for the review, the issue is confirmed. The documented default incorrectly included bottom: 8, while the source defines static contentInset = { top: 16, label: 4, input: 8, left: 0, right: 0 } (src/components/field/index.js:125-131) with no bottom field. Fixed in the latest commit: the default value in the API table is now { top: 16, label: 4, input: 8, left: 0, right: 0 }, README.md has been updated accordingly.

likedislike
cpf-manager
cpf-managerCollaborators5 days agoStart code review3
README.md
Outdated
@@ -75,0 +71,4 @@
71+ const [errors, setErrors] = useState({});
72+ const [combinedState, setCombinedState] = useState({
73+ ...defaults,
74+ secureTextEntry:true, // 从上面的 useState 中取得值
cpf-manager
cpf-manager5 days agoComments:

【AI-Review】【一般】【基础代码问题】【代码逻辑错误】
● 问题: 示例代码中 combinedState 包含 secureTextEntry: true(第 74 行),onChangeText 函数(第 102-116 行)不断更新 combinedState,但 combinedState 在 JSX 渲染部分(第 118-180 行)从未被读取,成为死状态。密码输入框(第 160-172 行)没有设置 secureTextEntry={true},导致密码以明文显示。secureTextEntry 定义在 combinedState 中却从未传递给任何 TextField。

● 影响: 用户照抄示例代码会发现密码明文显示,存在安全隐患;combinedState 状态被更新但从未使用,造成困惑。README_en.md 第 73-76 行有同样问题。

● 建议: 给密码 TextField 添加 secureTextEntry={true} 属性;移除未使用的 combinedState 状态,或将其中的值实际绑定到对应 TextField 的 props 上。

likedislike
System
System MessageSystem
5 days ago Comments:

changed this line on f1de1234 view diff detail

likedislike
gbw
gbw
5 days ago Comments:

感谢检视,意见属实。示例中密码输入框缺少 secureTextEntry={true}(明文显示),且 combinedState 仅在 onChangeText 中被更新、从未被读取,属于死状态。已在最新提交修复:密码 TextField 添加 secureTextEntry={true};移除未使用的 combinedState 状态与 onChangeText 函数(onChangeText 的唯一作用即更新 combinedState,其 JSX 绑定一并清理),字段值仍由 onSubmit 通过 ref 收集,示例功能不受影响。README_en.md 已同步修改。

likedislike
cpf-manager
cpf-managerCollaborators5 days agoStart code review3
README.md
Outdated
@@ -73,0 +73,4 @@
73+ ...defaults,
74+ secureTextEntry:true, // 从上面的 useState 中取得值
75+ });
76+ const firstnameRef = React.createRef();;
cpf-manager
cpf-manager5 days agoComments:

【AI-Review】【建议】【编码规范】【其他编码规范】
● 问题: 示例代码存在多处残留:第 76 行 React.createRef();; 有多余分号;第 78 行 aboutRef 声明后从未使用;第 202-205 行 buttonContainer 样式定义后从未使用(Button 组件未引用该样式)。

● 影响: 用户照抄示例代码会引入 lint 警告和未使用的变量/样式。README_en.md 第 77、79 行有同样问题。

● 建议: 移除多余分号、未使用的 aboutRef 声明和 buttonContainer 样式定义。

likedislike
System
System MessageSystem
5 days ago Comments:

changed this line on f1de1234 view diff detail

likedislike
gbw
gbw
5 days ago Comments:

感谢检视,意见属实。已在最新提交移除示例中的多余分号(React.createRef();;)、未使用的 aboutRef 声明与未使用的 buttonContainer 样式定义,README_en.md 已同步修改。

likedislike
cpf-manager
cpf-managerCollaborators5 days agoStart code review2
README.md
@@ -16,3 +7,1 @@
16-[![license][license-badge]][license-url]
17-[![travis][travis-badge]][travis-url]
18-[![codeclimate][codeclimate-badge]][codeclimate-url]
7+[English](./README_en.md) | **简体中文**
cpf-manager
cpf-manager5 days agoComments:

【AI-Review】【一般】【编码规范】【其他编码规范】
● 问题: 根目录 README.md 默认语言为中文(第 7 行 **简体中文** 加粗表示当前语言),英文版本需通过链接跳转至 README_en.md。通用检视规则 5 要求"根目录 README.md 和文档默认首页/默认语言必须为英文",当前设置将中文作为默认入口。

● 影响: 非中文开发者在访问仓库时默认看到中文文档,需要额外点击切换至英文。

● 建议: 将根目录 README.md 改为英文版本,中文版改为 README_zh.md 并提供切换链接。如 CPF-RN 社区 v0.4.2 模板统一采用中文默认,建议在仓库自定义检视规范中明确豁免此通用规则。

likedislike
gbw
gbw
5 days ago Comments:

感谢检视。根目录 README.md 默认中文、顶部提供中英文切换链接,是 CPF-RN 社区 v0.4.2 文档模板(模板版本 v0.4.2)的统一口径,本仓 README.md/README_en.md 均严格按该模板编写,顶部已有 简体中文 | English 切换链接。因此本条不涉及修改;如需调整社区默认语言约定,建议在模板层面统一修订后各仓对齐。

likedislike
cpf-managercpf-managerCollaborators
5 days ago Removed label: AI检视中
cpf-managercpf-managerCollaborators
5 days ago Added label: AI已检视
gbwgbw
5 days ago Force-pushed 1 commits:f1de1234-docs: upgrade README and README_en to v0.4.2 template
cpf-managercpf-managerCollaborators
5 days ago Removed label: AI已检视
cpf-managercpf-managerCollaborators
5 days ago Added label: AI检视中
openharmony_ciopenharmony_ciCollaborators
5 days ago Removed label: 静态检查失败
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

代码有更新,重置PR验证状态

likedislike
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

感谢提交 Pull Requests!
Thanks for submitting a pull request.

likedislike
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

本地或库上代码有更新,全量重新构建,重置所有关联PR的验证状态
门禁构建开始,包含静态检查,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6b09249264650f998b9bc3d4/runlist

likedislike
openharmony_ciopenharmony_ciCollaborators
5 days ago Added label: 静态检查失败
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

代码门禁未通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6b09249264650f998b9bc3d4/runlist

静态检查:

# check type result report
1 codeCheck noPass >>>

likedislike
cpf-managercpf-managerCollaborators
5 days ago Removed label: AI检视中
cpf-managercpf-managerCollaborators
5 days ago Added label: AI已检视
gbw
gbw
5 days ago Comments:

start build

likedislike
openharmony_ciopenharmony_ciCollaborators
5 days ago Removed label: 静态检查失败
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

部分构建失败,仅触发失败构建
门禁构建开始,包含静态检查,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6b093c4164650f998ba798bb/runlist

likedislike
openharmony_ciopenharmony_ciCollaborators
5 days ago Added label: 静态检查成功
openharmony_ciopenharmony_ciCollaborators
5 days ago Test passed
openharmony_ci
openharmony_ciCollaborators
5 days ago Comments:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6b093c4164650f998ba798bb/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

likedislike
dingchengjiedingchengjieCollaborators
4 days ago Set dingchengjie as approver
dingchengjiedingchengjieCollaborators
4 days ago Approval passed
cpf-managercpf-managerCollaborators
4 days ago Added label: AI检视复核中
cpf-managercpf-managerCollaborators
4 days ago Reset test status
dingchengjiedingchengjieCollaborators
4 days ago Resolved final issue
cpf-manager
cpf-managerCollaborators
4 days ago Comments:

【AI-Review复核报告】

结论: ✅ 通过

复核基线: f1de1234 | 意见总数: 5 | 有效处置: 5 | 无效处置: 0

全部意见均已正确处置(已修复 / 有据非问题 / Issue跟踪),测试通过。

likedislike
cpf-managercpf-managerCollaborators
4 days ago Test passed
cpf-managercpf-managerCollaborators
4 days ago Removed label: AI检视复核中
cpf-managercpf-managerCollaborators
4 days ago Added label: AI检视复核通过
openharmony_ciopenharmony_ciCollaborators
4 days ago Closed associated issue
openharmony_ciopenharmony_ciCollaborators
4 days ago Merged pull request, merge node SHA: 2e99d63c2d9b0287d0ba917cb622c88a27d7f02e