1.9 KiB
1.9 KiB
Batch A2 Worker B:local folder restore 后 FileTree focus/reveal — 最终结果
结论
Worker B 目标已完成。local folder 非 md 资源从 trash workbench restore 后,FileTree 恢复行最终可稳定出现 data-active="true",task473-local-folder-trash-restore-no-refresh-focus-gap-smoke.js 已由 ok:false 变为 ok:true。
修改文件
rust/crates/mnote-web/src/routes/gateway.rsrust/crates/mnote-web/src/routes/mindmap_shell.rsrust/crates/mnote-web/src/routes/web_shell.rsrust/crates/mnote-web/src/ssr/pages/layout.rsscripts/task473-local-folder-trash-restore-no-refresh-focus-gap-smoke.js
实现策略
- trash workbench restore 后写入
mnote.pendingLocalFolderRestoreFiletreeRowId。 - filetree 初始渲染与
refreshLocalFolderSidebarSnapshot()轮询刷新时消费 pending row-id。 - 为避免 local folder polling 覆盖 focus,采用短时间重放聚焦的方式,稳定后再清理 pending。
task473同步改为真实回归 smoke:只有出现 focus 证据才算通过。
验证命令和结果
cargo test --manifest-path rust/Cargo.toml -p mnote-web layout -- --test-threads=1
cargo test --manifest-path rust/Cargo.toml -p mnote-web gateway -- --test-threads=1
node --check scripts/task473-local-folder-trash-restore-no-refresh-focus-gap-smoke.js
MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3012 PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/google-chrome-stable node scripts/task473-local-folder-trash-restore-no-refresh-focus-gap-smoke.js
结果:
layout/gatewaytargeted tests 通过。task473最终结果:ok:truefocusAfterRestore.attrs.data-active="true"
未完成项 / 风险
- local folder empty-trash smoke 仍未补齐。
- local folder Markdown 自身 trash lifecycle 仍未单独编写独立 smoke。
- 3000 常驻进程若仍旧,后续 smoke 需确认已重启到最新代码。