Google Drive integration + GitHub lastModifiedUtc back-fill#1478
Open
pablo-mayrgundter wants to merge 11 commits intobldrs-ai:mainfrom
Open
Google Drive integration + GitHub lastModifiedUtc back-fill#1478pablo-mayrgundter wants to merge 11 commits intobldrs-ai:mainfrom
pablo-mayrgundter wants to merge 11 commits intobldrs-ai:mainfrom
Conversation
Introduces an extensible two-level architecture for connecting external storage providers: - Connections: auth-level bindings (Google account, GitHub account, etc.) - Sources: specific browsable storage locations (Drive folders, repos) Google Drive is the first fully implemented provider using Google Identity Services (GIS) for OAuth and the native Google Picker API for file/folder selection. Files download via OAuth-authenticated Drive API and load through the existing OPFS/uploaded-file pipeline. New "Sources" tab in the Open dialog lets users connect Google Drive, add folder sources, browse files, and open BIM/CAD models directly. Framework is designed for future providers (OneDrive, Dropbox, GitHub migration, enterprise storage) via ConnectionProvider and SourceBrowser interfaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds the two new environment variables needed for Google Drive OAuth and Picker API alongside the existing GOOGLE_API_KEY in the esbuild vars config chain (prod → cypress → dev). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The parseFloat branch in parse() was converting values like "123456-abc.apps.googleusercontent.com" to the number 123456, discarding the rest of the string. This broke GOOGLE_OAUTH2_CLIENT_ID. Added a full-string equality check (matching the parseInt branch's pattern) so parseFloat only applies when the entire string is numeric. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GIS fires error_callback with popup_closed while the user is still completing authentication on some browsers. This was rejecting the promise and showing an error before auth could complete. Now popup_closed is ignored — real auth failures come through the main callback with response.error instead. Also added settled guards to prevent double-resolve/reject of the promise. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add console logging to GoogleDriveProvider for debugging auth flow - Handle fetchUserEmail failure gracefully (still resolves connection) - Wait 1s after popup_closed before rejecting (GIS timing issue) - Update proxy.js cert paths for local HTTPS dev server - Fix .gitignore typo: *.pen → *.pem - Version bump to 1.0.1900 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents infinite spinner if GIS callback never fires by adding a 120s overall timeout, 5s email-fetch timeout, and centralized settle helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
UI changes: - URL paste section removed; Browse button moved below recent files, right-aligned - Account title uses subtitle1/bold, left-aligned - Dates older than 5 days display as locale date with year Lint fixes (pre-existing): - Extract magic numbers to named constants in GoogleDriveProvider/PickerDialog - Replace console.log with debug() in GoogleDriveProvider - Add JSDoc to registry, loadGisScript, generateId - Remove async from checkStatus and pickLocation (no await needed) - Fix empty revoke callback and stale eslint-disable directives Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- OPFS.worker.js: fetchLatestCommitHash now returns {hash, date}; the
commit date is stored as LastModifiedGithub header in the HTTP cache
and included in all completed postMessage events
- utils.js: downloadModel accepts an onLastModifiedGithub callback that
fires whenever any completed message carries the date (handles both
immediate 'exists' and deferred 'renamed' events after Promise resolves)
- Loader.js: passes callback to downloadModel; constructs sharePath via
navigateBaseOnModelPath and calls updateRecentFileLastModified
- persistence.ts: adds updateRecentFileLastModified and
updateRecentFileModelTitle helpers
- Share.jsx: mounts useGithubLastModified hook as a non-OPFS fallback
- connections/useGithubLastModified.js: new hook; fixes missing leading
slash bug (filepath from routes layer has no leading slash — must
prepend '/' before passing to navigateBaseOnModelPath)
- Tests: OPFS.worker.test.js (fetchLatestCommitHash), utils.test.js
(onLastModifiedGithub callback cases), Loader.github.test.js
(end-to-end sharePath + updateRecentFileLastModified),
persistence.test.ts (updateRecentFileLastModified contract)
- Fix pre-existing test failures: GitHubFileBrowser.test (add theme
wrapper), OpenModelControl.test (update for new tab/UI structure)
- Docs: DESIGN.md and PLAYBOOK.md updated with OPFS architecture,
recent-files pipeline, filepath format contract, and testing patterns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for bldrs-share-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Pablo Mayrgundter <pablo.mayrgundter@gmail.com>
|
Approve |
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
SourcesTabandConnectProviderButtonarchitecture for pluggable file sources; Google Drive provider with OAuth popup flow and file pickerAccountFootercomponent for connected account displaylastModifiedUtcback-fill: Two-path approach to populate the last-modified date in recent file entries:fetchLatestCommitHashnow returns{hash, date}; date stored asLastModifiedGithubheader in HTTP cache and forwarded via workerpostMessage;Loader.jscallback writes topersistence.tsuseGithubLastModified): Direct commits API call inShare.jsxfor non-OPFS browsersuseGithubLastModifiedwas passingmodelPath.filepath(no leading slash) directly tonavigateBaseOnModelPath, producing a malformed ID that never matched any stored entry — silently a no-opTest plan
lastModifiedUtcis populated in the recent files list on next visityarn testpasses (was previously failing onGitHubFileBrowser.testandOpenModelControl.testdue to pre-existing UI changes — both fixed in this PR)yarn lintpasses🤖 Generated with Claude Code