feat(web): FileDropZone component with upload progress #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The CreateItemPane redesign needs drag-and-drop file upload with progress tracking. Files are uploaded directly to MinIO via presigned URLs (see #12 for backend).
This component can be built and tested with mock upload functions before the backend is ready.
Component:
FileDropZoneFile:
web/src/components/items/FileDropZone.tsxProps
Drop Zone UI
--ctp-surface1,border-radius: 0.5rem--ctp-overlay0at 0.75rem--ctp-surface1border--ctp-mauveborder,rgba(203,166,247,0.05)bg<input type='file' multiple>File List
Each file shows:
.FCStd/.step/.stl-> blue ('CAD'),.pdf-> red ('PDF'),.png/.jpg-> green ('IMG'), other -> overlay1 ('FILE')--ctp-overlay0--ctp-mauvefill) when uploading--ctp-overlay0->--ctp-redHook:
useFileUploadFile:
web/src/hooks/useFileUpload.tsUpload flow:
POST /api/uploads/presignwith{ filename, content_type, size }{ object_key, upload_url, expires_at }PUTfile to presigned URL via XMLHttpRequest (for progress events)Dependencies
Acceptance Criteria