From 4b83966a243a09896efbfb9acc1687df6d9d55b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 05:05:34 +0000 Subject: [PATCH 1/4] Initial plan From 75bd20a79dc11b31538f2cdbca315966d60ba2dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 05:11:54 +0000 Subject: [PATCH 2/4] Add sorting functionality to GridView component with column header indicators Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- packages/ui/examples/airtable-example.tsx | 45 +++- packages/ui/src/components/grid/GridView.tsx | 203 ++++++++++++++++--- 2 files changed, 211 insertions(+), 37 deletions(-) diff --git a/packages/ui/examples/airtable-example.tsx b/packages/ui/examples/airtable-example.tsx index e45aa5fd..c350930c 100644 --- a/packages/ui/examples/airtable-example.tsx +++ b/packages/ui/examples/airtable-example.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { GridView } from "../components/grid/GridView" +import { GridView, SortConfig } from "../components/grid/GridView" import { Toolbar, ViewSwitcher, ToolbarIcons } from "../components/Toolbar" import { Button } from "../components/Button" import { Badge } from "../components/Badge" @@ -119,6 +119,7 @@ export function AirtableExample() { const [data, setData] = React.useState(sampleData) const [activeView, setActiveView] = React.useState('grid') const [showCreateModal, setShowCreateModal] = React.useState(false) + const [sorts, setSorts] = React.useState([]) const handleCellEdit = (rowIndex: number, columnId: string, value: any) => { const newData = [...data] @@ -141,6 +142,19 @@ export function AirtableExample() { setShowCreateModal(false) } + const handleSortChange = (newSorts: SortConfig[]) => { + setSorts(newSorts) + console.log('Sorts changed:', newSorts) + } + + const getSortDescription = () => { + if (sorts.length === 0) return 'No sorting applied' + return sorts.map((s, i) => { + const column = sampleColumns.find(c => c.id === s.columnId) + return `${i + 1}. ${column?.label} (${s.direction === 'asc' ? '↑' : '↓'})` + }).join(', ') + } + const views = [ { id: 'grid', label: 'Grid', icon: }, { id: 'list', label: 'List', icon: }, @@ -166,10 +180,11 @@ export function AirtableExample() {