Repository navigation
fix(i18n): pick the singular for seven count labels at a count of 1 - #25811
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: all seven renamed keys are read only at the 12 call sites this diff changes, and four committed screenshots show the reshaped refusal notice. Notes
[DESIGN-REVIEWED] 5c5227f Description read[DESCRIPTION-READ] b147ffe9edcf39f6633928e660822e5faea47fd72e7ab504a6e0ee8a32037cdf That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the new "move request failed" notice. The PR adds a second Evidence gaps
Notes
[UX-REVIEWED] 5c5227f Description read[DESCRIPTION-READ] 517f05d8f016753a07528a283990913b8c165b959fab82f134b104939879a850 That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One rider sits outside the Goal: a new failure notice for the Move to Trash request. Everything else is the plural fix, or the Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: when a count is 1, seven labels should read "1 tool" or "Peeked 1 time" in every shipped language. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 5c5227f Description read[DESCRIPTION-READ] 7c95e13ac34b91d04d70c26b0cfd0d7d4f95ccfc6aa0ea5743d6529269b0c4e8 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
e8dbe7e to
799d9a3
Compare
|
span=57949b222f59 disposition=fixed sha=799d9a303a79
self-added: no |
799d9a3 to
5203d17
Compare
|
span=e7ade05b465a disposition=fixed sha=5203d17d3e94
self-added: yes |
|
span=c0269ce7e36d disposition=fixed sha=5203d17d3e94
self-added: yes |
5203d17 to
550c607
Compare
|
Reply to the notes on Refusal reasons joined on one line (Design, UX, First Principles): fixed in "session is too recent" leaves the reader asking how long (UX): left as is. |
550c607 to
67968a9
Compare
|
span=e6d21834438d disposition=fixed sha=67968a90d06a
self-added: yes |
|
Reply to the notes on Red styling for the refusal box (Design): this is required, not a choice. Editing the heading brought the box under Formal-to-informal switch in three No close button, and "too recent" not saying how long (UX): both predate this PR. The old box had no close button either, and |
67968a9 to
ce6fd52
Compare
19c6e6c to
b7193ca
Compare
|
Rebased: main moved in website/src/i18n/locales/ (19 overlapping files, same-file) since this head went green (c32037e -> 14f5a48); CI re-running. No conflicts; src/i18n, src/apps/mochi and SessionStorageScreen tests, tsc and the plural codemod check pass locally. @iamwhatever on your blocker: fixed in the description. Opened #27342 for the five remaining |
|
@iamwhatever your r139 point, against head b7193ca:
|
iamwhatever
left a comment
There was a problem hiding this comment.
Requesting changes at b7193ca for one translation defect inside this PR's goal.
Our r139 tracking blocker is cleared: the description says Part of #25809 and links #27342 for the five remaining keys. The call-site change is right, and checks are green.
Defect (Opus note, unanswered). The new Hindi singular keeps the plural verb: refused_heading_one is {{n}} सत्र नहीं ले जाए जा सके (hi.json#L16619). At a count of 1 a Hindi user still sees a plural sentence, the same bug this PR fixes in English. The catalog already uses the singular नहीं ले जाया जा सका elsewhere (hi.json#L13788). Smallest fix: set refused_heading_one to {{n}} सत्र नहीं ले जाया जा सका.
AI findings judged non-blocking
- Opus (note): fr/ru/bn
screenshots_*use the informal pronoun. The locale style guides require tu/ты/তুমি for changed values (website/src/i18n/style/fr.md, ru.md, bn.md); the formal neighbours are older strings. - UX evidence gaps: the failed-move notice is the shared ErrorNotice, and the test asserts its alert, text and hand-off (SessionStorageScreen.tsx#L473-L478). The Mochi and tool labels change only the noun form, and render tests assert the exact text.
- UX notes: the 'Ask the agent' label and the missing dismiss predate this PR.
- Design (note): recording a partial refusal builds a local report that the hand-off reads only on demand (SessionStorageScreen.tsx#L142-L148). A shared helper is optional.
- First Principles items 5 and 6: the failed-move notice replaces a silent failure on the mutation this PR edits, and the capture harness is evidence tooling.
— crew-pr-reviewer (r140)
|
@iamwhatever your r140 points:
|
b7193ca to
13f568d
Compare
Seven English values put a plural noun after {{count}} with no
_one/_other forms, so a count of 1 read "1 tools", "1 sessions could
not be moved", "Peeked 1 times". The call sites also passed
fmtNumber() text as count, which i18next reads as NaN for grouped
numbers such as Russian "1 001" and so lands on the wrong form.
Split each key into the plural forms its locale selects, register them
in pluralKeys.json, and pass the raw number as count with the
formatted text as n, the pattern telemetryPanel already uses.
The session-storage refusal heading is one of the edited messages, so
that hand-written box moves to ErrorNotice with the agent hand-off,
as errors-use-error-notice requires for a touched error surface.
Closes #25809
13f568d to
5c5227f
Compare
|
Rebased: main moved in website/src/i18n/pluralKeys.json (#21995 appended two keys at the same spot), so the PR conflicted (13f568d -> 5c5227f). Kept both key sets; no other change. Locally: src/i18n, src/apps/mochi and the three touched test files (115 files, 1698 tests) pass with I18N_BASE_REF=origin/main; i18n-check, check-i18n-keys, plural codemod --check, a clean en-XA regen, tsc and eslint all clean. |
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 5c5227fb63bc0f7708753165b5901d8eefe086e4.
Our r140 blocker is fixed: the Hindi singular now reads {{n}} सत्र नहीं ले जाया जा सका (hi.json#L16693-L16694). The rest of the head is a rebase that keeps both key sets in pluralKeys.json. Each call site passes the raw number as count and the formatted text as n (MochiPage.tsx#L780), the five remaining keys are tracked in #27342, every AI lane passed on this head, and CI is green.
AI findings judged non-blocking
- UX: no capture of the failed-move notice. It is the shared
ErrorNotice, empty unless the request fails (SessionStorageScreen.tsx#L474-L478), and the test asserts its alert, text and hand-off. - UX: heading does not say "to Trash". A wording nit; the notice sits on the Trash action.
- First Principles item 6: the failed-move notice is outside the Goal. It replaces a silent failure on the mutation this PR edits; no user harm.
- Design: the
ErrorNoticeconversion would read better as its own commit, and later Mochi fixes belong in the app's repo after #26967. Commit-shape and routing advice only.
— crew-pr-reviewer (r142)
Problem / Motivation
Goal: Seven count labels read in the singular at a count of 1 ("1 tool", "Peeked 1 time"), in English and in every shipped language's own plural forms.
Seven English values put a plural noun after
{{count}}and had no_one/_otherforms:pages.sessionBreakdown.tool_countpages.sessionStorage.refused_headingapps.mochi.stats.dragsapps.mochi.stats.peeksapps.mochi.stats.screenshotsapps.mochi.stats.walksapps.mochi.stats.longest_chatEach one renders whenever its count is above 0, so a count of 1 is reachable on every site. The call sites also passed
count: fmtNumber(n), a string.Why it matters
Anyone with one sub-agent tool call, one refused session, or one Mochi walk, peek, drag, screen look or chat message sees broken English. Passing formatted text as
countalso breaks plural choice in other languages: Russian groups 1,001 as "1 001", which parses as NaN and lands on the wrong form.Not a goal
{{count}} <noun>svalues in the catalog. They are listed in i18n: seven count labels read '1 tools', '1 sessions', 'Peeked 1 times' #25809 for a later change.pages.chat.recoveryCard.n_patterns, left alone on purpose.What changed (motivation → approach → change)
The noun's form was fixed in one string, and i18next was handed text instead of a number. So:
Intl.PluralRules):_one/_otherin English, German, Hindi and Bengali;_one/_many/_otherin Spanish, French, Italian and Portuguese;_one/_few/_many/_otherin Russian;_otheronly in Japanese, Korean and Chinese.en-XAis regenerated withgen-pseudolocale.mjs.src/i18n/pluralKeys.json.i18n-plural-codemod.mjsonly rewrites+ 's'glue at call sites, and these sites have none, so the keys are registered by hand, as other feature PRs do.pages/SessionBreakdownTree.tsx,pages/system/SessionStorageScreen.tsx, five each inapps/mochi/MochiPage.tsxandapps/mochi/src/renderer/SettingsPanel.tsx) pass the raw number ascountand thefmtNumbertext asn, and the values show{{n}}. That is the patternpages.telemetryPanel.startups_recordedalready uses. i18next's built-in formatter could do{{count, number}}, but no shipped key uses a format spec, andi18n-catalog.mdroutes numbers throughfmtNumber.refused_headingis the title of a hand-written refusal box inSessionStorageScreen.tsx. Editing its message brings it undererrors-use-error-notice, so the box is now anErrorNotice: the heading asmessage, one row per refused session in itsfooteras before,askAgenton, and areportrecorded when the refusal arrives (source: 'system', the trash endpoint, and each session's uid and reason code asdetail) so the hand-off tells the agent which sessions failed and why. The same mutation had no surface at all when the request itself failed, so a secondErrorNotice(askAgenton) now renderserrMessage(trashMut.error)beside it (the selection is already cleared when it shows, and the one text box is a search filter).тыin Russian,tuand U+202F in French,তোমারin Bengali.Backwards compatibility
Compatible: the seven keys are read only at the 12 call sites changed here, and i18next resolves the base key to its plural forms.
Reader: website/src/i18n/locales/*.json:the seven base keys -- app -- every reader is one of the 12 call sites in this diff; deadKeys.test.ts and catalogParity.test.ts pass
Tests
website/src/i18n/countPlurals.test.ts: one test per key, English, count 1 and count 2 ("1 tool" / "2 tools" and so on).src/test/SessionBreakdownTree.test.tsx: a node with one tool call renders "1 tool"; in Russian, 1,001 tool calls render "1 001 инструмент", which needs the raw number.src/test/SessionStorageScreen.test.tsx: one refused session renders "1 session could not be moved" inside an element withrole="alert"(that check fails on the old hand-written box); two refusals render "2 sessions could not be moved" with onelirow per session in the alert. A third test presses "Ask the agent" and asserts the staged prompt carries the endpoint and bothuid: reasonlines; it fails on the previous head, whose prompt held only the heading. A fourth test rejects the move request and asserts an alert with the error text and the hand-off; it fails on the previous head, which showed nothing.src/test/MochiPageCoverage.test.tsx: stats of 1 render "1 step", "Looked at your screen 1 time", "Peeked 1 time", "Dragged 1 time", "Longest chat: 1 message".All 11 fail on
origin/main. The Russian one also fails with only the new catalogs and the old stringcount. All pass on this head, and ran 3 times with--sequence.shuffle.catalogParity,deadKeysand every locale style gate are insrc/i18n(102 files, 1500 tests withsrc/apps/mochi): green.i18n-check.mjs,i18n-plural-codemod.mjs --check,tsc -p tsconfig.app.jsonandeslinton the touched files: clean.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
node website/scripts/capture-session-storage-refused.mjsrenders the realSessionStorageScreen(viawebsite/capture/session-storage-refused.html, with a stubbed inventory), selects rows, presses Move to Trash, and asserts before each PNG that the heading uses the right plural form, sits in arole="alert"element, and lists every refused session with its reason. All four scenes passed.The Mochi stats and the sub-agent tool count change only the noun's form; the render tests above assert their exact text.
Screenshots / video
The refusal notice is now an
ErrorNotice(red alert, with the agent hand-off) instead of a neutral box. Each refused session keeps its own row. Captured at this head:One refused session:
Several refused sessions:
Related Issues
Part of #25809
Refs #27342 -- the five remaining
{{count}} <noun>skeys (apps.mochi.stats.busiest_day, bothcritique_this_flow_count_screenskeys,pages.membersPage.member_count_filtered,pages.telemetryPanel.daily_trend_point).Sibling sweep
Swept: en.json values matching {{count}} followed by a plural noun, outside pluralKeys.json
Sibling: website/src/apps/mochi/MochiPage.tsx -- tracked in #27342
Sibling: website/src/apps/mochi/src/renderer/SettingsPanel.tsx -- tracked in #27342
Sibling: website/src/apps/design-critique/Composer.tsx -- tracked in #27342
Sibling: website/src/apps/design-critique/ScopingPicker.tsx -- tracked in #27342
Sibling: website/src/pages/members/MembersPageRoster.tsx -- tracked in #27342
Sibling: website/src/pages/TelemetryPanel.tsx -- tracked in #27342
Pattern harvest
Rule candidate: lint
Pattern: a catalog value with a plural noun after {{count}} whose key is not in pluralKeys.json, or a count option passed through fmtNumber
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)