Skip to content

fix(admin): use Radio for single-select role assignment#1631

Merged
paanSinghCoder merged 3 commits into
mainfrom
fix/assign-role-radio
May 21, 2026
Merged

fix(admin): use Radio for single-select role assignment#1631
paanSinghCoder merged 3 commits into
mainfrom
fix/assign-role-radio

Conversation

@paanSinghCoder
Copy link
Copy Markdown
Contributor

@paanSinghCoder paanSinghCoder commented May 20, 2026

Summary

Replaced Checkbox with Radio.Group + Radio in the single-select Assign Role dialogs:

  • web/sdk/admin/components/AssignRole.tsx — org-level (org members tab, user details membership dropdown)
  • web/sdk/admin/views/organizations/details/projects/members/assign-role.tsx — project-level (project members dialog)

web/apps/admin/src/components/assign-role.tsx is genuinely multi-select and left as-is.

API payloads unchanged.

Test plan

  • Org members tab → row action "Assign role…"
  • User detail page → side panel → membership dropdown → "Assign role…"
  • Org Projects tab → click a project → member row "Assign role…"

🤖 Generated with Claude Code

The org-level and project-level Assign Role dialogs were rendering
Checkbox inputs for what is a single-select field (form schema and
backend both accept only one roleId). This swaps them to Radio.Group +
Radio, dropping the per-item dispatch helper that emulated radio
semantics. API payloads are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment May 21, 2026 3:22am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ee947143-e01d-4596-89e7-dca4681354ea

📥 Commits

Reviewing files that changed from the base of the PR and between 0a64547 and 920df84.

📒 Files selected for processing (2)
  • web/sdk/admin/components/AssignRole.tsx
  • web/sdk/admin/views/organizations/details/projects/members/assign-role.tsx
💤 Files with no reviewable changes (1)
  • web/sdk/admin/views/organizations/details/projects/members/assign-role.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Role assignment UI now enforces single-selection using radio buttons instead of checkboxes, preventing multiple roles from being selected simultaneously.
    • Selection changes are tracked so the Update action remains disabled until a change is made, preventing accidental submissions.

Walkthrough

Both the AssignRole component and assign-role view were refactored from checkbox-based multi-select role selection to single-select radio groups. Imports changed from Checkbox to Radio, checkbox handlers were removed, and role selection UI now uses Radio.Group bound to the form's roleId.

Changes

Role Selection UI Refactoring

Layer / File(s) Summary
AssignRole component — checkbox to radio conversion
web/sdk/admin/components/AssignRole.tsx
Imports Radio instead of Checkbox, removes the checkbox state-change helper, and replaces per-role checkbox items with a controlled Radio.Group of Radio inputs wired via value/onValueChange to update the form's roleId using setValue({ shouldDirty: true }).
assign-role view — checkbox to radio conversion
web/sdk/admin/views/organizations/details/projects/members/assign-role.tsx
Imports Radio instead of Checkbox and replaces the checkbox list with a Radio.Group containing per-role Radio inputs; the group controls roleId and updates the form via setValue on radio value changes, removing checkbox checked/onCheckedChange logic and the previous wrapper.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • rohanchkrabrty
  • rsbh
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coveralls
Copy link
Copy Markdown

coveralls commented May 20, 2026

Coverage Report for CI Build 26203474805

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 42.592%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 37953
Covered Lines: 16165
Line Coverage: 42.59%
Coverage Strength: 11.91 hits per line

💛 - Coveralls

@paanSinghCoder paanSinghCoder self-assigned this May 20, 2026
@paanSinghCoder paanSinghCoder enabled auto-merge (squash) May 21, 2026 03:22
@paanSinghCoder paanSinghCoder merged commit 1df544c into main May 21, 2026
8 checks passed
@paanSinghCoder paanSinghCoder deleted the fix/assign-role-radio branch May 21, 2026 03:27
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.

3 participants