Files
mnote/design/04-tree-domain/done/4-42-filetree-open-target-rooturi-contract-v1.md
T
lix-2026 1956a8a21a chore: align mvp design governance
- 统一 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
2026-05-21 09:04:13 +08:00

52 lines
1.9 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.
# 4-42 FileTree Open Target RootUri Contract Checklist v1
> 状态:done
>
> 归档说明(2026-05-21):FileTree open target `rootUri` 合同已完成,缺失 `rootUri` 的旧 payload 兼容仍保留。
>
> 日期:2026-05-20
>
> OwnerFileTree runtime open target / `filetree_runtime.rs`
## 1. 目标
补齐 P0-4 的剩余合同问题:`FileTreeOpenTarget::LocalFile` / `Directory` 已存在,但 `rootUri` 仍为空字符串占位。需要让 runtime 环境携带本地 root,并让 open target 输出真实 `rootUri`
## 2. 允许修改范围
- `rust/crates/mnote-web/src/tree_shell/filetree_runtime.rs`
- `rust/crates/mnote-web/src/tree_shell/runtime_api.rs`
- `rust/crates/mnote-web/src/routes/tree.rs`
- 相关 Rust 单测
## 3. 禁止事项
- 不改变 File Tree row 的长期资源真相。
- 不改前端打开行为。
- 不删除旧 `Asset` JSON 兼容字段。
## 4. Checklist
- [x] `FileTreeRuntimeEnvironment` 携带可选 `rootUri`
- [x] `resolve_open_target``LocalFile` / `Directory` 使用环境中的 `rootUri`
- [x] tree shell SSR app state / runtime reduce 请求填入 local folder `rootUri`
- [x] runtime API 反序列化对缺失 `rootUri` 保持兼容。
- [x] Rust 单测覆盖 local file / directory open target 输出真实 `rootUri`
## 5. 验收
- [x] `cargo test -p mnote-web filetree_runtime -- --test-threads=1`
- [x] `cargo test -p mnote-web runtime_api -- --test-threads=1`
- [x] `cargo test -p mnote-web tree_shell_filetree_mode_embeds_asset_state -- --test-threads=1`
## 5.1 本轮执行记录
- 已合入:`FileTreeRuntimeEnvironment.rootUri`,并在 filetree runtime open target 中用于 local file / directory。
- 已补充:tree shell 前端 runtime 环境构造会在 local folder 模式传入 `rootUri`
- 已验证:缺失 `rootUri` 的旧 runtime API JSON 仍可反序列化。
## 6. 非目标
- 不处理 resource lifecycle。
- 不处理 tab URL 同步。