Files
mnote/design/03-rust-web/process/3-20-browser-runtime-followup-checklist-v1.md
T

74 lines
4.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 3-20 Browser Runtime 后续收口 Checklist v1
> 创建时间:2026-05-25
> 状态:`process`
> 来源:承接 `design/03-rust-web/done/3-19-rust-web-browser-runtime-module-extraction-v1.md` 的后续未专项完成项。
## 1. 目标
`3-19` 已归档的基础上,继续把仍留在 Rust inline / 主壳大 runtime 中的浏览器行为切成可审计模块。Codex 维护本文件作为事实源,Reasonix 只承接短批次审计、窄范围实现或浏览器 smoke;每批最多 4 个 worker。
## 2. 本轮边界
本轮优先处理:
- 主壳 filetree keyboard / clipboard / DND / context menu DOM 后续切片。
- document pane host adapter / document session / conflict panel runtime 只读审计。
- 本地上传主流程剩余边界审计,包括 `uploadFileToMediaAsset``uploadFilesWithResolvedTarget``insertUploadedAssetIntoEditor`
- WS / SSE tree live 浏览器回归 smoke。
本轮不处理:
- Tiptap 编辑器内部命令、history、selection overlay;这些归 `5-29`
- Rust kernel tree command 语义重写。
- Page AI panel 外置化;需要另起 `07-ai` 设计。
## 3. Batch A 候选任务
- [ ] Worker A:只读审计 document pane host adapter。
- 目标:列出 `web_shell.rs` 中 document pane host / session / conflict panel 可迁模块、风险和 smoke。
- 输出:候选模块表、禁止迁入 editor runtime 的边界、下一刀建议。
- [ ] Worker B:只读审计 local upload 主流程。
- 目标:复核上传主流程剩余函数是否可从 `SIDEBAR_TREE_JS` 拆入 `local-upload-runtime.js`,不得改变资源归属语义。
- 输出:函数归属表、不可迁项、必须保留的 smoke。
- [ ] Worker C:只读审计 filetree keyboard / clipboard / DND。
- 目标:基于已落地 `filetree-runtime.js` / `filetree-selection-runtime.js` / `filetree-context-menu-runtime.js`,给出下一刀最小实现范围。
- 输出:建议只迁纯 helper 还是 DOM listener,列出冲突文件。
- [ ] Worker D:浏览器 smoke 审计 WS / SSE tree live。
- 目标:只读验证主壳 tree live 外置 runtime 在浏览器中仍加载,记录 WS 正常路径和 SSE fallback 的可测性。
- 输出:截图、console/network、result.json;不修改源码。
## 4. 验收命令
按具体切片选择:
```bash
cargo fmt --manifest-path rust/Cargo.toml --all --check
cargo check --manifest-path rust/Cargo.toml -p mnote-web
cargo test --manifest-path rust/Cargo.toml -p mnote-web filetree
cargo test --manifest-path rust/Cargo.toml -p mnote-web runtime
node scripts/task487-local-folder-tree-live-consumer-smoke.js
node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js
```
UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据。
## 5. 采纳规则
- Reasonix 结果必须先查 Hindsight `reasonix` recall,再读 `process-handoff.md/json``result.json`、diff 和验证证据。
- 只采纳限定文件范围内的最小 diff;越界重构、回滚用户改动、修改 git 状态的一律拒绝。
- browser smoke worker 必须 `modified_files=[]`
- 本文件只记录真实完成项;未验证项保持未勾选。
## 6. 本轮执行记录
- 2026-05-25Codex 创建本续跑事实源。
- 2026-05-25:修正执行约束:本文件遵循当前 goal 的“每批最多 2 个 worker”,不再沿用早期草稿中的 4 worker 并行方案。
- 2026-05-25:下一批只派发 Worker Blocal upload / filetree 下一刀只读审计);Worker A/C/D 暂缓。
- 2026-05-25Reasonix local upload / filetree 只读审计尝试未产生 `result.json` / `process-handoff`,且运行期间出现额外 Batch A2 runner,主控已终止进程;该结果不作为正式 handoff 采纳。
- 可参考的 transcript 结论:`fetchWithTimeout` 是低风险纯工具函数,可先迁入 `local-upload-runtime.js``uploadFileToMediaAsset` / `uploadFilesWithResolvedTarget` / `insertUploadedAssetIntoEditor` 仍与 API、editor 插入和 snapshot refresh 耦合,暂不迁。
- 2026-05-25Codex 主控直接完成低风险切片:`local-upload-runtime.js` 新增并导出 `fetchWithTimeout``layout.rs` 的 inline `fetchWithTimeout` 先委托 runtime,保留原 fallback。
- 修改:`rust/crates/mnote-web/browser/local-upload-runtime.js``rust/crates/mnote-web/src/ssr/pages/layout.rs`
- 已验证:`node --check rust/crates/mnote-web/browser/local-upload-runtime.js``cargo fmt --manifest-path rust/Cargo.toml --all --check``cargo check --manifest-path rust/Cargo.toml -p mnote-web``cargo test --manifest-path rust/Cargo.toml -p mnote-web mnote_browser_runtime_assets_are_explicitly_mounted -- --test-threads=1``cargo test --manifest-path rust/Cargo.toml -p mnote-web local_upload_runtime_contains_editor_upload_context_helpers -- --test-threads=1`
- 未完成:`insertUploadedAssetIntoEditor``uploadFileToMediaAsset``uploadFilesWithResolvedTarget` 仍未迁出。