Repository navigation
Added custom field editing to member details - #29405
Conversation
|
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 (5)
WalkthroughAdds feature-flagged custom fields to the member detail page with read-only display and per-field editing for scalar and address values. It updates API types, normalization, formatting, validation, merge-patch saving, clearing, and server-error handling. Unit, browser acceptance, and end-to-end tests cover the editing flows and feature visibility. Possibly related PRs
Suggested reviewers: 🚥 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 |
…creen ref https://linear.app/ghost/issue/BER-3800/edit-custom-field-values-on-the-member-details-screen Why this shape — the member detail screen is a record, not a form. An admin's daily relationship to a member's data is reading it; editing is the rare, deliberate act. The design follows from that: - values render as a read-only record with a per-field editor, not as inline form inputs: always-hot inputs invert the read/edit priority, put an accidental edit one keystroke away, and drown the values in control chrome (an earlier inline version of this feature was built and rejected for exactly this — see feat/member-custom-field-values for the record) - each field saves individually through its own modal with its own Save: one field, one save, one outcome. Inline editing shared the page's Save and made "which Save saves what" genuinely confusing; the API's merge semantics (only the sent key is touched, null clears) make isolated single-key saves safe by design - a dirty editor refuses casual dismissal (outside click, Escape) — Cancel is the only explicit discard, so a typed value can never be lost to a stray click; pristine editors dismiss freely - values validate client-side against the shared @tryghost/custom-field-types schemas — the same schemas the server enforces — with human copy per the writing guide; a server 422 naming a field via its property path pins the message to the exact input as a backstop - rows speak the admin's existing list language: hover tint with fading dividers (settings lists), whole-row click with a revealed pencil (tags list); values stay selectable so addresses can be copied — a selection release doesn't open the editor - behind membersCustomFields; existing members only (the create contract doesn't take values yet, and a value can't exist before its member does)
3601181 to
ad1f917
Compare
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 5m 28s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin-x-f... |
✅ Succeeded | 2m 38s | View ↗ |
nx run @tryghost/activitypub:test:acceptance |
✅ Succeeded | 36s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 4s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | <1s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | 1s | View ↗ |
nx run-many -t lint -p @tryghost/admin-x-framew... |
✅ Succeeded | 8s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 5s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-17 11:34:34 UTC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29405 +/- ##
=======================================
Coverage 74.30% 74.30%
=======================================
Files 1595 1595
Lines 139505 139505
Branches 16946 16946
=======================================
+ Hits 103657 103659 +2
+ Misses 34831 34830 -1
+ Partials 1017 1016 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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/src/members/detail/member-custom-fields-field.tsx`:
- Around line 168-213: Update the dialog dismissal handling in the member
custom-field editor so it cannot close while editMutation.isPending is true.
Apply this guard to Cancel, onOpenChange, and the Escape/outside interaction
handlers, while preserving the existing isDirty prevention behavior for
non-pending edits.
- Around line 31-33: The ErrorMessage component currently renders validation
text without accessibility semantics. Update ErrorMessage to expose each
non-empty message as an assertive live region by adding role="alert" to the
rendered paragraph, while preserving its existing conditional rendering and
styling.
In `@apps/admin/src/members/detail/member-detail-edit.ts`:
- Around line 270-295: Localize the complete custom-field editing flow: in
apps/admin/src/members/detail/member-detail-edit.ts:270-295, use Admin
translations for validation messages and interpolate the character limit; in
apps/admin/src/members/detail/member-custom-fields-field.tsx:22-29, translate
address labels; at :154-162, translate toast messages with {fieldName}; at
:186-213, translate modal controls and status copy; and at :250-304, translate
the section heading and dynamic edit ARIA label. Add all corresponding entries
to packages/i18n/locales/en/ghost.json, using {variable} interpolation syntax
for dynamic values.
🪄 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: f4910273-7992-4dba-8a92-e1940543695b
📒 Files selected for processing (9)
apps/admin-x-framework/src/api/member-custom-fields.tsapps/admin-x-framework/src/api/members.tsapps/admin/src/members/detail/member-custom-fields-field.tsxapps/admin/src/members/detail/member-detail-custom-fields.acceptance.test.tsxapps/admin/src/members/detail/member-detail-edit.test.tsapps/admin/src/members/detail/member-detail-edit.tsapps/admin/src/members/detail/member-detail-format.test.tsapps/admin/src/members/detail/member-detail-format.tsapps/admin/src/members/detail/member-detail.tsx
Guards against no-op saves that would fire member.edited for an unmoved value, blocks dismissing or double-saving while a PUT is in flight, and gives screen readers the failure and the current value. Over-long required address sub-fields now report a length error instead of the missing-value copy.
ad1f917 to
1687ebf
Compare
Component acceptance tests mock the API, leaving the cross-surface round-trip unverified: a field defined in Settings must appear on the member detail screen, accept a value through its own editor, and persist across a reload. This pins that settings -> member-detail -> server flow end-to-end, adding the CustomFieldsSection page object and member detail custom-field helpers to drive it.

Describe the problem you are solving
Custom field definitions shipped in Settings (BER-3785), but values were only reachable over the API — nothing in the admin let a person see or change what a member's fields hold. This PR adds the value side to the React member details screen: the fields defined in Settings appear against each member as a read-only record, and each one is editable through a focused per-field editor. Behind the
membersCustomFieldsflag (and the screen itself behindmemberDetailsReact).Depends on #29373 (member custom field values API) — this PR consumes its contract and stays draft until it lands. With the flag on but no values API, the member read's
include=custom_fieldsis rejected; with the flag off, requests are byte-identical to today.Changelog for devs
nullclears)@tryghost/custom-field-typesschemas — the same schemas the server enforces — with plain-English messages per the writing guide; a server 422 naming a field via itspropertypath pins the message to the exact input as a backstopcustom_fieldsto the framework'sMember/EditMemberDatatypes; the member PUT requestsinclude=custom_fieldsonly when the payload writes valuesChangelog for customers
membersCustomFieldsflag)Notes
Technical debt
contextrenders verbatim in the (rare) backstop path — humanizing that copy is a server-side follow-up, flagged separatelyPR Scope (mark all that apply)
Checklist before requesting a review (mark all that apply)