-
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 site filter: show unseen post count #15581
Conversation
You can trigger an installable build for these changes by visiting CircleCI here. |
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
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.
These are looking good. Thanks @ScoutHarris!
Hey @mattmiklic . Sorry for the ping, but I just noticed something. Is the multiplier for thousands supposed to be upper or lower case "K"? I made it lowercase to match Android, but I see now the designs have uppercase. Thank you! |
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.
Heya @ScoutHarris !
I tested and the changes look good.
I had one nitpick code wise. Apart from that and the question about k
vs K
this should be good to go. :)
@@ -43,7 +43,7 @@ extension Double { | |||
static let units: [Unit] = { | |||
var units: [Unit] = [] | |||
|
|||
units.append(Unit(abbreviationFormat: NSLocalizedString("%@K", comment: "Label displaying value in thousands. Ex: 66.6K."), accessibilityLabelFormat: NSLocalizedString("%@ thousand", comment: "Accessibility label for value in thousands. Ex: 66.6 thousand."))) | |||
units.append(Unit(abbreviationFormat: NSLocalizedString("%@k", comment: "Label displaying value in thousands. Ex: 66.6k."), accessibilityLabelFormat: NSLocalizedString("%@ thousand", comment: "Accessibility label for value in thousands. Ex: 66.6 thousand."))) |
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.
Was going to ask if we wanted the upper case K to match the other abbreviations, but I see you already asked :)
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 went ahead and reverted the change (i.e. make it uppercase again) since I think we all agree on it. If @mattmiklic rebels, I can change it later. 😄
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.
No rebellion here, I agree with making this uppercase. :)
/// Adds a custom accessory view displaying the unseen post count. | ||
/// | ||
private static func addUnseenPostCount(_ topic: ReaderSiteTopic, with cell: UITableViewCell) { | ||
|
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.
Wondering if it would be better to set the accessory view to nil here. Refs my comment in prepareForReuse.
@@ -43,6 +43,10 @@ class SiteTableViewCell: UITableViewCell, GhostableView { | |||
fatalError("init(coder:) has not been implemented") | |||
} | |||
|
|||
override func prepareForReuse() { | |||
accessoryView = nil |
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 think we'd probably want to call super
here. :)
However, I'm wondering if this would be better done elsewhere. Per the docs:
For performance reasons, you should only reset attributes of the cell that are not related to content, for example, alpha, editing, and selection state.
Changes that modify the view hierarchy seem like they would be content related.
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 think we'd probably want to call super here.
Every. Time. 🤦
I'm wondering if this would be better done elsewhere.
Thanks for that! Tis been moved.
Thanks @aerych ! Ready for another pass please. |
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.
Shiny!
Ref #15483
On the Reader's site filter, a unseen post count is now displayed for each site.
To test:
Filter
.To verify large numbers are abbreviated, you can hack the displayed count. In
FilterProvider:addUnseenPostCount
, change the displayed value:countLabel.text = topic.unseenCount.abbreviatedString()
Example:
PR submission checklist:
RELEASE-NOTES.txt
if necessary.