Skip to content

feat(data-grid): add external file upload/delete callbacks - #1034

Merged
sadmann7 merged 4 commits into
mainfrom
add-drop
Nov 24, 2025
Merged

sadmann7 merged 4 commits into
mainfrom
add-drop

Conversation

@sadmann7

Copy link
Copy Markdown
Owner

No description provided.

- Add onFilesUpload and onFilesDelete callbacks to useDataGrid hook
- Support batched file operations with object parameters
- Update FileCell to use external callbacks when provided
- Add demo implementation showing API integration pattern
- Maintain backward compatibility with fallback to local URLs
Copilot AI review requested due to automatic review settings November 24, 2025 12:29
@vercel

vercel Bot commented Nov 24, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
shadcn-table Ready Ready Preview Comment Nov 24, 2025 0:40am
tablecn Ready Ready Preview Comment Nov 24, 2025 0:40am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds external file upload and delete callback support to the data-grid component, enabling consumers to implement custom file handling logic (e.g., uploading to a server or cloud storage) instead of relying on local blob URLs.

Key Changes

  • Added onFilesUpload and onFilesDelete callback props to useDataGrid hook
  • Modified FileCell component to call external callbacks when provided, falling back to local behavior
  • Removed explanatory comments from FileCell implementation
  • Updated parameter naming from props to params for onDataUpdate

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types/data-grid.ts Added type definitions for file upload/delete callbacks and renamed onDataUpdate parameter
src/hooks/use-data-grid.tsx Threaded new callbacks through the hook to table meta
src/components/data-grid/data-grid-demo.tsx Added example implementations showing API integration patterns
src/components/data-grid/data-grid-cell-variants.tsx Integrated callbacks into FileCell, refactored drag-and-drop handlers, removed comments
public/r/data-grid.json Updated registry content with new implementations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/data-grid/data-grid-cell-variants.tsx Outdated
All file addition methods (cell drop, dropzone drop, file input) should use skipUpload=false to properly trigger the external upload callback and show loading states.
@sadmann7
sadmann7 merged commit 93bf906 into main Nov 24, 2025
5 of 7 checks passed
@sadmann7
sadmann7 deleted the add-drop branch November 24, 2025 12:40
noodleman1991 pushed a commit to noodleman1991/tablecn that referenced this pull request Mar 12, 2026
…1034)

* feat: add external file upload/delete callbacks to data grid

- Add onFilesUpload and onFilesDelete callbacks to useDataGrid hook
- Support batched file operations with object parameters
- Update FileCell to use external callbacks when provided
- Add demo implementation showing API integration pattern
- Maintain backward compatibility with fallback to local URLs

* chore: rebuild registry

* fix: ensure all file additions trigger upload callback

All file addition methods (cell drop, dropzone drop, file input) should use skipUpload=false to properly trigger the external upload callback and show loading states.

* chore: remove logs
anhdd-kuro pushed a commit to anhdd-kuro/tablecn that referenced this pull request Apr 8, 2026
…1034)

* feat: add external file upload/delete callbacks to data grid

- Add onFilesUpload and onFilesDelete callbacks to useDataGrid hook
- Support batched file operations with object parameters
- Update FileCell to use external callbacks when provided
- Add demo implementation showing API integration pattern
- Maintain backward compatibility with fallback to local URLs

* chore: rebuild registry

* fix: ensure all file additions trigger upload callback

All file addition methods (cell drop, dropzone drop, file input) should use skipUpload=false to properly trigger the external upload callback and show loading states.

* chore: remove logs

This branch was successfully deployed

2 active deployments
Preview – tablecn — 475fba87 Deployed Nov 24, 2025 by vercel[bot]
Preview – shadcn-table — 475fba87 Deployed Nov 24, 2025 by vercel[bot]
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