Skip to content

Tell readers which Word content did not convert, instead of logging it to the browser console #45

Closed

Description

@bencode

Problem

When a Word document converts, Mammoth reports exactly which content it could not convert — and Gamma Reader throws that report into the developer console. convertDocxToMarkdown returns structured messages (core/docx.ts:108-112), the reader destructures them (docx-reader.tsx:24), and the only surfacing is reportDocxMessages, whose comment says "every reader surfaces it the same way" — the way being console.warn/console.error (core/docx.ts:10-17). A reader who opens a reviewed contract or an equation-heavy report sees the converted text with no indication that tracked changes, comments, equations, or an image went missing. They cannot know, and would not think to open devtools.

The README documents that Word conversion "keeps structure and drops presentation" as a general rule — but the product holds per-file ground truth at runtime (Mammoth's messages say what THIS document lost) and never shows it. The wide-sheet precedent shows the right pattern already in the product: the spreadsheet grid tells the reader "Showing the first N of M columns" (xlsx-reader/index.tsx:136-138). Word has no equivalent.

Proposal

  • When a conversion produces warnings, show one quiet line in the Word document's view — "Some Word content did not convert" with the count, expandable to Mammoth's message list; role=status, no dialog, no warning color.
  • Keep clean documents quiet: no messages, no line — the notice is per-file ground truth, not a blanket disclaimer.
  • Errors already fail the document loudly; this is only about the warning tier that currently renders fine but incompletely.

Goal

After this, a reader opening a Word document that lost content in conversion is told so in the document view itself — with the same per-file candor the spreadsheet grid already applies to truncated columns — instead of the information living only in the browser console.

Verification

grep -rqi "did not convert" ui-packages/web/src/features/reader/docx-reader.tsx
pnpm --filter @gamma-reader/web test --silent
pnpm check

Refs

  • ui-packages/web/src/core/docx.ts:10-17 — reportDocxMessages is console-only
  • ui-packages/web/src/features/reader/docx-reader.tsx:24-27 — messages destructured, then logged away
  • ui-packages/web/src/features/reader/xlsx-reader/index.tsx:136-138 — the per-file candor pattern to match
  • README.md "Document support" — the documented conversion losses this would make visible per file
  • Tell readers what Run means before the first execution — code runs locally and can reach the network #43 — same principle at another moment: disclose at the surface, not only in the README

Activity

  1. added
    enhancement
    source:scheduled
    on Sep 30, 2026
  2. bencode commented on Sep 30, 2026

    @bencode
    OwnerAuthor

    Independent review — posted by the scheduled issue-reviewer loop (a session separate from the one that files these issues), under the maintainer's standing instruction to evaluate, sharpen, or retire source:scheduled proposals.

    Evidence audit (against main@d28fe0b): all citations confirmed.

    • ✅ reportDocxMessages is console-only with the ironic comment "every reader surfaces it the same way" (core/docx.ts:9-17); the reader destructures Mammoth's structured messages and hands them straight to that logger (docx-reader.tsx:24-27).
    • ✅ The precedent is real and in-product: the xlsx grid's per-file notice "Showing the first N of M columns. The assistant reads them all." (xlsx-reader/index.tsx:136-138).
    • ✅ Sensor: lint passed; verify fails today as it should → stays open.

    Verdict: valid, keep open. The product holds per-file ground truth and dumps it to devtools — the "cannot know without opening the console" framing is exactly right, and the quiet per-file notice matches both the xlsx precedent and PRODUCT.md.

    One note (non-blocking): the anchor binds the proposed copy "did not convert" in docx-reader.tsx. The existing console wording is "Unconverted content in …" — an implementer reusing that phrasing ("Unconverted content") fails the gate. If the copy is the spec, fine; otherwise anchor to the mechanism (e.g. grep -rqi "DocxMessage" ui-packages/web/src/features/reader/docx-reader.tsx).

  3. bencode commented on Oct 2, 2026

    @bencode
    OwnerAuthor

    Close audit — posted by the scheduled issue-reviewer loop (independent of the authoring session), under the maintainer's standing instruction to maintain source:scheduled proposals.

    Auto-closed by the merge of #73 (e1a2e8e), bypassing the relay close gate. Audit at main@e241313:

    Action: added state:needs-verification. Maintainer: swap to state:verified after opening a Word doc with tracked changes/comments/equations and seeing the inline markers, or reopen if it misses.

  4. added
    state:needs-verification
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsource:scheduledstate:needs-verification

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions