Skip to content

Changed settings menus to styled Shade dropdowns - #29366

Merged
9larsons merged 3 commits into
mainfrom
codex/admin-x-settings-dropdown-styles
Jul 15, 2026
Merged

Changed settings menus to styled Shade dropdowns#29366
9larsons merged 3 commits into
mainfrom
codex/admin-x-settings-dropdown-styles

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

What changed

Reworked the admin-x-settings menu migration from #29363 on top of current main:

  • replaced the three legacy Menu call sites with Shade DropdownMenu composition
  • retained the existing triggers, actions, end alignment, permission checks, and modal z-index behavior
  • used the Radix onSelect API for menu actions
  • updated acceptance selectors from the legacy popover markup to menu and menuitem roles
  • added computed-style assertions for the menu minimum width and padding

Why

The earlier PR only proved that the Radix menu behavior worked. A functional-but-unstyled menu could still pass its acceptance coverage. This replacement is based on the standalone Shade stylesheet lane already on main and explicitly verifies that Shade component utilities are compiled and applied. Production Admin continues to use its single centralized Shade CSS lane, so the embedded app does not import a duplicate stylesheet.

Validation

  • pnpm --filter @tryghost/admin-x-settings lint
  • pnpm nx run @tryghost/admin-x-settings:test:unit — 203 passed
  • pnpm --filter @tryghost/admin-x-settings exec playwright test test/acceptance/site/theme.test.ts test/acceptance/general/users/actions.test.ts --reporter=line — 36 passed
  • pnpm nx run @tryghost/admin:build

Supersedes #29363.

ref #29363

- the legacy Menu is being phased out in favour of Shade's composable dropdown
- the reworked branch includes the standalone Shade stylesheet lane from main
- acceptance coverage now verifies generated Shade menu dimensions, preventing functional but unstyled markup from passing
@coderabbitai

coderabbitai Bot commented Jul 15, 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: b7e850e2-ff22-4aca-acff-c8171a6f7b10

📥 Commits

Reviewing files that changed from the base of the PR and between 7f5894e and d326103.

📒 Files selected for processing (1)
  • apps/admin/src/settings/offers.acceptance.test.tsx

Walkthrough

Migrated user and theme action menus in admin settings from the legacy Menu implementation to DropdownMenu components. Acceptance tests now use menu and menuitem roles, verify visibility and styling, and cover menu dismissal. An offer update test now validates clearing and refilling the offer code.

Possibly related PRs

  • TryGhost/Ghost#29363: Migrates the same admin settings menus and related acceptance-test selectors.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating settings menus to styled Shade dropdowns.
Description check ✅ Passed The description matches the changeset and accurately explains the menu migration, tests, and validation.
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-x-settings-dropdown-styles

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 15, 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 7f5894e

Command Status Duration Result
nx run @tryghost/admin-x-settings:test:acceptance ✅ Succeeded 9m 38s View ↗
nx run-many -t test:unit -p @tryghost/admin-x-s... ✅ Succeeded 2m 20s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 20s View ↗
nx run @tryghost/admin:build ✅ Succeeded 44s View ↗
nx run @tryghost/admin:test:acceptance ✅ Succeeded 59s View ↗
nx run-many -t lint -p @tryghost/admin-x-settin... ✅ Succeeded 46s 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-15 19:22:04 UTC

ref #29366

The edit modal renders before its fetched offer populates the form, so the test could clear an empty input that was then replaced with valid data.
@9larsons
9larsons marked this pull request as ready for review July 15, 2026 19:05
ref #29366

Referencing the fixture value directly keeps the loading-race assertion stable when the shared offer fixture changes.

@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/site/theme/advanced-theme-settings.tsx (1)

170-172: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider styling the delete action as destructive.

For visual consistency with the user actions menu (in user-detail-modal.tsx), consider adding the destructive text styling to this "Delete" menu item.

✨ Proposed fix to add destructive styling
-                    {isDeletableTheme(theme) && (
-                        <DropdownMenuItem onSelect={handleDelete}>Delete</DropdownMenuItem>
-                    )}
+                    {isDeletableTheme(theme) && (
+                        <DropdownMenuItem className='text-destructive focus:text-destructive' onSelect={handleDelete}>
+                            Delete
+                        </DropdownMenuItem>
+                    )}
🤖 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/theme/advanced-theme-settings.tsx`
around lines 170 - 172, Update the Delete DropdownMenuItem in the
isDeletableTheme rendering within the advanced theme settings component to apply
the existing destructive text styling used by the user actions menu, while
preserving its current onSelect={handleDelete} behavior.
🤖 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/site/theme/advanced-theme-settings.tsx`:
- Around line 170-172: Update the Delete DropdownMenuItem in the
isDeletableTheme rendering within the advanced theme settings component to apply
the existing destructive text styling used by the user actions menu, while
preserving its current onSelect={handleDelete} behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 14cfe113-2c15-4d41-b2ed-f64555c2dd15

📥 Commits

Reviewing files that changed from the base of the PR and between 77790bf and 7f5894e.

📒 Files selected for processing (6)
  • apps/admin-x-settings/src/components/settings/general/user-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/site/change-theme.tsx
  • apps/admin-x-settings/src/components/settings/site/theme/advanced-theme-settings.tsx
  • apps/admin-x-settings/test/acceptance/general/users/actions.test.ts
  • apps/admin-x-settings/test/acceptance/site/theme.test.ts
  • apps/admin/src/settings/offers.acceptance.test.tsx

@9larsons
9larsons enabled auto-merge (squash) July 15, 2026 19:18
@9larsons
9larsons merged commit 5f87c42 into main Jul 15, 2026
42 checks passed
@9larsons
9larsons deleted the codex/admin-x-settings-dropdown-styles branch July 15, 2026 19:23
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