refactor: extract hovered block target helper
This commit is contained in:
@@ -287,3 +287,7 @@ UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据
|
||||
- 审计结论经 Codex 复核后采纳:`handle_lane_left(stage_rect_width)` 属于 editor layout helper,不应迁入 `editor_runtime/block_dnd.rs`;若继续推进 DnD 边界,下一刀应迁 `pointer_in_handle_corridor` 这一层 DOM 查询包装,而不是复制 `CONTENT_COLUMN_*` / `HANDLE_*` 常量。
|
||||
- Codex 主控完成后续小切片:`editor_runtime/block_dnd.rs` 新增 `pointer_in_handle_corridor(client_x, client_y, block, handle_selector, handle_left_fallback, handle_width)`,承接 block/stage/handle DOM 查询与 `HandleCorridorGeometry` 组装;`lib.rs` 删除同名 wrapper,调用点改为显式委托 `block_dnd` helper,并继续由壳层传入 `handle_lane_left(stage_rect.width())` fallback,不复制布局常量。
|
||||
- 已验证:`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_BIND=127.0.0.1:3018 MNOTE_WEB_PUBLIC_BIND=127.0.0.1:3018 cargo run --manifest-path rust/Cargo.toml -p mnote-web`、`MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3018 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:3018 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:3018 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`。
|
||||
- 2026-05-25:Batch AJ 未派发 Reasonix worker;主控直接收口 `hovered_block_from_target` 的共享 DnD/hover 解析层。
|
||||
- 修改:`editor_runtime/block_dnd.rs` 新增 `hovered_block_from_target(target, root, handle_selector)`,承接 `target_element`、handle shell 过滤、direct block index 解析和 `block_state_from_index(index)` 委托;`lib.rs` 的同名函数退化为只负责获取 `editor_root_element()` 后调用 runtime helper。
|
||||
- 边界:未迁 `hovered_block_from_selection`、`drop_indicator_from_target`、`drop_indicator_from_point`、drag/drop listener、keyboard signal 分支或 block reorder 行为;本批只外置共享 target -> `HoveredBlockState` 解析层。
|
||||
- 已验证:`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_BIND=127.0.0.1:3020 MNOTE_WEB_PUBLIC_BIND=127.0.0.1:3020 cargo run --manifest-path rust/Cargo.toml -p mnote-web`、`MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3020 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:3020 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:3020 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`。
|
||||
|
||||
Reference in New Issue
Block a user