Improve featured image flow#23962
Merged
kean merged 39 commits intochristmas-feature-branchfrom Jan 9, 2025
Merged
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr23962-f44329d | |
| Version | 25.6 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | f44329d | |
| App Center Build | WPiOS - One-Offs #11315 |
Contributor
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr23962-f44329d | |
| Version | 25.6 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | f44329d | |
| App Center Build | jetpack-installable-builds #10348 |
crazytonyli
reviewed
Jan 12, 2025
| let selection = MediaPickerSelection(items: items, source: source) | ||
| DispatchQueue.main.async { | ||
| self.onSelection?(selection) | ||
| } |
Contributor
There was a problem hiding this comment.
Why dispatch async here? For chaining dismising presenting view controllers, maybe?
Contributor
There was a problem hiding this comment.
If that's the cause, maybe we can use dismiss(animated:completion:) in the call sites, which would be syntactically nicer than dispatch async?
Contributor
Author
There was a problem hiding this comment.
I was debating this, but the problem with dismiss(animated:completion:) is that it you perform onSelection in the completion callback, it feels too slow. DispatchQueue.main.async is probably redundant here, but I added it just in case.
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.


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
MediaPickercomponent 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.txtif necessary.Testing checklist: