Repository navigation
fix(mobile): translate built-in workspace status names and this computer's name - #52318
Conversation
[Low impact] The PR appears safe to merge; no blocking issue was found. SummaryThe mobile screens now translate built-in status names and default computer names while keeping custom names unchanged.
Reviews (3) · Last reviewed commit: "fix(mobile): show built-in status and co..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The mobile app showed the shipped workspace status names (Todo, In progress, In review, Done) and this computer's built-in name (Local Mac, Local Windows, Local Linux, This computer) in English in the status sections, the status sheet, the row menu, the workspace options host list, and the new-workspace run target picker. Translate a status name only when it is still the shipped default, and translate this computer's name only when the host has no name of its own, so names users set stay literal, as on desktop. Original fix by @x-Ai in stablyai#52318. Co-authored-by: Neil <[email protected]>
063a6d7 to
36d2478
Compare
The mobile app showed the shipped workspace status names (Todo, In progress, In review, Done) and this computer's built-in name (Local Mac, Local Windows, Local Linux, This computer) in English in the status sections, the status sheet, the row menu, the workspace options host list, and the new-workspace run target picker. Translate a status name only when it is still the shipped default, and translate this computer's name only when the host has no name of its own, so names users set stay literal, as on desktop. Original fix by @x-Ai in stablyai#52318. Refs stablyai#32207 Co-authored-by: Neil <[email protected]>
36d2478 to
511d90c
Compare
ELI5
Some names in the mobile app stayed in English even when the app was set to another language. These are the four built-in status names (Todo, In progress, In review, Done) and the built-in name for your own computer (Local Mac, Local Windows, Local Linux, This computer). They now show in your language. A name you typed yourself stays exactly as you wrote it.
What Changed
Before: the phone showed the host's English status labels in the Group by Status section headers, the Status sheet and the row menu's Status row. The new-workspace "Run on" picker and its selected value showed "Local Mac" (or Windows/Linux) in English in every locale.
After: these places use the mobile catalog when the name is still a built-in one. Renamed or custom statuses, and computers with their own name, stay literal.
How:
mobile/src/worktree/workspace-list/workspace-status-label.ts(translateWorkspaceStatusLabel). It uses the same rule as desktop'stranslateWorkspaceBoardStatusLabel: a status is translated only if its id is one ofDEFAULT_WORKSPACE_STATUSESand its label is blank or still the shipped default. The status section headers (workspace-list-sections.ts), the Status sheet and the row menu's current status use it.getTranslatedHostContextLabelinworktree-host-context-labels.ts. A host with its own label, or a host that is not local, goes through the sharedgetHostContextLabelunchanged. Otherwise it picks this computer's name by platform from the existinghostScreen.workspaceOptionsSheet.local*/thisComputerkeys. The workspace options sheet's inline version of this logic is replaced by the helper, with the same keys and the same result.getNewWorkspaceRunTargetandbuildNewWorkspaceRunTargetOptionsnow taketand use it as well.worktree.workspaceStatus.{todo,inProgress,inReview,done}in all 11 mobile locales. Each value matches the desktopworkspaceBoardStatusstring, so a status reads the same on both.Why
The status a user picks on the phone should read the same as the lane it lands in on desktop. "Run on" was the only place in the new-workspace form that named the computer in English, while the workspace options sheet, two taps away, already translated it. Matching desktop's rule keeps user-set names untouched, and moving the options sheet's logic into one shared helper means the two pickers can't drift apart.
Linked Issue
Refs #32207 (localization tracking issue; this covers part of it)
Still English, out of scope here: mixed-host row badges, the tasks repository detail line, and the gated-off feed path.
Visual Proof
N/A. These are React Native phone screens with no component fixtures, so there are no screenshots. Instead, the changed functions were run with the real catalogs. On main a zh-backed
buildMobileWorkspacePlangrouped by status givesTodo / In progress / In review / Doneand the Run on picker givesLocal Mac. On this branch they give待办 / 进行中 / 评审中 / 完成and本地 Mac. A renamed status ("Backlog"), a custom status ("Blocked"), a named local host and an SSH host all stay literal.Testing
Reproduced on main with a scratch vitest probe (zh and ja catalogs): the status headers and the Run on label come out in English. The same probe passes on this branch.
Added
workspace-status-label.test.ts(shipped and blank labels are translated, renamed and custom labels pass through) andworktree-host-context-labels.test.ts(darwin/win32/linux/unknown platform, a local host with its own name, and an SSH host whose name is "Local Mac").Targeted mobile vitest passes.
pnpm -C mobile typecheckpasses.pnpm verify:mobile-localizationpasses.CI static gates on the touched files are clean: anti-slop oxlint, code-quality native oxlint, ast-grep, changed-code quality, oxfmt, and the render-path-translate and mobile React Compiler hazard ratchets.
Platforms: the logic is platform-agnostic and was checked in unit tests for darwin, win32, linux and an unknown platform. Not rendered on a device.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None that matters, because these are render-time label lookups inside existing memos, with no I/O, polling or subprocess work.
tfromuseMobileTranslationchanges identity only when the language changes, so the newtdependency inNewWorktreeModal's memo adds no recomputation.Risk
The main risk is a wrong translated string, which would show up as a mistranslated status or computer name. Names the user set are never translated, so their data is not affected. Nothing is persisted, and the phone/host protocol is unchanged, so this is safe with older desktops and SSH hosts. A status whose label exactly matches a default spelling is translated, which is also how desktop behaves. Back out with a plain revert.
Level: Low
Review
Reviewed by two independent passes, both approved. Fixed during review: the row menu's Status row now matches the sheet it opens, the host helper picks the name by platform instead of matching English copy, and host-label tests were added.
Agent skill upstream boundary
Notes
Original fix by @x-Ai in #52318 (authorship preserved on the commit).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)