Skip to content

feat(ui): add list-level ui.listView config (initialColumns + initialSort)#552

Merged
borisno2 merged 1 commit into
mainfrom
claude/issue-550-listview-ui-config
Jun 6, 2026
Merged

feat(ui): add list-level ui.listView config (initialColumns + initialSort)#552
borisno2 merged 1 commit into
mainfrom
claude/issue-550-listview-ui-config

Conversation

@borisno2

@borisno2 borisno2 commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds a list-level ui.listView config to core's ListConfig, mirroring Keystone 1:1 so migrators can map per-list defaults directly. Wires it through AdminUIListViewListViewClient.

  • initialColumns: string[] — drives the list table's default column selection and order.
  • initialSort: { field, direction } — sets the default sort.
  • label / labelField / description are intentionally deferred (different concerns).
lists: {
  Post: list({
    fields: { title: text(), status: text(), createdAt: timestamp() },
    ui: {
      listView: {
        initialColumns: ['title', 'status'],
        initialSort: { field: 'createdAt', direction: 'desc' },
      },
    },
  }),
}

When ui.listView is absent, behaviour is unchanged: all non-system fields are shown and no default sort is applied.

How it's consumed

  • core (packages/core/src/config/types.ts): new ListUIConfig / ListViewUIConfig types, exposed on ListConfig.ui; exported from @opensaas/stack-core config entry. list() passes ui through unchanged.
  • AdminUI (packages/ui/src/components/AdminUI.tsx): the ListView branch reads config.lists[listKey].ui?.listView and passes initialColumns as the columns prop and initialSort as a new prop.
  • ListView (packages/ui/src/components/ListView.tsx): accepts initialSort and threads it to the client component (plain serializable data across the server/client boundary).
  • ListViewClient (packages/ui/src/components/ListViewClient.tsx): seeds sortBy/sortOrder state from initialSort; existing columns already drives selection/order.

Tests

  • packages/core/tests/config.test.ts: ui.listView (initialColumns + initialSort) is accepted; ui stays undefined when not configured.
  • packages/ui/tests/components/ListViewClient.test.tsx: column order from initialColumns; default sort + direction from initialSort; sort indicator on the seeded column; no default sort when initialSort absent.
  • packages/ui/tests/components/AdminUIListView.test.tsx: AdminUI passes initialColumns/initialSort from config to ListView; passes undefined when ui.listView absent.

All green: stack-core 588 tests, stack-ui 190 tests. Lint (0 errors), format:check pass.

Fixes #550

https://claude.ai/code/session_01ULd2HCT8dUve9aa9gKi6sX


Generated by Claude Code

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-bot

changeset-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5cfe15e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@opensaas/stack-core Minor
@opensaas/stack-ui Minor
@opensaas/stack-auth Minor
@opensaas/stack-cli Minor
@opensaas/stack-rag Minor
@opensaas/stack-storage Minor
@opensaas/stack-tiptap Minor
@opensaas/stack-storage-s3 Minor
@opensaas/stack-storage-vercel Minor

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

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stack-docs Ready Ready Preview, Comment Jun 6, 2026 5:00am

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Core Package Coverage (./packages/core)

Status Category Percentage Covered / Total
🔵 Lines 89.64% (🎯 65%) 580 / 647
🔵 Statements 88.85% (🎯 65%) 590 / 664
🔵 Functions 98.09% (🎯 62%) 103 / 105
🔵 Branches 77.17% (🎯 50%) 382 / 495
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for UI Package Coverage (./packages/ui)

Status Category Percentage Covered / Total
🔵 Lines 76.03% 92 / 121
🔵 Statements 75.39% 95 / 126
🔵 Functions 75.6% 31 / 41
🔵 Branches 65.78% 75 / 114
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for CLI Package Coverage (./packages/cli)

Status Category Percentage Covered / Total
🔵 Lines 75.15% 1295 / 1723
🔵 Statements 74.93% 1342 / 1791
🔵 Functions 83.64% 179 / 214
🔵 Branches 64.36% 569 / 884
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Auth Package Coverage (./packages/auth)

Status Category Percentage Covered / Total
🔵 Lines 74.64% 159 / 213
🔵 Statements 69.74% 166 / 238
🔵 Functions 83.11% 64 / 77
🔵 Branches 70.67% 94 / 133
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Storage Package Coverage (./packages/storage)

Status Category Percentage Covered / Total
🔵 Lines 69.67% 170 / 244
🔵 Statements 71.59% 189 / 264
🔵 Functions 80.28% 57 / 71
🔵 Branches 68.29% 168 / 246
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for RAG Package Coverage (./packages/rag)

Status Category Percentage Covered / Total
🔵 Lines 47.97% 355 / 740
🔵 Statements 48.14% 377 / 783
🔵 Functions 54.26% 70 / 129
🔵 Branches 42.55% 180 / 423
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)

Status Category Percentage Covered / Total
🔵 Lines 100% 40 / 40
🔵 Statements 100% 40 / 40
🔵 Functions 100% 9 / 9
🔵 Branches 100% 19 / 19
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)

Status Category Percentage Covered / Total
🔵 Lines 100% 38 / 38
🔵 Statements 100% 38 / 38
🔵 Functions 100% 8 / 8
🔵 Branches 100% 22 / 22
File CoverageNo changed files found.
Generated in workflow #1150 for commit 5cfe15e by the Vitest Coverage Report Action

@borisno2 borisno2 merged commit 66496b4 into main Jun 6, 2026
6 checks passed
@borisno2 borisno2 deleted the claude/issue-550-listview-ui-config branch June 6, 2026 05:09
@github-actions github-actions Bot mentioned this pull request Jun 6, 2026
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.

stack-ui: list-level ui.listView (initialColumns + initialSort) mirroring Keystone (SF-16)

2 participants