Add Google Photos integration for importing photos#31
Open
Conversation
Add the ability to browse and import photos from Google Photos directly into the photobook. Uses Google Identity Services for OAuth2 and the Photos Library API for browsing albums and downloading photos. New files: - googlePhotosApi.ts: Auth layer (dynamic GIS loading, token management), API calls (albums, media items), and photo blob download - GooglePhotosPicker.tsx: Custom picker UI with album browsing, photo grid with multi-select, import progress, and client ID setup flow Modified files: - PhotoPicker.tsx: Added "Import from Google Photos" button that toggles to the Google Photos picker view - useBookState.tsx: Added addPhotoFromBlob() for importing downloaded blobs without needing a File object https://claude.ai/code/session_011atU8xw1b7RJTCgYdVBdf1
The Client ID setup screen now shows a numbered guide walking through creating a Google Cloud project, enabling the Photos Library API, creating OAuth credentials, and adding the correct JavaScript origin. https://claude.ai/code/session_011atU8xw1b7RJTCgYdVBdf1
|
Preview deploy is ready! https://toys-pr-31.somehats.workers.dev Built from e85ee1f |
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
This PR adds Google Photos integration to the photobook application, allowing users to browse and import photos directly from their Google Photos library without uploading files manually.
Key Changes
New Google Photos API module (
googlePhotosApi.ts): Implements OAuth2 authentication using Google Identity Services (GIS) and integrates with the Google Photos Library API for:New Google Photos Picker component (
GooglePhotosPicker.tsx): Multi-step UI for Google Photos integration:Enhanced PhotoPicker component: Integrated Google Photos picker alongside existing file upload:
handleGoogleImportcallback to process imported photosExtended useBookState hook: Added
addPhotoFromBlobmethod to support importing photos from blob data (in addition to File objects), enabling flexible photo source handlingMinor import reorganization: Alphabetized imports across multiple files for consistency
Implementation Details
https://claude.ai/code/session_011atU8xw1b7RJTCgYdVBdf1