11 KiB
11 KiB
5-29 Editor Runtime 后续收口 Checklist v1
创建时间:2026-05-25 状态:
process来源:承接design/05-editor-mainline/done/5-28-leptos-tiptap-editor-runtime-module-extraction-v1.md的后续未专项完成项。
1. 目标
在 5-28 已完成附件链接、history-safe delete、command sync、persistence、attachment upload intent 首批拆分后,继续把 editor runtime 的 selection / overlay / block menu / mindmap node view 切成可索引模块。Codex 维护本文件作为事实源,Reasonix 只做短批次审计、窄范围实现或浏览器 smoke;每批最多 2 个 worker。
2. 本轮边界
本轮优先处理:
editor_runtime/dom_selection.rs第一刀。- overlay / block menu 后续切片的只读审计。
- 仍使用 HTML 整文替换的用户编辑路径风险复核,例如块手柄拖拽重排和复制副本。
task488/task489/task479作为回归基线。
本轮不处理:
- shell host resource open / local upload 落盘语义;这些归
3-20。 - Page AI 流式 apply / review session。
- mindmap 事实源重构;本轮最多审计 node view 拆分边界。
3. Batch A 候选任务
- Worker A:实现
dom_selection.rs第一刀。- 允许修改:
rust/spikes/leptos-tiptap-spike/src/lib.rs、rust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs、新增rust/spikes/leptos-tiptap-spike/src/editor_runtime/dom_selection.rs。 - 目标函数:
active_editor_text_selection、selection_summary、has_active_text_selection、selection_has_rich_marks,以及必要的 selection payload helper。 - 禁止:迁出 block menu DOM、overlay state、host bridge、resource open。
- 允许修改:
- Worker B:只读审计 overlay / block menu 拆分。
- 目标:列出强依赖 Leptos signal 的函数,判断是否先抽 context struct 或先迁纯 helper。
- 输出:下一刀最小实现范围和 smoke 建议。
- Worker C:只读审计剩余 HTML 整文替换用户编辑路径。
- 目标:查
set_content、apply_html_update、apply_document_update的用户触发链路,列出可迁 Tiptap command/transaction 的候选。 - 输出:风险表和建议 RED smoke。
- 目标:查
- Worker D:浏览器 smoke 审计 editor runtime 基线。
- 目标:只读运行或复核
task488、task489、task479,截图/结果证明附件删除和块菜单删除 undo/redo 仍可用。 - 输出:result.json、截图、console/network;不修改源码。
- 目标:只读运行或复核
4. 验收命令
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/task488-local-attachment-link-delete-undo-smoke.js
node scripts/task489-block-menu-delete-undo-smoke.js
node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js
UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据。
5. 采纳规则
- Reasonix 结果必须先查 Hindsight
reasonixrecall,再读process-handoff.md/json、result.json、diff 和验证证据。 - 实现 worker 只能改允许范围;只读和 smoke worker 必须没有源码 diff。
lib.rs不能新增附件/history/DOM bridge 大块逻辑。- 本文件只记录真实完成项;未验证项保持未勾选。
6. 本轮执行记录
- 2026-05-25:Codex 创建本续跑事实源。
- 2026-05-25:Worker A 未继续派发;Codex 主控已在主工作区完成
dom_selection.rs第一刀并提交c7ab4e56 refactor: extract editor dom selection runtime。- 已迁函数:
node_is_within_root、active_editor_text_selection、has_active_text_selection、selection_summary、selection_has_rich_marks。 - 未迁:
SelectionPayload、selection_payload、send_selection_state*、selection_event_payload,原因是仍依赖 bridge event、HoveredBlockState和 runtime block id 边界。 - 已验证:
cargo fmt --manifest-path rust/Cargo.toml --all --check、cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgen、task488、task489、CodeGraph pending 0。
- 已迁函数:
- 2026-05-25:执行口径修正:继续遵循当前 goal 的“每批最多 2 个 worker”;Reasonix 后续必须使用独立 worktree 或明确只读任务,完成后由 Codex 读取 handoff 并复核。
- 2026-05-25:Reasonix runner 异常:后续实现 run 未写
result.json、process-handoff.md/json,部分 transcript 停在工具调用阶段;Codex 不采纳其文字结论,只复核实际 diff。 - 2026-05-25:Reasonix overlay / block menu 只读审计尝试未产生
result.json/process-handoff,且运行期间出现额外 Batch A2 runner,主控已终止进程;该结果不作为正式 handoff 采纳。- transcript 只显示探索过程,未形成函数归属表;下一次应改为更窄的单问题只读任务,例如只审计
floating_toolbar_anchor_from_selection/sync_text_selection_overlay能否迁入overlays.rs。
- transcript 只显示探索过程,未形成函数归属表;下一次应改为更窄的单问题只读任务,例如只审计
- 2026-05-25:Codex 主控直接完成 overlay 第一刀:新增
editor_runtime/overlays.rs,迁出FloatingToolbarAnchor、floating_toolbar_anchor_from_selection、sync_text_selection_overlay。- 未迁:
sync_editor_overlay_state/try_sync_editor_overlay_state,原因是仍依赖HoveredBlockState、slash/block menu signal 和 overlay 关闭策略。 - 已验证:
cargo fmt --manifest-path rust/Cargo.toml --all --check、cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgen、node scripts/task488-local-attachment-link-delete-undo-smoke.js、node scripts/task489-block-menu-delete-undo-smoke.js。 - 运行中再次出现额外 Batch A2 Reasonix runner,主控已终止;这些 runner 未作为本批证据。
- 未迁:
- 2026-05-25:采纳并复核 Worker B 候选 patch:新增
editor_runtime/block_menu_legacy_html.rs,迁出duplicate_top_level_block_html、reorder_top_level_block_html;lib.rs仅保留调用点和DropPlacement的pub(crate)可见性。- Reasonix run:
reasonix-2026-05-24T17-07-59-603Z-bfe72d77,已读取 Hindsight recall、process-handoff.md/json、diff,并由 Codex 独立复核。 - Codex 合入时保持实现逻辑同构,仅收口模块边界和 checklist 事实记录。
- 已验证:
cargo fmt --manifest-path rust/Cargo.toml --all --check、cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgen、node scripts/task488-local-attachment-link-delete-undo-smoke.js、node scripts/task489-block-menu-delete-undo-smoke.js。 - 未完成:HTML 整文替换仍是 legacy 路径,后续要用 history-safe Tiptap command 替换;
sync_editor_overlay_state、block menu signal 仍未拆出。
- Reasonix run:
- 2026-05-25:复跑浏览器 smoke 后修正上一条验收口径:
task488通过,但task489-block-menu-delete-undo-smoke连续两次失败,失败点是块菜单删除后Control+Z未恢复Beta block。- 证据:
tmp/task489-block-menu-delete-undo-smoke/result.json、tmp/task489-block-menu-delete-undo-smoke/failure.png。 - 已登记缺陷:
bugs/05-editor-mainline/done/5-39-block-menu-delete-undo-regression-v1.md。 - Worker E(
reasonix-2026-05-24T17-34-41-774Z-85427058)已在独立 worktree/mnt/Data1T/mnote-worktrees/0525-b3-block-delete-undo派发修复任务,但 runner 仅产出prompt.md/memory-recall.json/reasonix-transcript.jsonl,无final.md、result.json、process-handoff.md/json,worktree 无 diff,拒绝采纳。 - 当前结论:5-29 仍未完成;下一步应先定位
delete_top_level_block_with_history、sync_persisted_editor_command、editor focus / undo keydown 之间的真实断点,再修复。
- 证据:
- 2026-05-25:Codex 主控修复
5-39:诊断确认 history 未丢,断点是块菜单删除后焦点短暂落到BODY;最终修复为删除菜单项mousedown阶段阻止默认焦点转移、关闭菜单后异步editor.focus()兜底,并在BODY焦点窗口只转发 undo/redo 快捷键到当前 editor;缺陷文档已移到bugs/05-editor-mainline/done/5-39-block-menu-delete-undo-regression-v1.md。- 同批新增
editor_runtime/block_menu_document.rs,迁出未走当前运行路径的 legacy 顶层块 JSON helper:duplicate_top_level_block、delete_top_level_block、reorder_top_level_block;replace_top_level_block_kind暂不迁,因仍依赖 slash action、mindmap 和 image placeholder 语义。 - 已验证:
cargo fmt --manifest-path rust/Cargo.toml --all --check、cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgen、node scripts/task489-block-menu-delete-undo-smoke.js、node scripts/task488-local-attachment-link-delete-undo-smoke.js。 - 未覆盖:
cargo test --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml block_menu_document -- --test-threads=1被既有STYLE测试编译错误阻断,未进入本次新增 helper 测试。
- 同批新增
- 2026-05-25:根据用户纠正,后续 B/C/D 等实现 worker 不再只读或在主工作区直接修改;Batch C 统一采用独立 worktree 候选 patch,Codex 读取 Hindsight recall、
process-handoff.md/json、result.json、diff 与验证证据后再选择性合入。 - 2026-05-25:Batch C Worker B(
reasonix-2026-05-24T17-41-07-634Z-a39f8963)在独立 worktree/mnt/Data1T/mnote-worktrees/0525-c-worker-b-block-delete-undo未产出final.md、result.json或process-handoff.md/json,worktree diff 为空,拒绝采纳;Codex 随后在同一 worktree 独立定位根因、产出候选 patch、通过 smoke 后移植到主工作区。 - 2026-05-25:Reasonix 只读审计
sync_editor_overlay_state/try_sync_editor_overlay_state下一刀,使用独立 worktree/mnt/Data1T/mnote-worktrees/0525-d-5-29-overlay-readonly,run idreasonix-2026-05-24T17-53-20-962Z-d3077308。- Codex 已读取 Hindsight recall、
process-handoff.md/json、result.json,并核对 worktreegit status --short/git diff --stat为空;runner 已产出 completed handoff 但进程未自行退出,主控已终止残留 runner。 - 审计结论:当前不宜直接把
sync_editor_overlay_state/try_sync_editor_overlay_state迁入overlays.rs,因为它们仍强依赖HoveredBlockState、slash/block menu signals、active_editor_stage和 8/18 overlay signal 的局部关闭策略;on_selection_change仍有一套内联 signal 同步逻辑,直接迁出会造成两套 overlay reconciler。 - 下一刀建议:先做类型/边界准备或更窄 helper,而不是迁整个 sync 函数;候选是抽出 block/overlay shared types(例如
HoveredBlockState及相关 anchor 类型)或把active_editor_stage的 DOM 判断收口到 runtime helper,之后再考虑close_editor_floating_overlays整簇迁移。
- Codex 已读取 Hindsight recall、