Skip to content

Roles → Person picker: filter to user-kind principals only (CL-6664) - #566

Open
TheGreatAxios wants to merge 1 commit into
mainfrom
cl-6664-roles-assign-a-role-person-picker-49-duplicate-placeholder
Open

Roles → Person picker: filter to user-kind principals only (CL-6664)#566
TheGreatAxios wants to merge 1 commit into
mainfrom
cl-6664-roles-assign-a-role-person-picker-49-duplicate-placeholder

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Fixes CL-6664

The "Assign a role" person picker was pulling from the full principals list — people, agents, and workflows — surfacing 49+ duplicate placeholder-named service accounts (e.g. "Dana Reyes Gaj0a5c7 Localhost") indistinguishable from real members.

What changed:

  • roles-section.tsx: filter principals to kind === "user" only for both the picker and assignments table, replace optgroup with flat <select>
  • identity.ts: updated comment to reflect Roles' picker is user-only
  • test/roles-section.test.tsx: 4 rewritten tests covering user-only filter, flat list, agent exclusion from assignments table, and single-kind label artifact

Why component-level filter: The picker already receives the full principals list from the parent. A kind === "user" filter at the component boundary is the simplest, most localized fix — no backend changes, no new API params. The People section already validates that user-kind principals represent actual workbench members.

The "Assign a role" person picker showed all principals — people, agents,
and workflows — in one flat list. This surfaced 49+ duplicate placeholder-
named service accounts (e.g. "Dana Reyes Gaj0a5c7 Localhost") in the
picker, none scoped to the workbench's actual member roster.

Fix by filtering principals to kind === "user" in both the picker select
and the assignments table, matching the People section's member list.
Remove the now-unused optgroup structure and PRINCIPAL_KIND imports.

All 4 tests rewritten to verify user-only filtering.
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Review — Skywalker (orchestrator)

lens · implementation

Filters the Roles "Assign a role" picker to user-kind principals only, matching the People section roster. Removes now-unused optgroup structure and PRINCIPAL_KIND imports.

Key paths:

  • packages/settings-ui/src/roles-section.tsx:320principals.filter(p => p.kind === "user") feeds both picker and table
  • packages/settings-ui/src/identity.ts:9-13 — comment updated to reflect user-only scope
  • packages/settings-ui/test/roles-section.test.tsx — 4 rewritten tests, 11 assertions

Critic review: clean (all findings VERIFIED, zero defects, zero blockers).
Build gate: tests pass (bun test test/roles-section.test.tsx — 4/4). Typecheck: zero errors in changed files.

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.

1 participant