Skip to content

feat(editor): Casual Docs and Sheets editors with co-editing, comments and Office export - #605

Open
tobao17 wants to merge 9 commits into
testfrom
feat/casual-editors
Open

tobao17 wants to merge 9 commits into
testfrom
feat/casual-editors

Conversation

@tobao17

@tobao17 tobao17 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What

Two in-app editors for the desk, both built on Casual Office (Apache/MIT):

  • Casual Docs (editor_docs, .udoc): native .docx editing (ProseMirror + WASM layout), Google-Docs style header with editable title, autosave, Ctrl+S, co-editing and comments through the Casual Docs gateway.
  • Casual Sheets (editor_sheet, .usheet): Univer based spreadsheet with the full Casual chrome (menus, toolbar, formula bar, comments, tables), dark/light theme, presence avatars and live co-editing through the Casual Sheets server.

Also:

  • "+ New" menu gets Document / Spreadsheet rows for the new editors (same label and glyph as the ONLYOFFICE rows, Casual colours), tiles use the Casual logos.
  • Download of .udoc / .usheet produces a real .docx / .xlsx (builtins/editor/export.js), like Google Docs and Sheets.
  • Help menu of both editors opens a one-row "Contact us" popover that leads to the Drumee support chat.

How it is wired

  • Files are stored through the existing media.save path as JSON ({docx: base64} for docs, the Univer workbook snapshot for sheets), so nothing changes server side.
  • Co-editing is optional: on mount the editor probes <endpoint>/collab/health (docs) and <endpoint>/sheets/health (sheets). When the gateway is not routed the editor silently runs single-user. On stage the gateways run as Docker containers on the box and are currently routed for the liam endpoint only; the root endpoint needs the two nginx locations before co-editing is live there.
  • Univer's @univerjs/docs-mention-ui is not published on npm: stubs/univerjs-docs-mention-ui provides a no-op plugin, referenced from package.json as a file: dependency.
  • patches/@casualoffice+sheets+0.20.0.patch (patch-package) makes the Casual Sheets lazy plugin loader per Univer instance; upstream keeps it module global, which leaves comments and tables dead in every sheet after the first one.
  • scripts/postinstall-casual.js copies the Casual Docs layout engine WASM next to the chunk that loads it (the package ships it one directory up).
  • .npmrc turns on legacy-peer-deps: Casual Docs' peer ranges conflict with the Univer 0.25.1 set Casual Sheets needs. Every peer the build relies on is listed explicitly.

Verified

  • Clean clone, npm install, production webpack build: 0 errors.
  • On the liam stage endpoint: create, edit, save, reopen, rename, download for both editors; two-tab co-editing, remote cursors, comments with author names, presence; first click works everywhere; no periodic save loop; desk theme untouched.

Known limits

  • Multi-select / zip downloads still contain the raw JSON files.
  • Debug [DOCS] / [SHEET] console logs are still in place.
  • Casual Docs' File menu keeps its native Open / Make a copy / Email as attachment entries.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
11.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant