Repository navigation
fix(i18n): group thousands in collection, Browse and person counts - #916
Conversation
Collection card counts, the TV Browse grid subtitle, and the phone and TV
person page title counts printed large numbers without a thousands
separator ("1284 titles"). They now use the locale's separator through a
new LocaleFormat.groupedCount ("1,284 titles", "1.284 Titel"), matching
Apple. LocaleFormat.integer stays ungrouped for years, codes and episode
numbers.
The person page moves from the person.count plurals, whose %1$d slot
can't be grouped, to library.titleCount, which Apple's person page
already uses. A shared model passes the grouped count as
UiText.GroupedCount.
Closes #915
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks for documenting the validation limits. This changes visible count labels on phone and TV, but the Evidence section explicitly provides tests only and no device captures. Please add before-and-after screenshots with the same data showing counts above 1,000 on the affected collection, person, and TV Browse surfaces, including the Japanese/Arabic person-label changes. CONTRIBUTING also requires phone, tablet, foldable (folded/open), and TV coverage, or a reason a device is unaffected. The unit-test results support formatting correctness but do not show the rendered change. |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.1-sol, reviewed c8f31f5)
F1 is attached to the formatter line. The Spanish behavior disclosed as unverified in the PR is confirmed by Android 16 libcore/ICU source and an ICU 77.1 reproduction.
Validation: 35 focused tests passed (LocaleFormatTest, SharedPresentationTextTest, SharedTextTest, and PersonPresentationTest). Checked all eight shipped catalogs, placeholder positions, plural selection, configuration observation, RTL argument handling, and the affected Apple implementations. No device rendering was tested.
AI disclosure: reviewed by gpt-6.1-sol using Codex via T3 Code.
Spanish writes four-digit counts without a separator ("1284") and groups
from "12.840". java.text.NumberFormat grouped them anyway ("1.284"),
unlike Apple's automatic grouping. On Android 11+ groupedCount now uses
ICU's NumberFormatter with automatic grouping; older versions keep the
legacy formatter.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Added device captures against a sandbox seeded with a 1,284-item collection and a person credited on 1,287 titles, comparing
The evidence page has every pair: https://evidence.siloserver.org/r/silo-android/issue-915/. Two surfaces weren't captured, with reasons in the PR body: the TV Browse subtitle (1,000+ loaded titles means paging through 1,000 cards) and the Collections list row subtitle (needs a personal collection with 1,000+ items). Both use the same |
|
The separate collections-grid count badge ( Suggested fix: add the collections-grid before-and-after captures to the evidence page for phone, tablet, and foldable (folded and open). Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
No user path opens |
Problem
Closes #915
Related issue: N/A
Validation tasks: changes #317 C1, changes #318 C1 (person page count label: grouping at 1,000+ titles, and the Japanese and Arabic wording noted under Risks)
Other clients: Apple Silo-Server/silo-apple#1161 (source change); Roku Silo-Server/silo-roku#69; Web Silo-Server/silo-server#4137 (PR Silo-Server/silo-server#4138)
Android printed large counts without a thousands separator: "1284 titles" instead of "1,284 titles" in English or "1.284 Titel" in German. That affected:
The cause was
LocaleFormat.integer, which never groups (D55), plus a bareitemCount.toString()on one collection card. The person page also used theperson.countplurals, whose%1$dslot can't take a formatted number.Approach
LocaleFormat.groupedCount(n)formats anIntwith the locale's separator and digits, through the samenumberLocale()asinteger. On Android 11+ it uses ICU'sNumberFormatterwith automatic grouping, so it follows each locale's minimum grouping as Apple does: Spanish writes "1284" and groups from "12.840". Android 7–10 group every count over 999.integerstays ungrouped for years, codes and episode numbers.LibraryCollectionCardusegroupedCount. The card now also uses the locale's digits, whichtoString()didn't.pluralStringResourceWithNames, whose only caller is the Collections row subtitle, fills{count_text}withgroupedCountand still isolates the kind name in right-to-left text.personWorksCountLabel) and TV switch fromperson.count/person.countMoreto the existinglibrary.titleCount/library.titleCountMoreplurals, which have a{count_text}slot and are the keys Apple's person page uses. A shared model passes the grouped number as a newUiText.GroupedCount. The phone's "X of Y titles" form keepsperson.countOf, with grouped arguments. No catalog strings change.library.titleCountplurals and now groups them too, matching Apple's tvOS library grid in #1161. The issue didn't list this surface.docs/i18n.mdnames the grouped surfaces and documentsUiText.GroupedCount.The TV collection detail count ("24 items" beside the sort controls) stays ungrouped. Apple's collection detail count is also ungrouped.
Validation
main(cc4fd66) before and this branch (7271ade) after with the same account and data:groupedCountcall as the captured screens. TheLibraryCollectionsScreencard badge can't be captured because no user path reaches it: it renders only forRoute.Collectionswith alibraryId, and the app's only navigation to that route (AppNavigation.kt:1543) passes none, so it opensCollectionsScreen. The Libraries Collections tab, captured above, is the library collections grid users see.SharedPresentationTextTest.personPageexpects "1,060 of 1,200 titles". It fails onmainand passes on this branch.LocaleFormatTest.groupedCountsUseTheLocalesSeparatorcovers en, de, ar, es-ES ("1284", "12.840") and es-MX ("1,284"). The Spanish assertions fail on c8f31f5 and pass on 7271ade../gradlew testDebugUnitTest(7,112 tests, 0 failures);lintDebugfor android-shared, phone and TV;lintVitalReleasefor phone and TV;assembleDebugfor both apps. The supply-chain self-test scripts need Ruby, which the build host lacks; this diff doesn't touch them.Release readinessfails onmaintoo, with the same Gradle dependency-verification error, unrelated to this diff. build: take the Compose Gradle plugin from Maven Central only #918 fixes it; this PR's required check passes once that merges and this branch picks it up.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/issue-915/
Surface and build: phone, tablet, foldable (folded and open) and Android TV emulators on Android 16; server 4448e401; app cc4fd66 (before) and 7271ade (after).
Risks
NumberFormatterneeds API 30. Android 11+ matches Apple.pluralStringResourceWithNamesnow always groups its count. Its one caller is a collection size.Checklist
AI Disclosure
Longoverload; the attack flagged the Japanese and Arabic wording changes listed under Risks. A high-level multi-agent code review (claude-opus-5-5 finders and a Sonnet validation pass) found the ungrouped TV Browse subtitle, which this PR now fixes, and a KDoc mismatch, now corrected. A simplify pass made no changes. A background gpt-6.1-sol review of c8f31f5 found that Spanish four-digit counts were grouped unlike Apple; 7271ade fixes it.🤖 Generated with Claude Code