Skip to content

Add advanced table features: grouping, bulk operations, copy/paste, drag-drop#16

Merged
hotlong merged 6 commits intomainfrom
copilot/add-table-grouping-inline-editing
Jan 9, 2026
Merged

Add advanced table features: grouping, bulk operations, copy/paste, drag-drop#16
hotlong merged 6 commits intomainfrom
copilot/add-table-grouping-inline-editing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 9, 2026

Implements 5 table component features: data grouping, inline editing enhancements, bulk operations with row selection, clipboard copy/paste, and column drag-drop reordering.

Changes

DataTable Component

  • Row Selection: Checkbox column with TanStack Table selection API
  • Grouping: Collapsible groups via getGroupedRowModel(), configurable by column
  • Bulk Actions: Toolbar showing selection count, copy/delete operations
  • Copy/Paste: TSV export to clipboard with fallback for non-HTTPS contexts

GridView Component

  • Row Selection: Checkbox state management with Set for O(1) lookups
  • Grouping: Client-side grouping with Map-based index optimization (O(n) vs O(n²))
  • Drag-Drop: Column reordering via HTML5 drag API with visual feedback
  • Bulk Actions: Same toolbar pattern as DataTable
  • Copy/Paste: TSV clipboard with error handling

Usage

// All features enabled
<GridView
  columns={columns}
  data={data}
  enableRowSelection={true}
  enableGrouping={true}
  groupByColumn="department"
  enableCopyPaste={true}
  enableColumnDragDrop={true}
  onBulkDelete={(rows) => deleteRows(rows)}
  onColumnReorder={(cols) => setColumns(cols)}
/>

API

GridView/DataTable Props

  • enableRowSelection: boolean - Adds checkbox column
  • enableGrouping: boolean - Groups by groupByColumn
  • enableCopyPaste: boolean - Adds copy button and TSV export
  • enableColumnDragDrop: boolean - Draggable column headers (GridView only)
  • onBulkDelete: (rows) => void - Bulk delete handler
  • onBulkUpdate: (rows, updates) => void - Bulk update handler (DataTable only)
  • onColumnReorder: (columns) => void - Column order handler (GridView only)

Implementation Notes

  • Clipboard operations use modern API with execCommand fallback
  • Grouped data rendering uses Map for O(1) index lookups instead of indexOf
  • All features opt-in, no breaking changes to existing usage
  • ~7KB gzipped addition to bundle size
Original prompt

表格组件实现以下功能

❌ Grouping(分组): 无法对数据进行分组展示
❌ Inline Editing: Grid 中直接编辑单元格
❌ Bulk Operations: 批量操作(批量删除、批量更新)
❌ Copy/Paste: 复制粘贴功能
❌ Drag & Drop:
字段拖拽排序


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 9, 2026 04:12
…te, and drag-drop

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ance, and remove type assertions

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add grouping, inline editing, and bulk operations to table component Add advanced table features: grouping, bulk operations, copy/paste, drag-drop Jan 9, 2026
Copilot AI requested a review from hotlong January 9, 2026 04:24
@hotlong hotlong marked this pull request as ready for review January 9, 2026 05:04
@hotlong hotlong merged commit 42da27b into main Jan 9, 2026
1 check passed
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.

2 participants