Repository navigation
fix(web): pick a backup warning toggle's singular for exactly one item - #4737
Conversation
The backup warning toggles chose "Show the account" or "Show the accounts" with a plural on the count. The label prints no number, and in Russian, Ukrainian, Croatian, Lithuanian, Latvian and Slovenian CLDR's "one" form also covers 21, 31 or 101, so a backup that left out 21 accounts showed the singular label. The toggles now pass "exactlyOne", "exactlyTwo" or "other" to the catalog's select, which keeps the dual Arabic and Slovenian use for exactly two. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in the backup warning toggle keys that select on {amount}
(Silo-Server/silo-translations#132 and #136) and the other catalog
changes released since the last pin.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Opus 5.5, reviewed 920a018)
One finding, a boundary nit. The rest held up. No caller of the six keys still passes count. All 43 locale files compile the three branches for each key, and none still uses count. The re-pin's only other change is the new web.admin.tasks.detail.sampleSeriesEpisode key. prepareValues skips selector arguments, so the string amount gets no isolates in ar or ar-XB.
| * also covers 21, 31, and 101 in Russian or Latvian, and `exactlyTwo` keeps | ||
| * the dual that Arabic and Slovenian use for two. | ||
| */ | ||
| function amount(count: number): "exactlyOne" | "exactlyTwo" | "other" { |
There was a problem hiding this comment.
O1 (nit, boundary): #4741 adds exactAmount() to web/src/i18n/format.ts and exports it from @/i18n. It has the same signature and body as this amount(), and the i18n docs rule in #4741 points callers to it. #4741 doesn't touch this file, so once both merge the web app has two copies of the same exact-count rule, one private to this component.
Suggested repair: keep one copy. If #4741 lands first, rebase and call exactAmount from @/i18n here. If this lands first, move the helper to @/i18n under that name so #4741 reuses it.
There was a problem hiding this comment.
CI's web tests check out only the English and pseudo-English catalogs, so the test can't import the Russian or Arabic ones. It now formats the pseudo-English catalog under Russian plural rules, and checks the exactly-two branch with a small catalog of its own. 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:
|
The test read three of the six labels and passed when any one of them differed. It now reads the accounts, files, and file-group toggles both closed and open, and checks each label on its own. 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:
|
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (the Backups and Restore admin pages exist only in the web app; the six keys are web-only)
In the web admin's backup warning details (the Backups page and the Restore page's Users section), the toggle under each warning shows "Show the account" or "Show the accounts", "Show the file" or "Show the files", or "Show file" or "Show files" for one group of files. The label prints no number. Main picks the wording with a CLDR plural on the count, but in Russian, Ukrainian, Croatian, Lithuanian, Latvian and Slovenian the plural
onecategory also covers 21, 31, 101 and so on. A backup that left out 21 accounts shows "Показать аккаунт" (Show the account) in Russian, and 21 missing files show "Показать файл".Approach
The six keys now
selecton an{amount}the web code sets (Silo-Server/silo-translations#132 and Silo-Server/silo-translations#136):exactlyOnefor one item,exactlyTwofor two, otherwiseother. Only exactly one item gets the singular.exactlyTwokeeps the dual Arabic and Slovenian use for two ("عرض الحسابين"), which the plural forms on main already give. In English,exactlyTworeads the same asother, so the English labels don't change.The three call sites in
BackupWarningDetails.tsxpass the number of items each toggle reveals: the left-out accounts, the listed missing files, or the files in one group. The missing-files toggle uses the listed count rather than the headline total. The server only truncates that list past 10,000 entries, so a count of one or two is always the real count.The translation pin moves to 2026.11.21-d2ccdf3. Apart from these six keys, it changes the English of
web.admin.settings.hooks.settings.conflict.description, which nothing on main renders, and addsweb.admin.tasks.detail.sampleSeriesEpisode.A sibling change will move the other count-free backup and restore labels (
restore.choose.showThem/hideThemand the omission reasons) to the same selector and may share theamount()helper.Validation
make lint-changed: no changed Go packages.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4737/
Surface and build: web admin Backups page and Restore page (Users section), Russian, Arabic and English, desktop, tablet and phone widths; main 5be6082 against this branch.
Risks
None identified. A caller that still passed
{ count }to these keys would throw in development and log a format error in production. The six call sites in this file are the only callers, and the test renders all of them.Checklist
Council review
Rounds: 1, last reviewed 920a018
Fixed: S1 (low), the test read three of the six labels and passed when any one differed; since 2251134 it checks all six, closed and open, one at a time. Answered: O1 (nit), the private
amount()duplicatesexactAmount()from #4741; whichever PR merges second keeps one copy. Commits after 920a018 change only the test.Visual review: 2 rounds, captures from 920a018
Fixed: the iPad Restore captures now show the opened toggle clear of the fixed header. Answered: the fixed header over full-page captures, the tablet action alignment, the phone date wrap, the toggle's contrast and indent, the truncated reason line on phones, and the English file-group names in other languages all look the same on main and are outside this change. The Russian headline's pronoun after 21 is a separate key, left for a follow-up. The file-group toggle at 21 files is covered by the test rather than a capture.
AI Disclosure
make translate-prfor the catalog translationsexactlyTwonow covers. See Council review.🤖 Generated with Claude Code