Repository navigation
🎨 Updated settings chooser controls - #29503
Conversation
no ref The legacy chooser layer duplicated behavior already provided by Shade and let accessibility and modal behavior diverge. Composing existing controls keeps settings on one UI system without introducing another settings-specific wrapper.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (27)
🚧 Files skipped from review as they are similar to previous changes (19)
WalkthroughThe PR removes legacy Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 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 |
no ref Fresh review exposed stale async results, incorrect font previews, and lost grouping and toolbar behavior. These fixes preserve legacy behavior while keeping settings composed from existing Shade controls.
no ref Final review exposed stuck loading states, stale cancel state, and indicator overlap risks. These fixes keep migrated controls resilient while preserving the planned preview API.
no ref Deep review exposed a transient hydration path that could discard saved recipient filters and repeated trigger chrome that violated the slice shared-composition rule.
ref #29503 Regenerated the pnpm lockfile from the merged workspace manifests so the chooser migration can merge cleanly without stale dependency entries.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 3m 5s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin-x-d... |
✅ Succeeded | 7m 33s | View ↗ |
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 6m 58s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 2m 59s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 3m 15s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 19s | View ↗ |
nx run-many -t lint -p @tryghost/admin-x-design... |
✅ Succeeded | 3m 21s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 3m 11s | View ↗ |
Additional runs (8) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-21 21:37:12 UTC
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (5)
apps/admin-x-settings/src/components/settings/advanced/history-modal.tsx (1)
91-103: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueClear the pending search timer for immediate requests too.
In
requestOptions,clearTimeout(searchTimer.current)runs only inside thedeferredbranch. When an immediate request (e.g. popover open at line 149) fires while a debounced search is still pending, the stale timer still triggers a discardedloadDatacall. The sibling implementations (default-recipients.tsxandembed-signup-sidebar.tsx) clear the timer unconditionally; aligning here avoids the wasted request and keeps the three loaders consistent.♻️ Suggested change
const requestOptions = useCallback((input: string, deferred = false) => { requestSequence.current += 1; const request = requestSequence.current; setStaffLoading(true); + if (searchTimer.current) { + clearTimeout(searchTimer.current); + } if (deferred) { - if (searchTimer.current) { - clearTimeout(searchTimer.current); - } searchTimer.current = setTimeout(() => void loadOptions(input, request), 500); } else { void loadOptions(input, request); } }, [loadOptions]);🤖 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/admin-x-settings/src/components/settings/advanced/history-modal.tsx` around lines 91 - 103, Update requestOptions to clear any existing searchTimer unconditionally before branching on deferred, matching the behavior in the sibling loaders. Preserve the deferred timer scheduling and immediate loadOptions execution after the timer is cleared.apps/admin-x-settings/src/components/settings/general/users/role-selector.tsx (1)
62-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant/competing anchor styling inside
FieldDescription.
FieldDescriptionalready styles direct-child<a>tags ([&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary), but the<a>here re-declares its own text/hover color classes, which duplicates and can conflict with the ancestor's built-in link styling.♻️ Suggested simplification
- This user is the owner of the site. <a className='font-medium text-muted-foreground transition-colors hover:text-foreground' href='https://ghost.org/help/transfer-publication-ownership/' rel='noopener noreferrer' target='_blank'>Transfer ownership</a> first to change their role. + This user is the owner of the site. <a href='https://ghost.org/help/transfer-publication-ownership/' rel='noopener noreferrer' target='_blank'>Transfer ownership</a> first to change their role.🤖 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/admin-x-settings/src/components/settings/general/users/role-selector.tsx` around lines 62 - 64, Remove the redundant text and hover color utility classes from the anchor inside the FieldDescription for the ownership-transfer link, allowing FieldDescription’s built-in direct-child link styling to control its appearance while preserving the remaining link classes and behavior.apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHardcoded
z-[9999]onSelectContentis repeated across every modal-hosted Select. This migration introduces the same manualclassName='z-[9999]'override onSelectContentat 11 sites across 8 files, all working around the same root cause: Shade'sSelectContentdefault z-index isn't high enough to escape aModal's stacking context. Centralizing this (e.g. a higher default z-index inSelectContent, or a modal-aware variant/prop in Shade) would remove the duplication and prevent a future select from being silently hidden behind a modal when someone forgets to add the override.
apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx#L451-483: remove the threez-[9999]class overrides on the heading-font, heading-weight, and body-fontSelectContents once the shared default/variant is in place.apps/admin-x-settings/src/components/settings/advanced/integrations/webhook-modal.tsx#L95-95: remove thez-[9999]override on the EventSelectContent.apps/admin-x-settings/src/components/settings/general/users/role-selector.tsx#L58-58: remove thez-[9999]override on the owner-roleSelectContent.apps/admin-x-settings/src/components/settings/general/users/role-selector.tsx#L85-85: remove thez-[9999]override on the editable-roleSelectContent.apps/admin-x-settings/src/components/settings/growth/explore/testimonials-modal.tsx#L210-210: remove thez-[9999]override on the previous-platformSelectContent.apps/admin-x-settings/src/components/settings/growth/offers/add-offer-modal.tsx#L226-226: remove thez-[9999]override on the tier-cadenceSelectContent.apps/admin-x-settings/src/components/settings/growth/offers/add-offer-modal.tsx#L257-257: remove thez-[9999]override on the amount-typeSelectContent.apps/admin-x-settings/src/components/settings/growth/offers/add-offer-modal.tsx#L272-272: remove thez-[9999]override on the durationSelectContent.apps/admin-x-settings/src/components/settings/growth/offers/edit-retention-offer-modal.tsx#L320-320: remove thez-[9999]override on the durationSelectContent.apps/admin-x-settings/src/components/settings/membership/custom-fields/custom-field-modal.tsx#L226-226: remove thez-[9999]override on the typeSelectContent.apps/admin-x-settings/src/components/settings/membership/portal/look-and-feel.tsx#L86-86: remove thez-[9999]override on the button-styleSelectContent.🤖 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/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx` at line 1, Centralize the modal stacking behavior in Shade’s SelectContent by increasing its shared default z-index or adding a modal-aware variant/prop, ensuring SelectContent renders above Modal stacking contexts. Then remove the repeated z-[9999] class overrides from the affected SelectContent usages, including those in NewsletterDetailModal and the other modal settings components, while preserving existing Select behavior.apps/admin-x-settings/src/components/settings/site/design-and-branding/global-settings.tsx (1)
17-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
FontOption(andFontSelectOption) appear duplicated innewsletter-detail-modal.tsx.Graph context shows
apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsxdefines an identicalFontOptioncomponent (same props shape, same JSX/className/data-testid logic) for its own font Select. Consider extractingFontSelectOption/FontOptioninto a shared local module (e.g. afont-option.tsxhelper under settings) so both files import the same implementation instead of maintaining two copies that can drift.Also applies to: 48-56
🤖 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/admin-x-settings/src/components/settings/site/design-and-branding/global-settings.tsx` around lines 17 - 31, Extract the duplicated FontSelectOption/FontOption implementation from global-settings.tsx and newsletter-detail-modal.tsx into a shared local font-option module. Export and import the shared types and component in both consumers, preserving their existing props, JSX, className, and data-testid behavior so the implementations cannot drift.apps/shade/src/components/ui/combobox.tsx (1)
46-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider defaulting
ComboboxContentto a high z-index.Every consumer of this new component in this PR (
time-zone.tsx,access.tsx,tier-detail-modal.tsx, etc.) manually appendsclassName='z-[9999]'to override the popover's stacking context, presumably because these controls are frequently rendered insideModals. Since the override is identical everywhere, it'd be more maintainable to bake a suitable z-index intoComboboxContent's base classes (consumers can still override viaclassNamewhen needed) rather than repeating the magic value across every settings file.♻️ Proposed fix
const ComboboxContent = React.forwardRef< React.ElementRef<typeof PopoverContent>, React.ComponentPropsWithoutRef<typeof PopoverContent> >(({align = 'start', className, ...props}, ref) => ( <PopoverContent ref={ref} align={align} - className={cn('w-(--radix-popover-trigger-width) p-0', className)} + className={cn('z-[9999] w-(--radix-popover-trigger-width) p-0', className)} {...props} /> ));🤖 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/combobox.tsx` around lines 46 - 57, Update ComboboxContent’s base className to include the shared high z-index required for popovers rendered inside modals, using the same value currently repeated by its consumers. Keep the existing className merge so individual consumers can still override the default, and remove the redundant z-index classes from the affected ComboboxContent usages.
🤖 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/admin-x-settings/src/components/settings/advanced/history-modal.tsx`:
- Line 115: Initialize the searchedStaff state in HistoryFilter from the
incoming userId by locating the matching staff option, while preserving
null/empty state when no matching option exists. Ensure the staff combobox
displays the selected user and exposes its clear action for history/view/{id}
filters.
In `@apps/admin-x-settings/src/components/settings/email/default-recipients.tsx`:
- Around line 90-94: Update the selectedSegments merge effect to preserve
metadata.group when combining selected and existing segment options. Avoid
flattening grouped options through flattenSegmentOptions, or reconstruct each
option with its original group metadata, so MultiSelectCombobox continues
rendering section headers after selections change.
In `@apps/admin/src/settings/general/publication-language.acceptance.test.tsx`:
- Around line 82-95: Update the test case “clears validation when cancelling
changes to a stored custom locale” to explicitly assert that the “Invalid locale
format” validation message is no longer visible after clicking Cancel, while
preserving the existing assertions for the restored locale value and helper
text.
In `@apps/shade/src/components/ui/multi-select-combobox.tsx`:
- Around line 363-371: Update the CommandGroup key in the unselectedGroups
rendering to distinguish ungrouped groups from a real group whose key is
"options". Preserve stable uniqueness for grouped sections by using a dedicated
fallback key for groups where group.key is absent.
---
Nitpick comments:
In `@apps/admin-x-settings/src/components/settings/advanced/history-modal.tsx`:
- Around line 91-103: Update requestOptions to clear any existing searchTimer
unconditionally before branching on deferred, matching the behavior in the
sibling loaders. Preserve the deferred timer scheduling and immediate
loadOptions execution after the timer is cleared.
In
`@apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx`:
- Line 1: Centralize the modal stacking behavior in Shade’s SelectContent by
increasing its shared default z-index or adding a modal-aware variant/prop,
ensuring SelectContent renders above Modal stacking contexts. Then remove the
repeated z-[9999] class overrides from the affected SelectContent usages,
including those in NewsletterDetailModal and the other modal settings
components, while preserving existing Select behavior.
In
`@apps/admin-x-settings/src/components/settings/general/users/role-selector.tsx`:
- Around line 62-64: Remove the redundant text and hover color utility classes
from the anchor inside the FieldDescription for the ownership-transfer link,
allowing FieldDescription’s built-in direct-child link styling to control its
appearance while preserving the remaining link classes and behavior.
In
`@apps/admin-x-settings/src/components/settings/site/design-and-branding/global-settings.tsx`:
- Around line 17-31: Extract the duplicated FontSelectOption/FontOption
implementation from global-settings.tsx and newsletter-detail-modal.tsx into a
shared local font-option module. Export and import the shared types and
component in both consumers, preserving their existing props, JSX, className,
and data-testid behavior so the implementations cannot drift.
In `@apps/shade/src/components/ui/combobox.tsx`:
- Around line 46-57: Update ComboboxContent’s base className to include the
shared high z-index required for popovers rendered inside modals, using the same
value currently repeated by its consumers. Keep the existing className merge so
individual consumers can still override the default, and remove the redundant
z-index classes from the affected ComboboxContent usages.
🪄 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
Run ID: 38e7d7d2-2edf-417b-bebb-7b17c0b0bb1c
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (51)
apps/admin-x-design-system/package.jsonapps/admin-x-design-system/src/global/chrome/desktop-chrome-header.stories.tsxapps/admin-x-design-system/src/global/form/multi-select.stories.tsxapps/admin-x-design-system/src/global/form/multi-select.tsxapps/admin-x-design-system/src/global/form/select-with-other.stories.tsxapps/admin-x-design-system/src/global/form/select-with-other.tsxapps/admin-x-design-system/src/global/form/select.stories.tsxapps/admin-x-design-system/src/global/form/select.tsxapps/admin-x-design-system/src/global/form/text-field.stories.tsxapps/admin-x-design-system/src/global/modal/preview-modal.tsxapps/admin-x-design-system/src/index.tsapps/admin-x-settings/package.jsonapps/admin-x-settings/src/components/settings/advanced/history-modal.tsxapps/admin-x-settings/src/components/settings/advanced/integrations/webhook-event-options.tsxapps/admin-x-settings/src/components/settings/advanced/integrations/webhook-modal.tsxapps/admin-x-settings/src/components/settings/email/default-recipients.tsxapps/admin-x-settings/src/components/settings/email/mailgun.tsxapps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsxapps/admin-x-settings/src/components/settings/email/use-default-recipients-options.tsxapps/admin-x-settings/src/components/settings/general/publication-language.tsxapps/admin-x-settings/src/components/settings/general/time-zone.tsxapps/admin-x-settings/src/components/settings/general/users/role-selector.tsxapps/admin-x-settings/src/components/settings/growth/embed-signup/embed-signup-form-modal.tsxapps/admin-x-settings/src/components/settings/growth/embed-signup/embed-signup-sidebar.tsxapps/admin-x-settings/src/components/settings/growth/explore/testimonials-modal.tsxapps/admin-x-settings/src/components/settings/growth/offers/add-offer-modal.tsxapps/admin-x-settings/src/components/settings/growth/offers/edit-retention-offer-modal.tsxapps/admin-x-settings/src/components/settings/growth/tips-and-donations.tsxapps/admin-x-settings/src/components/settings/membership/access.tsxapps/admin-x-settings/src/components/settings/membership/custom-fields/custom-field-modal.tsxapps/admin-x-settings/src/components/settings/membership/portal/look-and-feel.tsxapps/admin-x-settings/src/components/settings/membership/portal/portal-links.tsxapps/admin-x-settings/src/components/settings/membership/portal/signup-options.tsxapps/admin-x-settings/src/components/settings/membership/tiers/tier-detail-modal.tsxapps/admin-x-settings/src/components/settings/site/design-and-branding/global-settings.tsxapps/admin-x-settings/src/components/settings/site/design-and-branding/theme-setting.tsxapps/admin-x-settings/src/components/settings/site/theme/theme-preview.tsxapps/admin-x-settings/src/utils/currency.tsapps/admin-x-settings/src/utils/get-tiers-cadences.tsapps/admin/src/settings/advanced/advanced.acceptance.test.tsxapps/admin/src/settings/email/default-recipients.acceptance.test.tsxapps/admin/src/settings/general/publication-language.acceptance.test.tsxapps/admin/src/settings/membership/access.acceptance.test.tsxapps/admin/src/settings/membership/custom-fields.acceptance.test.tsxapps/admin/src/settings/offers.screen.tsapps/admin/src/settings/settings.screen.tsapps/shade/src/components.tsapps/shade/src/components/ui/combobox.stories.tsxapps/shade/src/components/ui/combobox.tsxapps/shade/src/components/ui/multi-select-combobox.tsxe2e/helpers/pages/admin/settings/sections/access-section.ts
💤 Files with no reviewable changes (8)
- apps/admin-x-settings/package.json
- apps/admin-x-design-system/src/global/form/select.tsx
- apps/admin-x-design-system/src/global/form/select.stories.tsx
- apps/admin-x-design-system/src/global/form/multi-select.stories.tsx
- apps/admin-x-design-system/src/global/form/multi-select.tsx
- apps/admin-x-design-system/src/global/form/select-with-other.stories.tsx
- apps/admin-x-design-system/src/global/form/select-with-other.tsx
- apps/admin-x-design-system/src/index.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29503 +/- ##
==========================================
+ Coverage 74.52% 74.57% +0.04%
==========================================
Files 1609 1609
Lines 141329 141338 +9
Branches 17240 17263 +23
==========================================
+ Hits 105320 105397 +77
+ Misses 34948 34909 -39
+ Partials 1061 1032 -29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ref #29503 The chooser migration exposed Escape to legacy modal listeners and left several selection states inconsistent with their active routes.
|
Addressed the review-summary items in 78b935f:
Validation completed locally: 35 affected Admin acceptance tests, 206 Settings unit tests, 227 Shade unit tests, package type checks and lint, Shade build, and Storybook build. |

What changed
Why
The legacy chooser layer duplicated behavior already available in Shade and allowed focus, accessibility, async loading, and modal layering behavior to diverge.
This intentionally does not add SettingsSelect, SettingsCombobox, SelectField, or ComboboxField wrappers. Ordinary fields compose Shade controls directly. The generic Combobox only centralizes the repeated accessible input-surface trigger, value, chevron, and popover-content chrome across six callsites. MultiSelectCombobox only gained generic grouping support needed by tier, segment, and currency lists.
Review fixes incorporated
Eight independent review passes plus a clean re-review were applied:
Validation