Skip to content

Claim the formats odrcore renders that iOS has no type for - #160

Merged
andiwand merged 1 commit into
mainfrom
claim-what-odrcore-renders
Aug 16, 2026
Merged

Claim the formats odrcore renders that iOS has no type for#160
andiwand merged 1 commit into
mainfrom
claim-what-odrcore-renders

Conversation

@andiwand

@andiwand andiwand commented Aug 16, 2026

Copy link
Copy Markdown
Member

The document browser decides what the user may pick from CFBundleDocumentTypes. The app claims four broad types plus public.zip-archive, which is mostly right — that is what carries docx, doc, pdf and the ODF packages — but it misses seven formats odrcore renders:

.fodt .fodp .fods .fodg LibreOffice's flat XML documents
.otm an ODF master document template
.xlm an Excel macro sheet
.xlt an Excel template

The first six resolve to a dynamic type — what iOS invents for an extension it has never heard of. It conforms to public.data and nothing else, so no claim short of public.data reaches it. .xlt is stranger: iOS does know com.microsoft.excel.xlt, it just does not conform to public.composite-content the way com.microsoft.excel.xls does. Either way the file was greyed out with no way in.

UTImportedTypeDeclarations gives the six a real type — imported rather than exported, since none of them is ours — and they join LSItemContentTypes along with .xlt's.

Why not narrow the claims instead

The broad types are also what covers the formats odrcore does not render and the app hands to the system — rtf, html, the iWork formats. Replacing them with per-format entries would lose that. So this adds to them rather than replacing them.

The test

The plist cannot read odrcore's format table, so DeclaredDocumentTypesTests holds one against the other, which is how OpenDocument.droid keeps its manifest honest (SupportedDocumentTypes.kt). It reads the built app's plist rather than a copy, over the set droid calls CLAIMED_FILE_TYPES — everything with translateHtml in the document category, plus txt and csv:

  • every offered format resolves to a real type, not a dynamic one
  • every offered format lands on something claimed
  • nothing is declared that odrcore cannot render

Reverting the plist fails it with exactly the seven above; with it, all 35 tests pass and both schemes build.

🤖 Generated with Claude Code

The document browser decides what the user may pick from
`CFBundleDocumentTypes`, and the four broad types claimed there miss seven
formats odrcore renders: the flat XML documents (.fodt .fodp .fods .fodg), an
ODF master template (.otm), and .xlm and .xlt. The first six resolve to a
dynamic type, which conforms to `public.data` and nothing else; .xlt has a
system type that conforms to no claim of ours. All seven were greyed out.

`UTImportedTypeDeclarations` gives the six a real type - imported, since none
of them is ours - and they join `LSItemContentTypes` along with .xlt's.

The plist cannot read odrcore's table, so `DeclaredDocumentTypesTests` holds
one against the other, as OpenDocument.droid does with its manifest. Reverting
the plist fails it with exactly those seven.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNugiHVRHVc1CGHgVGW7Dz
@andiwand
andiwand force-pushed the claim-what-odrcore-renders branch from 3eb185d to ad5bf94 Compare August 16, 2026 08:14
@andiwand
andiwand merged commit c353ccc into main Aug 16, 2026
4 checks passed
@andiwand
andiwand deleted the claim-what-odrcore-renders branch August 16, 2026 08:19
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