Add Google Drive file loading functionality #427
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
Implements the ability to load Scratch 3.0 projects (.sb3) directly from
Google Drive, addressing issue #426.
Key Features
user first clicks "Load from Google Drive", improving initial page load
performance
Services
Implementation Details
New Files
src/lib/google-script-loader.jssrc/lib/google-drive-api.jssrc/containers/google-drive-loader.jsxdocs/google-drive-setup.md.env.examplecspell.jsonModified Files
src/components/menu-bar/menu-bar.jsx.gitignore.envto prevent accidental commits of sensitive credentialsConfiguration
Environment Variables
Two environment variables are required:
GOOGLE_CLIENT_ID: OAuth 2.0 Client ID from Google Cloud ConsoleGOOGLE_API_KEY: API Key for Google Picker APISetup Instructions
See
docs/google-drive-setup.mdfor detailed setup instructions including:Technical Approach
Why Dynamic Script Loading?
Instead of including Google API scripts in
index.html, we use dynamicloading because:
loading unnecessary scripts
by the user
initial bundle size
Error Handling
Testing
Manual Testing Steps
npm run buildLint and Build
npm run test:lintnpm run buildBreaking Changes
None. This is a new feature that doesn't affect existing functionality.
Future Enhancements
Possible improvements for future PRs:
Related Issues
Closes #426
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com