Skip to content

Moved settings confirmation dialogs to Shade - #29561

Merged
9larsons merged 2 commits into
mainfrom
codex/admin-settings-shade-confirmation
Jul 23, 2026
Merged

9larsons merged 2 commits into
mainfrom
codex/admin-settings-shade-confirmation

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

What changed

  • replaced the legacy admin-x-design-system ConfirmationModal with a settings-local Shade AlertDialog compatibility layer
  • migrated all settings confirmation flows and removed the old component, export, and story
  • preserved async labels, caller-owned close behavior, custom and sticky footers, nested-modal Escape handling, and destructive variants
  • fixed dark-mode Sonner close-button contrast and spacing regressions found during manual validation

Why

ConfirmationModal was one of the remaining settings dependencies on admin-x-design-system. A local compatibility layer lets settings move to Shade without rewriting the existing NiceModal workflow contracts in every caller.

Validation

  • pnpm --filter @tryghost/admin-x-settings lint
  • pnpm --filter @tryghost/admin-x-settings test:unit (216 tests)
  • pnpm --filter @tryghost/shade lint
  • pnpm --filter @tryghost/shade test:unit (233 tests)
  • pnpm --filter @tryghost/shade build
  • pnpm --filter @tryghost/admin-x-design-system lint
  • pnpm --filter @tryghost/admin-x-design-system build
  • pnpm --filter @tryghost/admin test:acceptance -- src/settings (371/372 passed; unrelated Comments thread-sidebar close test timed out)
  • manual dark-mode validation of nested confirmations, toast close button, and staff/social spacing

no ref

The legacy dialog blocked removing the old settings design system, so the settings app now owns the compatibility layer while preserving existing caller behavior.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 80a8bef2-cd15-48b1-a84c-1a6f43168090

📥 Commits

Reviewing files that changed from the base of the PR and between e7fbaee and 93de4db.

📒 Files selected for processing (25)
  • apps/admin-x-settings/src/components/settings/advanced/danger-zone.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/custom-integration-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/transistor-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/webhooks-table.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/zapier-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/labs/migration-options.tsx
  • apps/admin-x-settings/src/components/settings/advanced/migration-tools/universal-import-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/emails.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletters-tab-content.tsx
  • apps/admin-x-settings/src/components/settings/general/user-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/general/users/staff-token.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/edit-offer-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/recommendations/edit-recommendation-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/custom-fields/custom-field-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/member-emails.tsx
  • apps/admin-x-settings/src/components/settings/membership/portal/portal-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/stripe/stripe-connect-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/tiers/tier-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/advanced-theme-settings.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/invalid-theme-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/theme-installed-modal.tsx
🚧 Files skipped from review as they are similar to previous changes (24)
  • apps/admin-x-settings/src/components/settings/advanced/labs/migration-options.tsx
  • apps/admin-x-settings/src/components/settings/growth/recommendations/edit-recommendation-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/webhooks-table.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations.tsx
  • apps/admin-x-settings/src/components/settings/site/theme-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/invalid-theme-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/portal/portal-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/theme-installed-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/zapier-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/tiers/tier-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/migration-tools/universal-import-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletters-tab-content.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/custom-integration-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/custom-fields/custom-field-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/danger-zone.tsx
  • apps/admin-x-settings/src/components/settings/general/users/staff-token.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/edit-offer-modal.tsx
  • apps/admin-x-settings/src/components/settings/general/user-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/emails.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/advanced-theme-settings.tsx
  • apps/admin-x-settings/src/components/settings/membership/member-emails.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/transistor-modal.tsx

Walkthrough

The pull request moves ConfirmationModal into admin-x-settings, rewires its consumers, and adds tests for confirmation, loading, and cancellation behavior. It also adjusts tab spacing, updates Shade’s SettingGroup and Sonner components, adds Sonner stories, and refreshes adoption metadata.

Possibly related PRs

Suggested reviewers: weylandswart

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: moving settings confirmation dialogs to Shade.
Description check ✅ Passed The description matches the changeset and accurately summarizes the migration, validation, and related Sonner fixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/admin-settings-shade-confirmation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 93de4db

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 9s View ↗
nx run-many -t test:unit -p @tryghost/admin-x-d... ✅ Succeeded 2m 10s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 17s View ↗
nx run-many -t lint -p @tryghost/admin-x-design... ✅ Succeeded 57s View ↗
nx run @tryghost/admin:build ✅ Succeeded 12s View ↗
nx run ghost-admin:test ✅ Succeeded 1s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 42s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-23 17:30:28 UTC

@9larsons
9larsons marked this pull request as ready for review July 23, 2026 16:43
@9larsons
9larsons enabled auto-merge (squash) July 23, 2026 16:44
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.84%. Comparing base (0f60af6) to head (e7fbaee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29561      +/-   ##
==========================================
+ Coverage   74.82%   74.84%   +0.01%     
==========================================
  Files        1611     1611              
  Lines      141723   141742      +19     
  Branches    17331    17339       +8     
==========================================
+ Hits       106050   106086      +36     
+ Misses      34630    34612      -18     
- Partials     1043     1044       +1     
Flag Coverage Δ
admin-tests 55.62% <ø> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/shade/src/components/ui/sonner.stories.tsx`:
- Around line 50-76: Update the toast options in the Success and Info story
render functions so their descriptions match their semantics instead of using
“Error description”; use success-appropriate wording for Success and
informational wording for Info, while leaving the toast types and other options
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 80e623b9-6e0a-456a-a45b-5d5021716768

📥 Commits

Reviewing files that changed from the base of the PR and between 0f60af6 and e7fbaee.

📒 Files selected for processing (34)
  • apps/admin-x-design-system/src/global/modal/confirmation-modal.stories.tsx
  • apps/admin-x-design-system/src/global/modal/confirmation-modal.tsx
  • apps/admin-x-design-system/src/index.ts
  • apps/admin-x-settings/src/components/confirmation-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/danger-zone.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/custom-integration-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/transistor-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/webhooks-table.tsx
  • apps/admin-x-settings/src/components/settings/advanced/integrations/zapier-modal.tsx
  • apps/admin-x-settings/src/components/settings/advanced/labs/migration-options.tsx
  • apps/admin-x-settings/src/components/settings/advanced/migration-tools/universal-import-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/emails.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletters-tab-content.tsx
  • apps/admin-x-settings/src/components/settings/general/user-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/general/users/staff-token.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/edit-offer-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/recommendations/edit-recommendation-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/custom-fields/custom-field-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/member-emails.tsx
  • apps/admin-x-settings/src/components/settings/membership/portal/portal-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/stripe/stripe-connect-modal.tsx
  • apps/admin-x-settings/src/components/settings/membership/tiers/tier-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/advanced-theme-settings.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/invalid-theme-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/theme-installed-modal.tsx
  • apps/admin-x-settings/test/unit/components/confirmation-modal.test.tsx
  • apps/shade/src/components/patterns/setting-group.tsx
  • apps/shade/src/components/ui/sonner.stories.tsx
  • apps/shade/src/components/ui/sonner.tsx
  • apps/shade/src/docs/adoption-data.json
💤 Files with no reviewable changes (3)
  • apps/admin-x-design-system/src/global/modal/confirmation-modal.stories.tsx
  • apps/admin-x-design-system/src/global/modal/confirmation-modal.tsx
  • apps/admin-x-design-system/src/index.ts

Comment on lines 50 to +76
export const Success: Story = {
args: {},
render: () => (
<Button onClick={() => toast.success('Hello world!', {description: 'Error description', duration: Infinity})}>Toast!</Button>
)
),
parameters: {
docs: {
description: {
story: 'Use a success toast to confirm that an action completed.'
}
}
}
};

export const Info: Story = {
args: {},
render: () => (
<Button onClick={() => toast.info('Hello world!', {description: 'Error description', duration: Infinity})}>Toast!</Button>
)
),
parameters: {
docs: {
description: {
story: 'Use an informational toast for contextual feedback without success or error semantics.'
}
}
}
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the success and info toast descriptions.

Line 53 and Line 67 both display “Error description”, which makes these examples contradict their toast semantics.

Proposed fix
- <Button onClick={() => toast.success('Hello world!', {description: 'Error description', duration: Infinity})}>Toast!</Button>
+ <Button onClick={() => toast.success('Hello world!', {description: 'Success description', duration: Infinity})}>Toast!</Button>

- <Button onClick={() => toast.info('Hello world!', {description: 'Error description', duration: Infinity})}>Toast!</Button>
+ <Button onClick={() => toast.info('Hello world!', {description: 'Info description', duration: Infinity})}>Toast!</Button>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const Success: Story = {
args: {},
render: () => (
<Button onClick={() => toast.success('Hello world!', {description: 'Error description', duration: Infinity})}>Toast!</Button>
)
),
parameters: {
docs: {
description: {
story: 'Use a success toast to confirm that an action completed.'
}
}
}
};
export const Info: Story = {
args: {},
render: () => (
<Button onClick={() => toast.info('Hello world!', {description: 'Error description', duration: Infinity})}>Toast!</Button>
)
),
parameters: {
docs: {
description: {
story: 'Use an informational toast for contextual feedback without success or error semantics.'
}
}
}
};
export const Success: Story = {
args: {},
render: () => (
<Button onClick={() => toast.success('Hello world!', {description: 'Success description', duration: Infinity})}>Toast!</Button>
),
parameters: {
docs: {
description: {
story: 'Use a success toast to confirm that an action completed.'
}
}
}
};
export const Info: Story = {
args: {},
render: () => (
<Button onClick={() => toast.info('Hello world!', {description: 'Info description', duration: Infinity})}>Toast!</Button>
),
parameters: {
docs: {
description: {
story: 'Use an informational toast for contextual feedback without success or error semantics.'
}
}
}
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/shade/src/components/ui/sonner.stories.tsx` around lines 50 - 76, Update
the toast options in the Success and Info story render functions so their
descriptions match their semantics instead of using “Error description”; use
success-appropriate wording for Success and informational wording for Info,
while leaving the toast types and other options unchanged.

no ref

Admin compiles Settings through its own source alias, so the Settings-local component must use unambiguous relative imports.
@9larsons
9larsons merged commit 2109e39 into main Jul 23, 2026
45 checks passed
@9larsons
9larsons deleted the codex/admin-settings-shade-confirmation branch July 23, 2026 17:34
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