fix(i18n): settings-overview role namespace, scopesHint rich-tag, and role SelectValue from #375#417
Conversation
The identity card at the top of the Settings overview was calling
useTranslations('roles') (root-level) instead of useTranslations
('Settings.roles'). The root 'roles' namespace only exists in the
es-CO translation as a workaround added to mask this bug — in English
the chip rendered the raw keypath (e.g. 'roles.admin').
Aligns with invite-member-dialog.tsx:78 and members-tab.tsx:129,
which already use the 'Settings.roles' namespace.
Part of ArnasDon#375
next-intl rich tags must be attribute-less. The className on the
<code> wrapping 'GET /api/v1/me' was being silently dropped, so the
'text-[11px]' Tailwind utility was a phantom — the code rendered at
the surrounding text size anyway.
This strips the className from both en.json and ko.json so the rich
tag is parsed correctly. The <code> element still renders at default
size; the smaller styling can be restored globally via CSS
('code { font-size: ... }') if desired.
Part of ArnasDon#375
Base UI's <SelectValue> with no children does not reliably extract
text from the selected <SelectItem> when the item's children is a
function call (e.g. tRoles(r.value)) — the trigger falls back to
displaying the raw enum string ('admin', 'agent', 'viewer').
Render the translated label explicitly as children of <SelectValue>
so the trigger always shows the human-readable role name.
Scope: only the two role selectors in Settings (matches this PR's
theme). The same pattern affects ~5 other sites (template-manager
header format, button type; ai-config provider and handoff target;
flows/broadcasts) — those are left as follow-up and tracked in ArnasDon#375.
Part of ArnasDon#375
|
Went through all three against The For Which brings up one thing in the description I think is wrong. It says the On Your question about bug 2: your first guess was the right one, it landed in a recent commit.
Edit: I've taken this key in #419 together with a parity test that would have caught it (and would catch the next one), so you can skip the Separately, the same bug sits 20 lines below your fix. <SelectValue>
{t(`days${expiry}` as Parameters<typeof t>[0])}
</SelectValue>Last thing, the follow-up is bigger than "~5 other sites". A Both additions typecheck and lint clean with no new warnings, and the test suite is unchanged from |
Summary
Lands the Settings-overview-related i18n bug fixes from #375 (point 3): a namespace mismatch that rendered raw keypaths in English, a phantom rich-tag styling, and a Base UI
SelectValuelimitation. Skips bug 2 (Settings.sections.quick-replies) — the label is already present inen.json:1494; left for @opastorello to confirm on the issue.What changed
src/components/settings/settings-overview.tsx—useTranslations('roles')→useTranslations('Settings.roles'). Aligns withinvite-member-dialog.tsx:78andmembers-tab.tsx:129, which already use theSettings.rolesnamespace. The root-levelrolesblock inmessages/es-CO.jsonand the emptyroles: {}inmessages/ko.jsonwere workarounds added to mask this bug; the proper fix makes them unnecessary. This PR does not touch those locale files — they belong in the contributors' own locale PRs and are out of scope here.messages/en.json,messages/ko.json— stripclassNamefrom thescopesHint<code>rich tag. next-intl rich tags must be attribute-less, so thetext-[11px]Tailwind utility was a phantom; the code rendered at surrounding-text size anyway. The<code>element now renders at default size; the smaller styling can be restored globally via CSS (code { font-size: ... }) if desired.src/components/settings/members-tab.tsx,src/components/settings/invite-member-dialog.tsx— render the translated label explicitly as<SelectValue>children so the trigger shows the human-readable role name instead of the raw enum (admin/agent/viewer).5 files, 5 lines net change. Three commits, one per bug, for atomic review.
Test plan
npm run typecheckclean.npm run lint— 0 errors, no new warnings (39 pre-existing warnings on files this PR doesn't touch).npm run buildsucceeds (CI on PR open)./settings. The role chip in the identity card (top of the page) should show the role name (e.g. "Owner"), not the raw keypath.<SelectValue>trigger should show the role name and notadmin/agent/viewer.scopesHinttext should renderGET /api/v1/meas an inline<code>element, with no rendering errors in the browser console.Notes
<SelectValue>pattern affects ~5 other sites —template-manager.tsx(header format, button type),ai-config.tsx(provider, handoff target), plus a couple in flows / broadcasts. They're the same one-line fix and easy to follow up. Left out to keep this PR focused.npm run format:checkflags 333 files. The 5 files this PR touches were no more out of format than before. Left untouched to keep the diff focused; happy to do a project-wide Prettier pass in a separate PR if wanted.es-COtranslation;messages/es-CO.jsonhas a root-levelrolesblock (the workaround this fix replaces) and a few other locale additions. The branch was cut clean from upstreammain(b24aa79) and contains only the upstream-relevant changes.Related
Part of #375.