Skip to content

Updated settings text fields to Shade - #29513

Merged
9larsons merged 5 commits into
mainfrom
codex/admin-settings-shade-text-fields
Jul 22, 2026
Merged

9larsons merged 5 commits into
mainfrom
codex/admin-settings-shade-text-fields

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

What changed

  • replaced the remaining settings TextArea, URLTextField, CurrencyField, and Hint consumers with Shade fields, inputs, textareas, and input groups
  • moved settings search and access-code regeneration onto Shade input groups
  • added a generic Shade CopyField and used it for API keys, gift subscriptions, and tips & donations
  • removed the four legacy admin-x-design-system controls, their stories, and their exports
  • kept URL and currency editing behavior in small settings-local hooks
  • refreshed Shade adoption data

Why CopyField exists

The three copy rows had independently implemented the same value layout, hover/focus action reveal, clipboard state, timeout cleanup, and copied feedback. CopyField owns only that generic interaction contract and exposes compound slots for labels, values, and caller-supplied actions. It has no Ghost settings, routing, query, or modal knowledge, so it belongs in Shade rather than another settings wrapper.

Ordinary text, URL, and currency fields still compose existing Shade primitives directly; there is no new settings-level field component.

Validation

  • Shade lint, typecheck, unit tests, and build
  • admin-x-design-system lint, typecheck, unit tests, build, and dependency-cruiser
  • admin-x-settings lint, typecheck, and 206 unit tests
  • Admin lint
  • full settings acceptance suite: 38 files, 298 tests
  • frozen lockfile install and regenerated Shade adoption data
  • architecture, behavior/accessibility, and CI review loops completed with no significant findings

Manual validation

  • settings search filtering, clear action, / focus shortcut, and Escape blur
  • API key, gift, and donation copy rows on hover and keyboard focus; copy feedback and regeneration
  • donation amount save, validation, currency selection, and Cancel reset
  • tier monthly/yearly prices and welcome-page URL formatting
  • navigation URL formatting and representative migrated textareas/errors
  • access-code regeneration

no ref

The remaining legacy fields blocked removal of their design-system exports, while repeated copy rows needed one generic owner for consistent focus and feedback behavior.
@coderabbitai

coderabbitai Bot commented Jul 22, 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: 0514e86d-d750-4735-a708-999a077b46e3

📥 Commits

Reviewing files that changed from the base of the PR and between d2db232 and 1549a4b.

📒 Files selected for processing (7)
  • apps/admin-x-design-system/src/global/form/code-editor-view.tsx
  • apps/admin-x-design-system/src/global/form/html-field.tsx
  • apps/admin-x-design-system/src/global/form/text-field.tsx
  • apps/admin-x-design-system/src/global/legacy-hint.tsx
  • apps/admin-x-design-system/src/global/list.tsx
  • apps/admin-x-design-system/src/global/sortable-list.tsx
  • apps/admin-x-design-system/src/global/table.tsx

Walkthrough

The design system removes legacy Hint, TextArea, CurrencyField, and URLTextField exports and replaces their usage with Shade field primitives. New CopyField, useCurrencyInput, and useUrlInput implementations support copying and controlled currency/URL inputs. Settings screens migrate form fields, validation messages, shareable links, navigation URLs, and sidebar search to the new components. Acceptance tests and Shade adoption metrics are updated.

Suggested reviewers: peterzimon

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and broadly matches the PR’s migration of settings form controls to Shade.
Description check ✅ Passed The description clearly matches the changeset, covering the Shade field migration, CopyField addition, legacy removals, hooks, and adoption data.
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-text-fields

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 22, 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 1549a4b

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 40s View ↗
nx run-many -t test:unit -p @tryghost/admin-x-d... ✅ Succeeded 5m 6s View ↗
nx run ghost-admin:test ✅ Succeeded 3m 16s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 20s View ↗
nx run-many -t lint -p @tryghost/admin-x-design... ✅ Succeeded 2m 6s View ↗
nx run @tryghost/admin:build ✅ Succeeded 1m 59s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 47s 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-22 13:20:11 UTC

@codecov

codecov Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.57%. Comparing base (8de5eeb) to head (d2db232).
⚠️ Report is 210 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29513      +/-   ##
==========================================
- Coverage   74.57%   74.57%   -0.01%     
==========================================
  Files        1609     1609              
  Lines      141363   141363              
  Branches    17258    17258              
==========================================
- Hits       105423   105419       -4     
- Misses      34909    34911       +2     
- Partials     1031     1033       +2     

☔ 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 added 3 commits July 21, 2026 20:13
no ref

The Shade migration should preserve the established visual hierarchy while the broader filled-control treatment is reviewed with design.
no ref

Navigation URL inputs should retain visual parity with their label inputs during the Shade migration.
no ref

Shade replacements should preserve the established filled input treatment and stable row alignment throughout this migration.
@9larsons
9larsons marked this pull request as ready for review July 22, 2026 12:59
no ref

The public Hint API can remain retired while the few surviving legacy consumers share semantic styling instead of duplicating the removed component CSS.

@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: 3

🤖 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/growth/recommendations/recommendation-description-form.tsx`:
- Around line 109-124: Add a FieldError component within the description Field
in the recommendation description form, using errors.description as its
displayed message so invalid submissions show the validation reason while
preserving the existing textarea and FieldDescription behavior.

In `@apps/admin-x-settings/src/components/settings/membership/access.tsx`:
- Around line 213-246: Update the InputGroupButton for “Regenerate access code”
so it is disabled when isPrivateLocked as well as while isRegenerating. Preserve
handleRegenerateAccessCode and the existing enabled behavior when the access
code is editable.

In `@apps/admin-x-settings/src/hooks/use-currency-input.ts`:
- Around line 5-7: Update forceCurrencyValue to preserve leading-decimal inputs
such as .5 and .99 by cleaning the input with the existing numeric sanitization
approach and passing the resulting string to parseFloat before converting to
cents; retain the current zero fallback for empty or invalid input. Add focused
useCurrencyInput tests covering leading decimals and the hook’s related edge
cases, including multiple decimal points and external reset synchronization.
🪄 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: a3c1f841-2f5a-49c9-af6c-bae2f1ba65c2

📥 Commits

Reviewing files that changed from the base of the PR and between 7dd0025 and d2db232.

📒 Files selected for processing (50)
  • apps/admin-x-design-system/src/global/form/code-editor-view.tsx
  • apps/admin-x-design-system/src/global/form/currency-field.stories.tsx
  • apps/admin-x-design-system/src/global/form/currency-field.tsx
  • apps/admin-x-design-system/src/global/form/html-field.tsx
  • apps/admin-x-design-system/src/global/form/text-area.stories.tsx
  • apps/admin-x-design-system/src/global/form/text-area.tsx
  • apps/admin-x-design-system/src/global/form/text-field.tsx
  • apps/admin-x-design-system/src/global/form/url-text-field.stories.tsx
  • apps/admin-x-design-system/src/global/form/url-text-field.tsx
  • apps/admin-x-design-system/src/global/hint.stories.tsx
  • apps/admin-x-design-system/src/global/hint.tsx
  • apps/admin-x-design-system/src/global/layout/page.stories.tsx
  • apps/admin-x-design-system/src/global/list.tsx
  • apps/admin-x-design-system/src/global/sortable-list.tsx
  • apps/admin-x-design-system/src/global/table.tsx
  • apps/admin-x-design-system/src/global/table/dynamic-table.stories.tsx
  • apps/admin-x-design-system/src/index.ts
  • apps/admin-x-settings/src/components/settings/advanced/integrations/api-keys.tsx
  • apps/admin-x-settings/src/components/settings/advanced/spam-filters.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/add-newsletter-modal.tsx
  • apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx
  • apps/admin-x-settings/src/components/settings/general/users/profile-tab.tsx
  • apps/admin-x-settings/src/components/settings/growth/embed-signup/embed-signup-sidebar.tsx
  • apps/admin-x-settings/src/components/settings/growth/explore/testimonials-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/add-offer-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/edit-offer-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/offers/edit-retention-offer-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/recommendations/recommendation-description-form.tsx
  • apps/admin-x-settings/src/components/settings/growth/tips-and-donations.tsx
  • apps/admin-x-settings/src/components/settings/membership/access.tsx
  • apps/admin-x-settings/src/components/settings/membership/gift-subscriptions.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-x-settings/src/components/settings/membership/member-emails/welcome-email-preview-frame.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/design-and-branding/global-settings.tsx
  • apps/admin-x-settings/src/components/settings/site/design-and-branding/theme-setting.tsx
  • apps/admin-x-settings/src/components/settings/site/navigation/navigation-edit-form.tsx
  • apps/admin-x-settings/src/components/settings/site/navigation/navigation-item-editor.tsx
  • apps/admin-x-settings/src/components/sidebar.tsx
  • apps/admin-x-settings/src/hooks/use-currency-input.ts
  • apps/admin-x-settings/src/hooks/use-url-input.ts
  • apps/admin/src/settings/advanced/integrations.acceptance.test.tsx
  • apps/admin/src/settings/growth/tips-and-donations.acceptance.test.tsx
  • apps/shade/src/components.ts
  • apps/shade/src/components/ui/copy-field.stories.tsx
  • apps/shade/src/components/ui/copy-field.tsx
  • apps/shade/src/components/ui/input-group.tsx
  • apps/shade/src/docs/adoption-data.json
💤 Files with no reviewable changes (9)
  • apps/admin-x-design-system/src/global/form/url-text-field.tsx
  • apps/admin-x-design-system/src/global/form/text-area.stories.tsx
  • apps/admin-x-design-system/src/global/form/url-text-field.stories.tsx
  • apps/admin-x-design-system/src/global/form/text-area.tsx
  • apps/admin-x-design-system/src/global/hint.stories.tsx
  • apps/admin-x-design-system/src/global/form/currency-field.tsx
  • apps/admin-x-design-system/src/global/form/currency-field.stories.tsx
  • apps/admin-x-design-system/src/global/hint.tsx
  • apps/admin-x-design-system/src/index.ts

@9larsons
9larsons enabled auto-merge (squash) July 22, 2026 13:23
@9larsons
9larsons merged commit 6c43413 into main Jul 22, 2026
45 checks passed
@9larsons
9larsons deleted the codex/admin-settings-shade-text-fields branch July 22, 2026 13:24
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