Add photos to elements#30
Merged
Merged
Conversation
Lets users attach photos to an element from the edit screen. Photos are picked from the device library, downsampled on-device to stay under the server's 5 MB cap (re-encoded to JPEG via a dimension/quality loop), then run through the three-step upload: signed URL -> PUT to S3 -> createPhoto. The resulting ids are sent as the element's complete photoIds set on save, so the same flow handles adding, removing, and reordering. Regenerates GraphQL types against the current schema, which also picks up the createS3Photo/createUnsplashPhoto -> createPhoto consolidation that had drifted out of the committed types. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
photoIdsset on save, so the one flow covers add/remove/reorder.src/photos/photoUpload.ts(usePhotoUploader):createUploadUrl→PUTbytes to S3 →createPhoto({type: S3, storageKey}).react-native-image-picker+@bam.tech/react-native-image-resizer(both autolink for Android) and mocks them injest.setup.js.createS3Photo/createUnsplashPhoto→createPhotoconsolidation that had drifted out of the committed types.Notes
bun run android) since native modules were added; library selection uses the Android system photo picker, so no new manifest permissions.Content-Typeis set toimage/jpeg; adjust inputToSignedUrlif the server's presigned PUT binds a different content type.Photorecord is created at pick-time, so uploading then cancelling the edit without saving leaves an unattached photo server-side (harmless orphan).🤖 Generated with Claude Code