Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize Media screen #21457

Closed
21 tasks done
kean opened this issue Aug 29, 2023 · 1 comment
Closed
21 tasks done

Modernize Media screen #21457

kean opened this issue Aug 29, 2023 · 1 comment
Assignees
Milestone

Comments

@kean
Copy link
Contributor

kean commented Aug 29, 2023

Spec: UI Modernisation: Media on iOS.

Foundation ✅

The existing Media screen implementation relies heavily on MediaPicker framework, which is written in Objective-C and hasn't received a lot of attention recently. The framework attempts to generalize the code that displays images from different sources: your WordPress media library, Photos, Free Photos and GIFs, and more, which makes it brittle and hard to modify. The existing implementation also has some severe performance issues with thumbnail loading and caching, which have to be addressed.

In version 23.2, we've made the first step on the road to replacing the MediaPicker framework: integrating PHPickerViewController. The next step is to reimplement the Media screen in Swift while fixing the many unaddressed performance and other issues. This ticket covers it.

The first part of this ticket covers reimplementing the core Media screen functionality in Swift.

Modernization ✅

The second part of this ticket covers the new features and design improvements.

List

Details

Fixes

Thumbnail Loading Improvements ✅

  • Add prefetching (PR: #21470, fixes: #4288)
  • Cancel the requests when cells moved offscreen (PR: #21470, fixes: #14528)
  • Fix main thread performance issues due image decompression happening on the main thread (PR: #21470)
  • Remove transcoding when downloading remote thumbnails and store original thumbnail data in local cache
  • Use URLSession with no URLCache to avoid double-caching it: the service has its own disk cache
  • Use absoluteThumbnailLocalURL for storing thumbnails. It gets populated by MediaImportService when the assets are added, so we avoid duplicating the work of generating the thumbnail
  • Move disk I/O to background threads
  • Removes unnecessary coreDataStack.mainContext.perform hops and use @MainActor to enforce thread confinement
@kean kean mentioned this issue Aug 30, 2023
13 tasks
@kean kean self-assigned this Aug 30, 2023
This was referenced Sep 18, 2023
@kean
Copy link
Contributor Author

kean commented Nov 9, 2023

It's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant