refactor: move body focus detection

This commit is contained in:
lix-2026
2026-05-25 02:19:57 +08:00
parent 6d0852e431
commit a3abeadfe8
5 changed files with 20 additions and 17 deletions
@@ -98,7 +98,7 @@ UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据
- Codex 已读取 Hindsight recall、`process-handoff.md/json``result.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` 整簇迁移。
- 2026-05-25Codex 主控完成 editor focus helper 第一刀:新增 `editor_runtime/editor_focus.rs`,迁出 `schedule_editor_focus``active_editor_stage``lib.rs` 仍保留 overlay / block menu signal 编排和调用点。
- 2026-05-25Codex 主控完成 editor focus helper 第一刀:新增 `editor_runtime/editor_focus.rs`,迁出 `schedule_editor_focus``body_has_focus``active_editor_stage``lib.rs` 仍保留 overlay / block menu signal 编排和调用点。
- 修改:`rust/spikes/leptos-tiptap-spike/src/editor_runtime/editor_focus.rs``rust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs``rust/spikes/leptos-tiptap-spike/src/lib.rs`、generated island wasm/js。
- 已验证:`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`
- 未完成:`sync_editor_overlay_state` / `try_sync_editor_overlay_state``HoveredBlockState` shared type、block menu signal 仍未拆出。