Skip to content

Conversation

@borisno2
Copy link
Member

This commit implements a complete filtering system for the admin UI list pages with all state stored in URL query parameters. The system supports all field types and provides both ready-to-use components and composable primitives for developers.

Features:

  • URL-based filter state management (filters[field][operator]=value format)
  • Field type-specific filters (text, integer, checkbox, timestamp, select, relationship)
  • Operator support per field type (contains, equals, gt, gte, lt, lte, in, etc.)
  • FilterBar component with add/remove/clear functionality
  • Primitive filter input components for custom implementations
  • Server-side Prisma where clause generation
  • Client-side URL navigation and state updates
  • Full TypeScript type safety

Components Added:

  • FilterBar: Main filter UI with field/operator selection
  • FilterInput components: TextFilterInput, NumberFilterInput, BooleanFilterInput, DateFilterInput, SelectFilterInput, RelationshipFilterInput

Utilities Added:

  • parseFiltersFromURL: Parse filter state from URL search params
  • serializeFiltersToURL: Serialize filters to URL string
  • filtersToPrismaWhere: Convert filters to Prisma where clauses
  • addFilter, removeFilter, clearFilters: Filter state management

Integration:

  • ListView: Server-side filter parsing and Prisma query building
  • ListViewClient: Client-side FilterBar integration
  • AdminUI: Pass searchParams to ListView

All primitives and utilities are exported from @opensaas/stack-ui for developer customization.

@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2025

🦋 Changeset detected

Latest commit: d765703

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

This PR includes changesets to release 10 packages
Name Type
@opensaas/stack-ui Major
@opensaas/stack-tiptap Major
@opensaas/stack-auth Major
@opensaas/stack-cli Major
@opensaas/stack-core Major
@opensaas/stack-rag Major
@opensaas/stack-storage-s3 Major
@opensaas/stack-storage-vercel Major
@opensaas/stack-storage Major
create-opensaas-app Major

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
Copy link

vercel bot commented Nov 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
stack-docs Ready Ready Preview Comment Nov 16, 2025 1:23am

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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

Status Category Percentage Covered / Total
🔵 Lines 65.27% 203 / 311
🔵 Statements 63.43% 203 / 320
🔵 Functions 66.66% 20 / 30
🔵 Branches 48.73% 58 / 119
File CoverageNo changed files found.
Generated in workflow #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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

Status Category Percentage Covered / Total
🔵 Lines 43.45% 73 / 168
🔵 Statements 43.78% 74 / 169
🔵 Functions 45.45% 15 / 33
🔵 Branches 40.13% 61 / 152
File CoverageNo changed files found.
Generated in workflow #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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 #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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

Status Category Percentage Covered / Total
🔵 Lines 84.3% 419 / 497
🔵 Statements 83.39% 427 / 512
🔵 Functions 95.83% 69 / 72
🔵 Branches 74.63% 306 / 410
File CoverageNo changed files found.
Generated in workflow #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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

Status Category Percentage Covered / Total
🔵 Lines 75.65% 87 / 115
🔵 Statements 75% 90 / 120
🔵 Functions 76.92% 30 / 39
🔵 Branches 65.38% 68 / 104
File CoverageNo changed files found.
Generated in workflow #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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 #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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.08% 178 / 423
File CoverageNo changed files found.
Generated in workflow #384 for commit d6e4461 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2025

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

Status Category Percentage Covered / Total
🔵 Lines 64.49% 89 / 138
🔵 Statements 61.03% 94 / 154
🔵 Functions 74.46% 35 / 47
🔵 Branches 62.79% 54 / 86
File CoverageNo changed files found.
Generated in workflow #384 for commit d6e4461 by the Vitest Coverage Report Action

This commit implements a complete filtering system for the admin UI list pages with all state stored in URL query parameters. The system supports all field types and provides both ready-to-use components and composable primitives for developers.

Features:
- URL-based filter state management (filters[field][operator]=value format)
- Field type-specific filters (text, integer, checkbox, timestamp, select, relationship)
- Operator support per field type (contains, equals, gt, gte, lt, lte, in, etc.)
- FilterBar component with add/remove/clear functionality
- Primitive filter input components for custom implementations
- Server-side Prisma where clause generation
- Client-side URL navigation and state updates
- Full TypeScript type safety

Components Added:
- FilterBar: Main filter UI with field/operator selection
- FilterInput components: TextFilterInput, NumberFilterInput, BooleanFilterInput, DateFilterInput, SelectFilterInput, RelationshipFilterInput

Utilities Added:
- parseFiltersFromURL: Parse filter state from URL search params
- serializeFiltersToURL: Serialize filters to URL string
- filtersToPrismaWhere: Convert filters to Prisma where clauses
- addFilter, removeFilter, clearFilters: Filter state management

Integration:
- ListView: Server-side filter parsing and Prisma query building
- ListViewClient: Client-side FilterBar integration
- AdminUI: Pass searchParams to ListView

All primitives and utilities are exported from @opensaas/stack-ui for developer customization.
@borisno2 borisno2 force-pushed the claude/admin-list-filtering-url-state-01Wj7FAfADcK36HD7sgkb8nP branch from 800961e to b9f0be6 Compare November 15, 2025 21:21
Fixed Next.js error 'Functions cannot be passed directly to Client Components'
by extracting only serializable field metadata instead of passing the entire
config object (which contains methods) to client components.

Changes:
- Created FilterableField type with serializable field data (name, type, options)
- Updated FilterBar to accept fields array instead of full config
- Updated ListView to extract and serialize field metadata
- Updated ListViewClient to pass serialized data to FilterBar
- Ensured all data crossing server/client boundary is JSON-serializable

This maintains the same functionality while respecting Next.js server/client
component boundaries.
Fixed blank filter dropdown by using proper Radix UI Select structure with
SelectTrigger, SelectContent, and SelectItem instead of HTML option tags.

Changes:
- Updated FilterBar to use SelectTrigger, SelectContent, SelectItem
- Updated FilterInput components to use proper Radix UI Select structure
- Imported missing Select subcomponents from primitives

The filter bar now displays properly with working dropdowns for field
and operator selection.
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.

3 participants