[UI] Add per-update image transitions and placeholder policies - #94
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Reviewed and corrected in 21720df. The submitted version was not fully equivalent to the old default behavior. The audit found that it constructed the source renderer before the placeholder, added an extra UI-scheduler hop to source results when a placeholder renderer was present, and added Restored the original renderer preparation order, source/placeholder scheduling, and exact UIKit animation options. Keeping the current image with a configured placeholder now uses the same empty-placeholder pipeline as the previous app wrapper. Standard updates also avoid the newly introduced read of the displayed image. Validation:
No remaining unintended behavioral difference was found in #94's default paths. The new explicit policies intentionally add behavior; the tests and code comparison are not an exhaustive proof of every possible interleaving. Separate dependency scope: the app pin also includes already-merged AsyncImageView #92, which gives SwiftUI image replacements an identity so their existing opacity transitions run. That is a separate intentional behavior change from #94, so the whole dependency upgrade should not be described as 100% behavior-equivalent. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
UIKit callers can now choose a transition and placeholder policy for each image update. This supports appearance-specific artwork that crossfades even on cache hits and keeps the displayed image while its replacement loads, without altering renderer results or cache identity.
The defaults preserve existing
.databehavior..nonedisables animation;.keepCurrentImagefalls back to normal placeholders when no image is displayed. Presentation options travel with each request, and duplicate data does not replace a pending request's options. The SwiftUI loader retains its existing interface and behavior.Added UIKit behavior tests for cached/uncached animation, immediate updates, placeholder retention/fallback, duplicate requests, stale completions, nil resets, empty results, and deferred sizing.
Validation: all 64 tests passed on iOS 27 Simulator; strict SwiftLint passed. Four compatibility tests also pass unchanged on the pre-PR implementation. They cover renderer preparation order, synchronous source delivery, pending-placeholder suppression, and scheduling without a placeholder.
Consumer: https://github.com/WatchChessApp/watchchessapp/pull/1226
Consumer demonstration
WatchChess light → dark → light using this API, recorded on iOS 27 Simulator and exported at 60 fps:
crossfade-60fps.mp4