refactor: move selection payload helpers

This commit is contained in:
lix-2026
2026-05-25 05:34:16 +08:00
parent e6ab9268b6
commit ec27e08e8b
5 changed files with 87 additions and 76 deletions
@@ -190,3 +190,11 @@ UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据
- 修改:`rust/spikes/leptos-tiptap-spike/src/editor_runtime/overlays.rs``rust/spikes/leptos-tiptap-spike/src/lib.rs`
- 已验证:`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``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task489-block-menu-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task488-local-attachment-link-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`
- 未迁:`send_selection_state_to_target` / `selection_payload` bridge 链路、`runtime_block_id_from_index`、selection bridge event、`drop_indicator_from_target`、拖拽 listener 和 block reorder 行为仍留在 `lib.rs`
- 2026-05-25Batch V 只派发 1 个只读 Reasonix worker 审计 selection bridge 迁出边界,使用独立 worktree `/mnt/Data1T/mnote-worktrees/0525-v-worker-a-5-29-selection-bridge-readonly`run id `reasonix-2026-05-24T21-22-36-118Z-1e489f85`,并显式使用 `--no-memory-recall`
- Codex 已读取 Hindsight recall、`process-handoff.md/json``result.json``final.md`,并核对 worktree `git status --short` / `git diff --stat` 为空;Reasonix 未修改源码。
- 审计结论经 Codex 复核后采纳:selection bridge 的事件分发层必须留在 `lib.rs`,但 `SelectionPayload``selection_payload``runtime_block_id_from_index` 及其 block id 读取 helper 属于可迁出的 selection 数据层。
- Codex 主控基于只读审计结论在主工作区完成最小实现;本批没有实现 worker 候选 patch,因此不记录虚构 worktree 采纳链。
- 已合入最小切片:`SelectionPayload``selection_payload``runtime_block_id_from_index``block_id_from_element``block_id_from_json_node` 迁入 `editor_runtime/dom_selection.rs``send_selection_state_to_target``dispatch_selection_event_to_target``CustomEvent` bridge 和 `selection_event_target` 壳层调用继续留在 `lib.rs`
- 修改:`rust/spikes/leptos-tiptap-spike/src/editor_runtime/dom_selection.rs``rust/spikes/leptos-tiptap-spike/src/lib.rs`
- 已验证:`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``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task489-block-menu-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task488-local-attachment-link-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`
- 未迁/未删:`send_selection_state_to_target`、selection event dispatch、`send_selection_state``selection_event_payload``runtime_state_payload``runtime_status_payload` 等未使用 bridge/helper 函数;死代码清理后续单独切片处理。