Skip to content

fix(i18n): group thousands in collection, Browse and person counts - #916

Merged
Quick104 merged 3 commits into
mainfrom
fix/issue-915-grouped-counts
Nov 14, 2026
Merged

Quick104 merged 3 commits into
mainfrom
fix/issue-915-grouped-counts

Conversation

@Quick104

@Quick104 Quick104 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • collection cards on a library's Collections tab (badge and caption) and on the collections grid
  • the Collections list row subtitle
  • the phone and TV person page title counts
  • the Android TV Browse grid subtitle

The cause was LocaleFormat.integer, which never groups (D55), plus a bare itemCount.toString() on one collection card. The person page also used the person.count plurals, whose %1$d slot can't take a formatted number.

Approach

  • LocaleFormat.groupedCount(n) formats an Int with the locale's separator and digits, through the same numberLocale() as integer. On Android 11+ it uses ICU's NumberFormatter with 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. integer stays ungrouped for years, codes and episode numbers.
  • Collections. The two inline card labels and LibraryCollectionCard use groupedCount. The card now also uses the locale's digits, which toString() didn't. pluralStringResourceWithNames, whose only caller is the Collections row subtitle, fills {count_text} with groupedCount and still isolates the kind name in right-to-left text.
  • Person page. Phone (personWorksCountLabel) and TV switch from person.count/person.countMore to the existing library.titleCount/library.titleCountMore plurals, which have a {count_text} slot and are the keys Apple's person page uses. A shared model passes the grouped number as a new UiText.GroupedCount. The phone's "X of Y titles" form keeps person.countOf, with grouped arguments. No catalog strings change.
  • TV Browse. The subtitle fills the same library.titleCount plurals and now groups them too, matching Apple's tvOS library grid in #1161. The issue didn't list this surface.
  • docs/i18n.md names the grouped surfaces and documents UiText.GroupedCount.

The TV collection detail count ("24 items" beside the sort controls) stays ungrouped. Apple's collection detail count is also ungrouped.

Validation

  • Emulators against a sandbox seeded with a 1,284-item collection and a person credited on 1,287 titles, each running main (cc4fd66) before and this branch (7271ade) after with the same account and data:
    • phone (Pixel 7): the Collections tab card ("1284" / "1284 items" → "1,284" / "1,284 items") and the person page in English, Japanese and Arabic ("60 of 1287 titles" → "60 of 1,287 titles")
    • tablet (Pixel Tablet) and foldable (Pixel 9 Pro Fold, folded and open): the Collections tab card and the English person page
    • Android TV (1080p): the person page in English and Japanese ("1287 titles" → "1,287 titles"; "1287作品" → "1,287タイトル")
  • Not captured: the TV Browse subtitle (it counts loaded titles, so 1,000+ means paging through 1,000 cards with the D-pad) and the Collections list row subtitle (needs a personal collection with 1,000+ items). Both use the same groupedCount call as the captured screens. The LibraryCollectionsScreen card badge can't be captured because no user path reaches it: it renders only for Route.Collections with a libraryId, and the app's only navigation to that route (AppNavigation.kt:1543) passes none, so it opens CollectionsScreen. The Libraries Collections tab, captured above, is the library collections grid users see.
  • SharedPresentationTextTest.personPage expects "1,060 of 1,200 titles". It fails on main and passes on this branch.
  • LocaleFormatTest.groupedCountsUseTheLocalesSeparator covers en, de, ar, es-ES ("1284", "12.840") and es-MX ("1,284"). The Spanish assertions fail on c8f31f5 and pass on 7271ade.
  • Gate: ./gradlew testDebugUnitTest (7,112 tests, 0 failures); lintDebug for android-shared, phone and TV; lintVitalRelease for phone and TV; assembleDebug for both apps. The supply-chain self-test scripts need Ruby, which the build host lacks; this diff doesn't touch them. Release readiness fails on main too, 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

  • Wording on the person page changes in two languages. Japanese moves from 作品 to タイトル (as on Apple). While more pages load, the phone's "X of Y" label still says 作品, so the noun changes once loading finishes. In Arabic, a single title reads "١ عنوان" instead of "عنوان واحد". Other shipped languages say the same thing in both keys.
  • Android 7–10 group four-digit Spanish counts ("1.284"), because NumberFormatter needs API 30. Android 11+ matches Apple.
  • pluralStringResourceWithNames now always groups its count. Its one caller is a collection size.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code, running in T3 Code
  • Tool(s): Claude Code, T3 Code delegate tasks (Codex), silo-evidence CLI
  • Model(s): claude-opus-5-5 (implementation, code review), gpt-6.1-sol (plan review)
  • Involvement: Fully AI-generated; not yet human verified
  • Adversarial review: Before implementation, gpt-6.1-sol (xhigh) attacked the plan and claude-opus-5-5 (high) cut it. The cut dropped an unused Long overload; 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

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-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 14, 2026
@silo-kody

silo-kody Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T05:09:19.216004Z 7271ade New commits
🔒 Security Review ✅ Completed 2026-11-14T05:10:18.400345Z 7271ade New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds locale-aware grouped-count formatting and applies it to collection counts and title-count labels in Android and Android TV. It also adds a shared grouped-count text value, updates person-title plural mappings, and revises related tests and i18n guidance.

Changes: Locale-Grouped Count Labels

Layer / File(s) Summary
Shared count contract and person labels
shared/src/commonMain/kotlin/org/siloserver/silo/common/i18n/SharedString.kt, shared/src/commonMain/kotlin/org/siloserver/silo/common/i18n/SharedUiText.kt, shared/src/commonMain/kotlin/org/siloserver/silo/model/catalog/PersonPresentation.kt, shared/src/commonTest/kotlin/org/siloserver/silo/model/catalog/PersonPresentationTest.kt
UiText adds GroupedCount. SharedPlural replaces PersonTitles and PersonTitlesMore with TitleCount and TitleCountMore. Person presentation uses the updated plural variants and grouped-count arguments.
Android grouped-count formatting
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/LocaleFormat.kt, android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/UiText.kt, android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/IsolatedStrings.kt, android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/SharedStrings.kt, shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/i18n/EnglishText.android.kt, android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/i18n/LocaleFormatTest.kt, android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/i18n/SharedPresentationTextTest.kt
LocaleFormat.groupedCount formats counts with locale-specific grouping. Android text resolution and {count_text} plural formatting use it. Shared plural resources map the updated title-count variants. Tests cover locale-specific formatting and grouped person-page counts.
Grouped counts in screens
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/collections/LibraryCollectionsScreen.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/browse/TvBrowseScreen.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailScreen.kt, docs/i18n.md
Collection counts, TV Browse title counts, and TV person-page title counts use grouped formatting. The i18n guidance documents LocaleFormat.groupedCount and UiText.GroupedCount.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to c8f31

Large counts for collections and person titles now use the locale's thousands separator. No merge-blocking issue was found.

Security architecture risk: Minimal · up to c8f31

The inspected change affects count labels, not access decisions or stored counts. It preserves numeric plural selection and existing text-isolation behavior. No introduced or worsened security, ownership, rollback, or failure-containment risk was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected propagation is confined to in-process count presentation: collection counts become Text arguments, and TV Browse counts become subtitle strings. These changed paths do not show count text gaining authority over requests, credentials, persistence, or access decisions.

Trust Boundaries and Controls

  • observed — The collection plural helper continues isolating name arguments in right-to-left text. Shared plural resolution also retains its existing isolation path for text arguments; adding GroupedCount does not bypass that path.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: grouping thousands separators in Android collection, Browse, and person-page counts. The fix(i18n) prefix matches the changeset. The title is specific and concise, and…
Linked Issues check Passed Issue #915 is the only direct linked issue. Its requirements are locale-grouped counts for collection cards, the collections-list subtitle, and the phone and TV person-page title counts. The whole-PR …
Out of Scope Changes check Passed Most changes map directly to the #915 objectives. The shared supporting changes (LocaleFormat.groupedCount, UiText.GroupedCount, SharedPlural key remapping, i18n docs, and tests) are needed to impleme…
Description check Passed The description is specific and on-topic. It names the problem (Android large counts lacking thousands separators), the affected surfaces (collection cards, Collections list subtitle, phone and TV per…
Full details: Title check

Explanation

The title names the main change: grouping thousands separators in Android collection, Browse, and person-page counts. The fix(i18n) prefix matches the changeset. The title is specific and concise, and it matches the objectives of #915 and PR #916.

Full details: Linked Issues check

Explanation

Issue #915 is the only direct linked issue. Its requirements are locale-grouped counts for collection cards, the collections-list subtitle, and the phone and TV person-page title counts. The whole-PR summary shows each surface changed:

  • Collection cards: LibrariesScreen.kt badge and caption now call LocaleFormat.groupedCount instead of LocaleFormat.integer.
  • LibraryCollectionsScreen.kt: the bare itemCount.toString() is replaced by LocaleFormat.groupedCount, which also localizes digits.
  • Collections-list subtitle: pluralStringResourceWithNames fills {count_text} with groupedCount.
  • Phone person page: personWorksCountLabel uses library.titleCount plurals and UiText.GroupedCount.
  • TV person page: tvPersonFilmographyCountLabel uses the same plurals with groupedCount.
    LocaleFormat.integer stays ungrouped, as the issue requires for non-count values.
    Automated tests exist: LocaleFormatTest.groupedCountsUseTheLocalesSeparator covers en, de, and ar, and SharedPresentationTextTest.personPage and PersonPresentationTest were updated for grouped output. The PR reports a passing unit test run. Spanish grouping and device rendering are unverified, but the issue does not require a device check.
Full details: Out of Scope Changes check

Explanation

Most changes map directly to the #915 objectives. The shared supporting changes (LocaleFormat.groupedCount, UiText.GroupedCount, SharedPlural key remapping, i18n docs, and tests) are needed to implement the person-page and collection-card changes.
The TV Browse grid subtitle (TvBrowseScreen.kt browseSubtitle) is not one of the surfaces listed in #915. The issue also states that Android has no library-header count equivalent. The change is a two-line switch to groupedCount for the same title-count plurals, and the same thousands-separator concern applies. It is therefore related, not unrelated. The PR discloses it as an added surface.
The TV collection-detail count stays ungrouped, as the PR states. No unrelated code changes appear in the summary.

Full details: Description check

Explanation

The description is specific and on-topic. It names the problem (Android large counts lacking thousands separators), the affected surfaces (collection cards, Collections list subtitle, phone and TV person pages, TV Browse subtitle), the approach (LocaleFormat.groupedCount, switching person page to library.titleCount plurals, UiText.GroupedCount), and validation with tests and device captures. It matches the changeset in the raw summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0057c57f-0fb3-4938-bfd7-877ee025191d
Commits

Reviewing files that changed from the base of the PR and between cc4fd66 and c8f31f5.

Files selected for processing: 16

  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/IsolatedStrings.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/LocaleFormat.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/SharedStrings.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/UiText.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/i18n/LocaleFormatTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/i18n/SharedPresentationTextTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/collections/LibraryCollectionsScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/browse/TvBrowseScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailScreen.kt
  • docs/i18n.md
  • shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/i18n/EnglishText.android.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/common/i18n/SharedString.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/common/i18n/SharedUiText.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/catalog/PersonPresentation.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/model/catalog/PersonPresentationTest.kt

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@silo-triage silo-triage Bot added bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 14, 2026
@silo-triage

silo-triage Bot commented Nov 14, 2026

Copy link
Copy Markdown

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 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

silo-kody Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

Added device captures against a sandbox seeded with a 1,284-item collection and a person credited on 1,287 titles, comparing main (cc4fd66) with 7271ade on the same data:

  • phone: Collections tab card, and the person page in English, Japanese and Arabic
  • tablet and foldable (folded and open): Collections tab card and person page
  • Android TV: person page in English and Japanese, which shows the 作品 → タイトル change

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 groupedCount call as the captured screens.

@macroscopeapp

macroscopeapp Bot commented Nov 14, 2026

Copy link
Copy Markdown

The separate collections-grid count badge (LibraryCollectionsScreen.kt) is also changed, but the evidence list identifies only the library Collections-tab card. Please add a same-data before-and-after pair for the collections grid on phone, tablet, and foldable (folded and open), or identify where that pair appears in the linked evidence. The Collections list-row and TV Browse omissions are already explained in the PR, so I am not repeating them.

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

@Quick104

Copy link
Copy Markdown
Contributor Author

No user path opens LibraryCollectionsScreen, so there is no screen to capture. It renders only when Route.Collections carries a libraryId (AppNavigation.kt, the Route.Collections.ROUTE destination). The app's only navigation to that route, AppNavigation.kt:1543, calls Route.Collections() without one, so it opens CollectionsScreen, and no deep link targets it. The library collections grid users actually see is the Libraries → Collections tab (InlineLibraryCollectionCard), which the evidence covers on phone, tablet and foldable (folded and open). I changed the unreachable card anyway so both cards format counts the same way. The PR body now says this too.

@Quick104
Quick104 merged commit b2b0fb5 into main Nov 14, 2026
10 checks passed
@Quick104
Quick104 deleted the fix/issue-915-grouped-counts branch November 14, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parity: group thousands in collection card and person page counts (from Silo-Server/silo-apple#1161)

1 participant