Skip to content

fix(badge): cap unread counts at 99+ - #1585

Merged
bmc08gt merged 2 commits into
code/cashfrom
fix/unread-badge-cap
Sep 28, 2026
Merged

bmc08gt merged 2 commits into
code/cashfrom
fix/unread-badge-cap

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Badge appended "+" to the raw count only past 100, so 100 read "100" and 150 read "150+". It now formats through unreadCountLabel (past 99 reads "99+"), which moves from the messenger module into ui:components so the Chats row pill, the Chats tab badge, and the unread divider share it.

showMoreUnread is removed from Badge, so no caller can produce an uncapped label. ChatNode, the other place that passed it, had no callers and is deleted.

BadgeTest covers 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.

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+".
@bmc08gt bmc08gt self-assigned this Sep 28, 2026
@github-actions github-actions Bot added type: fix Bug fix area: ui Compose UI, theme, components, resources and removed type: fix Bug fix labels Sep 28, 2026
Nothing in the repo calls it.
@github-actions github-actions Bot added the type: fix Bug fix label Sep 28, 2026
@bmc08gt
bmc08gt merged commit 633215c into code/cash Sep 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Compose UI, theme, components, resources type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant