From 4d901b66968f39526f98be6a8a60a172267b6b67 Mon Sep 17 00:00:00 2001 From: Levi Gomes Date: Mon, 13 Jul 2026 15:26:08 -0300 Subject: [PATCH 1/3] feat(user-picker): add excludePlatformAdmins option to UserSearchPicker Optional prop to drop platform admins from the search results, folded into the existing excludeIds filter. Generalize the empty-results message so it reads correctly whether matches were dropped for being already-added or for being admins. --- src/components/common/UserSearchPicker.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/common/UserSearchPicker.tsx b/src/components/common/UserSearchPicker.tsx index 5c4fa05..57d82cf 100644 --- a/src/components/common/UserSearchPicker.tsx +++ b/src/components/common/UserSearchPicker.tsx @@ -12,12 +12,14 @@ export function UserSearchPicker({ selectedUser, onSelect, excludeIds, + excludePlatformAdmins, label, placeholder, }: { selectedUser: UserListResponse | null onSelect: (user: UserListResponse | null) => void excludeIds?: string[] + excludePlatformAdmins?: boolean label?: string placeholder?: string }) { @@ -68,9 +70,11 @@ export function UserSearchPicker({ return () => document.removeEventListener("mousedown", handleClickOutside) }, []) - const filtered = excludeIds - ? results.filter((u) => !excludeIds.includes(u.id)) - : results + const filtered = results.filter( + (u) => + !(excludePlatformAdmins && u.is_platform_admin) && + !excludeIds?.includes(u.id), + ) return (
@@ -129,7 +133,9 @@ export function UserSearchPicker({
) : filtered.length === 0 ? (

- {results.length > 0 && excludeIds ? "All results already added" : "No users found"} + {results.length > 0 + ? "All matching users are already added or unavailable" + : "No users found"}

) : ( filtered.map((user) => ( From d932479a9417c500d73e3d297503eec538fee135 Mon Sep 17 00:00:00 2001 From: Levi Gomes Date: Mon, 13 Jul 2026 15:26:08 -0300 Subject: [PATCH 2/3] feat(project-access): exclude platform admins from the Grant User picker Platform admins already manage every project, so they can't be added as members. Enable excludePlatformAdmins on the Grant User picker, and surface the backend's 400 rejection with a clear toast as defense in depth. --- src/components/pages/ProjectAccessTab.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/pages/ProjectAccessTab.tsx b/src/components/pages/ProjectAccessTab.tsx index 3613d16..9bd9081 100644 --- a/src/components/pages/ProjectAccessTab.tsx +++ b/src/components/pages/ProjectAccessTab.tsx @@ -322,6 +322,8 @@ export function ProjectAccessTab({ projectId }: { projectId: string }) { ?.status if (status === 409) { toast.error("This user already has access to the project") + } else if (status === 400) { + toast.error("Platform admins can't be added to a project") } else { toast.error("Failed to grant user access") } @@ -420,6 +422,7 @@ export function ProjectAccessTab({ projectId }: { projectId: string }) { selectedUser={selectedUser} onSelect={setSelectedUser} excludeIds={userAccess.map((u) => u.user_id)} + excludePlatformAdmins label="User" placeholder="Search users by email or name..." /> From a0b22832b1981b73a398f621104ef2dcec9b6742 Mon Sep 17 00:00:00 2001 From: Levi Gomes Date: Wed, 15 Jul 2026 17:00:29 -0300 Subject: [PATCH 3/3] chore(ci): empty commit to re-trigger CI checks Co-Authored-By: Claude Opus 4.8 (1M context)