Files
mnote/.codex/reasonix-tasks/2026-05-25-batch-c-worker-b-5-29-block-delete-undo.md
T

60 lines
2.6 KiB
Markdown
Raw Normal View History

2026-05-25 19:12:33 +08:00
# Reasonix Batch C / Worker B5-29 block menu delete undo 修复候选
Project root`/mnt/Data1T/mnote-worktrees/0525-c-worker-b-block-delete-undo`
## 目标
在独立 worktree 中产出候选 patch,修复 `node scripts/task489-block-menu-delete-undo-smoke.js` 暴露的回归:块菜单删除 `Beta block` 后,`Control+Z` 必须恢复目标块,`Control+Y` 必须再次删除目标块。
## 允许修改
- `rust/spikes/leptos-tiptap-spike/src/editor_runtime/history_safe_commands.rs`
- `rust/spikes/leptos-tiptap-spike/src/editor_runtime/command_sync.rs`
- `rust/spikes/leptos-tiptap-spike/src/lib.rs`
- 如确需重建运行时,可更新:
- `rust/spikes/leptos-tiptap-spike/generated/island/mnote-leptos-tiptap-spike-island.js`
- `rust/spikes/leptos-tiptap-spike/generated/island/mnote-leptos-tiptap-spike-island_bg.wasm`
如证据证明只是 smoke 焦点问题,允许只修改:
- `scripts/task489-block-menu-delete-undo-smoke.js`
但必须用浏览器证据说明为什么产品行为没有问题。
## 禁止事项
- 不回退到 `apply_html_update(...)` / `set_content(...)` 整文替换删除。
- 不修改 3-20 runtime、上传、mnote-web shell、AGENTS、设计文档、bugs 文档或 git 状态。
- 不提交 git。
- 不做与 block menu delete undo 无关的重构。
## 必做排查
1. 阅读 `bugs/05-editor-mainline/process/5-39-block-menu-delete-undo-regression-v1.md`
2. 对比 `delete_top_level_block_with_history`、block menu delete click handler、`sync_persisted_editor_command` 的调用顺序。
3. 先判断根因:history 未入栈、后续同步清空 history、焦点导致快捷键未进入 editor,或脚本断言问题。
4. 若修改 Rust island 源码,必须重建 generated island 文件并跑浏览器 smoke。
## 验收命令
```bash
cargo fmt --manifest-path rust/Cargo.toml --all --check
cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml
cargo build --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml --target wasm32-unknown-unknown --release
wasm-bindgen rust/spikes/leptos-tiptap-spike/target/wasm32-unknown-unknown/release/mnote_leptos_tiptap_spike.wasm --target web --out-dir rust/spikes/leptos-tiptap-spike/generated/island --out-name mnote-leptos-tiptap-spike-island
node scripts/task489-block-menu-delete-undo-smoke.js
node scripts/task488-local-attachment-link-delete-undo-smoke.js
```
## 输出要求
handoff 必须列出:
- 根因判断。
- 修改文件。
- 为什么不会破坏 history-safe 删除方向。
- 验收命令和结果。
- 浏览器 smoke 证据路径。
- 未覆盖风险。
- `git diff --stat`