Skip to content

Open every format the core renders, not just half of them - #546

Merged
andiwand merged 2 commits into
redesignfrom
core/supported-formats
Jul 28, 2026
Merged

Open every format the core renders, not just half of them#546
andiwand merged 2 commits into
redesignfrom
core/supported-formats

Conversation

@andiwand

@andiwand andiwand commented Jul 28, 2026

Copy link
Copy Markdown
Member

odrcore v6 keeps reference html output for doc, ppt, xls and pptx next to the formats the app already claimed, so the TODO: enable pptx too in CoreLoader was the only thing keeping presentations out. The legacy binary formats reached the core only by accident, through the application/msword entry that was listed before vnd.ms-powerpoint and vnd.ms-excel ever were.

What the loader claims is now one list: opendocument, the whole ooxml family, the three legacy microsoft formats and pdf. Prefixes, so the templates and the macro enabled variants come along — the latter are spelled vnd.ms-word / vnd.ms-excel / vnd.ms-powerpoint rather than under the openxmlformats prefix, which is why those appear without their subtypes.

Text, csv and images stay out: the core renders them too, but RawLoader is what gives them their player, and it only gets a turn when CoreLoader.isSupported() says no.

The STRICT_CATCH filter and SupportedDocumentTypes follow, so the system offers us pptx/ppt/xls and the folder browser lists them.

Two things fall out of it:

  • doOoxml is gone. It has been passed true since ooxml stopped being experimental and now gates nothing.
  • The .doc-files are not real documents special case becomes a check for all three legacy types. The core does parse them now, but declares them neither editable nor savable, so keeping one open only buys a second parse.

pdf changes which viewer a failed upload falls back to, so that stays explicit: the google docs viewer still gets the pdf, the microsoft one keeps everything else the core knows.

Verification

Rendered on an emulator, each in a fresh process (type= from the core's own log):

format log result
pptx type=pptx slides, titles and bullets
ppt type=ppt same deck, same output
doc type=doc text with headings
xls type=xls Sheet1, table with rows

CoreTest grows a case per format over the same samples odrcore tests with, CoreLoaderTest is new and covers the claim itself, and spotlessCheck / lintProDebug / the unit tests are green.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 939d7a8baf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread app/src/main/java/app/opendocument/droid/background/CoreLoader.kt Outdated
odrcore v6 keeps reference html output for doc, ppt, xls and pptx next to
the ones the app already claimed, so the "TODO: enable pptx too" that sat
in CoreLoader was the only thing keeping presentations out - and the
legacy binary formats reached the core only by accident, through the doc
mime type that was listed before ppt and xls ever were.

What the loader claims is now one list: opendocument, the whole ooxml
family, the three legacy microsoft formats and pdf. Prefixes, so the
templates and the macro enabled variants come along - the latter are
spelled vnd.ms-word/vnd.ms-excel/vnd.ms-powerpoint rather than under the
openxmlformats prefix, which is why those appear without their subtypes.
Text, csv and images stay out: the core renders them too, but RawLoader
is what gives them their player, and it only gets a turn when the core
loader says no.

The manifest filter and SupportedDocumentTypes follow, so the system
offers us pptx/ppt/xls and the folder browser lists them.

Two things fall out of it. The doOoxml flag is gone - it has been passed
true since ooxml stopped being experimental and now gates nothing. And
the ".doc-files are not real documents" special case becomes a check for
all three legacy types: the core does parse them now, but declares them
neither editable nor savable, so keeping one open only buys a second
parse.

pdf changes which viewer a failed upload falls back to, so that stays
explicit: google docs still gets the pdf, the microsoft viewer keeps
everything else the core knows.

Verified on device - .pptx, .ppt, .doc and .xls all render through the
core, with CoreTest covering each of them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgJyGjRBpjAJ2724aMNnEp
@andiwand
andiwand force-pushed the core/supported-formats branch from 939d7a8 to 424c4c9 Compare July 28, 2026 19:08
Codex was right on #546: doc, ppt and xls now reach CoreLoader, and
prepareActions offered Edit for every CORE result except ODS and PDF -
so the legacy formats got a button that could only ever end in a failed
save, because host() would not keep a document open for them.

The list of exceptions was never ours to keep. odrcore answers this
itself: Document.isEditable()/isSavable() is false for the three legacy
binary formats, for ooxml spreadsheets and presentations, and for every
spreadsheet including odf - the last being the core's own TODO, the same
gap as #442 that the UI was spelling out by mime prefix. host() now
keeps the document only when the core says yes, which makes "we have a
document" the answer, and it travels to the fragment on Result.

While in there, two more copies of the same idea:

- CoreLoader.MIME_PREFIXES was a second SupportedDocumentTypes. It is
  gone; the loader defers to the table. What stays separate is the
  manifest, which XML keeps out of reach - so SupportedFormatsTest walks
  odrcore's FileType values, asks Odr.mimetypeByFileType for each, and
  asserts the table and the package manager agree. Adding a format to
  one side and forgetting the other is now a red test.

  The core cannot replace the table itself: its lookups are native, and
  know one canonical mime per format - no templates, no macroEnabled, no
  x-vnd.oasis, which is exactly what providers hand out.

- toggleDarkMode's isDarkModeSupported was dead. Nothing in the body read
  it while DocumentFragment worked out that a pdf is not worth inverting.
  Renamed to disableDarkening(), which is what it does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgJyGjRBpjAJ2724aMNnEp
@andiwand
andiwand merged commit b8becde into redesign Jul 28, 2026
4 of 7 checks passed
@andiwand
andiwand deleted the core/supported-formats branch July 28, 2026 19:28
andiwand added a commit that referenced this pull request Jul 28, 2026
* Open every format the core renders, not just half of them

odrcore v6 keeps reference html output for doc, ppt, xls and pptx next to
the ones the app already claimed, so the "TODO: enable pptx too" that sat
in CoreLoader was the only thing keeping presentations out - and the
legacy binary formats reached the core only by accident, through the doc
mime type that was listed before ppt and xls ever were.

What the loader claims is now one list: opendocument, the whole ooxml
family, the three legacy microsoft formats and pdf. Prefixes, so the
templates and the macro enabled variants come along - the latter are
spelled vnd.ms-word/vnd.ms-excel/vnd.ms-powerpoint rather than under the
openxmlformats prefix, which is why those appear without their subtypes.
Text, csv and images stay out: the core renders them too, but RawLoader
is what gives them their player, and it only gets a turn when the core
loader says no.

The manifest filter and SupportedDocumentTypes follow, so the system
offers us pptx/ppt/xls and the folder browser lists them.

Two things fall out of it. The doOoxml flag is gone - it has been passed
true since ooxml stopped being experimental and now gates nothing. And
the ".doc-files are not real documents" special case becomes a check for
all three legacy types: the core does parse them now, but declares them
neither editable nor savable, so keeping one open only buys a second
parse.

pdf changes which viewer a failed upload falls back to, so that stays
explicit: google docs still gets the pdf, the microsoft viewer keeps
everything else the core knows.

Verified on device - .pptx, .ppt, .doc and .xls all render through the
core, with CoreTest covering each of them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Ask the core what can be edited instead of guessing by mime type

Codex was right on #546: doc, ppt and xls now reach CoreLoader, and
prepareActions offered Edit for every CORE result except ODS and PDF -
so the legacy formats got a button that could only ever end in a failed
save, because host() would not keep a document open for them.

The list of exceptions was never ours to keep. odrcore answers this
itself: Document.isEditable()/isSavable() is false for the three legacy
binary formats, for ooxml spreadsheets and presentations, and for every
spreadsheet including odf - the last being the core's own TODO, the same
gap as #442 that the UI was spelling out by mime prefix. host() now
keeps the document only when the core says yes, which makes "we have a
document" the answer, and it travels to the fragment on Result.

While in there, two more copies of the same idea:

- CoreLoader.MIME_PREFIXES was a second SupportedDocumentTypes. It is
  gone; the loader defers to the table. What stays separate is the
  manifest, which XML keeps out of reach - so SupportedFormatsTest walks
  odrcore's FileType values, asks Odr.mimetypeByFileType for each, and
  asserts the table and the package manager agree. Adding a format to
  one side and forgetting the other is now a red test.

  The core cannot replace the table itself: its lookups are native, and
  know one canonical mime per format - no templates, no macroEnabled, no
  x-vnd.oasis, which is exactly what providers hand out.

- toggleDarkMode's isDarkModeSupported was dead. Nothing in the body read
  it while DocumentFragment worked out that a pdf is not worth inverting.
  Renamed to disableDarkening(), which is what it does.

Co-Authored-By: Claude Opus 5 (1M context) <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.

1 participant