-
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
Reader: Fix cropped recommended sites #23802
Conversation
Generated by 🚫 Danger |
📲 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.
|
@@ -113,6 +118,7 @@ extension SiteIconViewModel { | |||
|
|||
extension SiteIconViewModel { | |||
/// - parameter isBlavatar: A hint to skip the "is icon blavatar" check. | |||
/// - parameter size: Size in pixels. | |||
static func makeReaderSiteIconURL(iconURL: String?, isBlavatar: Bool = false, siteID: Int?, size: CGSize) -> URL? { |
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.
Nitpick: may as well rename the label size:
-> pixelSize:
😄
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.
It's actually size in points 🤦
This is how it's used:
static func optimizedBlavatarURL(from path: String, imageSize: CGSize) -> URL? {
let size = imageSize.scaled(by: UITraitCollection.current.displayScale)
let query = String(format: "d=404&s=%d", Int(max(size.width, size.height)))
return parseURL(path: path, query: query)
}
I'm going to revert it.
Yeah, it's a low-level method. The app uses SiteIconViewModel.Size
enum in most cases. It also ensures that you don't create too many different variants of the the same icon but off by a few points.
e5c5d03
to
9acbf09
Compare
Before:
After:
Note: I added 16pt vertical spacing (not visible on the screenshots)
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-11-13.at.17.00.04.mp4
It also uses a different design for the "Subscribe" buttons to make sure site titles fit.
To test:
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.txt
if necessary.Testing checklist: