-
Notifications
You must be signed in to change notification settings - Fork 497
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
Fix: truncate pills if they are too long #7455
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #7455 +/- ##
========================================
Coverage 12.30% 12.30%
========================================
Files 1645 1645
Lines 162982 162992 +10
Branches 66914 66916 +2
========================================
+ Hits 20048 20056 +8
- Misses 142285 142287 +2
Partials 649 649
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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 👍
@@ -108,6 +112,7 @@ struct PillTextAttachmentData: Codable { | |||
case isHighlighted | |||
case alpha | |||
case font | |||
case maxWidth |
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.
My only question is about encoding/decoding these pills - I'm not sure where/when we do it.
Does it make sense to encode a computed maxWidth with them? Could it be decoded to be displayed in a different size window (e.g. If the user is now a different split size on iPad)? If so, maybe it would make sense to not encode it, and instead set it back to .greatestFiniteMagnitude
?
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.
Thanks @pixlwave, I've updated the code to reflect your suggestions.
@@ -93,12 +95,14 @@ struct PillTextAttachmentData: Codable { | |||
items: [PillTextAttachmentItem], | |||
isHighlighted: Bool, | |||
alpha: CGFloat, | |||
font: UIFont) { | |||
font: UIFont, | |||
maxWidth: CGFloat = CGFloat.greatestFiniteMagnitude) { |
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.
Should be able to infer the type of the default here :)
maxWidth: CGFloat = CGFloat.greatestFiniteMagnitude) { | |
maxWidth: CGFloat = .greatestFiniteMagnitude) { |
Kudos, SonarCloud Quality Gate passed! |
This PR fixes #7413
Pull Request Checklist