Skip to content

fix(ios): declare txt and md in fileAssociations so Files offers Readest again - #5415

Merged
chrox merged 1 commit into
mainfrom
fix/ios-txt-file-association
Jul 31, 2026
Merged

fix(ios): declare txt and md in fileAssociations so Files offers Readest again#5415
chrox merged 1 commit into
mainfrom
fix/ios-txt-file-association

Conversation

@chrox

@chrox chrox commented Jul 31, 2026

Copy link
Copy Markdown
Member

Problem

Regression in 0.11.20 (0.11.18 was fine): on iOS, previewing or sharing a .txt file from the Files app no longer offers Readest in the share sheet. EPUB and PDF were unaffected.

Root cause

The app's plain-text claim used to come from the hand-tuned CFBundleDocumentTypes in src-tauri/Info.plist (Text File / public.plain-text), merged into the generated iOS Info.plist at build time.

The tauri CLI bump 2.10.1 -> 2.11.4 (#5085) picked up tauri-cli 2.11.0's new mobile file associations feature (tauri-apps/tauri#14486): the CLI now generates CFBundleDocumentTypes from bundle.fileAssociations and inserts the key after the custom-plist merge, replacing the hand-tuned array. fileAssociations listed every supported format except txt and md, so 0.11.20 builds silently stopped claiming public.plain-text and iOS dropped Readest as a handler for .txt. Markdown rode on the same claim (net.daringfireball.markdown conforms to public.plain-text), so .md was lost as well.

Fix

Declare txt and md in bundle.fileAssociations:

  • txt with text/plain: tauri-utils maps it to the public.plain-text UTI and emits LSItemContentTypes, restoring exactly the claim that was lost.
  • md with text/markdown: tauri-utils has no UTI mapping for markdown, so it gets an extension-based entry, the same shape that keeps EPUB working on iOS.

Added a regression test asserting both entries (plus the seven pre-existing formats) stay in fileAssociations, since the hand-tuned CFBundleDocumentTypes in src-tauri/Info.plist is dead on iOS for any key the CLI generates.

Note: fileAssociations also feeds the Windows installer registry and Linux mime entries, so desktop platforms now list Readest under Open With for .txt/.md too (macOS already claimed plain text via the hand-tuned plist).

Verification

  • New test fails before the config change, passes after
  • Full unit suite (8033 tests), pnpm lint, pnpm format:check pass
  • pnpm fmt:check, pnpm clippy:check, pnpm test:rust pass (Rust compile re-validates the modified config through tauri codegen)
  • Device check pending: needs a TestFlight/device build since the regression lives in the generated Info.plist

🤖 Generated with Claude Code

…est again

tauri-cli 2.11.0 (bumped in #5085) started generating the iOS
CFBundleDocumentTypes from bundle.fileAssociations, replacing the
hand-tuned array merged from src-tauri/Info.plist that carried the
public.plain-text claim. fileAssociations listed every supported format
except txt and md, so 0.11.20 builds stopped claiming plain text and the
Files preview/share sheet dropped Readest for .txt files while EPUB/PDF
kept working. Markdown rode on the same claim since its UTI conforms to
public.plain-text, so .md was lost as well.

Declaring txt with mimeType text/plain makes the generator emit
LSItemContentTypes public.plain-text, restoring the claim; md gets an
extension-based entry like epub, which iOS resolves through the
extension to UTI mapping.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chrox
chrox merged commit 7d95e88 into main Jul 31, 2026
11 checks passed
@chrox
chrox deleted the fix/ios-txt-file-association branch July 31, 2026 16:36
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