Skip to content

feat(ui): ResetConnectionDialog + ConfigureSSO confirmation restyle#8706

Draft
iagodahlem wants to merge 8 commits into
mainfrom
iago/orgs-1588-sdk-improve-confirmation-step-with-new-reset-connection
Draft

feat(ui): ResetConnectionDialog + ConfigureSSO confirmation restyle#8706
iagodahlem wants to merge 8 commits into
mainfrom
iago/orgs-1588-sdk-improve-confirmation-step-with-new-reset-connection

Conversation

@iagodahlem
Copy link
Copy Markdown
Member

Summary

  • Adds <ResetConnectionDialog /> — modal-based, type-to-confirm gated, scoped to the ConfigureSSO wizard chrome via contentRef portal. Wraps the destructive flow: useReverification(user.deleteEnterpriseConnection) → setProvider(undefined) → goToStep('select-provider').
  • Restyles the ConfigureSSO confirmation step: unified Step.Header with inline status badge, two-column details grid, outlined Configure again, destructive Reset connection button, sticky inactive footer banner.
  • Adds an optional badge prop to Step.Header so steps can render an inline status pill next to the title without crowding the right-aligned children slot.
  • Fixes OrganizationProfile so it forwards its ProfileCard contentRef down to ConfigureSSO — required for the dialog to portal into the wizard chrome (instead of the document body) when embedded under <OrganizationProfile />.
  • Adds unit tests for <ResetConnectionDialog /> covering type-to-confirm gating, cancel, and the successful submit chain.

Linear: ORGS-1588. Follow-up commits on this branch will add the wizard-wide reset entry for ORGS-1550 before this PR exits draft.

Test plan

  • Confirmation — inactive: title SSO Successfully configured + Inactive badge inline, two-column details (Enable SSO, Domain, Configuration details), outlined Configure again, destructive solid Reset connection, sticky info banner SSO is inactive and you need to enable it to authenticate at the bottom.
  • Confirmation — active: same layout, Active badge, no inactive banner.
  • Dialog open: clicking Reset opens the dialog scoped to the ConfigureSSO card (backdrop does not cover the rest of the page).
  • Gating: empty input → Reset button disabled; typing the wrong text → still disabled; typing the org name exactly → enables.
  • Cancel: clicking Cancel closes the dialog without side effects.
  • Successful reset: click Reset → reverification challenge → connection deleted → wizard rewinds to Select Provider step.
  • Embedded under <OrganizationProfile />: dialog still portals into the wizard chrome, not the page body.
  • Unit tests: pnpm vitest run packages/ui/src/components/ConfigureSSO/__tests__/ResetConnectionDialog.test.tsx green (8/8).

Standalone modal dialog with type-to-confirm gating. Wraps the destructive
delete flow (useReverification + deleteEnterpriseConnection + provider clear +
wizard rewind to select-provider). Controlled via isOpen/onClose props with
the confirmation value injected by the caller.

Widens ConfigureSSOContext.setProvider to accept undefined so the dialog can
clear the local provider selection after deleting the connection, and adds
the configureSSO.resetConnectionDialog localization keys (and matching type
entries in @clerk/shared) for the dialog copy.
Replaces the inline reset confirmation card (Action.Root / Action.Card pattern)
with the new ResetConnectionDialog modal. The destructive button now opens the
dialog instead of expanding an inline form; the dialog handles type-to-confirm,
reverification, deletion, and wizard rewind internally.
…tainer

Portals the dialog into the wizard's content container instead of the document
body and switches the backdrop to absolute positioning so it stays inside the
ConfigureSSO card. Disables the modal-context toggle so the auto-rendered
close button is suppressed — the Cancel button is the explicit dismiss for the
destructive flow.
Backdrop now uses a transparent fill plus backdrop-filter blur so the wizard
chrome shows through without an opaque tint. Card switches to a tighter border
radius, start-aligned text, and reduced padding to match the design spec for
the inline reset confirmation.
The OrganizationProfile self-serve SSO page was creating its own contentRef
that diverged from the ProfileCard content ref. ConfigureSSO needs the same
container ref to portal child modals (ResetConnectionDialog) into the wizard
chrome instead of the document body, so the SSO page now receives the shared
ref from the surrounding routes and forwards it down.
Unifies the SSO Successfully configured title with the status badge, lays out
configuration details in a two-column grid, swaps the configure-again and
reset connection actions to dedicated outlined and destructive buttons, and
adds a sticky inactive banner inside the step footer when the connection is
disabled.
Covers the type-to-confirm gating, cancel and reset interactions, and the
successful submit chain (delete + provider clear + wizard rewind + onClose).
Lets a step render an inline badge next to the title without crowding the
right-aligned children slot. The SSO confirmation step now passes its active
status badge through this prop instead of layering its own header component
inside the body.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 929090b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/ui Patch
@clerk/chrome-extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 29, 2026 4:23pm

Request Review

'@clerk/ui': patch
---

Restyle the ConfigureSSO confirmation step with a unified header, two-column details layout, dedicated Configure again and Reset connection buttons, and an inactive-state banner.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep all in the same changeset for a single patch on clerk/ui + use pnpm run changeset for the file naming convention

then separate those items with bullet points

};

describe('ResetConnectionDialog', () => {
it('returns null when isOpen is false', async () => {
Copy link
Copy Markdown
Member

@LauraBeatris LauraBeatris May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('returns null when isOpen is false', async () => {
it('does not render when `isOpen` is `false`', async () => {

});
});

it('does not delete when the active enterprise connection is missing', async () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a case for it? Once we select the provider, then the connection gets created

I thought of not displaying this button if the connection doesn't exist

Comment on lines 32 to +36
* Sets the local provider selection used by Select Provider before a
* connection has been created.
* connection has been created. Pass `undefined` to clear the selection
* (e.g. after deleting the connection from the reset dialog).
*/
setProvider: (provider: ProviderType) => void;
setProvider: (provider: ProviderType | undefined) => void;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll have to adjust this JSDocs based on the new flow

Once the user selects the provider, then the connection already gets created for that organization

Previously we were relying on verifying the email address, to then create the connection, so I think the comment is just stale

Comment on lines +19 to +24
/**
* The string the user must type to enable the destructive submit button.
* Today this is the organization name; long-term it may swap to the
* connection's domain — the dialog stays agnostic so callers own the
* canonical value.
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* The string the user must type to enable the destructive submit button.
* Today this is the organization name; long-term it may swap to the
* connection's domain — the dialog stays agnostic so callers own the
* canonical value.
*/

I believe it's fine if we remove this, especially if we want to change later the underlying value used for confirmation - the prop has enough semantics

const { enterpriseConnection, deleteEnterpriseConnection, setProvider } = useConfigureSSO();
const { goToStep } = useWizard();

const deleteConnection = useReverification((id: string) => deleteEnterpriseConnection(id));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need reverification here? I'm not sure if all FAPI mutations rely on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants