2.1 KiB
2.1 KiB
Reasonix Batch J / Worker D:3-20 document conflict action helper 候选
Project root:/mnt/Data1T/mnote-worktrees/0525-j-worker-d-3-20-conflict-action
目标
在独立 worktree 中产出候选 patch:围绕 document-conflict-panel-runtime.js 与 web_shell.rs 的边界继续收口,只允许迁出一个低风险 action/wiring helper。优先选择把冲突按钮 action 的 try/catch、toast、rerender 包装委托给 runtime;业务保存状态机仍留在 web_shell.rs。
允许修改
rust/crates/mnote-web/browser/document-conflict-panel-runtime.jsrust/crates/mnote-web/src/routes/web_shell.rs
必要时只更新同文件现有字符串断言测试。
实现要求
- 保持
acceptDiskVersion(session)、keepCurrentEditorVersion(session)、writeMergedConflictResult(session, value)的业务语义在web_shell.rs。 - runtime 只做 action wrapper / DOM wiring / 错误 toast 协调,通过
deps注入具体业务函数。 - runtime 不存在时,inline fallback 必须继续执行原实现。
- 若发现当前 HEAD 已有相同 helper 或不宜继续迁出,则输出诊断 patch 或 handoff 说明,不强迁。
禁止事项
- 不迁 document session lifecycle。
- 不迁 local upload / filetree / editor island。
- 不修改 AGENTS、设计文档或 bugs 文档。
- 不提交 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。