承接 RFC #13(docs/LIBREOFFICE_MIGRATION_PLAN.md)与 Phase 0 原型 #39。Phase 0 已完成、结论 GO(走路线 A / ZetaOffice WASM),正式立项 Phase 1。所有工作在分支 feat/libreoffice-migration,master 继续发 WPS 稳定版,互不影响。
Phase 0 验收结论(GO)/ Phase 0 verdict
四个生死项的 PoC 均在真机/浏览器跑通(截图与日志见 #39):
- ✅ CJK 渲染:CDN 默认 LOWA 无中文字体→豆腐块;注入 CJK 字体即正确渲染(简繁皆可)。
- ✅ 中文输入:Qt5-WASM 上游无 IME;自建"真 input 承接系统 IME →
compositionend → UNO 在光标处 insertString"输入桥可正常连续中文输入(焦点交还、追加不替换/不选中均已修)。
- ✅ zetajs 程序化能力:取选区 / 模型原生搜索(
XSearchable、findFirst/findNext)/ RecordChanges 修订留痕——RFC §0.2"弃整数 offset、用模型原生"主张功能性验证通过。
- ⚠️ 性能/包体:50 页批量生成 ≈26.5s(程序化写入、非真实编辑);加载既有 docx 的真实耗时与安装包体积增量待量化补测(Phase 1 任务 ⑤)。
Phase 1 任务(可认领)/ Phase 1 tasks (claimable)
接手者必读·关键工程事实 / Key facts
- LOWA 运行时=
cdn.zetaoffice.net/zetaoffice_latest/ 的 soffice.{js,wasm,data},但 zeta.js 桥不在 CDN,须本地 vendored。
- 主线程线程端口=
Module.uno_main(非 Module.zetajs,后者只在 office worker 里),且须在 soffice.js 的 onload 里挂。
- WASM 需
SharedArrayBuffer → 页面须跨源隔离(COOP same-origin + COEP require-corp);Electron 用 session.webRequest.onHeadersReceived 注入。
- emscripten 全局
out(stdout)会覆盖页面全局 out —— 勿用 out 当全局名(spike 已改 zlog)。
- 字体注入须在 fontconfig 启动扫描前(
Module.preRun;LOWA data 挂载是 merge 进 MEMFS,故 preRun 写入有效)。
- 跑 spike:
cd experiments/zetaoffice-spike && node serve.mjs → 真 Chrome:8777;或 ../../desktop/node_modules/.bin/electron .(真机)。
English (summary). Phase 0 of the LibreOffice migration (RFC #13, spike #39) is complete — verdict GO (route A / ZetaOffice WASM). All four make-or-break checks have working PoCs on branch feat/libreoffice-migration: CJK rendering (inject a CJK font into the LOWA font dir), Chinese input (a real <input> hosts the system IME → compositionend → UNO insertString at the cursor; focus-handoff + append-not-replace fixed), and zetajs programmatic ops (selection, model-native XSearchable search, RecordChanges redline). Perf/bundle is partial (50-page bulk-gen ~26.5s; real load/edit timing + installer size increment TBD). This Epic tracks the claimable Phase 1 tasks: font into self-hosted bundle, IME overlay, backend tool-contract rename, frontend executor rewrite (drop integer offsets → model-native), perf re-measure, Electron integration (COOP/COEP via onHeadersReceived), and gray rollout. master keeps shipping the WPS-based release; migration work stays isolated on the branch. Key engineering facts above.
Phase 0 验收结论(GO)/ Phase 0 verdict
四个生死项的 PoC 均在真机/浏览器跑通(截图与日志见 #39):
compositionend→ UNO 在光标处insertString"输入桥可正常连续中文输入(焦点交还、追加不替换/不选中均已修)。XSearchable、findFirst/findNext)/RecordChanges修订留痕——RFC §0.2"弃整数 offset、用模型原生"主张功能性验证通过。Phase 1 任务(可认领)/ Phase 1 tasks (claimable)
/instdir/share/fonts/truetype/,构建期由 fontconfig 原生扫到(替代 PoC 的运行时注入)。area: desktoparea: frontendWpsTools/WpsActionService/useWpsBridge等 WPS 命名 → 编辑器无关命名(后端命令逻辑不动,仅命名解耦)。area: aiXSearchable+XParagraphCursor+书签锚点(弃整数 offset);修订→RecordChanges默认开;选区/插入/替换→UNO 游标+XReplaceable。area: frontendonHeadersReceived(COOP/COEP)+ WASM 渲染窗,按独立 session/partition 接进desktop/main/main.js(不动主应用现有webSecurity设置)。area: desktop接手者必读·关键工程事实 / Key facts
cdn.zetaoffice.net/zetaoffice_latest/的soffice.{js,wasm,data},但zeta.js桥不在 CDN,须本地 vendored。Module.uno_main(非Module.zetajs,后者只在 office worker 里),且须在soffice.js的onload里挂。SharedArrayBuffer→ 页面须跨源隔离(COOPsame-origin+ COEPrequire-corp);Electron 用session.webRequest.onHeadersReceived注入。out(stdout)会覆盖页面全局out—— 勿用out当全局名(spike 已改zlog)。Module.preRun;LOWA data 挂载是 merge 进 MEMFS,故 preRun 写入有效)。cd experiments/zetaoffice-spike && node serve.mjs→ 真 Chrome:8777;或../../desktop/node_modules/.bin/electron .(真机)。English (summary). Phase 0 of the LibreOffice migration (RFC #13, spike #39) is complete — verdict GO (route A / ZetaOffice WASM). All four make-or-break checks have working PoCs on branch
feat/libreoffice-migration: CJK rendering (inject a CJK font into the LOWA font dir), Chinese input (a real<input>hosts the system IME →compositionend→ UNOinsertStringat the cursor; focus-handoff + append-not-replace fixed), and zetajs programmatic ops (selection, model-nativeXSearchablesearch,RecordChangesredline). Perf/bundle is partial (50-page bulk-gen ~26.5s; real load/edit timing + installer size increment TBD). This Epic tracks the claimable Phase 1 tasks: font into self-hosted bundle, IME overlay, backend tool-contract rename, frontend executor rewrite (drop integer offsets → model-native), perf re-measure, Electron integration (COOP/COEP viaonHeadersReceived), and gray rollout. master keeps shipping the WPS-based release; migration work stays isolated on the branch. Key engineering facts above.