Repository navigation
fix(badge): cap unread counts at 99+ - #1585
Merged
Merged
Conversation
Badge rendered "$count+" only past 100, so 100 read "100" and 150 read "150+". It now formats every count through unreadCountLabel, moved from the messenger module into ui:components so the Chats row pill, the Chats tab badge, and the unread divider share one rule: past 99 reads "99+". The showMoreUnread parameter is gone from Badge and ChatNode, so a caller can no longer produce an uncapped "150+".
Nothing in the repo calls it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Badgeappended "+" to the raw count only past 100, so 100 read "100" and 150 read "150+". It now formats throughunreadCountLabel(past 99 reads "99+"), which moves from the messenger module intoui:componentsso the Chats row pill, the Chats tab badge, and the unread divider share it.showMoreUnreadis removed fromBadge, so no caller can produce an uncapped label.ChatNode, the other place that passed it, had no callers and is deleted.BadgeTestcovers the label and the rendered badge at 99, 100, and 150, and checks that "99+" keeps the chat row pill at 18dp with the text inside its bounds. That test runs under Robolectric's default font, not Avenir.iOS caps its unread divider at "99+" in
ChatItem.swift; the matching iOS badge fix is tracked separately.