Repository navigation
fix(i18n): say the deploy age in unit words inside sentences - #36685
Conversation
Code change approver recommendation: ApproveWhy: the decider estimates a 6% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. deployAge gains an optional unitDisplay argument (default 'narrow') and passes it through to fmtDuration and then fmtUnit, which honours the override. The three sentence callers pass 'short'; the two stat-card callers keep the narrow default, so they render as before. The ja deploy_task_stopped_when value drops a stray space to match its sibling sentences. The tests pin both widths and the Japanese render. CI failures are GitHub API rate-limit/infra errors, not code verdicts. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is a small, opt-in change to how wide the age units are in three sentences. The stat cards keep the narrow default, and four screenshots of this revision show the result. Notes
[DESIGN-REVIEWED] edddeb9 Description read[DESCRIPTION-READ] aa3b3f15d86594484e47d754630e9e24773ef60c30297e4d968d0047c43cc92b 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) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. This PR changes copy only and adds no controls. In the after shots the blind reader read "13 分" and "13 min" correctly and was sure of both, where "13m" had read as "metres or months". Notes
[UX-REVIEWED] edddeb9 Description read[DESCRIPTION-READ] 0904278e7e98f875bc7676f42b87516df11443ef085ea2f06d0182695a6312d9 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 Nothing blocks. The new What this change shipsInventory (4 items) — 4 justifiedIntent: make the deploy views state a stopped task's age, or a finished deploy's age, in unit words inside a sentence, so Japanese reads
[FIRST-PRINCIPLES-REVIEWED] edddeb9 Description read[DESCRIPTION-READ] 1e0ec91681bde571384f6c6182a1053382020e94448c132535d98b774edfb9c9 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: |
The stopped-task line on the Fargate deploy view rendered its age with the narrow unit default, so the Japanese sentence read 13m 前に停止しました. The EC2 view's "A deploy finished ... ago" sentences had the same narrow age. deployAge takes a unitDisplay argument, defaulting to narrow for the stat cards, and the three sentence callers pass short: Japanese now reads 13 分前に停止しました, English "It stopped 13 min ago". The ja value for deploy_task_stopped_when drops the space before 前 to match its two sibling sentences. Fixes #36611
The new #36611 render test computed its stop time from the real Date.now(), which the flake-pattern ratchet (J3-unpinned-date) rules out. Pin the instant with vi.setSystemTime and restore it in onTestFinished.
8f4a4eb to
edddeb9
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approve. I read the whole diff on this head. All checks pass: the failed GPT 6.1 Review, PR Policy and Publish readiness signal runs, and the cancelled Sensitive Change Review, each have a newer passing run on this head.
deployAgetakes an optionalunitDisplay, defaulting to the narrow form, which it passes tofmtDuration. The two sentences that hold an age now passshort: the Fargate "stopped … ago" line and the EC2 "deploy finished … ago" line. So Japanese reads25 分前に停止しました。instead of25m 前.- Stat cards keep the narrow default, so their compact value is unchanged.
- In
ja.json, the space before前is dropped, because the short unit already ends in a word. - Tests pin both forms and the Japanese sentence on a fixed clock.
- Display only. No regex, and nothing is refused.
Problem / Motivation
Goal: The deploy views say how long ago a task stopped or a deploy finished in unit words, so the Japanese sentence reads
13 分前に停止しました。instead of13m 前に停止しました。.With the dashboard in Japanese, a stopped task on a crewmate's cloud deploy view reads
13m 前に停止しました。: a narrow Latin unit inside a Japanese sentence. English readsIt stopped 13m ago.The EC2 view'sA deploy finished {{age}} ago in {{region}}.sentences take the same narrow age.Why it matters
Every reader of those sentences outside English meets an abbreviation their language does not use mid-sentence. The crew patrol interval was fixed the same way in #35603 (#33514), so these deploy sentences are left reading the narrow form.
Not a goal
since deployvalue): a compact value over a label, so they keep the narrow form.What changed (motivation → approach → change)
deployAgeinwebsite/src/pages/members/deployShared.tsxcalledfmtDurationwith fmtUnit's narrow unit default. That form is meant for tight chrome, and it is right for the stat cards, but three callers drop the age into a sentence.deployAgetakes a thirdunitDisplayargument, defaulting to'narrow', so the two stat-card callers are unchanged. The three sentence callers pass'short', the form #35603 used:website/src/pages/members/FargateCrewView.tsx:pages.membersPage.deploy_task_stopped_when.website/src/pages/members/DeployMyCrew.tsx:pages.membersPage.deploy_state_gone/deploy_state_unknown.The ja value of
deploy_task_stopped_whenwas{{age}} 前に停止しました。, with a space before前that its two sibling sentences ({{age}}前に …) do not have. With unit words that space would read13 分 前に, so it is dropped to give the13 分前に停止しました。the issue expects.Backwards compatibility
Compatible:
deployAge's new argument is optional and defaults to the old narrow output, so every existing caller renders the same unless it opts in; no catalog key, prop or API moves.Removes nothing: only the unit width of three rendered sentences and one ja space change.
Tests
website/src/pages/members/FargateCrewView.test.tsx: the stopped-task case expectsIt stopped 25 min ago.; a new case renders the view in Japanese, with the clock pinned byvi.setSystemTime, and expects25 分前に停止しました。.website/src/pages/members/DeployMyCrew.test.tsx: a newdeployAgecase pins the narrow default (13m, the stat card) and the short form (13 min, a sentence).With the production hunks reverted those three tests fail (3 failed, 83 passed); with them, all pass.
npx vitest run src/pages/members/(65 files, 1197 tests) andnpx vitest run src/i18n(78 files, 1234 tests) pass;tsc,eslinton the touched files,lint:i18n,i18n:check,jscpdandnpm run buildare clean, andpython -m pytest -n0 test/test_flake_pattern_ratchet.py -k test_no_changed_file_gains_a_flaky_shapepasses.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
FargateCrewView(andDeployMyCrewDialog, which lazy-loads it) is not mounted by any page on main, so it cannot be opened in the running dashboard. I rendered the real component instead in a throwaway Vite harness (not committed):FargateCrewViewinside the app's own providers andsrc/index.css, with a finished Fargate launch whose task ECS reportsSTOPPED13 minutes ago. Playwright loaded the build throughpage.route, with no server and no gateway. The same harness was built once fromorigin/main(before) and once from this head (after). The capture host has no CJK system font, so the harness put Noto Sans JP first in--script-fallbacks, limited to CJK code points, so the Japanese glyphs are drawn and Latin text keeps its normal font.Screenshots / video
The stopped-task card on the Fargate deploy view; the second line is the changed sentence.
Japanese, before (
13m 前に停止しました。):Japanese, after (
13 分前に停止しました。):English, before and after
Before (
It stopped 13m ago.):After (
It stopped 13 min ago.):Related Issues
Fixes #36611
Sibling sweep
Swept: git grep -n "deployAge" -- website/src
Sibling: website/src/pages/members/FargateCrewView.tsx:381 -- changed here
Sibling: website/src/pages/members/DeployMyCrew.tsx:589 -- changed here
Sibling: website/src/pages/members/DeployMyCrew.tsx:556 -- not affected -- stat card value, keeps the narrow form
Sibling: website/src/pages/members/FargateCrewView.tsx:397 -- not affected -- stat card value, keeps the narrow form
Pattern harvest
Rule candidate: review-prompt
Pattern: a
fmtDuration/fmtUnitvalue interpolated into a full-sentence catalog string uses the narrow unit default instead ofunitDisplay: 'short'Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.