Skip to content

refactor: clarify permission MVVM responsibilities - #184

Merged
xiaomu120413 merged 7 commits into
masterfrom
codex/permission-mvvm-refactor-20260721
Jul 21, 2026
Merged

refactor: clarify permission MVVM responsibilities#184
xiaomu120413 merged 7 commits into
masterfrom
codex/permission-mvvm-refactor-20260721

Conversation

@xiaomu120413

Copy link
Copy Markdown
Collaborator

变更概述

  • 将防火墙、日志、外设的 PresentationMapper 从 viewmodels 迁入独立 presentation 层,并更新主代码与测试引用。
  • 从 PermissionPage 拆出 PermissionTargetPanel 与 PermissionPolicyTable,页面只保留生命周期、组合、动作转发和反馈。
  • 从 PermissionViewModel 抽取 PermissionRefreshCoordinator,集中处理普通刷新复用、完整刷新排队和账号事件尾部补刷。
  • 更新总体设计 RFC、相关模块设计和本地实施/验收方案。
  • 未修改 ukey、权限声明、签名模板、MDM 参数、状态模型或持久化结构。

架构结果

  • PermissionPage:约 807 行降至 433 行。
  • PermissionViewModel:约 662 行降至 604 行。
  • 新组件不依赖 ViewModel、Service、Repository、Dialog 或平台能力。
  • RefreshCoordinator 不持有页面业务状态,不调用 Service,不依赖 UI 或定时器。
  • ViewModel 仍是权限页面唯一状态持有者和公开动作入口。

验证

  • python scripts/check_docs_consistency.py
  • python scripts/e2e/tools/validate_test_assets.py
  • hvigorw test --mode module -p product=default -p module=entry@default
  • hvigorw test --mode module -p product=default -p module=entry@ohosTest
  • 主 HAP 与 ohosTest HAP 构建、签名和安装成功
  • 新增 10 个 RefreshCoordinator 并发测试;原有 56 个 PermissionViewModel 测试保留并通过
  • 设备 route/theme 回归:24/24 通过,覆盖权限管理浅色、深色、跟随系统
  • 设备 UI 树确认账号区、禁止安装、目标应用、应用策略和当前策略区域正常渲染

人工验收提示

本次属于行为保持型职责重构。为避免改变测试设备现有安全策略,尚未逐项执行真实 MDM 策略写入、恢复和删除;合入前建议按设计文档在专用测试设备完成账号切换、应用刷新、策略写入/恢复及当前策略删除验收。

🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%]
@xiaomu120413
xiaomu120413 merged commit 34bb685 into master Jul 21, 2026
10 checks passed
@xiaomu120413
xiaomu120413 deleted the codex/permission-mvvm-refactor-20260721 branch July 21, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant