Files
mnote/.codex/reasonix-tasks/results/batch-a2-worker-b-restore-focus.md
T

42 lines
1.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.
# Batch A2 Worker Blocal 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.rs`
- `rust/crates/mnote-web/src/routes/mindmap_shell.rs`
- `rust/crates/mnote-web/src/routes/web_shell.rs`
- `rust/crates/mnote-web/src/ssr/pages/layout.rs`
- `scripts/task473-local-folder-trash-restore-no-refresh-focus-gap-smoke.js`
## 实现策略
1. trash workbench restore 后写入 `mnote.pendingLocalFolderRestoreFiletreeRowId`
2. filetree 初始渲染与 `refreshLocalFolderSidebarSnapshot()` 轮询刷新时消费 pending row-id。
3. 为避免 local folder polling 覆盖 focus,采用短时间重放聚焦的方式,稳定后再清理 pending。
4. `task473` 同步改为真实回归 smoke:只有出现 focus 证据才算通过。
## 验证命令和结果
```bash
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` / `gateway` targeted tests 通过。
- `task473` 最终结果:`ok:true`
- `focusAfterRestore.attrs.data-active="true"`
## 未完成项 / 风险
- local folder empty-trash smoke 仍未补齐。
- local folder Markdown 自身 trash lifecycle 仍未单独编写独立 smoke。
- 3000 常驻进程若仍旧,后续 smoke 需确认已重启到最新代码。