Files
mnote/.codex/reasonix-tasks/2026-05-21-batch-g-worker-b-local-folder-tree-live-frontend.md
T

48 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.
# Reasonix Worker BLocal Folder Tree Live 前端 consumer 接入
Project root`/mnt/Data1T/mnote`
你不是唯一 worker。不要回滚、覆盖或清理他人的改动;只修改本任务 ownership 范围内的文件。不要提交 git。
## 背景
`3-3` 暂不能归档,因为 `sourceKind=local_folder` 当前在 `TREE_LIVE_CONTROLLER_JS` 中直接设置 `data-mnote-tree-live-transport="local-folder-static"` 并 returnSidebar / FileTree 依赖 `startLocalFolderSidebarWatch()` 轮询 `/api/tree/local-folder-watch` 后补拉 projection。
新 checklist`design/03-rust-web/process/3-18-local-folder-tree-live-consumer-convergence-checklist-v1.md`
## Ownership
允许修改:
- `rust/crates/mnote-web/src/ssr/pages/layout.rs`
禁止修改:
- Rust route 后端文件
- `scripts/*.js`
- 其他 design 文档
## 目标
1. local_folder 默认路径应进入 tree live controller,不再直接 `local-folder-static` return。
2. 使用 Worker A 新增/扩展的 local_folder tree live SSE,接收到 snapshot/resync 后 dispatch `tree:snapshot` / `tree:resync`,复用已有 `renderSidebarSnapshot()` consumer。
3. `startLocalFolderSidebarWatch()` 可保留为 fallback,但不再是默认主链。
4. 不破坏 web_shell/tiptap 的 `/api/local-folder/events` 文档外部变更通道。
5. DOM 状态应能区分新主链,例如 `data-mnote-tree-live-transport="local-folder-events"`,并在应用成功后设置 `data-mnote-tree-live-applied="snapshot"``"resync"`
## 验收命令
```bash
cargo test --manifest-path rust/Cargo.toml -p mnote-web sidebar_tree_runtime -- --test-threads=1
cargo test --manifest-path rust/Cargo.toml -p mnote-web web_shell -- --test-threads=1
git diff --check
```
## 最终回复格式
- 修改文件列表
- local_folder tree live 主链变化
- fallback 保留情况
- 运行过的命令和结果
- 未完成项或风险