Skip to content

fix(writer): fix DOCX export and rewrite exporter for correct, professional formatting - #515

Open
DikshaJadhav3110 wants to merge 8 commits into
frappe:developfrom
DikshaJadhav3110:fix/writer-docx-export
Open

fix(writer): fix DOCX export and rewrite exporter for correct, professional formatting#515
DikshaJadhav3110 wants to merge 8 commits into
frappe:developfrom
DikshaJadhav3110:fix/writer-docx-export

Conversation

@DikshaJadhav3110

@DikshaJadhav3110 DikshaJadhav3110 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the broken Export → DOCX functionality and significantly improves DOCX export quality.

  • Fix DOCX export crash: Corrected the export handler to use editor.value.getHTML() and props.file, resolving the silent failure where clicking Export → DOCX did nothing.
  • Improve DOCX exporter: Reworked the exporter to recursively process the document structure, fixing issues with tab wrappers, hyperlinks, images, tables, lists, code blocks, and heading support.
  • Add multi-tab export: Documents with multiple tabs now prompt the user to export either the current tab or all tabs, while single-tab documents continue exporting directly.
  • Fix FDialogs.vue: Restored support for the message prop, fixing a latent issue affecting dialogs across the application.

Closes #514

Screen.Recording.2026-08-07.at.1.41.47.PM.mov

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Fix All in Greploop

Reviews (6): Last reviewed commit: "test(writer): add unit tests for DOCX ex..." | Re-trigger Greptile

Comment thread frontend/src/apps/writer/utils/docxexporter.js Outdated
Comment thread frontend/src/apps/writer/utils/docxexporter.js Outdated
Comment thread frontend/src/apps/writer/utils/docxexporter.js
DikshaJadhav3110 and others added 4 commits August 10, 2026 12:56
Exports the small, pure conversion helpers in docxexporter.js (color/font/
size mapping, image sizing, list numbering, column-width distribution, etc.)
and adds focused unit tests for each, following the existing xlsx-io.js
convention: plain input/output assertions with tiny duck-typed DOM stubs,
no real DOCX generation or parsing. Also adds a .d.ts shim so importing
from the untyped .js file doesn't warn in editors.

Coverage was verified with mutation testing (Stryker, run ad hoc, not
added as a dependency), which surfaced and fixed several real gaps:
whitespace-padded font-family lookups silently missing the font map,
zero/negative image dimensions not being rejected, a malformed colwidth
segment corrupting column-width distribution, and randomId's fallback
chain never being exercised for a stripped-down crypto object.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

[Bug]: Export → DOCX in Writer does nothing (silent JS error)

1 participant