fix(ui): curate admin default columns by declared flag, not field name/type - #1020
Conversation
…e/type (#1018) Replaces the hardcoded password/createdAt/updatedAt exclusion in the admin list view, related-list tables, and ListTable with one shared curation rule driven by each field's declared `ui.listView.defaultColumn` (core). A list's structural createdAt/updatedAt columns are identified from its own timestamp config rather than by name, password() sets the flag instead of being matched by type, and auth's read-denied credential fields now declare it too so they no longer render as permanently empty default columns. Closes #1018 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pydn7Pah2bUAZnKCDzhvXU
🦋 Changeset detectedLatest commit: 10f9b50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cabb0c302d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ListViewClient/ListTable derived the default column set from Object.keys(fields), but fields may legitimately cover only a subset of fieldTypes (columnField/getFieldConfig already synthesize a fallback for any column missing an entry). A column absent from fields was silently dropped instead of defaulting to shown. Curate off fieldTypes' own key set instead, consulting fields[key] only for the declaration. Found in code review of #1020 (chatgpt-codex-connector). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pydn7Pah2bUAZnKCDzhvXU
|
Deployment failed for project stack-docs with the following error: Learn More: https://vercel.com/open-saas?upgradeToPro=build-rate-limit |
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Coverage Report for UI Package Coverage (./packages/ui)
File CoverageNo changed files found. |
Coverage Report for CLI Package Coverage (./packages/cli)
File CoverageNo changed files found. |
Coverage Report for Auth Package Coverage (./packages/auth)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
Summary
password,createdAt,updatedAt) — over-inclusive (an unrelated field literally namedcreatedAtwas silently hidden) and under-inclusive (a credential column named anything else, e.g.Session.token, was never excluded).ui.listView.defaultColumn?: boolean(defaulttrue) onBaseFieldConfig(@opensaas/stack-core). Naming a field explicitly inui.listView.initialColumnsor a relationship'sui.itemView.columnsalways shows it regardless of the flag.deriveItemView.ts's related-list default columns,ListViewClient's list-view fallback, andListTable's standalone fallback) into one shared implementation (packages/ui/src/lib/defaultColumns.ts:computeDefaultColumns/isDefaultColumnField).createdAt/updatedAttimestamp columns are now identified from the list's own timestamp configuration (db.timestamps, per-list or global) rather than by name —withStructuralTimestampDefaultsbakes the flag onto those fields server-side before they cross to the client.password()now setsui.listView.defaultColumn: falseby default instead of the UI matching on field type — a password field can opt back in withui: { listView: { defaultColumn: true } } }.@opensaas/stack-auth's credential-field read-deny (ADR-0036) now also declares the flag, so a read-denied credential column is curated out of the default table instead of rendering as a permanently empty column.ListTable(standalone component) gains an optionalfields?: Record<string, SerializableFieldConfig>prop to supply this curation metadata.Behavior change: an application field literally named/typed
password,createdAt, orupdatedAtthat does not declareui.listView.defaultColumn: false(and isn't your list's actual auto-timestamp column) is no longer hidden from default admin columns purely by name/type match — this is the bug the issue reports. Real password fields and real system timestamps are unaffected.Test plan
pnpm testgreen acrosscore(1178),ui(609),auth(297+4 skipped), and every other workspace packagepackages/ui/tests/lib/defaultColumns.test.ts, plus updated/added coverage inderiveItemView.test.ts,ListView.test.tsx,ListViewClient.test.tsx,ListTable.test.tsx,field-types.test.ts(corepassword()), andderive-auth-lists.test.ts(auth credential fields)pnpm lintclean (no new warnings)pnpm buildgreen across all 11 packages, including the docs site (config-api.md / fields-api.md updated and link-checked)pnpm manypkg fix/pnpm format— no changes needed@opensaas/stack-core(minor),@opensaas/stack-ui(minor),@opensaas/stack-auth(patch)Closes #1018
Generated by Claude Code