feat(ui): add Airtable-like view customization schemas#616
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add RowHeight, GroupingConfig, GalleryConfig, TimelineConfig, ViewSharing, RowColorConfig, ColumnSummary schemas. Add pinned/summary to ListColumnSchema. Add description, sharing, rowHeight, grouping, rowColor, hiddenFields, fieldOrder to ListViewSchema. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the UI view protocol (packages/spec/src/ui) to support Airtable-like list view customization, adding new Zod schemas for view metadata and per-view presentation controls and updating existing list view/column schemas accordingly.
Changes:
- Added new schemas for column summaries, row density, grouping, gallery/timeline configs, view sharing, and row coloring.
- Enhanced
ListColumnSchema(pinning + footer summaries) andListViewSchema(description/sharing + per-view field visibility/order + grouping/rowHeight/rowColor + gallery/timeline configs). - Added/extended Vitest coverage for the new/updated schemas.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/spec/src/ui/view.zod.ts | Introduces new Airtable-like customization schemas and extends ListViewSchema/ListColumnSchema with new optional configuration fields. |
| packages/spec/src/ui/view.test.ts | Adds tests covering new schemas and the new list view/column configuration options. |
| * Supports multi-level grouping for grid/gallery views. | ||
| */ | ||
| export const GroupingConfigSchema = z.object({ | ||
| fields: z.array(GroupingFieldSchema).min(1).describe('Fields to group by (supports up to 3 levels)'), |
There was a problem hiding this comment.
GroupingConfigSchema claims grouping "supports up to 3 levels", but the schema only enforces min(1) and will accept any number of grouping fields. Either enforce the stated limit with a .max(3) (or similar constraint), or update the description to avoid promising a limit that isn’t validated.
| fields: z.array(GroupingFieldSchema).min(1).describe('Fields to group by (supports up to 3 levels)'), | |
| fields: z.array(GroupingFieldSchema).min(1).describe('Fields to group by (supports multi-level grouping)'), |
The existing
ListViewSchemalacked several primitives needed for Airtable-style view customization — per-view field visibility/ordering, record grouping, row density, column pinning/summaries, gallery/timeline configs, and view sharing semantics.New schemas
RowHeightSchema—compact | short | medium | tall | extra_tallGroupingConfigSchema— Multi-level record grouping with per-level sort order and collapse stateGalleryConfigSchema— Cover image field, fit mode, card size, title/visible fieldsTimelineConfigSchema— Start/end date fields, group-by, color field, time scaleViewSharingSchema—personal | collaborativeownership with optional lockRowColorConfigSchema— Color rows by field value with explicit color mapColumnSummarySchema— Footer aggregation:count | sum | avg | min | max | count_unique | percent_empty | percent_filled | …Enhanced existing schemas
ListColumnSchema— Addedpinned: 'left' | 'right'(frozen columns) andsummary(footer aggregation)ListViewSchema— Addeddescription,sharing,rowHeight,grouping,rowColor,hiddenFields,fieldOrder,gallery,timelineExample
37 new tests added (124 total view tests).
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.