Skip to content

Conversation

@mpivchev
Copy link
Collaborator

@mpivchev mpivchev commented Dec 8, 2025

  • Fixes issue where trying to share or download the photo while in draw mode will cause a crash.
    - Issue occurs because we moveFile to a new location instead of copyFile. iOS cannot find the original location of the file, causing a crash.

  • Fixes issue where a draw edit will not be saved properly and will be reset.
    - Happened because saveModifiedFile is called before didSaveEditedCopyOf , ignoring the changes.

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes two issues in the QuickLook viewer for scanned documents. First, it resolves a crash that occurred when sharing or downloading photos while in draw mode by using copyFile instead of moveFile (preventing iOS from losing the file reference). Second, it addresses a timing issue where draw edits weren't being saved properly by refactoring the dismiss flow to show the save alert after the view controller dismisses, giving more time for QuickLook's didSaveEditedCopyOf callback to complete.

Key Changes:

  • Changed file operation from moveFile to copyFile in didSaveEditedCopyOf to prevent iOS file reference loss
  • Refactored alert presentation logic into separate showSaveAlert() method
  • Modified dismissView to show save alert in dismiss completion handler rather than before dismissing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
@mpivchev mpivchev enabled auto-merge (squash) December 8, 2025 09:26
@mpivchev mpivchev merged commit d29548b into master Dec 10, 2025
5 checks passed
@mpivchev mpivchev deleted the quick-look-fixes branch December 10, 2025 15:06
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.

3 participants