-
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
Dynamic Dashboard Card Image UI Fix #22516
Dynamic Dashboard Card Image UI Fix #22516
Conversation
📲 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.
|
…o task/dynamic-dashboard-card-image-ui-fix
WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/BlogDashboardDynamicCardCell.swift
Outdated
Show resolved
Hide resolved
WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Dynamic/DynamicDashboardCard.swift
Outdated
Show resolved
Hide resolved
I'm going to bump this to the next release because we'll be code freezing 24.2 today and this hasn't been approved yet. If these changes cannot wait two weeks and it's important that it makes it into this release, let me know and we'll organize a new beta once ready. |
Hey @mokagio |
) / CGFloat( | ||
height ?? 1 | ||
) | ||
} |
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.
[Suggestion] I think if either width
or height
, is nil
. I would expect the aspect ratio to be nil
as well. Because it doesn't make sense to calculate the aspect ratio out of nil
dimensions!
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.
Makes sense!
@@ -75,10 +76,24 @@ extension BlogDashboardRemoteEntity { | |||
let icon: String? | |||
} | |||
|
|||
struct ImageSize: Decodable, Hashable { | |||
let width: Int? | |||
let height: Int? |
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.
[Suggestion] I believe the type of these properties can be CGFloat
even if the Backend returns them as Int
.
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.
I see your point, however I would rather match the backend type unless it is an enum if that's okay with you.
@alpavanoglu I've dropped a few code suggestions but I confirm the UI glitch is resolved. Also, the unit tests are failing. |
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.
LGTM! 🚀
Generated by 🚫 dangerJS |
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.
🚀
@alpavanoglu all good. Merging now. |
Fixes #22501
Testing Steps
Screen Recordings
Before
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-02-01.at.13.12.18.mp4
After
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-02-01.at.13.11.12.mp4
Regression Notes
Potential unintended areas of impact
N/A
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: