Files
mnote/design/05-editor-mainline/done/5-17-resource-editor-kind-and-smoke-matrix-checklist-v1.md
T
lix-2026 1956a8a21a chore: align mvp design governance
- 统一 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
2026-05-21 09:04:13 +08:00

2.9 KiB
Raw Blame History

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.rs
  • rust/crates/mnote-web/src/ssr/pages/layout.rs
  • rust/crates/mnote-web/src/ssr/styles.rs
  • rust/crates/mnote-web/src/routes/onlyoffice.rs
  • scripts/task457-main-editor-resource-tab-smoke.js
  • scripts/task459-local-markdown-attachment-tab-smoke.js
  • 可新增 resource kind smoke

3. Checklist

  • 定义轻量 resource editor resolver
    • 输入:namemimeTypehrefassetIdrootUripathopenTarget
    • 输出:editorKindbadgeKinddefaultOpenModeeditableviewerUrl
  • .md / .markdown / .txt / 常见 code 文件继续使用 tiptap resource editor。
  • Office 文件默认在主编辑区 tab 内 iframe 打开,显式新窗口仍可打开。
  • PDF 使用独立 pdf badge kind,不再复用 ppt。
  • image 使用 image badge kind 和 img viewer。
  • unknown file 有明确 fallback:下载/新窗口/错误占位,不应无响应。
  • active-tabsidenew-window 三个 target 在同一 resolver 后执行,不再散落在 attachment capture 与 filetree click 中。

4. Smoke 矩阵

  • .md 上传/文件树点击 -> 主编辑区 tiptap tab,可编辑并写回资源文件。
  • .txt -> 主编辑区 tiptap tab,可编辑并写回。
  • .json.ts -> 主编辑区 tiptap/code-like tab,可编辑并写回。
  • .docx -> 主编辑区 Office iframeDocumentServer 可回源。
  • .pptx / .xlsx -> badge 颜色分别正确。
  • .pdf -> 主编辑区 iframebadge 为 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.jsuploaded_attachment_rows_use_colored_file_badges 通过。
  • 未完成:正式 resource editor resolver 抽象、Office DocumentServer 回源修复、active-tab / side / new-window 统一 resolver 后执行。

5. 非目标

  • 不引入 Monaco / CodeMirror。
  • 不实现云端资源写回。
  • 不重构 OnlyOffice DocumentServer 部署。
  • 不改变 .md 资源仍用 tiptap 编辑的产品口径。