Files
mnote/bugs/04-tree-domain/process/4-46-filetree-resource-row-document-command-leak-v1.md
T
lix-2026 3311bd0366 chore: document architecture gaps and add dev hot reload
- add npm dev:hot wrapper using cargo-watch and page reload polling

- add mnote-web dev hot reload endpoint and coverage

- record current architecture review and tracked bug findings across realtime, tree, editor, and AI runtimes

Verification:

- node scripts/task-dev-hot-plan-test.js

- node --check scripts/dev-hot.js

- cargo test -p mnote-web dev_hot -- --nocapture
2026-05-17 23:09:56 +08:00

1.7 KiB

4-46 [process][bug] FileTree 资源行被当成页面命令对象处理 v1

发现时间:2026-05-17

状态:[process]

关联主线:04-tree-domain

1. 问题定义

FileTree asset row 的 resourceMeta 同时带 documentIdassetId,但 tree shell 的部分交互会优先读取 documentId,从而把资源行当成页面行执行删除、复制、移动、重命名等页面命令。

这直接违反 Resource Tree / File Tree / Page Tree 的分层边界。

2. 证据

  • bridge-runtime/src/lib.rs 附近构造 asset row resource meta。
  • tree.rs getFileTreeRowDocumentId() 优先返回资源行中的 documentId
  • tree.rs 键盘删除路径使用 documentId。
  • tree.rs 剪贴板路径使用 documentId。
  • tree.rs F2 重命名路径使用 documentId。

3. 影响

  • 选中 mindmap / table / media asset 行后,可能误删或误重命名所属页面。
  • 资源归属与页面结构命令混淆。
  • tree.resource.* 的正式命令面无法成为资源操作唯一入口。

4. 建议修复

  • FileTree row model 必须区分 document rowresource row,不要对 resource row 暴露页面 document command。
  • Delete / F2 / copy / move 对资源行应走 tree.resource.*,或在未实现时显式禁用。
  • 增加浏览器 smoke:资源行上 Delete、F2、Ctrl+C/X/V 不得触发页面命令。

5. 状态

已确认 row model 与命令分发存在泄漏,尚未修复。