Overview
ClipSync allows you to share files alongside text content. Files are uploaded to Supabase Storage and linked to your clipboard entries, making them accessible across all devices in your session.Supported File Types
ClipSync supports a wide range of file formats:- Images:
image/*(all image formats) - Documents:
- Microsoft Word:
application/msword - Microsoft Excel:
application/vnd.ms-excel - Microsoft PowerPoint:
application/vnd.ms-powerpoint - PDF:
application/pdf - Plain Text:
text/plain
- Microsoft Word:
src/App.jsx:540-547
File Size Limits
Files must be under 10MB to be uploaded:src/App.jsx:124-127
Image Compression
ClipSync automatically compresses images before uploading to save bandwidth and storage space.Compression Library
ClipSync uses thebrowser-image-compression library:
src/compressedFileUpload.jsx:1-17
Compression Settings
- Maximum file size: 0.2MB (200KB) after compression
- Maximum dimensions: 1920px (width or height)
- Web Worker: Enabled for better performance
Automatic Compression
Images are automatically compressed during upload:src/App.jsx:139-147
Compression is only applied to image files. Documents and other file types are uploaded as-is (within the 10MB limit).
Attaching Files vs Images
ClipSync provides two separate upload buttons for better organization:Attach File Button
For documents and general files:src/App.jsx:549-551
Attach Image Button
Specifically for image files:src/App.jsx:553-564
File Upload Process
The complete file upload flow:src/App.jsx:121-165
Key Features
- Random prefix: 3-character random string added to filename to prevent collisions
- Loading feedback: Toast notification shows upload progress
- Error handling: Comprehensive error messages for various failure scenarios
- Type tracking: Files tagged as “file” or “image” for proper display
Storage in Supabase
Files are stored in Supabase Storage under theclipboard bucket:
Storage Path
src/App.jsx:151
files/ directory with a 3-character random prefix.
Public URL Generation
src/App.jsx:156
File Metadata
File information is stored in the clipboard entry:src/App.jsx:179-184
File Preview
Attached files are shown before sending:src/App.jsx:589-602
Viewing Files in History
Files appear in clipboard history with appropriate icons and download links:src/App.jsx:659-674
Long filenames are automatically truncated for better display while preserving the file extension.
File Deletion
When you delete a clipboard entry with an attached file, the file is also removed from storage:src/App.jsx:230-234