Skip to content

Add a shimmering card view when loading card art#6355

Merged
wooj-stripe merged 3 commits intomasterfrom
wooj/shimer
Apr 20, 2026
Merged

Add a shimmering card view when loading card art#6355
wooj-stripe merged 3 commits intomasterfrom
wooj/shimer

Conversation

@wooj-stripe
Copy link
Copy Markdown
Collaborator

Summary

Adds shimmering view that can be used to indicate an image loading

Motivation

Card art

Testing

Manual testing

Changelog

@wooj-stripe wooj-stripe marked this pull request as ready for review April 17, 2026 22:46
@wooj-stripe wooj-stripe requested review from a team as code owners April 17, 2026 22:46
Copy link
Copy Markdown
Collaborator

@porter-stripe porter-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questions


/// A view that displays a sliding shimmer animation overlay.
/// Used as a loading indicator while card art images are downloaded.
class ShimmerView: UIView {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add some snapshot tests for this view?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't consider it due to the animation.

We could write some unit tests that test to make sure the gradient has various alpha components, but that doesn't seem too valuable?

Task {
let image = try? await DownloadManager.sharedManager.downloadImage(url: cardArtURL)
guard paymentMethodLogo.tag == cardArtURL.hashValue else { return }
paymentMethodLogo.removeShimmer()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove shimmer on line 376?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 376 is showing me:

                                    paymentMethodLogo.image = paymentMethodCellImage

Removing the shimmer as proposed in the PR (on line 371) seems appropriate since we've added it prior to loading, and we should be removing it irregardless of the card art image loads or we fallback to the network logo.

@wooj-stripe wooj-stripe merged commit 3ac90bb into master Apr 20, 2026
7 checks passed
@wooj-stripe wooj-stripe deleted the wooj/shimer branch April 20, 2026 21:42
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.

2 participants