You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(expo): pick attachments from Photos / Files / Clipboard
Replaces the single document-picker entry point with an action-sheet
style modal so users can choose: Photos library (expo-image-picker),
Files (expo-document-picker, the existing path), or Paste from
Clipboard (expo-clipboard + expo-file-system to write base64 to cache
dir, then file:// URI through the same RN-FormData shorthand the other
pickers use).
Two crash fixes in the same change:
- sheet.tsx was synthesising File objects via
`new File([new Uint8Array(0)], …)` to satisfy validateAttachments'
File[] signature. RN's BlobManager rejects ArrayBuffer/ArrayBufferView
parts at runtime, so this threw "Creating blobs from 'ArrayBuffer'
and 'ArrayBufferView' are not supported". Modern TypeScript also
rejects Uint8Array<ArrayBufferLike> as a BlobPart. Both paths fixed
by widening validateAttachments to accept an AttachmentCandidate
shape ({name, size, type, blob?}) and passing duck-typed records on
the Expo side. File still satisfies the candidate type on the web.
- pickFromClipboard previously did `new Blob([uint8array])` which hits
the same RN issue. Now writes base64 to expo-file-system.cacheDirectory
and passes the file:// URI as previewUrl, matching pickFromFiles /
pickFromPhotos. The Attachment.blob field is a placeholder; the
intake-client ships from the URI.
Renames `pickFiles` → `pickFromFiles` for symmetry with `pickFromPhotos`
and `pickFromClipboard`. Tests follow the rename.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments