Files
XCEngine/docs/used/Subplan-01_XCUI-Core-Tree-State.md

49 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Subplan 01XCUI Core Tree / State / Invalidation
目标:
- 搭出 XCUI 的 retained-mode 核心骨架。
- 明确 `ElementTree``NodeId``View``ViewModel``dirty flag``rebuild``lifecycle` 的最小闭环。
负责人边界:
- 负责 `engine/include/XCEngine/UI/``engine/src/UI/Core/` 的核心树模型。
- 不负责具体布局算法。
- 不负责 ImGui 适配绘制。
建议目录:
- `engine/include/XCEngine/UI/Core/`
- `engine/src/UI/Core/`
- `tests` 中对应 XCUI core 测试文件
前置依赖:
- 依赖主线完成 `Phase 0` 的基础类型和 UI 生命周期边界清理。
现在就可以先做的内容:
- 设计 `UIElementId` / `UIElement` / `UIContext` / `UIBuildContext`
- 设计 dirty 标记与增量重建规则
- 设计 ViewModel 读写边界和 command 回调入口
- 写最小 tree rebuild 测试
明确不做:
- 不接入 `.xcui` 文件
- 不接入 editor 面板
- 不写具体 widget 大库
交付物:
- XCUI core 基础类与生命周期定义
- tree rebuild / invalidation / state propagation 单元测试
- 一个最小 demo代码构建 UI tree 并触发一次增量更新
验收标准:
- 可以构建一棵稳定的 UI tree
- 局部状态变化时只标脏必要节点
- 重建逻辑与布局/渲染解耦
- 其他 subplan 可以基于该模块定义控件树和状态更新