2.2 KiB
2.2 KiB
Reasonix Batch C / Worker D:3-20 document conflict action 边界候选
Project root:/mnt/Data1T/mnote-worktrees/0525-c-worker-d-conflict-action
目标
在独立 worktree 中产出候选 patch:围绕 document-conflict-panel-runtime.js 与 web_shell.rs 的边界继续收口,但只允许迁出一个低风险 action helper 或 wiring helper。优先选择 openConflictDiffPanel(session, panel) 的纯 UI 面板创建/切换部分;如果发现它仍强依赖 session 状态或 editor 内容读取,则只输出最小诊断 patch 或测试,不强迁。
允许修改
rust/crates/mnote-web/browser/document-conflict-panel-runtime.jsrust/crates/mnote-web/src/routes/web_shell.rs
必要时只更新同文件现有字符串断言测试。
实现要求
- 保持
acceptDiskVersion(session)、keepCurrentEditorVersion(session)的保存 / 状态机语义在web_shell.rs中,不迁业务状态机。 - 如果迁
openConflictDiffPanel,runtime 必须通过deps接收读取编辑器内容、渲染 diff、toast、escape 等依赖,不得在 runtime 中复制 document session 真相。 - runtime 不存在时,inline fallback 必须继续执行原实现。
- 若实际不可安全迁出,必须用代码证据说明阻塞点,并可只补字符串断言或注释禁止误迁。
禁止事项
- 不迁 document session lifecycle。
- 不迁 local upload / filetree / editor island。
- 不修改 AGENTS、设计文档、bugs 文档或 git 状态。
- 不提交 git。
验收命令
node --check rust/crates/mnote-web/browser/document-conflict-panel-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 document_conflict_panel_runtime_contains_dom_helpers -- --test-threads=1
cargo test --manifest-path rust/Cargo.toml -p mnote-web mnote_browser_runtime_assets_are_explicitly_mounted -- --test-threads=1
输出要求
handoff 必须列出:
- 根因/边界判断:迁出或不迁出的理由。
- 修改文件。
- 委托 deps 清单或阻塞证据。
- 是否保留 fallback。
- 验收命令和结果。
- 未覆盖风险。
git diff --stat。