fix(i18n): render translated label inside role SelectValue

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 #375.

Part of #375
This commit is contained in:
Fabian Andres Parra Sanchez 2026-07-20 07:33:59 -05:00
parent 4f02b4cf58
commit 999a080a29
2 changed files with 2 additions and 2 deletions

View File

@ -274,7 +274,7 @@ export function InviteMemberDialog({
onValueChange={(v) => v && setRole(v as InviteRole)}
>
<SelectTrigger className="w-full bg-muted border-border text-foreground">
<SelectValue />
<SelectValue>{tRoles(role)}</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="admin">{tRoles('admin')}</SelectItem>

View File

@ -428,7 +428,7 @@ export function MembersTab() {
className="w-32 bg-muted border-border text-foreground"
disabled={isBusy}
>
<SelectValue />
<SelectValue>{tRoles(member.role)}</SelectValue>
</SelectTrigger>
<SelectContent>
{EDITABLE_ROLES.map((r) => (