wardethan2000-eng puts Word-style editing inside Mike

This fork turns document review into a more practical drafting workspace, without forcing lawyers back into a separate editor for every change.

draftingworkflow

The new in-app document editor is aimed at the everyday mechanics of legal drafting: making revisions, preserving formatting, and keeping a record of what changed.

  • Edit document text in place, with changes saved automatically.
  • Track paragraph-level revisions and move back through saved versions with undo.
  • Preserve existing formatting while changing text colour, font size and heading levels.
  • Keep a firm's established document styles rather than replacing them.
  • Create and maintain lists from the editing controls.

That is a meaningful step toward handling live drafting inside the legal-AI workflow, rather than treating documents as read-only inputs. The work also comes with substantial testing, though firms using complex templates should inspect it closely before relying on it for headers, footers, concurrent edits or heavily tracked documents.

So what Managing partners and legal-ops teams looking to reduce the handoff between AI-assisted review and final drafting should take a closer look.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

4 commits from wardethan2000-eng/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
cc7f331e feat: in-app Word document editor with formatting and autosave Ethan Ward 2026-08-18 ↗ GitHub
commit body
Adds an always-on editor for .docx documents in the viewer: click and
type in the rendered document, a toolbar for bold/italic/underline and
alignment, and autosave a moment after you stop typing. Formatting is
written back into the real .docx, so the letterhead, header, footer,
fonts and signature block are preserved.

Backend (docxTrackedChanges.ts + routes/documents.ts):
- applyFormattedEdits: reconciles edited paragraphs (runs with
  bold/italic/underline/colour/size + alignment) against the current
  document, rebuilding only changed paragraphs and inheriting each
  paragraph's base run properties so fonts carry over.
- edit_document now adds and removes whole paragraphs (a blank line in
  the replacement starts a new paragraph; deleting a paragraph's text
  removes it) via tracked paragraph marks; new column document_edits.mark_w_ids.
- applyUserParagraphEdits (inline text reconcile) and a save-docx
  autosave target.
- New routes: /formatted-edit, /inline-edit, /save-docx, /paragraphs;
  each saves a user version (overwrites the working copy in place, or
  starts a fresh version on top of an upload/assistant edit).

Frontend:
- RichDocxEditor: always-on contentEditable on the rendered document,
  formatting toolbar, debounced autosave; DocPanel routes document-mode
  .docx to it.

Also: golden-rule letter drafting guidance in the assistant prompt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RCY6K4dNwdbo9gU3HQ9un
49a6b5a3 feat: text colour, font size and headings in the document editor Ethan Ward 2026-08-18 ↗ GitHub
commit body
Extends the in-app Word editor with the formatting controls a letter
actually needs, all written back into the real .docx:

- Text colour and font size, applied to the selected text. Only text the
  user styled carries colour/size - the serializer reads them from spans
  the toolbar marked rather than from computed style, so untouched text
  keeps the document's own formatting.
- Heading 1-3 via a paragraph-style dropdown, applied as w:pStyle so Word
  treats them as real headings (navigation pane, outline level). Choosing
  "Body text" clears the style again.
- Heading styles the document does not define are added to styles.xml
  with a sensible default; a document that already defines them (a firm
  template) keeps its own look untouched.

Verified end to end in the browser: colour and Heading 2 both persisted
into the saved document, with the heading style defined and text intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RCY6K4dNwdbo9gU3HQ9un
9ddfc71a feat: bullet and numbered lists, and undo across saves (engine + routes) Ethan Ward 2026-08-19 ↗ GitHub
commit body
Lists: a paragraph can be marked as a bullet or numbered item. The list
definitions are written into word/numbering.xml and the part is registered
in the package when a document has none, so Word renders the list. A
document that already defines its own numbering keeps it - ours is added
beside it with unused ids. Consecutive items of the same kind share one
numId, so a numbered run counts 1, 2, 3. Clearing the list removes w:numPr.

Undo: POST /single-documents/:documentId/undo-edit restores the bytes of
the version preceding the current one and makes that current, so a save
can be stepped back without destroying later history.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RCY6K4dNwdbo9gU3HQ9un
33e4441c feat: list and undo buttons in the document editor Ethan Ward 2026-08-19 ↗ GitHub
commit body
Adds the toolbar controls for the list and undo support already in the
engine: bulleted list, numbered list, and an undo button that steps the
document back to how it was before the last save.

The list buttons toggle - pressing the same one again turns the
paragraphs back into ordinary text. A paragraph the document already
renders as a list item (inside a ul/ol) is recognised as one, so an
existing list is not flattened to body text by the next save. Undo
re-fetches and re-renders the restored document.

Verified end to end in the browser: a bulleted list persisted into the
saved .docx as a real Word list (w:numPr + numbering definitions
registered in the package), and undo restored the previous version
without destroying the later one.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RCY6K4dNwdbo9gU3HQ9un

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-1252.md from inside the repo you want the changes in.

⬇ Download capture-thread-1252.md