feat(admin): show configured fields in content lists - #2194
Conversation
🦋 Changeset detectedLatest commit: 0f5c7c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Scope checkThis PR touches 23 files. PRs with a broad scope are harder to review. Please confirm the scope hasn't drifted beyond the intended change. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
This PR correctly implements collection-level custom field columns for admin content lists as an additive, scoped feature. The approach fits EmDash's architecture: admin.listColumns is persisted in _emdash_collections.admin_config as JSON, travels through seeds and schema APIs, is validated/deduplicated/capped in the manifest build, and is rendered client-side from data already present in the content list payload (no extra per-row queries).
I reviewed the diff statically and traced the changes across the migration, schema registry, seed apply/validate/export, runtime manifest build, admin manifest types, and the ContentList component. I checked for Lingui coverage, RTL-safe Tailwind, SQL safety, API envelope consistency, query-count impact, comment discipline, and test coverage.
Headline conclusion: the code is clean. The migration is guarded by columnExists. The registry round-trips admin_config correctly and preserves existing list columns on unrelated updates. The manifest filter caps list columns at four supported, existing field types and warns appropriately. The admin UI renders headers and cells with logical Tailwind classes and uses the existing manifest/field metadata for select/multi-select labels and compact formatting. Tests cover the manifest cap behavior, registry persistence, migration registration, and component rendering.
I did not run the test suite, linter, or build; the author reports passing checks in the PR description.
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
8edcd0d to
1e5c71b
Compare
1e5c71b to
15acca2
Compare
223df29 to
9adfc22
Compare
There was a problem hiding this comment.
Re-review of feat/content-list-custom-field-columns. This is the same diff that was approved in the previous pass; I re-read the full diff and the changed files plus AGENTS.md and found no new code issues.
What I checked again
- The migration (
055_collection_admin_config) is idempotent viacolumnExistsand only adds a nullabletextcolumn — safe and forward-only. - Registry create/update/seed round-trips
admin_configcorrectly and preserves existing list columns on unrelated updates. - API schema and admin client types expose
admin.listColumnswith slug validation. - Runtime manifest build validates configured columns against existing fields, removes duplicates, ignores unsupported types, and caps at four in memory (no extra DB queries).
ContentListrenders the new columns fromitem.dataalready present in the list payload, so there are no per-row requests.- Lingui wraps user-facing strings (
Not set,Yes,No); custom headers use RTL-safetext-start; no raw SQL interpolation. - Tests cover manifest capping, registry persistence, seed export/validate, and component rendering.
Headline conclusion
The implementation is still clean. No line-level findings.
Still-open governance item (not a code defect)
The PR checklist notes that the feature’s design discussion (#1717) is opened, awaiting maintainer review. AGENTS.md asks for a maintainer-approved Discussion before a feature merges, so that approval should land before this is merged. With that resolved, the code is ready to go.
9adfc22 to
bd17740
Compare
What does this PR do?
Adds collection-level custom field columns to the admin content list.
Collections can opt into up to four scalar fields through
admin.listColumns. The collection schema, seed import/export path, API payloads, and runtime manifest preserve that configuration. The manifest validates configured fields, removes duplicates, ignores unknown or unsupported field types, and exposes the field metadata needed by the admin.The content list renders those fields between Title and Status without extra per-row requests. Select and multi-select values use their configured labels, booleans and dates receive compact formatting, and long values stay bounded so they cannot distort the table.
Searchable custom fields are handled separately in #2191. Trusted plugin-computed columns are handled in #2195. Server-backed indexed sorting and filtering are handled in #2212 and #2213.
#2195 and #2212 are stacked on this branch so all five contributions can be reviewed at the same time without duplicating the collection-column infrastructure. This PR should merge before those two; GitHub will then narrow their diffs automatically.
Addresses #2179
Related design discussion: #1717
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
Validated on EmDash 0.32.0 (base
776d65f7) with Node 24.16.0 and pnpm 11.9.0 on macOS. The workspace has all six stacked contributions applied, so these are the integrated totals rather than a per-PR subset:CI runs each PR on its own branch.