align workbench open editors tabs
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# 5-24 Open Editors Lightweight View Checklist v1
|
||||
|
||||
> 状态:process
|
||||
>
|
||||
> 日期:2026-05-21
|
||||
>
|
||||
> Owner:main 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 snapshot:page 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-21:Codex 补齐 `mnote.open_editors_snapshot.v1` 轻量合同,暴露 `window.__mnoteDocumentPaneRuntime.getOpenEditorsSnapshot()`,并同步 `window.__mnoteOpenEditorsSnapshot` / `data-mnote-open-editors-count` / `data-mnote-active-editor`。
|
||||
- 2026-05-21:snapshot 覆盖 page tab 与 resource tabs;resource 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 本地实现。
|
||||
@@ -0,0 +1,74 @@
|
||||
# 5-25 Editor Tab Keyboard and MRU Checklist v1
|
||||
|
||||
> 状态:process
|
||||
>
|
||||
> 日期:2026-05-21
|
||||
>
|
||||
> Owner:main editor tab keyboard / MRU behavior
|
||||
|
||||
## 1. 目标
|
||||
|
||||
参考 Sidex / VSCode `MultiEditorTabsControl`,补 MNote main tab 的基础键盘和 MRU 行为。当前只做轻量交互,不照搬完整 tab control。
|
||||
|
||||
## 2. 允许修改范围
|
||||
|
||||
- `rust/crates/mnote-web/src/routes/web_shell.rs`
|
||||
- `rust/crates/mnote-web/src/ssr/styles.rs`
|
||||
- 可新增聚焦 smoke
|
||||
|
||||
## 3. 禁止事项
|
||||
|
||||
- 不新增全局快捷键与浏览器默认冲突。
|
||||
- 不实现完整 tab overflow 复杂布局。
|
||||
- 不改变 resource tab identity。
|
||||
|
||||
## 4. Checklist
|
||||
|
||||
- [x] tab strip 支持左右箭头 roving focus。
|
||||
- [x] `Enter` / `Space` 激活当前 focused tab。
|
||||
- [x] 关闭 active resource tab 后回到 MRU 或 page tab,行为稳定。
|
||||
- [x] tab 上保留可测试 DOM 状态。
|
||||
- [x] 补测试或 smoke。
|
||||
|
||||
## 5. 验收
|
||||
|
||||
- `cargo test -p mnote-web web_shell -- --test-threads=1`
|
||||
- 如新增 smoke:`node scripts/task47*-editor-tab-keyboard-*.js`
|
||||
|
||||
## 6. 执行记录
|
||||
|
||||
> 引用 proposal:`.codex/reasonix-proposals/2026-05-21-tab-keyboard-mru-proposal.md`
|
||||
|
||||
### 已确认
|
||||
|
||||
- `resourceTabMru` 数组 + `touchResourceTabMru` / `lastActiveResourceTabKey` / `removeFromResourceTabMru` 逻辑完整,MRU 核心逻辑无需改动。
|
||||
- `activateMainEditorTab` 已正确维护 roving tabindex(active → `tabindex="0"`, others → `tabindex="-1"`)。
|
||||
- `createResourceTabDom` 中 resource tab 初始 `tabindex="-1"` 符合预期。
|
||||
|
||||
### 已实现
|
||||
|
||||
- [x] 新增 `bindMainEditorTabStrip()` 函数(keydown 事件委托 + collectTabs + 箭头/Home/End/Enter/Space)。
|
||||
- [x] 修改 `closeResourceTab()` 末尾,关闭后 focus 迁移到新激活的 tab。
|
||||
- [x] 在 `styles.rs` 补充 `:focus-visible` 样式。
|
||||
- [x] 更新 Rust contract test 断言。
|
||||
- [x] `cargo test -p mnote-web web_shell -- --test-threads=1` 通过。
|
||||
|
||||
### 后续可选
|
||||
|
||||
- [ ] 如后续需要浏览器级回归,可新增 `scripts/task475-editor-tab-keyboard-mru-smoke.js`,覆盖多 tab 键盘切换与关闭后 focus。
|
||||
|
||||
### 非预期发现
|
||||
|
||||
- `closeResourceTab` 在 activate 后未显式调用 `focus()`,导致 keyboard focus 丢失。需修复。
|
||||
- tab strip 无 `:focus-visible` 样式,键盘用户在箭头导航后看不到 focus 环。
|
||||
|
||||
### Codex 实施记录
|
||||
|
||||
- 2026-05-21:Reasonix Worker B 按要求只输出 proposal,未直接改源码。
|
||||
- 2026-05-21:Codex 按 proposal 的最小安全集实现键盘 roving focus、Enter/Space 激活、关闭后 MRU/page tab focus 迁移。
|
||||
- 2026-05-21:未新增全局快捷键;事件只绑定在 `[data-mnote-main-tab-strip]` 内。
|
||||
|
||||
## 7. 非目标
|
||||
|
||||
- 不做拖拽 tab 排序。
|
||||
- 不做 close others / close saved 复杂菜单。
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
# 5-26 Resource Open Resolver Convergence Checklist v1
|
||||
|
||||
> 状态:process
|
||||
>
|
||||
> 日期:2026-05-21
|
||||
>
|
||||
> Owner:resource open resolver / attachment and filetree open targets
|
||||
|
||||
## 1. 目标
|
||||
|
||||
继续参考 Sidex 的 editor input resolver 思路,把 MNote 正文附件、FileTree asset、side target、new-window 的资源打开策略收敛到更一致的 resolver 合同。
|
||||
|
||||
## 2. 允许修改范围
|
||||
|
||||
- `rust/crates/mnote-web/src/ssr/pages/layout.rs`
|
||||
- `rust/crates/mnote-web/src/routes/web_shell.rs` 仅限提出 patch 建议,默认不直接修改,避免与 5-24/5-25 冲突。
|
||||
- `scripts/task463-onlyoffice-resolver-smoke.js`
|
||||
|
||||
## 3. 禁止事项
|
||||
|
||||
- 不改变文件树当前已验证可用的 edit-mode active tab 行为。
|
||||
- 不把 md/text/code 改成 OnlyOffice 或浏览器新窗口默认打开。
|
||||
- 不把 resource kind 判断散回多个 UI 分支。
|
||||
|
||||
## 4. Checklist
|
||||
|
||||
- [ ] 审查 `buildLocalOnlyOfficeOpenUrl`、`openEditorAttachmentEditTab`、`openConvexAssetFromFileTree` 与 `resolveResourceOpen` 的重复判断。
|
||||
- [ ] 给出最小收敛方案,优先减少正文附件与 FileTree 的分歧。
|
||||
- [ ] 若可安全实现,只改 `layout.rs` / `task463` 内重复逻辑。
|
||||
- [ ] 补 smoke 或断言,覆盖正文附件 `弹窗编辑` 与 `新窗口编辑` 分流。
|
||||
|
||||
## 5. 验收
|
||||
|
||||
- `cargo test -p mnote-web sidebar_tree_runtime_opens_office_assets_through_resource_shell -- --test-threads=1`
|
||||
- `node scripts/task463-onlyoffice-resolver-smoke.js`
|
||||
|
||||
## 6. 非目标
|
||||
|
||||
- 不引入新的 editor service 层。
|
||||
- 不改 OnlyOffice callback 写回链路。
|
||||
|
||||
## 7. 本轮执行记录
|
||||
|
||||
- 2026-05-21:Reasonix Worker C 对照了 `openConvexAssetFromFileTree`、`openEditorAttachmentDetail`、`openEditorAttachmentNewWindow`、`openEditorAttachmentEditTab` 的重复 local Office 打开分支,并提交了“新增 `openLocalOfficeFileInActiveTab` 辅助函数”的计划。
|
||||
- 2026-05-21:Worker C 进程停留在计划提交阶段,没有生成 `final.md`,也没有实际修改 `layout.rs` / `task463`;本轮不把 5-26 checklist 标记为完成。
|
||||
- 后续建议:若继续推进 5-26,应先用 Codex 本地复核 helper 边界,再小步改 `layout.rs`,重点保持“正文附件弹窗编辑进 main resource tab、正文附件新窗口编辑进浏览器窗口、md/text/code 继续走 tiptap”三条已验证行为不回退。
|
||||
Reference in New Issue
Block a user