Skip to content

Moved settings overlays to Shade - #29495

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

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

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

Summary

  • migrated the Settings history filter from the legacy Popover to Shade
  • migrated the Offers filter and archived custom-field action to Shade DropdownMenu
  • migrated welcome-email and automation test-email overlays to controlled Shade Popovers
  • removed the legacy Menu, Popover, and unused SortMenu components, stories, exports, and Radix dependency
  • fixed the clear/drowdown indicator collision in the History staff filter and added a layout regression assertion

Why

Settings had several overlay implementations with different styling, accessibility, focus, Escape, and outside-click behavior. Moving them to Shade gives these surfaces one shared contract and removes the legacy components so they cannot be reintroduced.

The History staff selector also exposed a legacy react-select layout issue: its dropdown indicator is absolutely positioned without reserving space beside the clear indicator. This PR keeps the spacing fix local to the only clearable Settings Select; the full chooser migration remains scoped to Group 2.

User and developer impact

Users get consistent menus and popovers with standardized keyboard and dismissal behavior. Developers no longer have the legacy Menu, Popover, or SortMenu APIs available from admin-x-design-system.

How to validate

  1. Open Settings → Advanced → History, open Filter, toggle event/resource filters, select a staff member, and confirm the clear X and dropdown chevron have visible separation.
  2. Open Settings → Growth → Offers, open Filter, and toggle archived offers.
  3. Open an archived custom field, open its overflow menu, and choose Delete custom field.
  4. Open the member welcome-email editor, open Send test email, validate an invalid address, then send to a valid address. Confirm Escape and outside click close only the popover.
  5. Open an automation email editor and repeat the test-email flow.

Validation

  • admin-x-settings unit tests: 205 passed
  • full Admin Settings acceptance suite: 293 passed
  • focused Advanced Settings acceptance suite: 16 passed
  • admin-x-design-system unit tests: 23 passed
  • admin and admin-x-settings lint and TypeScript checks
  • Nx Admin build
  • pre-commit lint, dependency-cruiser, secret, and submodule checks

Screenshots

Before/after evidence is pending while this PR is in draft.

no ref

Moved settings overlays onto the shared Shade primitives so their styling, accessibility, and dismissal behavior no longer diverge across Admin.
@coderabbitai

coderabbitai Bot commented Jul 21, 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

Run ID: c09f2bc1-0edc-4b23-b222-9f667df32039

📥 Commits

Reviewing files that changed from the base of the PR and between cd0e403 and 1b45569.

📒 Files selected for processing (1)
  • e2e/helpers/pages/admin/settings/sections/custom-fields-section.ts

Walkthrough

The change removes legacy design-system menu and popover exports and the Radix popover dependency. Settings filters and custom-field actions now use Shade primitives, offer values use formatNumber, and email test dropdowns use controlled Shade Popovers. Acceptance tests and screen objects were updated for the new selectors and roles.

Possibly related PRs

  • TryGhost/Ghost#29417: Related archived custom-field menu and action changes in the same component area.

Suggested reviewers: renatoworks

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating settings overlays to Shade.
Description check ✅ Passed The description is clearly related to the changeset and matches the migrated overlays and cleanup work.
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-overlays

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 21, 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 1b45569

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 3m 4s View ↗
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 46s View ↗
nx run-many -t test:unit -p @tryghost/admin-x-d... ✅ Succeeded 5m 48s View ↗
nx run ghost:test:integration ✅ Succeeded 2m 51s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 21s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 18s View ↗
nx run-many -t lint -p @tryghost/admin-x-design... ✅ Succeeded 3m 38s View ↗
nx run ghost-admin:test ✅ Succeeded 3m 6s 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 17:43:07 UTC

@9larsons
9larsons marked this pull request as ready for review July 21, 2026 17:05

@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.

🧹 Nitpick comments (1)
apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx (1)

268-270: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Render TestEmailDropdown unconditionally to preserve state and exit animations.

Conditionally rendering TestEmailDropdown (which directly returns PopoverContent at its root) abruptly unmounts it from the DOM when the dropdown closes. This prevents Radix UI's exit animations from playing and clears any email address the user was typing if they accidentally close the popover.

Consider rendering the component unconditionally. Radix's Popover will natively manage the visibility of the content while respecting exit animations, and the user's input will be preserved if they reopen the dropdown.

  • apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx#L268-L270: Remove the {showTestDropdown && (...)} conditional wrapper.
  • apps/admin/src/automations/components/email-modal/email-content-modal.tsx#L350-L352: Remove the {showTestDropdown && (...)} conditional wrapper.
♻️ Proposed refactor for apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx
-                                        {showTestDropdown && (
-                                            <TestEmailDropdown automatedEmailId={automatedEmail.id} lexical={formState.lexical} subject={formState.subject} validateForm={validate} />
-                                        )}
+                                        <TestEmailDropdown automatedEmailId={automatedEmail.id} lexical={formState.lexical} subject={formState.subject} validateForm={validate} />
♻️ Proposed refactor for apps/admin/src/automations/components/email-modal/email-content-modal.tsx
-                                                {showTestDropdown && (
-                                                    <TestEmailDropdown automationId={automationId} lexical={formState.lexical} subject={formState.subject} validateForm={validateForTest} />
-                                                )}
+                                                <TestEmailDropdown automationId={automationId} lexical={formState.lexical} subject={formState.subject} validateForm={validateForTest} />
🤖 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/membership/member-emails/welcome-email-modal.tsx`
around lines 268 - 270, Render TestEmailDropdown unconditionally in
apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx:268-270
and
apps/admin/src/automations/components/email-modal/email-content-modal.tsx:350-352
by removing each showTestDropdown conditional wrapper, while preserving the
existing props so Radix Popover controls visibility, exit animations, and input
state.
🤖 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.

Nitpick comments:
In
`@apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx`:
- Around line 268-270: Render TestEmailDropdown unconditionally in
apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx:268-270
and
apps/admin/src/automations/components/email-modal/email-content-modal.tsx:350-352
by removing each showTestDropdown conditional wrapper, while preserving the
existing props so Radix Popover controls visibility, exit animations, and input
state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bbbf4814-8b24-44c4-9fb9-f0165d349757

📥 Commits

Reviewing files that changed from the base of the PR and between 524a7b5 and cd0e403.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • apps/admin-x-design-system/package.json
  • apps/admin-x-design-system/src/global/menu.stories.tsx
  • apps/admin-x-design-system/src/global/menu.tsx
  • apps/admin-x-design-system/src/global/popover.stories.tsx
  • apps/admin-x-design-system/src/global/popover.tsx
  • apps/admin-x-design-system/src/global/sort-menu.stories.tsx
  • apps/admin-x-design-system/src/global/sort-menu.tsx
  • apps/admin-x-design-system/src/index.ts
  • apps/admin-x-settings/src/components/settings/advanced/history-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/offers-index.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/test-email-dropdown.tsx
  • apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx
  • apps/admin/src/automations/components/email-modal/email-content-modal.tsx
  • apps/admin/src/automations/components/email-modal/test-email-dropdown.tsx
  • apps/admin/src/settings/advanced/advanced.acceptance.test.tsx
  • apps/admin/src/settings/membership/custom-fields.acceptance.test.tsx
  • apps/admin/src/settings/offers.screen.ts
💤 Files with no reviewable changes (8)
  • apps/admin-x-design-system/src/global/menu.stories.tsx
  • apps/admin-x-design-system/src/global/popover.tsx
  • apps/admin-x-design-system/src/global/sort-menu.stories.tsx
  • apps/admin-x-design-system/src/global/popover.stories.tsx
  • apps/admin-x-design-system/package.json
  • apps/admin-x-design-system/src/global/menu.tsx
  • apps/admin-x-design-system/src/global/sort-menu.tsx
  • apps/admin-x-design-system/src/index.ts

@codecov

codecov Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.57%. Comparing base (6d1f6e7) to head (1b45569).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29495      +/-   ##
==========================================
- Coverage   74.60%   74.57%   -0.03%     
==========================================
  Files        1604     1605       +1     
  Lines      140899   141105     +206     
  Branches    17212    17213       +1     
==========================================
+ Hits       105111   105230     +119     
- Misses      34729    34848     +119     
+ Partials     1059     1027      -32     
Flag Coverage Δ
admin-tests 55.44% <ø> (ø)
e2e-tests 76.65% <ø> (-0.04%) ⬇️

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.

@9larsons
9larsons enabled auto-merge (squash) July 21, 2026 17:17
@github-actions

Copy link
Copy Markdown
Contributor

E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 29851371123 -n playwright-report -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 29851371123 -n playwright-report -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

ref #29495

Shade dropdown content is portaled and exposes a menuitem role, so the lifecycle test must locate it from the page rather than as a button inside the modal.
@9larsons
9larsons merged commit 4158cd7 into main Jul 21, 2026
52 checks passed
@9larsons
9larsons deleted the codex/admin-settings-shade-overlays branch July 21, 2026 17:44
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