Repository navigation
Offer another app when a document's preview fails on iOS - #1815
Merged
Merged
Conversation
WebKit's Quick Look conversion of a document it can't read, such as a damaged .ppt, fails after the load is committed (didFailNavigation, QuickLookErrorDomain). react-native-webview handled only provisional failures, so File detail never heard of it and showed WebKit's own "This file cannot be previewed" page with nothing to do. The webview patch now reports committed failures through onError, and File detail shows its preview-failed state for them, as for an unreadable PDF. That state now offers the file to another app (share sheet on iOS, Quick Look on the Mac, the chooser on Android, the default app on Windows and Linux) next to Download Again. The patch is native, and 19.1.0's builds are made without it, so the app and runtime versions move to 19.2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Rui · project thread
What
On iOS, File detail shows Office and iWork documents in a web view, which WebKit converts with Quick Look. When Quick Look can't read the file (a damaged or mislabeled
.ppt, for example), WebKit shows its own "This file cannot be previewed" page, and File detail had nothing to offer beyond it.didFailNavigation) now reachesonError, as one that fails before it does (didFailProvisionalNavigation). WebKit reports a failed Quick Look conversion that way (QuickLookErrorDomain, code 912); upstream 14.0.1 ignores it, so the view never ended the load and JS never heard of it. The same ignored errors (cancelled loads, WebKit 101/102) are skipped for both.A valid PowerPoint 97
.pptpreviews correctly in the web view on iOS 27.2. Only files Quick Look can't parse fail.Tests
ios/learnXTests/Patches/WebViewPatchTests.swift: a committed failure is sent asonErrorwith its domain and code, and cancelled or interrupted loads are not.src/screens/__tests__/FileDetail.test.tsx: a web view error shows the preview-failed state with Share and Download Again, the header still switches to the info page, and the Electron app offers Open in Default App. The unreadable PDF case also checks Share.pnpm checkpasses locally, exceptlint:shell, which needs shellcheck installed (no shell scripts changed).Generated by Claude Code