feat: Airtable-style ListView grid view optimization - #594
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- P0-1: Record count status bar at bottom of ListView - P0-2: "+ Add record" row in data-table (showAddRow prop) - P0-3: Compound cells with prefix badge configuration - P0-4: DateTime split display (date + muted time) - P0-5: Row style refinement (white bg, fine borders, light hover) - P1-6: Inline sort arrows (smaller, appears on hover) - P1-7: Column header type icons (text/number/date/boolean/user/select) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…tGrid, and DateTimeCellRenderer - ListView: record count bar visibility tests with data/no-data scenarios - DataTable: type-level test for showAddRow and onAddRecord schema properties - ObjectGrid: column header type icons, datetime inference, compound cell prefix badge, and add record row tests - DateTimeCellRenderer: split date/time rendering, null value, invalid date Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add ListView record count bar tests - Add data-table showAddRow/onAddRecord schema tests - Add ObjectGrid datetime inference, compound cell, type icons, add record tests - Add DateTimeCellRenderer unit tests - Update ROADMAP.md with new Airtable feature entries Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive Airtable-style visual and interaction improvements to the ListView grid view, bridging the gap between ObjectUI's data tables and Airtable's polished list view experience. The changes span across ListView, ObjectGrid, and data-table components to deliver a cohesive, production-ready grid interface.
Changes:
- Record count status bar — Shows
{n} recordsat the bottom of ListView when data is loaded, with proper singular/plural handling - "+ Add record" row — New
showAddRow/onAddRecordprops enable Airtable-style bottom row for creating records; ObjectGrid auto-enables whenoperations.createis truthy - Compound cells with prefix badges — New
ListColumn.prefixconfig (e.g.,{ field: 'category', type: 'badge' }) renders badge/text inline before main cell value - DateTime split display — Refactored
DateTimeCellRendererto visually separate date (2/18/2026) and time (12:57 amin muted text); auto-inferred for*_at/*_timefield patterns - Row styling refinement — Applied clean Airtable-style row appearance:
bg-background border-b border-border/50 hover:bg-muted/30 - Inline sort arrows — Reduced to
h-3, hidden until column hover (opacity-0 group-hover:opacity-50), coloredtext-primarywhen active - Column header type icons — ObjectGrid automatically adds type-appropriate icons (Type/Hash/Calendar/Clock/CheckSquare/User/Tag) to column headers via
headerIconprop
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/types/src/zod/objectql.zod.ts |
Added prefix property to ListColumnSchema for compound cell configuration |
packages/types/src/data-display.ts |
Added showAddRow and onAddRecord properties to DataTableSchema |
packages/plugin-list/src/ListView.tsx |
Implemented record count status bar at bottom, shown when data is loaded |
packages/plugin-grid/src/ObjectGrid.tsx |
Added column type icon mapping, datetime inference patterns, compound cell prefix rendering, and auto-enable add record row when operations.create is truthy |
packages/fields/src/index.tsx |
Refactored DateTimeCellRenderer to split date/time display with muted styling for time component |
packages/components/src/renderers/complex/data-table.tsx |
Implemented add record row, refined row styling, reduced sort arrow size with hover/active states, added headerIcon support in column headers |
packages/plugin-list/src/__tests__/ListView.test.tsx |
Added tests for record count bar visibility logic |
packages/plugin-grid/src/__tests__/airtable-style.test.tsx |
Added 9 tests covering datetime inference, column type icons, compound cells, and add record row |
packages/fields/src/__tests__/datetime-cell.test.tsx |
New test file with 3 tests for DateTimeCellRenderer edge cases |
packages/components/src/renderers/complex/__tests__/data-table.test.ts |
Added test verifying showAddRow/onAddRecord schema properties |
ROADMAP.md |
Marked 7 Airtable-style features as complete in P6.1 ObjectGrid section |
| prefix: z.object({ | ||
| field: z.string().describe('Field name to render as prefix'), | ||
| type: z.enum(['badge', 'text']).optional().describe('Renderer type for the prefix'), | ||
| }).optional().describe('Prefix configuration for compound cell rendering (Airtable-style)'), |
There was a problem hiding this comment.
The comment states "Mirrors @objectstack/spec/ui ListColumnSchema" but the new prefix property appears to be an ObjectUI-specific extension not in the upstream spec. Consider either: (1) verifying this property exists in the latest @objectstack/spec and updating the comment if needed, or (2) adding a note that clarifies this is an ObjectUI-specific extension (similar to how other parts of the codebase mark extensions with "NOTE: This is ObjectUI-specific and not part of @objectstack/spec").
Closes the visual/interaction gap between ObjectUI's grid view and Airtable's list view across ListView, ObjectGrid, and data-table.
P0 — Visual alignment
ListViewbottom bar shows{n} recordswhen data is loadedshowAddRow/onAddRecordprops onDataTableSchema; ObjectGrid auto-enables whenoperations.createis truthyListColumn.prefixconfig renders a badge/text prefix inline with the primary cell value:DateTimeCellRendererrenders date and time as visually separated spans (2/18/2026+ muted12:57 am); newdatetimeauto-inference for*_at/*_timefield patternsbg-background border-b border-border/50 hover:bg-muted/30on data rows for clean Airtable-like appearanceP1 — Polish
h-3, hidden until column hover,text-primarywhen active sortheaderIconper column mapped from inferred type (Type/Hash/Calendar/Clock/CheckSquare/User/Tag)Type changes
DataTableSchema: addedshowAddRow,onAddRecordListColumnSchema(Zod): added optionalprefix: { field, type? }for compound cell configObjectGridProps: addedonAddRecordcallbackTests
11 new tests covering record count bar, add record row, compound cells, datetime inference, column type icons, and DateTimeCellRenderer edge cases. 369 tests pass across 28 related test files.
Original prompt
This section details on the original issue you should resolve
<issue_title>参考 Airtable 优化 ListView 列表视图(Grid View)</issue_title>
<issue_description>##
参考 Airtable 客户列表页面,对 ObjectUI 的
ListView+ObjectGrid+data-table进行全面优化,使其在视觉和交互上达到 Airtable 同等水平。📊 当前现状分析
✅ 已实现功能
packages/plugin-list/src/ListView.tsxL634-888ListView.tsxL694-729ListView.tsxL742-777ListView.tsxL638-692ListView.tsxL850-887ListView.tsxL894-917ListView.tsxL790-800ListView.tsxL802-832data-table.tsxdata-table.tsxdata-table.tsxObjectGrid.tsxL745ObjectGrid.tsxL747ObjectGrid.tsxL978-998ObjectGrid.tsxL346-388ObjectGrid.tsxL370-379🔴 Gap 分析:与 Airtable 的差距
P0 — 必须实现(视觉对齐)
1. 记录数量底栏 📊
现状:无记录计数显示
Airtable:底部显示
15 records,选中时显示选中数量packages/plugin-list/src/ListView.tsxListView底部添加状态栏,显示{data.length} records{selectedCount} of {total} selected2. "+ Add record" 添加行 ➕
现状:无底部添加行入口
Airtable:表格最底行有
+ Add record可点击packages/plugin-grid/src/ObjectGrid.tsx+packages/components/src/renderers/complex/data-table.tsxdata-table新增showAddRowprop,当operations.create启用时渲染onAddRecord回调或打开 NavigationOverlay 的创建表单3. 首列复合单元格(Badge + 文本)🏷️
现状:Badge 字段和 Name 字段分别在各自列中独立渲染
Airtable:第一列同一个单元格内
[Enterprise Badge] Acme Corppackages/types/src/views.ts(ListColumn 类型) +packages/plugin-grid/src/ObjectGrid.tsxListColumn新增prefix配置:generateColumns()中检测prefix配置并合成 compound cell renderer4. 日期时间分离显示 🕐
现状:日期字段使用
formatDate()统一格式化Airtable:
Created Time列显示2/18/2026 12:57am(日期和时间视觉分离)packages/fields/src/(新增 datetime cell renderer)datetime类型的 cell renderer:ObjectGrid.inferColumnType()中添加created_time/created_at等模式匹配5. 行样式精细化 🎨
现状:可能有条纹背景(zebra striping),hover 效果较重
Airtable:纯白背景 + 细
border-b分隔 + 极轻 hoverpackages/components/src/renderers/complex/data-table.tsxhover:bg-muted/30替换为更轻的 hoverborder-b border-border/50分隔线P1 — 锦上添花
6. 排序箭头内联到列标题 ⬆️
现状:使用
ChevronsUpDown图标按钮Airtable:标题文本后直接跟随小
↑/↓packages/components/src/renderers/complex/data-table.tsx7. 列标题类型图标 🔤
现状:列标题只有文本
Airtable:列标题前显示字段类型图标(如
Aᵢ= 文本,#= 数字,📅= 日期)packages/plugin-grid/src/ObjectGrid.tsx8. 侧边栏视图导航 📋
现状:视图切换在工具栏顶部
Airtable:左侧边栏列出"客户互动日历"、"客户列表页面"等视图
packages/plugin-list/src/ListView.tsx🔗 涉及文件
packages/plugin-list/src/ListView.tsxpackages/plugin-grid/src/ObjectGrid.tsxpackages/components/src/renderers/complex/data-table.tsxpackages/types/src/views.tspackages/fields/src/packages/plugin-list/src/__tests__/ListView.test.tsxpackages/plugin-grid/src/__tests__/packages/components/src/renderers/complex/__tests__/packages/components/src/stories-json/list-view.stories.tsx✅ 完成标准
{n} records显示正常pnpm test全部通过ROADMAP.md相关条目enhancementComments on the Issue (you are @copilot in this section)
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.