Files
mnote/.codex/reasonix-tasks/2026-05-25-batch-j-worker-c-3-20-filetree-dom.md
T

2.0 KiB
Raw Blame History

Reasonix Batch J / Worker C3-20 filetree DOM runtime 外置候选

Project root/mnt/Data1T/mnote-worktrees/0525-j-worker-c-3-20-filetree-dom

目标

在独立 worktree 中产出候选 patch:把 SIDEBAR_TREE_JSrevealFileTreeRow(row)revealFileTreeAssetRow(assetId)appendUploadedAssetRow(asset, documentId) 迁入 rust/crates/mnote-web/browser/filetree-runtime.jslayout.rs 只保留 runtime 委托 wrapper 和完整 inline fallback。

允许修改

  • rust/crates/mnote-web/browser/filetree-runtime.js
  • rust/crates/mnote-web/src/ssr/pages/layout.rs

必要时只更新 layout.rs 中现有字符串断言测试。

实现要求

  • filetree-runtime.js 新增并导出:
    • revealFileTreeRow(row)
    • revealFileTreeAssetRow(assetId, deps)
    • appendUploadedAssetRow(asset, documentId, deps)
  • layout.rs 中同名 inline 函数优先委托 fileTreeRuntimeFunction(...),runtime 不存在时继续执行原 fallback。
  • 不迁 refreshLocalFolderSidebarSnapshot
  • 不改资源归属、filetree row data contract、上传 API、editor 插入或 sidebar refresh 语义。

禁止事项

  • 不迁 refreshLocalFolderSidebarSnapshot
  • 不改 local-upload-runtime.js
  • 不改 conflict panel、editor island、AGENTS、设计文档或 bugs 文档。
  • 不提交 git,不回滚或清理无关文件。

验收命令

node --check rust/crates/mnote-web/browser/filetree-runtime.js
cargo fmt --manifest-path rust/Cargo.toml --all --check
cargo check --manifest-path rust/Cargo.toml -p mnote-web
cargo test --manifest-path rust/Cargo.toml -p mnote-web filetree_runtime_contains_row_accessor_helpers -- --test-threads=1
NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js

输出要求

handoff 必须列出:

  • 修改文件。
  • 委托 deps 清单。
  • 是否保留 fallback。
  • 验收命令、结果和 smoke 证据路径。
  • 未覆盖风险。
  • git diff --stat