Files
mnote/design/05-editor-mainline/process/5-29-editor-runtime-followup-checklist-v1.md
T

11 KiB
Raw Blame History

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.rsrust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs、新增 rust/spikes/leptos-tiptap-spike/src/editor_runtime/dom_selection.rs
    • 目标函数:active_editor_text_selectionselection_summaryhas_active_text_selectionselection_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_contentapply_html_updateapply_document_update 的用户触发链路,列出可迁 Tiptap command/transaction 的候选。
    • 输出:风险表和建议 RED smoke。
  • Worker D:浏览器 smoke 审计 editor runtime 基线。
    • 目标:只读运行或复核 task488task489task479,截图/结果证明附件删除和块菜单删除 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 reasonix recall,再读 process-handoff.md/jsonresult.json、diff 和验证证据。
  • 实现 worker 只能改允许范围;只读和 smoke worker 必须没有源码 diff。
  • lib.rs 不能新增附件/history/DOM bridge 大块逻辑。
  • 本文件只记录真实完成项;未验证项保持未勾选。

6. 本轮执行记录

  • 2026-05-25Codex 创建本续跑事实源。
  • 2026-05-25Worker A 未继续派发;Codex 主控已在主工作区完成 dom_selection.rs 第一刀并提交 c7ab4e56 refactor: extract editor dom selection runtime
    • 已迁函数:node_is_within_rootactive_editor_text_selectionhas_active_text_selectionselection_summaryselection_has_rich_marks
    • 未迁:SelectionPayloadselection_payloadsend_selection_state*selection_event_payload,原因是仍依赖 bridge event、HoveredBlockState 和 runtime block id 边界。
    • 已验证:cargo fmt --manifest-path rust/Cargo.toml --all --checkcargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgentask488task489、CodeGraph pending 0。
  • 2026-05-25:执行口径修正:继续遵循当前 goal 的“每批最多 2 个 worker”;Reasonix 后续必须使用独立 worktree 或明确只读任务,完成后由 Codex 读取 handoff 并复核。
  • 2026-05-25Reasonix runner 异常:后续实现 run 未写 result.jsonprocess-handoff.md/json,部分 transcript 停在工具调用阶段;Codex 不采纳其文字结论,只复核实际 diff。
  • 2026-05-25Reasonix overlay / block menu 只读审计尝试未产生 result.json / process-handoff,且运行期间出现额外 Batch A2 runner,主控已终止进程;该结果不作为正式 handoff 采纳。
    • transcript 只显示探索过程,未形成函数归属表;下一次应改为更窄的单问题只读任务,例如只审计 floating_toolbar_anchor_from_selection / sync_text_selection_overlay 能否迁入 overlays.rs
  • 2026-05-25Codex 主控直接完成 overlay 第一刀:新增 editor_runtime/overlays.rs,迁出 FloatingToolbarAnchorfloating_toolbar_anchor_from_selectionsync_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 --checkcargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgennode scripts/task488-local-attachment-link-delete-undo-smoke.jsnode 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_htmlreorder_top_level_block_htmllib.rs 仅保留调用点和 DropPlacementpub(crate) 可见性。
    • Reasonix runreasonix-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 --checkcargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgennode scripts/task488-local-attachment-link-delete-undo-smoke.jsnode scripts/task489-block-menu-delete-undo-smoke.js
    • 未完成:HTML 整文替换仍是 legacy 路径,后续要用 history-safe Tiptap command 替换;sync_editor_overlay_state、block menu signal 仍未拆出。
  • 2026-05-25:复跑浏览器 smoke 后修正上一条验收口径:task488 通过,但 task489-block-menu-delete-undo-smoke 连续两次失败,失败点是块菜单删除后 Control+Z 未恢复 Beta block
    • 证据:tmp/task489-block-menu-delete-undo-smoke/result.jsontmp/task489-block-menu-delete-undo-smoke/failure.png
    • 已登记缺陷:bugs/05-editor-mainline/done/5-39-block-menu-delete-undo-regression-v1.md
    • Worker Ereasonix-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.mdresult.jsonprocess-handoff.md/jsonworktree 无 diff,拒绝采纳。
    • 当前结论:5-29 仍未完成;下一步应先定位 delete_top_level_block_with_historysync_persisted_editor_command、editor focus / undo keydown 之间的真实断点,再修复。
  • 2026-05-25Codex 主控修复 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 helperduplicate_top_level_blockdelete_top_level_blockreorder_top_level_blockreplace_top_level_block_kind 暂不迁,因仍依赖 slash action、mindmap 和 image placeholder 语义。
    • 已验证:cargo fmt --manifest-path rust/Cargo.toml --all --checkcargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml、wasm release build、wasm-bindgennode scripts/task489-block-menu-delete-undo-smoke.jsnode 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 候选 patchCodex 读取 Hindsight recall、process-handoff.md/jsonresult.json、diff 与验证证据后再选择性合入。
  • 2026-05-25Batch C Worker Breasonix-2026-05-24T17-41-07-634Z-a39f8963)在独立 worktree /mnt/Data1T/mnote-worktrees/0525-c-worker-b-block-delete-undo 未产出 final.mdresult.jsonprocess-handoff.md/jsonworktree diff 为空,拒绝采纳;Codex 随后在同一 worktree 独立定位根因、产出候选 patch、通过 smoke 后移植到主工作区。
  • 2026-05-25Reasonix 只读审计 sync_editor_overlay_state / try_sync_editor_overlay_state 下一刀,使用独立 worktree /mnt/Data1T/mnote-worktrees/0525-d-5-29-overlay-readonlyrun id reasonix-2026-05-24T17-53-20-962Z-d3077308
    • Codex 已读取 Hindsight recall、process-handoff.md/jsonresult.json,并核对 worktree git 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 整簇迁移。