56 lines
1.7 KiB
Markdown
56 lines
1.7 KiB
Markdown
# Reasonix Batch A / Worker A:5-29 dom_selection 第一刀
|
||||
|
|
|
|||
|
|
Project root:由 runner 传入的独立 worktree。
|
|||
|
|
|
|||
|
|
## 目标
|
|||
|
|
|
|||
|
|
实现 `design/05-editor-mainline/process/5-29-editor-runtime-followup-checklist-v1.md` 中 Worker A:新增 `editor_runtime/dom_selection.rs`,从 `rust/spikes/leptos-tiptap-spike/src/lib.rs` 迁出最小 selection helper,保持行为不变。
|
|||
|
|
|
|||
|
|
## 允许修改
|
|||
|
|
|
|||
|
|
- `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`
|
|||
|
|
|
|||
|
|
## 候选函数
|
|||
|
|
|
|||
|
|
优先迁移边界清楚、参数少、与 Leptos signal 无强耦合的函数:
|
|||
|
|
|
|||
|
|
- `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、local upload。
|
|||
|
|
- 不改 shell / `mnote-web` 代码。
|
|||
|
|
- 不修改设计文档、AGENTS、git 状态或提交。
|
|||
|
|
- 不做大范围格式化。
|
|||
|
|
- 不改用户可见文案,除非编译必须。
|
|||
|
|
|
|||
|
|
## 验收命令
|
|||
|
|
|
|||
|
|
至少运行:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cargo fmt --manifest-path rust/Cargo.toml --all --check
|
|||
|
|
cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
如果时间允许,再运行:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cargo build --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml --target wasm32-unknown-unknown --release
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 输出要求
|
|||
|
|
|
|||
|
|
最终 handoff 必须列出:
|
|||
|
|
|
|||
|
|
- 修改文件和迁移函数清单。
|
|||
|
|
- 未迁函数及原因。
|
|||
|
|
- 验收命令和结果。
|
|||
|
|
- 风险,尤其是是否改变 selection / toolbar / shortcut 行为。
|