Files
mnote/design/05-editor-mainline/done/5-24-open-editors-lightweight-view-checklist-v1.md
T

54 lines
2.3 KiB
Markdown
Raw Normal View History

2026-05-21 05:57:19 +08:00
# 5-24 Open Editors Lightweight View Checklist v1
2026-05-21 09:04:13 +08:00
> 状态:done
>
> 归档说明(2026-05-21):open editors lightweight snapshot / 可观测模型已完成;完整 sidebar UI 不是本阶段目标。
2026-05-21 05:57:19 +08:00
>
> 日期:2026-05-21
>
> Ownermain editor tab / sidebar open editors parity
## 1. 目标
参考 Sidex / VSCode `OpenEditorsView`,为 MNote 做轻量版“打开的编辑器”视图或可观测模型。当前阶段不要求完整 UI,但至少要让 page/resource tabs 的 active、title、kind、dirty guard 状态可被统一读取和测试。
## 2. 允许修改范围
- `rust/crates/mnote-web/src/routes/web_shell.rs`
- `rust/crates/mnote-web/src/ssr/styles.rs`
- 可新增 `scripts/task47*-open-editors-*.js`
## 3. 禁止事项
- 不引入完整 VSCode editor group service。
- 不实现多 editor group grid。
- 不改变 Page Aggregate / local Markdown 事实源。
- 不破坏现有 resource tab 打开、关闭和 URL state。
## 4. Checklist
- [x] 暴露轻量 open editors snapshotpage tab + resource tabs。
- [x] snapshot 至少包含 `objectIdentity``title``kind``active``dirtyGuard`
- [x] active tab 切换时 snapshot 更新。
- [x] resource tab close / create 时 snapshot 更新。
- [ ] 如做 UI,保持低干扰,不新增复杂 sidebar 分组。
- [x] 补测试或 smoke,验证可读取 active editor 列表。
## 5. 验收
- `cargo test -p mnote-web web_shell -- --test-threads=1`
- 如新增 smoke`node scripts/task47*-open-editors-*.js`
## 6. 非目标
- 不做 drag editor between groups。
- 不做完整 dirty working copy service。
## 7. 执行记录
- 2026-05-21Codex 补齐 `mnote.open_editors_snapshot.v1` 轻量合同,暴露 `window.__mnoteDocumentPaneRuntime.getOpenEditorsSnapshot()`,并同步 `window.__mnoteOpenEditorsSnapshot` / `data-mnote-open-editors-count` / `data-mnote-active-editor`
- 2026-05-21snapshot 覆盖 page tab 与 resource tabsresource tab 条目包含 `objectIdentity``title``kind``badgeKind``active``dirtyGuard``assetId``path`
- 2026-05-21:未新增 sidebar UI,当前阶段先保持为可观测模型。
- 2026-05-21`cargo test -p mnote-web web_shell -- --test-threads=1` 通过。
- Reasonix Worker A 本轮只停留在探索,未产生可合入 diff;最终由 Codex 本地实现。