Skip to content

[UI] Drive image replacement transitions by identity - #93

Closed
NachoSoto wants to merge 3 commits into
masterfrom
fix-swiftui-image-replacement-animation
Closed

[UI] Drive image replacement transitions by identity#93
NachoSoto wants to merge 3 commits into
masterfrom
fix-swiftui-image-replacement-animation

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • perform non-cache SwiftUI image replacement inside an explicit animation transaction
  • retain image identity and the opacity transition so placeholder-to-source replacements crossfade reliably
  • preserve the existing behavior of skipping animation for cache hits
  • add a reusable Bazel package definition for direct local repository overrides

Root cause

The image carried an animated transition, but the observable renderer assignment itself was not performed in an animation transaction. On a physical device the placeholder could therefore snap to the final image even though the image identity changed.

The clear placeholder remains scoped to the empty/loading branch; an always-present clear layer was removed in response to review because it was redundant.

Validation

  • Swift 6 iOS Simulator build
  • package test action
  • swiftlint --config .swiftlint.yml --strict (0 violations across 34 files)
  • WatchChess ChessUITournaments tests and app build using the checked-in Bazel repository definition
  • controlled cold-cache WatchChess recording and 30 fps frame extraction on iOS 18.6: independent image fades are visible across successive frames while label baselines and cell bounds remain fixed

Recording

ios18-corrected-placeholder-transition.mp4

@NachoSoto
NachoSoto marked this pull request as ready for review September 3, 2026 19:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T19:38:15.775228Z 44f0a4a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread AsyncImageView/AsyncSwiftUIImageView.swift Outdated
@NachoSoto

Copy link
Copy Markdown
Owner Author

Superseded by the simpler WatchChess hybrid approach: the tournament cell remains SwiftUI, but its background now uses the established UIKit AsyncImageView as a layout-neutral UIViewRepresentable. This restores the proven cross-dissolve without adding SwiftUI image lifecycle machinery.

@NachoSoto NachoSoto closed this Sep 3, 2026
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.

1 participant