Drive#583
Merged
Merged
Conversation
…n grant Drive/Docs scopes
BYOK never requested access_type=offline/prompt=consent so no refresh token was issued and tokens died after ~1h; also stop handing back expired tokens and extend the connect timeout to 10m.
Runs the Picker in the user's real browser (it 403s inside Electron), sets appId so the drive.file grant attaches to the picked file, and downloads + opens the selected doc.
#620) * feat(google-docs): managed OAuth-redirect Picker (no API key, no BYOK) Adds the managed (rowboat-mode) Google Docs picker via Google's trigger_onepick flow. The Rowboat backend runs a standalone drive.file OAuth with the company client, renders the Picker inside the browser consent screen, and deep-links the selection back; the desktop downloads the picked doc with the fresh drive.file token the backend returns. No Picker API key, appId, or BYOK credentials on the desktop. - core: importGoogleDocWithToken downloads a picked doc with an explicit token; fetch/metadata helpers take an optional Drive client and share writeDocxAndLink. claimPickedFilesViaBackend claims the parked file ids + token from the api. - main: google-picker-managed.ts opens the backend start URL and resolves on the rowboat://oauth/google/picker/done deep link; deeplink.ts routes that completion. - ipc: google-docs:pickViaManaged. - renderer: the picker dialog gates on Rowboat sign-in (the picker grants drive.file per-file, so no pre-existing connection or scope is required). Backend contract: rowboatlabs/rowboatx-backend#7 (GET /oauth/google/picker/{start,callback}, POST /v1/google-oauth/claim-picked). * chore(google-docs): remove the dead API-key/system-browser Picker The managed picker replaced the only consumer (the picker dialog), so the experimental API-key Picker is now unused. Removes: - main: google-docs:openPicker handler (system-browser loopback Picker) - shared: google-docs:openPicker + google-docs:getAccessToken IPC schemas - core: getGoogleAccessToken (token plumbing for the client-side Picker) - renderer: lib/google-picker.ts (Picker JS SDK loader) Kept GoogleClientIdModal / google-credentials-store — still used by the general BYOK Google connect in onboarding, connectors, and settings.
Resolve conflicts: - apps/main/src/ipc.ts: import union (dev's gmail contacts/getAccountName + drive's google_docs/managed-picker imports). - apps/renderer/src/App.tsx: import union (dev's CodingRunBlock/KnowledgeViewMode + drive's GoogleDocPickerDialog). - apps/renderer/src/components/knowledge-view.tsx: keep the "Add Google Doc" button in the header next to the voice-note action; Search/Graph/New note are now dev's QuickActions / view-mode toggles.
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.
What
Connect a Google Doc (or an uploaded
.docx) in Drive to a local.docxin Knowledge, edit it with the in-app docx editor (#589), and sync both ways.Flow
.docxfiles across My Drive + shared drives..docxinto the folder (native Docs are exported to.docx; uploaded.docxfiles are downloaded as-is) and opens in the docx editor..docxback into the same Drive file (in place, id/URL preserved); sync down re-pulls it.Storage
.docx(full fidelity: tables, images, formatting).knowledge/.assets/google-docs/links.json(a.docxcan't carry frontmatter).Auth / scopes
https://www.googleapis.com/auth/drive(sync-up writes, whichdrive.readonlycan't do).Notes / follow-ups
driveis a restricted Google scope → the managed app would need OAuth verification, or a switch to Google Picker +drive.fileto avoid it.App.tsx/editor-toolbar.tsxcan be cleaned up.