Repository navigation
fix(mobile): localize agent mode badges on profile agent rows - #8168
Conversation
The row rendered the raw config value, so a translated screen showed PRIMARY or SUBAGENT in English. Map each mode to a short catalog label, with the key table typed against the mode union so a new mode cannot fall back to English.
|
bot: Android emulator, local dev stack, fake account, profile with one agent per mode. Badges before and after switching the app to हिन्दी.
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe only change since the last review adds the Assumptions: Files Reviewed (4 files)
Previous Review Summary (commit 82cec83)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 82cec83)Status: No Issues Found | Recommendation: Merge Executive SummaryThe badge now resolves a typed, exhaustive mode key map through Files Reviewed (90 files)
Reviewed by deepseek-flash-latest · Input: 71.6K · Output: 3.9K · Cached: 518.9K Review guidance: REVIEW.md from base branch |
…mode-badges # Conflicts: # apps/mobile/src/i18n/locales/fi.json # apps/mobile/src/i18n/locales/hu.json # apps/mobile/src/i18n/locales/sv.json # apps/mobile/src/i18n/locales/th.json
main moved ProfileAgentsScreen onto TabScreenScrollView, which pulls the real react-native module graph into the mounted test. Mock the wrapper the way the other screen suites do, so the badge assertions run again.



What changed
ProfileAgentsScreenrendered the raw config value as the mode badge, so a translated screen readPRIMARY/SUBAGENT/ALLin English next to Hindi row copy.profile-agents-model.tsnow exportsAGENT_VISIBILITY_LABEL_KEYS, typedsatisfies Record<AgentVisibility, string>so a future mode fails the typecheck instead of falling back to the raw enum.t(AGENT_VISIBILITY_LABEL_KEYS[visibility]), keeping the existinguppercase tracking-widestyling.profiles.agents.modePrimary/modeSubagent/modeAll("Primary only" / "Subagent only" / "All modes") inen.jsonand all 86 locale catalogs. Short labels, not the add-sheet picker copy, which carries an explanatory suffix and would be too long for the row badge; the picker is unchanged.AgentRowViewProps.visibilitytightened fromstringtoAgentVisibility.Branch state:
mainis merged into the branch as a merge commit. The only conflict was in four locale catalogs whosevisibility*copymainretranslated; those files takemain's strings and keep the three newmode*keys (themodeSubagentvalues were aligned withmain's newly chosen term for "subagent" in Finnish, Hungarian and Thai).Verification
node tools/i18n/check-catalogs.mjs→check-catalogs: 87 languages, every catalog matches en.jsonpnpm --filter kilo-app run check:i18n,run typecheck,run lint→ cleanvitest run(both mobile projects) on the merged head → 1246 files, 18491 tests passedNew
profile-agents-screen.mounted.test.tsxmounts the screen with thehicatalog and three agents (primary / subagent / all), asserting the badge text is the Hindi label and never the raw mode. It fails on the pre-change screen and passes after.mainmoved this screen ontoTabScreenScrollView, so the suite mocks that wrapper the way the other screen suites do; without it the realreact-nativemodule graph is parsed and the suite cannot load.Android emulator, local dev stack, fake account (
kilo-drain-badge-*@example.com), profile seeded with one agent per mode, app language हिन्दी, run on the merged head:Before:
PRIMARY ONLY/SUBAGENT ONLY/ALL MODESAfter:
केवल प्राथमिक/केवल सबएजेंट/सभीScreenshot attached in the next comment.
The change touches no iOS-specific code (
Platform, safe areas, keyboard, native modules), so the Android emulator is the required proof; the rendering path is sharedText. The iOS lane gate refuses a lease for this branch for the same reason, so the emulator run is the end-to-end proof for the badge.Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Short keys, no suffix
Confidence: 0.80 · Precedent: UX and design quality: remove redundant copy and keep badges right-sized; session a247f3c19b1e asked to remove the redundant "context" copy. Localize every string: session dcb3f9170164 "the mobile app always must respect i18n"
uppercaseCSS. Keep it for the localized labels?Answer: Keep styling (Recommended)
Confidence: 0.75 · Precedent: Keep similar elements consistent across surfaces; session a247f3c19b1e asked that the thought row match the tool call row
Answer: Primary only / Subagent only / All modes
Confidence: 0.55 · Precedent: Engineering conventions: prefer existing tooling over workarounds. Precision and consistency come from UX rules: 'Keep similar elements consistent across surfaces' (session a247f3c19b1e). This option keeps the i18n checker strict and needs no registry exemptions.
Answer: Show on every row
Confidence: 0.70 · Precedent: UX: 'Keep similar elements consistent across surfaces' (session a247f3c19b1e). The brief expects a localized badge on every agent row.
Answer: Mapping test + mounted Hindi test
Confidence: 0.55 · Precedent: Proof: 'we want to catch errors in PRs, as early as possible' (session 99e88001c4b4). Run only the targeted tests locally, and still verify on iOS in Hindi end to end with screenshots uploaded to the PR.