chendefine/dsh-sidebar-superdoc-docx0

dsh-sidebar-superdoc-docx

DSH web plugin: open and edit .docx files in the better-sidebar editor through SuperDoc (superdoc.dev) — a browser-native DOCX editor. Assets are self-hosted from this package's node_modules; edited documents export back to disk atomically.

包名
dsh-sidebar-superdoc-docx
版本
0.1.0
许可证
MIT
最近更新
2026年9月1日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:chendefine/dsh-sidebar-superdoc-docx

Usage

Opening a document

Click any .docx in the sidebar file tree — it opens in the DOCX (SuperDoc) viewer instead of the built-in code/download viewers.

Switching the open mode

Under Settings → Side cards → File preview → DOCX (SuperDoc), the gear exposes the "open mode" select: editing / suggesting / viewing. The choice persists in pluginSettings['superdoc:docx'].mode and takes effect immediately (the editor remounts in the new mode); viewing also hides the save button.

Editing & saving

  • The top toolbar is SuperDoc's native one (bold, lists, comments, …) and folds automatically as the pane narrows;
  • after edits, the header shows ● Unsaved changes; click Save to export and atomically write back to the opened path;
  • state machine: Saving… → Saved / Save failed (failures carry a reason and can be retried); edits made while a save is in flight keep the unsaved hint so you can re-save.

Following outside edits (e.g. an AI agent edited the file)

  • clean editor: the 3s poll detects the disk change → re-fetches and swaps in place via replaceFile, re-fitting the zoom;
  • dirty editor: only a "File changed on disk" banner appears — you decide whether to Reload (reloading discards the current unsaved edits).

Coexistence with other viewers

Vieweridpriority
built-in code viewercode-100
built-in download viewerbinary-download-50
office preview plugindocx0
OnlyOffice pluginonlyoffice:docx10
this pluginsuperdoc:docx10

Ties (e.g. with OnlyOffice) break by registration order. Every viewer can be toggled individually under Settings → Side cards → File preview without affecting the others.