-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve featured image flow #23962
Improve featured image flow #23962
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
let selection = MediaPickerSelection(items: items, source: source) | ||
DispatchQueue.main.async { | ||
self.onSelection?(selection) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why dispatch async here? For chaining dismising presenting view controllers, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the cause, maybe we can use dismiss(animated:completion:)
in the call sites, which would be syntactically nicer than dispatch async?
This PR reworks the Objective-C-based "Set Featured Image" flow in SwiftUI and introduces a few enhancements. The new implementation now completely isolated from the view controller and fits in a single file, so it's easy to follow.
Changes
Technical Notes
This PR introduces new
MediaPicker
component for managing media sources from SwiftUI. It builds on top of the existingMediaPickerMenu
, but provides a higher-level API:It also introduces
SiteMediaImageView
(UIKit) andSiteMediaImage
(UIKit) to simplify rendering thumbnails for site media images.Screenshots
Screen.Recording.2025-01-09.at.11.58.36.AM.mov
Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: