feat(site): add Default Roles section to organization roles page - #26028
Merged
Conversation
This was referenced Jun 3, 2026
Member
Author
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
2 times, most recently
from
June 3, 2026 19:17
c4a5fcc to
976957f
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 3, 2026 20:48
c91e381 to
d1ee7c9
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 3, 2026 20:48
976957f to
8ea2020
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 3, 2026 21:09
d1ee7c9 to
7813b1a
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
2 times, most recently
from
June 3, 2026 21:23
5c9c069 to
620c357
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
2 times, most recently
from
June 3, 2026 21:43
210be86 to
34ec9ef
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
2 times, most recently
from
June 3, 2026 21:56
eb10210 to
538597d
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
2 times, most recently
from
June 3, 2026 22:14
8e1cf4c to
d46be0c
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 3, 2026 22:14
538597d to
986699a
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 3, 2026 22:20
d46be0c to
0e1c45b
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 3, 2026 22:20
986699a to
8a07ffd
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 3, 2026 22:29
0e1c45b to
b78d140
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 3, 2026 22:29
8a07ffd to
9884564
Compare
Emyrk
marked this pull request as ready for review
June 3, 2026 23:03
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 5, 2026 14:19
b78d140 to
900ff1c
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 14:19
9884564 to
3d4e175
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 5, 2026 15:32
900ff1c to
9154d41
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 15:32
3d4e175 to
bf9be56
Compare
Emyrk
requested review from
DanielleMaywood
and removed request for
DanielleMaywood
June 5, 2026 16:53
Comment on lines
+105
to
+118
| onUpdateDefaultRoles={async (roles) => { | ||
| try { | ||
| await updateOrganizationMutation.mutateAsync({ | ||
| organizationId: organization.id, | ||
| req: { default_org_member_roles: roles }, | ||
| }); | ||
| toast.success("Default roles updated."); | ||
| } catch (error) { | ||
| toast.error( | ||
| getErrorMessage(error, "Failed to update default roles."), | ||
| { description: getErrorDetail(error) }, | ||
| ); | ||
| } | ||
| }} |
Contributor
There was a problem hiding this comment.
Just a small nit and unsure of other frontend peep's opinions on this, but I think I'd prefer to have this try/catch logic moved out of the markup (or removed entirely).
I think we should either:
- Update the existing
useMutationto defineonSuccessandonErrorhandlers (although making sure to not overwrite the originalonSuccessandonErrordefinitions). - Make use of
mutate'sonSuccessandonErrorcall arguments to achieve this.
Member
Author
There was a problem hiding this comment.
I can see it was just copying the pattern below for DeleteDialog.
I am going to leave this pattern right here so this CustomRolesPage is consistent with itself. Any fix should do both
DanielleMaywood
approved these changes
Jun 5, 2026
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 5, 2026 18:59
9154d41 to
fb90875
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 18:59
9fa32a5 to
a67d838
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 5, 2026 19:20
fb90875 to
d265c34
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 19:20
a67d838 to
238f18b
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
from
June 5, 2026 19:34
d265c34 to
4c0ab67
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 19:34
238f18b to
8a535b1
Compare
Emyrk
force-pushed
the
gateway-accounts/floor-shrink-org-member
branch
2 times, most recently
from
June 5, 2026 20:02
bb1bdc0 to
5c49c19
Compare
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 20:02
8a535b1 to
56220d5
Compare
Emyrk
changed the base branch from
gateway-accounts/floor-shrink-org-member
to
graphite-base/26028
June 5, 2026 20:31
Adds a new Default Roles section to the org settings page (gated on the minimum-implicit-member experiment) that edits an org's default_org_member_roles via the existing PATCH endpoint. Uses the existing RoleSelector primitive via a new DefaultRolesDialog sibling. RoleSelectorDialog itself is too user-centric (avatar header, username/email props) to reuse here. Refs #25936.
Relocate the Default Roles section, its dialog, and the roles query to the organization Roles page. The selector sits above Custom Roles, shares the page-level roles query, and stays gated on the experiment plus the editSettings permission.
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 20:31
56220d5 to
206014f
Compare
Emyrk
force-pushed
the
graphite-base/26028
branch
from
June 5, 2026 20:31
5c49c19 to
f17f839
Compare
The comments either named an experiment that will go stale when `minimum-implicit-member` is promoted, or described implementation rather than behavior. Prop names already convey intent.
Emyrk
force-pushed
the
gateway-accounts/default-roles-ui
branch
from
June 5, 2026 20:32
206014f to
3a0ec37
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refs #25936. Stacks on #26027.
Adds a
Default Rolessection to the org Roles page that edits an org'sdefault_org_member_rolesvia the existing PATCH endpoint.organizationRolesquery used by the rest of the page.minimum-implicit-memberexperiment viauseDashboard().experimentsand on the orgeditSettingspermission.RoleSelectorprimitive inside a newDefaultRolesDialog.getErrorDetailon failure.Setting is in
RolessectionWithout license
Video before setting was moved
Example of a regular member making a workspace. Then the org default roles being changed to remove the "workspace-access". The member can no longer view or create a workspace.
Screencast.From.2026-06-03.18-02-06.webm
Implementation notes
RoleSelectorDialogis the existing per-user role editor; it's user-centric (avatar header,username/emailprops). Wrapping it for the org-default case would have meant feeding it a synthetic "user", so this PR adds a small siblingDefaultRolesDialogand reuses the innerRoleSelectorprimitive directly. Same look, same behavior in the picker.updateOrganization->default_org_member_roles). The Roles page now owns theupdateOrganizationmutation used by the section.organizationRoles(orgName)is already fetched by the Roles page; the Default Roles section reuses that query rather than firing a parallel one.DefaultRolesSummaryresolves role names to display names via the fetchedAssignableRoles[], falling back to the raw name when the role is not in the list.Coder Agents on behalf of @Emyrk.