- 统一 local-first MVP 后阶段架构口径,补充 process 执行总序和 Reasonix 协作记录 - 归档已完成的 design checklist,标注参考型 process,更新 AGENTS/REASONIX/架构文档 - 补充文件树/主编辑器下载与上下文菜单相关实现、bug 记录和 smoke 脚本 验证:git diff --check;codegraph sync .;cargo test -p mnote-web;node --check scripts/task476-filetree-editor-context-menu-download-smoke.js
2.7 KiB
2.7 KiB
4-39 FileTree Open Target 与 Resource Identity Checklist v1
状态:done
归档说明(2026-05-21):FileTree open target 与 resource identity 合同已完成;
rootUri收尾由4-42覆盖并已归档。日期:2026-05-20
Owner:File Tree runtime / open target 合同
1. 目标
补齐 P0-4:扩展 FileTreeOpenTarget 和 runtime API,使 File Tree 能稳定表达 local raw file、directory、asset folder、office/image/pdf/code/mindmap/table 等资源身份,而不是只靠 UI 侧字符串分流。
2. 允许修改范围
rust/crates/mnote-web/src/tree_shell/filetree_runtime.rsrust/crates/mnote-web/src/tree_shell/runtime_api.rsrust/crates/mnote-web/src/routes/tree.rsrust/crates/mnote-web/src/routes/local_folder_source.rs- 相关 Rust 单测
3. 禁止事项
- 不改前端打开 UI 大流程;只输出更稳定的 open target / intent 合同。
- 不做 resource lifecycle delete/restore/purge cutover;该项由 4-40 处理。
- 不引入新的树真相层,Resource Tree / File Tree / Page Tree 口径保持不变。
4. Checklist
- 扩展
FileTreeOpenTarget或新增字段,能表达local_file、directory、asset_folder、office、image、pdf、code/text、mindmap、table。 - open target 包含 canonical resource identity、resource kind、relative path、document id / parent id(若有)。
parse_open_target_from_row支持现有 row dataset,不破坏 document/index/asset-folder/asset。- runtime API 序列化保持 camelCase,旧字段兼容。
- Rust 单测覆盖 local raw file、directory、office/image/pdf/code/mindmap/table open target。
5. 验收
cargo test -p mnote-web filetree_runtime -- --test-threads=1cargo test -p mnote-web runtime_api -- --test-threads=1cargo test -p mnote-web tree_shell_filetree_mode_embeds_asset_state -- --test-threads=1
6. 本轮执行记录
- 已完成:
FileTreeOpenTarget::Asset已补可选resourceKind,并新增LocalFile/Directoryvariant。resolve_open_target支持local-file/directory/office/image/pdf/code/text/mindmap/tablerow kind。- 新增序列化合同测试,覆盖 resource kind、local file 中文路径、directory。
- 未完成:
- 后续仍需把更多上游 row dataset 补齐真实
rootUri,当前LocalFile/Directoryvariant 的 rootUri 仍为空字符串占位。
- 后续仍需把更多上游 row dataset 补齐真实
- 风险:
FileTreeOpenTargetschema 已扩展,需保留旧AssetJSON 兼容;当前resourceKind=None时不序列化。
7. 非目标
- 不改变资源实际打开方式。
- 不处理 OnlyOffice 回源。