Repository navigation
Changed settings confirmations to a context provider - #29818
Conversation
…provider - ConfirmationModal and LimitModal were shown through NiceModal from 54 call sites; a settings-local ConfirmationProvider now hosts them behind confirm()/showLimit(), keeping the existing prop contracts, testids, and the onOk handle so call sites converted mechanically - one request per kind matches NiceModal's per-component keying: a second show replaces the first instead of stacking, which StrictMode double-effects depend on - prompt content that closed its surrounding confirmation through useModal (newsletter verification links, the theme upload picker) now closes through a handle closure passed from the confirm() caller - the provider wraps the NiceModal provider so the modals still shown imperatively (custom fields, welcome email, theme and editor dialogs) can confirm from inside their own flows
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (36)
WalkthroughThe settings app now provides Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 6m 6s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 9s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin |
✅ Succeeded | 2m 39s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 22s | View ↗ |
nx run-many -t lint -p @tryghost/admin,ghost-mo... |
✅ Succeeded | 1m 19s | 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-08-06 23:21:37 UTC

First slice of the settings NiceModal burn-down (follows the router swap #29780 and un-portal #29789).
ConfirmationModalandLimitModalwere NiceModal-shown from 54 call sites across 27 files — the bulk of settings' remaining NiceModal usage. They now go through a settings-localConfirmationProvider:What changed
ConfirmationProvider(app/components/providers/confirmation-provider.tsx):useConfirmation()→confirm(props)/showLimit(props), each returning a{remove()}handle. The request types are the existingConfirmationModalProps/LimitModalProps, testids stayconfirmation-modal/limit-modal, andonOkstill receives the close handle — so all 54 sites converted as a pureNiceModal.show(X, props)→confirm(props)substitution with prop objects verbatim.ConfirmationModalContent/LimitModalContenttakevisible/onRemovehost props instead ofuseModal(); their NiceModal.create default exports are gone. The two direct renderers (theme-installed / invalid-theme dialogs) pass their own handles.useModal().remove()-from-inside-the-prompt trick): newsletter verification links and the theme upload picker now close via a handle closure passed from theconfirm()caller — same UX, no NiceModal context needed. (This preserves behavior the earlier spike had documented as a lost capability.)Verification
tsc -b, full lint, boundaries cleanRemaining NiceModal in settings after this: 12 imperative dialog components (webhook, code, yaml, universal-import, feature-toggle, theme cluster, welcome-email pair, email-design, custom-field) — they convert to controlled Shade dialogs in follow-up slices, then the provider mount and the dependency go.