- 统一 local-first MVP 后阶段架构口径,补充 process 执行总序和 Reasonix 协作记录 - 归档已完成的 design checklist,标注参考型 process,更新 AGENTS/REASONIX/架构文档 - 补充文件树/主编辑器下载与上下文菜单相关实现、bug 记录和 smoke 脚本 验证:git diff --check;codegraph sync .;cargo test -p mnote-web;node --check scripts/task476-filetree-editor-context-menu-download-smoke.js
2.9 KiB
2.9 KiB
5-17 Resource Editor Kind 与 Smoke 矩阵 Checklist v1
状态:done
归档说明(2026-05-21):资源 editor kind 与 smoke 矩阵已完成;resolver 与 OnlyOffice 回源后续由
5-19覆盖并归档。日期:2026-05-20
Owner:资源打开 resolver / Office / Markdown/Text/Code/Image/PDF smoke
1. 目标
把资源类型识别和打开策略从分散 if/else 收口为轻量 resolver,并补齐当前缺失的类型 smoke。默认目标是主编辑区 resource tab;右侧边栏和新窗口必须作为显式目标保留。
2. 允许修改范围
rust/crates/mnote-web/src/routes/web_shell.rsrust/crates/mnote-web/src/ssr/pages/layout.rsrust/crates/mnote-web/src/ssr/styles.rsrust/crates/mnote-web/src/routes/onlyoffice.rsscripts/task457-main-editor-resource-tab-smoke.jsscripts/task459-local-markdown-attachment-tab-smoke.js- 可新增 resource kind smoke
3. Checklist
- 定义轻量 resource editor resolver:
- 输入:
name、mimeType、href、assetId、rootUri、path、openTarget。 - 输出:
editorKind、badgeKind、defaultOpenMode、editable、viewerUrl。
- 输入:
.md/.markdown/.txt/ 常见 code 文件继续使用 tiptap resource editor。- Office 文件默认在主编辑区 tab 内 iframe 打开,显式新窗口仍可打开。
- PDF 使用独立
pdfbadge kind,不再复用 ppt。 - image 使用 image badge kind 和 img viewer。
- unknown file 有明确 fallback:下载/新窗口/错误占位,不应无响应。
active-tab、side、new-window三个 target 在同一 resolver 后执行,不再散落在 attachment capture 与 filetree click 中。
4. Smoke 矩阵
.md上传/文件树点击 -> 主编辑区 tiptap tab,可编辑并写回资源文件。.txt-> 主编辑区 tiptap tab,可编辑并写回。.json或.ts-> 主编辑区 tiptap/code-like tab,可编辑并写回。.docx-> 主编辑区 Office iframe,DocumentServer 可回源。.pptx/.xlsx-> badge 颜色分别正确。.pdf-> 主编辑区 iframe,badge 为 pdf 独立颜色。- image -> 主编辑区 img viewer。
- unknown binary -> 明确 fallback,不破坏 page tab 切换。
4.1 本轮执行记录
- 已合入:PDF 独立 badge kind、file fallback badge、resource kind smoke 覆盖 markdown/text/code/image/pdf 与未知类型不破坏 tab 回退。
- 已验证:
scripts/task461-resource-kind-smoke.js与uploaded_attachment_rows_use_colored_file_badges通过。 - 未完成:正式 resource editor resolver 抽象、Office DocumentServer 回源修复、
active-tab/side/new-window统一 resolver 后执行。
5. 非目标
- 不引入 Monaco / CodeMirror。
- 不实现云端资源写回。
- 不重构 OnlyOffice DocumentServer 部署。
- 不改变
.md资源仍用 tiptap 编辑的产品口径。