Skip to content

fix(web): show role label instead of raw enum in Team settings selects - #147

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
akagifreeez:fix/team-role-select-label
Jun 2, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
akagifreeez:fix/team-role-select-label

Conversation

@akagifreeez

Copy link
Copy Markdown
Contributor

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 the items map is provided on <Select.Root>. This passes the existing ROLE_OPTIONS array as items to both selects, so the human-readable label is shown.

Closes #145.

How to test

  1. Go to Settings -> Team.
  2. Change an existing member's role via the dropdown — the control now shows e.g. Agency Partner instead of agency_partner.
  3. Open the Invite dialog and pick a role — same: the label is shown.

Notes

  • Minimal change: reuses the existing ROLE_OPTIONS (single source of truth), adds no new strings, and leaves SelectValue untouched.
  • Verified locally: prettier --check, eslint, and tsc --noEmit all pass.

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]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gkhngyk
gkhngyk merged commit dceea75 into ansvisor:main Jun 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings → Team role select shows slug (agency_partner) instead of label (Agency Partner)

2 participants