feat(ui): add list-level ui.listView config (initialColumns + initialSort)#552
Merged
Merged
Conversation
Add a list-level `ui.listView` block to core's `ListConfig` mirroring
Keystone:
- `initialColumns: string[]` drives the list table's default column
selection and order.
- `initialSort: { field, direction }` sets the default sort.
AdminUI reads `config.lists[listKey].ui?.listView` and passes
`initialColumns` as the ListView `columns` prop and threads `initialSort`
through ListView into ListViewClient, which seeds the initial
`sortBy`/`sortOrder`. Absent config leaves current behaviour unchanged
(all non-system fields, no default sort).
`label`/`labelField`/`description` are intentionally deferred.
Fixes #550
https://claude.ai/code/session_01ULd2HCT8dUve9aa9gKi6sX
🦋 Changeset detectedLatest commit: 5cfe15e 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.
|
Contributor
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Contributor
Coverage Report for UI Package Coverage (./packages/ui)
File CoverageNo changed files found. |
Contributor
Coverage Report for CLI Package Coverage (./packages/cli)
File CoverageNo changed files found. |
Contributor
Coverage Report for Auth Package Coverage (./packages/auth)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Contributor
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a list-level
ui.listViewconfig to core'sListConfig, mirroring Keystone 1:1 so migrators can map per-list defaults directly. Wires it throughAdminUI→ListView→ListViewClient.initialColumns: string[]— drives the list table's default column selection and order.initialSort: { field, direction }— sets the default sort.label/labelField/descriptionare intentionally deferred (different concerns).When
ui.listViewis absent, behaviour is unchanged: all non-system fields are shown and no default sort is applied.How it's consumed
packages/core/src/config/types.ts): newListUIConfig/ListViewUIConfigtypes, exposed onListConfig.ui; exported from@opensaas/stack-coreconfig entry.list()passesuithrough unchanged.packages/ui/src/components/AdminUI.tsx): the ListView branch readsconfig.lists[listKey].ui?.listViewand passesinitialColumnsas thecolumnsprop andinitialSortas a new prop.packages/ui/src/components/ListView.tsx): acceptsinitialSortand threads it to the client component (plain serializable data across the server/client boundary).packages/ui/src/components/ListViewClient.tsx): seedssortBy/sortOrderstate frominitialSort; existingcolumnsalready drives selection/order.Tests
packages/core/tests/config.test.ts:ui.listView(initialColumns + initialSort) is accepted;uistaysundefinedwhen not configured.packages/ui/tests/components/ListViewClient.test.tsx: column order frominitialColumns; default sort + direction frominitialSort; sort indicator on the seeded column; no default sort wheninitialSortabsent.packages/ui/tests/components/AdminUIListView.test.tsx: AdminUI passesinitialColumns/initialSortfrom config to ListView; passesundefinedwhenui.listViewabsent.All green: stack-core 588 tests, stack-ui 190 tests. Lint (0 errors),
format:checkpass.Fixes #550
https://claude.ai/code/session_01ULd2HCT8dUve9aa9gKi6sX
Generated by Claude Code