feat(ui): add OrganizationProfileApiKeysPanel mosaic component#9075
feat(ui): add OrganizationProfileApiKeysPanel mosaic component#9075alexcarpenter wants to merge 18 commits into
Conversation
…imental exports Rename the experimental Mosaic parts and their files so the source symbols match how they are exported from @clerk/ui/experimental/mosaic: - DeleteOrganization -> OrganizationProfileDeleteSection - LeaveOrganization -> OrganizationProfileLeaveSection - OrganizationProfileGeneral -> OrganizationProfileGeneralPanel - OrganizationProfile unchanged The rename cascades through each part's view, controller, and machine symbols and their co-located tests. The experimental entry no longer needs to alias on re-export. In @clerk/swingset, flatten the AIO/Panels/Sections sidebar groups into a single Organization group, and render each entry by its export name (components as <Name />, hooks as useName()), wrapping long names instead of overflowing. Public export names from @clerk/ui/experimental/mosaic are unchanged, so there is no user-facing impact.
Rebuilds the organization API keys experience (list, search, paginate, create + copy-secret, revoke-with-confirmation, permission gating) as a Mosaic machine/controller/view component, exposed via the experimental mosaic surface.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
76c5710 to
97961dc
Compare
Summary
Rebuilds the organization API keys experience as a Mosaic component following the established
machine → controller → viewsplit (mirrorsOrganizationProfileDeleteSection/ProfileSection). Functional parity with the legacypackages/ui/src/components/APIKeys/APIKeys.tsx(organization scope).Stacked on
feat/mosaic-org-profile-profile-section.Preview: https://swingset-git-feat-mosaic-org-profile-api-keys-panel.clerkstage.dev/organization/organization-profile-api-keys-panel
What's included
organization-profile-api-keys-panel-create.machine.ts— pure create + copy-secret flow (closed → editing → creating → showingSecret), guarded on name length,createAPIKeyinjected, reveals the secret once.organization-profile-api-keys-panel-revoke.machine.ts— pure revoke flow (idle → confirming → revoking), guarded on the "Revoke" confirmation word.organization-profile-api-keys-panel.controller.tsx— the only Clerk-touching layer:useOrganization/useSessiongating (loading/hidden/ready),org:sys_api_keys:read/:managepermissions,useAPIKeysfor list + search + pagination (local debounce + page-reset effect), wires both machines toclerk.apiKeys.create/revoke+revalidate, mapsAPIKeyResourceto a plain row model, and includes a puremapCreateApiKeyError(quota/conflict/generic).organization-profile-api-keys-panel.view.tsx— props-only, plain HTML rendering (search, create form with expiration select, table with per-row revoke, prev/next pagination, copy-secret dialog, revoke confirmation).organization-profile-api-keys-panel.tsx— thin wrapper gating onstatus === 'ready'.OrganizationProfile.ApiKeysPanelnamespace + flatOrganizationProfileApiKeysPanelexport inexperimental/mosaic.ts.Scope decisions
OrganizationAPIKeysPagerouting untouched (honors backwards-compat rules).Tests
TDD across all four layers — 47 tests (create machine 9, revoke machine 6, controller 14, view 18). Machine tests use
createActorwith no React/Clerk; controller test mocks@clerk/shared/react; view test renders with fake snapshots.Notes
open-heads-brush.md("Export experimental mosaic components").apiKeys.*keys can be wired in a later polish pass.