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

61 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Reasonix Batch B / Worker E5-29 block menu delete undo 回归修复
Project root`/mnt/Data1T/mnote-worktrees/0525-b3-block-delete-undo`
## 目标
在独立 worktree 中产出候选 patch,修复 `task489-block-menu-delete-undo-smoke` 暴露的回归:块菜单删除 `Beta block` 后,`Control+Z` 必须恢复目标块,`Control+Y` 必须再次删除目标块。
## 允许修改
- `rust/spikes/leptos-tiptap-spike/src/editor_runtime/history_safe_commands.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(...)` 整文替换删除。
- 不修改上传、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,或脚本断言问题。
## 验收命令
```bash
cargo fmt --manifest-path rust/Cargo.toml --all --check
cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml
```
若修改了 Rust island 源码且需要浏览器验证,请同时运行:
```bash
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
```
## 输出要求
handoff 必须列出:
- 根因判断。
- 修改文件。
- 为什么不会破坏 history-safe 删除方向。
- 验收命令和结果。
- 未覆盖风险。
- `git diff --stat`