Repository navigation
fix(web): show role label instead of raw enum in Team settings selects - #147
Conversation
Base UI's Select.Value renders the raw value unless an items map is provided on Select.Root. Pass the existing ROLE_OPTIONS to both role selects (member role change and invite dialog) so the human label is shown after selection. Closes ansvisor#145 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.
In the meantime, two things that make review faster:
- A short description of why the change matters, not just what it does — most of our PRs link a
Fixes #...to the issue that explains the why. - A quick local test note if there's anything worth eyeballing in the browser.
If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.
gkhngyk
left a comment
There was a problem hiding this comment.
Lovely fix, @akagifreeez — thanks for picking this up. The items prop on <Select.Root> is genuinely the cleanest path here. Verified in node_modules/@base-ui/react/select/root/SelectRoot.d.ts:90 — the JSDoc explicitly says it makes <Select.Value> render the matched item's label instead of the raw value. Two-line diff, single source of truth on ROLE_OPTIONS, no new strings. Nice.
Approving — Vercel's preview-deploy gate fails for fork PRs (expected), but the format / lint / typecheck job will run once a maintainer clicks Approve and run on the Actions tab. Will merge once it's green.
What & why
In Settings -> Team, the role
<Select>displayed the raw enum value (e.g.agency_partner) instead of the human label (Agency Partner) after a selection — in both the existing-member role dropdown and the invite dialog.Base UI's
<Select.Value />renders the raw value unless theitemsmap is provided on<Select.Root>. This passes the existingROLE_OPTIONSarray asitemsto both selects, so the human-readable label is shown.Closes #145.
How to test
agency_partner.Notes
ROLE_OPTIONS(single source of truth), adds no new strings, and leavesSelectValueuntouched.prettier --check,eslint, andtsc --noEmitall pass.