Skip to content

Feat/sync ogs desktop google picker desktop web ext#1586

Open
paustint wants to merge 4 commits intomainfrom
feat/sync-ogs-desktop-google-picker-desktop-web-ext
Open

Feat/sync ogs desktop google picker desktop web ext#1586
paustint wants to merge 4 commits intomainfrom
feat/sync-ogs-desktop-google-picker-desktop-web-ext

Conversation

@paustint
Copy link
Copy Markdown
Contributor

  • Added useDriveExternalPicker hook to manage Google Drive file selection via external flows (desktop and browser extension).
  • Introduced GoogleFileSelectorExternalButton and GoogleFolderSelectorExternalButton components for selecting files and folders from Google Drive.
  • Updated existing file download modals to support external Google Drive integration.
  • Enhanced Google sign-in components to handle external authentication flows.
  • Modified type definitions to accommodate new Google Drive integration features.

Copilot AI review requested due to automatic review settings March 15, 2026 19:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an external Google Drive auth/picker flow that works in Desktop (Electron IPC + deep link) and the Web Extension (popup + postMessage), and wires it into existing file load/download + background upload flows. Also introduces desktop↔web org sync behavior and aligns route typing via RouteValidator.

Changes:

  • Introduce useDriveExternalPicker + module-level external Google token storage, plus UI components to authorize/select files/folders via the external flow.
  • Update load/download modals and Jobs upload-to-Google logic to work with external tokens on Desktop/Extension (without gapi).
  • Add API endpoints + extension/desktop plumbing for fetching Google config, and add desktop org sync merge + tests; standardize route validators typing with RouteValidator.

Reviewed changes

Copilot reviewed 76 out of 76 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
libs/ui/src/lib/google/GoogleSignInExternal.tsx New external sign-in wrapper for desktop/extension picker auth flow.
libs/ui/src/lib/google/GoogleSignIn.tsx Adjust Google sign-in UI/error rendering.
libs/ui/src/lib/form/file-selector/GoogleFolderSelectorExternalButton.tsx New external Google Drive folder selector button.
libs/ui/src/lib/form/file-selector/GoogleFileSelectorExternalButton.tsx New external Google Drive file selector + download/parse Sheets.
libs/ui/src/lib/form/file-selector/FileOrGoogleSelector.tsx Add external Google Drive tab path using external selector.
libs/ui/src/lib/file-download-modal/options/FileDownloadGoogle.tsx Split web vs external (desktop/extension) Google download option.
libs/ui/src/lib/file-download-modal/RecordDownloadModal.tsx Enable Google option on desktop/extension.
libs/ui/src/lib/file-download-modal/FileFauxDownloadModal.tsx Enable Google option on desktop/extension; loosen key requirements.
libs/ui/src/lib/file-download-modal/FileDownloadModal.tsx Enable Google option on desktop/extension; loosen key requirements.
libs/types/src/lib/types.ts Add SalesforceOrgUi.source and OrgsWithGroupResponse type.
libs/shared/ui-utils/src/lib/hooks/useDriveExternalPicker.ts New hook bridging external picker results into React state.
libs/shared/ui-utils/src/lib/google-access-token.ts Module-level external Google token store + validity checks.
libs/shared/ui-utils/src/index.ts Export new external picker/token utilities.
libs/shared/ui-core/src/mass-update-records/MassUpdateRecordsObjectRow.tsx Add “Download Records” + FileDownloadModal for validation records.
libs/shared/ui-core/src/jobs/Jobs.tsx Use external token store on desktop/extension for Google uploads.
libs/shared/ui-app-state/src/lib/ui-app-state.ts Change default entitlements + simplify Google Drive access state derivation.
libs/features/org-groups/src/lib/SalesforceOrgCardConnectionRefresh.tsx Include connection error details in tooltip logic.
libs/features/load-records/src/steps/SelectObjectAndFile.tsx Enable external Google Drive selector for desktop/extension.
libs/features/load-records-multi-object/src/LoadRecordsMultiObject.tsx Enable external Google Drive selector for desktop/extension; tweak button label.
libs/desktop-types/src/lib/desktop-app.types.ts Add Google picker IPC channel/types; extend org persistence schema.
apps/landing/pages/web-extension/google-picker/index.tsx New web-extension picker landing page UI.
apps/landing/pages/desktop-app/google-picker/index.tsx New desktop picker landing page UI.
apps/landing/hooks/web-extension-google-picker.hooks.ts Web-extension picker state machine + postMessage return path.
apps/landing/hooks/google-picker-shared.ts Shared picker auth/picker flow utilities.
apps/landing/hooks/desktop-google-picker.hooks.ts Desktop picker state machine + deep link return path.
apps/jetstream-web-extension/src/utils/extension.types.ts Add GET_GOOGLE_CONFIG message type.
apps/jetstream-web-extension/src/extension-scripts/service-worker.ts Implement GET_GOOGLE_CONFIG fetching from API.
apps/jetstream-web-extension/src/core/AppInitializer.tsx Initialize appInfo with extension environment serverUrl/version.
apps/jetstream-web-extension/src/controllers/user.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/sf-record.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/sf-query.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/sf-misc.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/sf-metadata-tooling.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/sf-bulk-query-20-api.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/sf-bulk-api.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-web-extension/src/controllers/route.utils.ts Add RouteValidator alias export.
apps/jetstream-web-extension/src/controllers/jetstream-data-sync.web-ext.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/utils/utils.ts Allow googleapis in desktop CSP connect-src.
apps/jetstream-desktop/src/utils/route.utils.ts Add RouteValidator alias + shared getTokens() helper.
apps/jetstream-desktop/src/services/persistence.service.ts Add org sync merge logic + ignore list persistence; add org source handling.
apps/jetstream-desktop/src/services/ipc.service.ts Add IPC handler to open external Google picker + return results via IPC event.
apps/jetstream-desktop/src/services/api.service.ts Add desktop API call to fetch Google config.
apps/jetstream-desktop/src/services/tests/persistence.service.spec.ts Add tests for persistence + org merge/sync behaviors.
apps/jetstream-desktop/src/preload.ts Expose openGooglePicker + onGooglePickerResult via preload API.
apps/jetstream-desktop/src/controllers/user.desktop.controller.ts Use shared getTokens(); apply RouteValidator typing.
apps/jetstream-desktop/src/controllers/sf-record.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/sf-query.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/sf-misc.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/sf-metadata-tooling.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/sf-bulk-query-20-api.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/sf-bulk-api.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/orgs.desktop.controller.ts Fetch orgs from web API and merge into desktop persistence.
apps/jetstream-desktop/src/controllers/jetstream-orgs.desktop.controller.ts Apply RouteValidator typing to validators.
apps/jetstream-desktop/src/controllers/jetstream-data-sync.desktop.controller.ts Use shared getTokens(); apply RouteValidator typing.
apps/api/src/app/utils/route.utils.ts Export RouteValidator alias.
apps/api/src/app/routes/web-extension-server.routes.ts Extend CSP for Google picker + add /google-config route.
apps/api/src/app/routes/desktop-app.routes.ts Extend CSP for Google picker + add /orgs and /google-config routes.
apps/api/src/app/controllers/web-extension.controller.ts Add googleConfig endpoint + apply RouteValidator typing.
apps/api/src/app/controllers/user.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/team.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/sf-record.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/sf-query.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/sf-misc.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/sf-metadata-tooling.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/sf-bulk-query-20-api.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/sf-bulk-api.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/salesforce-api-requests.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/orgs.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/org-groups.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/oauth.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/desktop-assets.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/desktop-app.controller.ts Add /orgs + googleConfig endpoints; apply RouteValidator typing.
apps/api/src/app/controllers/data-sync.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/billing.controller.ts Apply RouteValidator typing to validators.
apps/api/src/app/controllers/auth.controller.ts Apply RouteValidator typing to validators.
.claude/settings.local.json Expand allowed command patterns for local Claude config.
Comments suppressed due to low confidence (1)

libs/shared/ui-app-state/src/lib/ui-app-state.ts:55

  • Setting DEFAULT_PROFILE.entitlements.googleDrive to true can transiently grant access:GoogleDrive ability on initial render (before the real profile loads) in non-extension contexts, because abilities are derived from user.entitlements.googleDrive. Consider keeping the default entitlement false and only enabling Google Drive for the browser extension path in fetchUserProfile() (or otherwise make the default profile environment-specific).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@paustint paustint force-pushed the feat/sync-ogs-desktop-google-picker-desktop-web-ext branch from 4992602 to dc7977b Compare March 16, 2026 01:21
@paustint paustint requested a review from Copilot March 16, 2026 01:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an “external” Google Drive auth/picker flow (desktop via Electron IPC + deep link, browser extension via popup + postMessage) and wires it into existing upload/download workflows so Drive integration works without relying on gapi inside the desktop/extension runtimes.

Changes:

  • Introduces useDriveExternalPicker + a module-level external Google access token store, and updates Jobs uploads to use either external token or gapi token.
  • Adds new UI components for external Google auth and file/folder selection, and updates download/upload modals & selectors to use them on desktop/extension.
  • Extends desktop + web-extension backends/types/routes to support fetching Google config and syncing orgs/groups into desktop persistence.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
libs/ui/src/lib/google/GoogleSignInExternal.tsx New wrapper component to authorize/sign out using the external picker flow.
libs/ui/src/lib/google/GoogleSignIn.tsx Tweaks the web sign-in UI markup/error rendering.
libs/ui/src/lib/form/file-selector/GoogleFolderSelectorExternalButton.tsx New external folder picker button backed by useDriveExternalPicker.
libs/ui/src/lib/form/file-selector/GoogleFileSelectorExternalButton.tsx New external file picker + Drive download + XLSX parse pipeline.
libs/ui/src/lib/form/file-selector/FileOrGoogleSelector.tsx Adds a flag to switch Google tab to the external picker on desktop/extension.
libs/ui/src/lib/file-download-modal/options/FileDownloadGoogle.tsx Splits Drive folder selection into external vs web implementations.
libs/ui/src/lib/file-download-modal/RecordDownloadModal.tsx Enables Drive option on desktop/extension regardless of web gapi config.
libs/ui/src/lib/file-download-modal/FileFauxDownloadModal.tsx Enables Drive option on desktop/extension and normalizes google config props.
libs/ui/src/lib/file-download-modal/FileDownloadModal.tsx Enables Drive option on desktop/extension and normalizes google config props.
libs/types/src/lib/types.ts Adds org source and OrgsWithGroupResponse type used by desktop sync.
libs/shared/ui-utils/src/lib/hooks/useDriveExternalPicker.ts New hook bridging IPC/postMessage picker results into React state.
libs/shared/ui-utils/src/lib/google-access-token.ts New module-level token store for external Drive access tokens.
libs/shared/ui-utils/src/index.ts Exports the new token store and hook.
libs/shared/ui-core/src/mass-update-records/MassUpdateRecordsObjectRow.tsx Adds “Download Records” (validation records) via FileDownloadModal.
libs/shared/ui-core/src/jobs/Jobs.tsx Uses external token (desktop/extension) or gapi token for Drive uploads.
libs/shared/ui-app-state/src/lib/ui-app-state.ts Changes default entitlements + Drive access gating logic.
libs/features/org-groups/src/lib/SalesforceOrgCardConnectionRefresh.tsx Surfaces connectionError detail in tooltip and adjusts helper signature.
libs/features/load-records/src/steps/SelectObjectAndFile.tsx Enables external picker for desktop/extension; updates config gating.
libs/features/load-records-multi-object/src/LoadRecordsMultiObject.tsx Enables external picker for desktop/extension; updates omitGoogle logic.
libs/desktop-types/src/lib/desktop-app.types.ts Adds IPC channel + Google picker result types + persistence schema updates.
apps/landing/pages/web-extension/google-picker/index.tsx New landing page UI for extension popup picker flow.
apps/landing/pages/desktop-app/google-picker/index.tsx New landing page UI for desktop browser picker flow.
apps/landing/hooks/web-extension-google-picker.hooks.ts Implements extension popup page state machine + postMessage result reporting.
apps/landing/hooks/google-picker-shared.ts Shared Google OAuth + picker implementation for desktop/extension pages.
apps/landing/hooks/desktop-google-picker.hooks.ts Implements desktop picker page state machine + deep link result reporting.
apps/jetstream-web-extension/src/utils/extension.types.ts Adds GET_GOOGLE_CONFIG message type.
apps/jetstream-web-extension/src/extension-scripts/service-worker.ts Implements GET_GOOGLE_CONFIG handler calling server endpoint.
apps/jetstream-web-extension/src/core/AppInitializer.tsx Forces appInfoState serverUrl/version based on extension environment.
apps/jetstream-desktop/src/utils/utils.ts Adds Google APIs domain to CSP allow-list.
apps/jetstream-desktop/src/utils/route.utils.ts Centralizes getTokens() helper used by desktop controllers.
apps/jetstream-desktop/src/services/persistence.service.ts Adds web-org sync merge + ignore list; tracks org source.
apps/jetstream-desktop/src/services/ipc.service.ts Adds IPC handler to open picker + emit result back to renderer.
apps/jetstream-desktop/src/services/api.service.ts Adds API call to fetch Google config for desktop picker page.
apps/jetstream-desktop/src/services/tests/persistence.service.spec.ts New vitest coverage for persistence + web-org merge behavior.
apps/jetstream-desktop/src/preload.ts Exposes openGooglePicker + onGooglePickerResult to renderer.
apps/jetstream-desktop/src/controllers/user.desktop.controller.ts Uses shared getTokens() helper instead of local implementation.
apps/jetstream-desktop/src/controllers/orgs.desktop.controller.ts Fetches orgs/groups from web and merges into desktop persistence.
apps/jetstream-desktop/src/controllers/jetstream-data-sync.desktop.controller.ts Uses shared getTokens() helper instead of local implementation.
apps/api/src/app/routes/web-extension-server.routes.ts Updates CSP for Google scripts + adds /google-config endpoint.
apps/api/src/app/routes/desktop-app.routes.ts Updates CSP for Google scripts + adds /orgs and /google-config endpoints.
apps/api/src/app/controllers/web-extension.controller.ts Adds googleConfig route returning appId/apiKey/clientId.
apps/api/src/app/controllers/desktop-app.controller.ts Adds org/group fetch + googleConfig route for desktop clients.
.claude/settings.local.json Allows additional nx command pattern for local Claude tooling.
Comments suppressed due to low confidence (1)

libs/shared/ui-app-state/src/lib/ui-app-state.ts:55

  • Setting DEFAULT_PROFILE.entitlements.googleDrive to true makes ability.can('access','GoogleDrive') temporarily true anywhere userProfileSyncState falls back to DEFAULT_PROFILE (including the web app before getUserProfile() resolves). This can briefly expose Google Drive UI/features to non-entitled users. Consider keeping the default as false and only forcing googleDrive: true in the browser-extension-specific fetchUserProfile() branch (or via a separate extension-only default profile).
// FIXME: browser extension should be able to obtain all of this information after logging in
export const DEFAULT_PROFILE: UserProfileUi = {
  id: 'unknown',
  userId: 'unknown',
  email: 'unknown',
  name: 'unknown',
  emailVerified: true,
  picture: null,
  preferences: {
    skipFrontdoorLogin: true,
    recordSyncEnabled: true,
    soqlQueryFormatOptions: SoqlQueryFormatOptionsSchema.parse({}),
  },
  // FIXME: we want these true for the browser extension
  entitlements: {
    googleDrive: true,
    chromeExtension: false,
    desktop: false,
    recordSync: false,
  },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

sync orgs and groups to desktop - require re-auth

This only syncs net-new orgs and does not attempt to merge anything
@paustint paustint force-pushed the feat/sync-ogs-desktop-google-picker-desktop-web-ext branch 2 times, most recently from 38413ca to d22c5d9 Compare March 16, 2026 01:54
- Added `useDriveExternalPicker` hook to manage Google Drive file selection
via external flows (desktop and browser extension).
- Introduced `GoogleFileSelectorExternalButton` and `GoogleFolderSelectorExternalButton`
 components for selecting files and folders from Google Drive.
- Updated existing file download modals to support external Google Drive integration.
- Enhanced Google sign-in components to handle external authentication flows.
- Modified type definitions to accommodate new Google Drive integration features.
@paustint paustint force-pushed the feat/sync-ogs-desktop-google-picker-desktop-web-ext branch from d22c5d9 to 974e6d8 Compare March 16, 2026 02:03
@paustint paustint requested a review from Copilot March 16, 2026 02:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an “external” Google Drive auth/picker flow that works in the desktop app (Electron IPC + browser deep-link callback) and the browser extension (popup + postMessage), and wires it into existing file selectors/download flows. It also introduces desktop↔web org/group sync support and supporting API endpoints/CSP updates.

Changes:

  • Introduces useDriveExternalPicker + in-memory external Google token store, plus UI wrappers/buttons for external file/folder selection.
  • Updates download/upload flows (modals + Jobs) to support Google Drive in desktop/extension environments without gapi.
  • Adds desktop org/group sync plumbing (types, persistence merge logic, API routes, and tests) and exposes Google config endpoints for desktop/extension.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
libs/ui/src/lib/google/GoogleSignInExternal.tsx New external Google Drive sign-in wrapper around useDriveExternalPicker.
libs/ui/src/lib/google/GoogleSignIn.tsx Adjusts sign-in UI/error rendering.
libs/ui/src/lib/form/file-selector/GoogleFolderSelectorExternalButton.tsx New external folder picker button (desktop/extension).
libs/ui/src/lib/form/file-selector/GoogleFileSelectorExternalButton.tsx New external file picker button + Drive download/export + XLSX parsing.
libs/ui/src/lib/form/file-selector/FileOrGoogleSelector.tsx Adds hasExternalGoogleDriveAccess branch to swap in external picker UI.
libs/ui/src/lib/file-download-modal/options/FileDownloadGoogle.tsx Splits Google download option into external vs web flows; adds external folder selection.
libs/ui/src/lib/file-download-modal/RecordDownloadModal.tsx Enables Google option in desktop/extension contexts.
libs/ui/src/lib/file-download-modal/FileFauxDownloadModal.tsx Enables Google option in desktop/extension contexts; passes empty config strings for external path.
libs/ui/src/lib/file-download-modal/FileDownloadModal.tsx Enables Google option in desktop/extension contexts; passes empty config strings for external path.
libs/types/src/lib/types.ts Adds SalesforceOrgUi.source and OrgsWithGroupResponse.
libs/shared/ui-utils/src/lib/hooks/useDriveExternalPicker.ts New hook bridging IPC/postMessage results into React state; opens external picker flows.
libs/shared/ui-utils/src/lib/google-access-token.ts New module-level external Google access token store with expiry buffer.
libs/shared/ui-utils/src/index.ts Exports new external picker hook + token helpers.
libs/shared/ui-core/src/mass-update-records/MassUpdateRecordsObjectRow.tsx Adds “Download Records” action + FileDownloadModal integration for validation records.
libs/shared/ui-core/src/jobs/Jobs.tsx Uses external token store for desktop/extension Drive uploads; refactors token access.
libs/shared/ui-app-state/src/lib/ui-app-state.ts Changes default entitlements + Drive access derivation logic.
libs/features/org-groups/src/lib/SalesforceOrgCardConnectionRefresh.tsx Enhances connection error tooltip with error detail.
libs/features/load-records/src/steps/SelectObjectAndFile.tsx Enables external Google Drive selector on desktop/extension.
libs/features/load-records-multi-object/src/LoadRecordsMultiObject.tsx Enables external Google Drive selector on desktop/extension; sets button label.
libs/desktop-types/src/lib/desktop-app.types.ts Adds IPC channel/types for Google picker and org persistence ignore-list support.
apps/landing/pages/web-extension/google-picker/index.tsx New landing page UI for extension picker flow.
apps/landing/pages/desktop-app/google-picker/index.tsx New landing page UI for desktop picker flow.
apps/landing/hooks/web-extension-google-picker.hooks.ts New client hook implementing extension picker state machine + postMessage result.
apps/landing/hooks/google-picker-shared.ts Shared Google auth + picker flow utilities for landing pages.
apps/landing/hooks/desktop-google-picker.hooks.ts New client hook implementing desktop picker flow + deep-link redirect result.
apps/jetstream-web-extension/src/utils/extension.types.ts Adds GET_GOOGLE_CONFIG message type.
apps/jetstream-web-extension/src/extension-scripts/service-worker.ts Handles GET_GOOGLE_CONFIG by fetching config from API with auth headers.
apps/jetstream-web-extension/src/core/AppInitializer.tsx Forces appInfoState serverUrl/environment for extension to avoid dev mismatch.
apps/jetstream-desktop/src/utils/utils.ts Expands desktop CSP allowlist to include www.googleapis.com.
apps/jetstream-desktop/src/utils/route.utils.ts Extracts reusable getTokens() helper for desktop controllers.
apps/jetstream-desktop/src/services/persistence.service.ts Adds merge logic for syncing web orgs/groups into desktop persistence + ignore list; updates org/group CRUD.
apps/jetstream-desktop/src/services/ipc.service.ts Adds IPC handler to open Google picker and forward results back to renderer.
apps/jetstream-desktop/src/services/api.service.ts Adds fetchGoogleConfig desktop API call.
apps/jetstream-desktop/src/services/tests/persistence.service.spec.ts Adds test coverage for persistence merge + ignore-list behaviors.
apps/jetstream-desktop/src/preload.ts Exposes openGooglePicker + onGooglePickerResult to renderer.
apps/jetstream-desktop/src/controllers/user.desktop.controller.ts Uses shared getTokens() helper.
apps/jetstream-desktop/src/controllers/orgs.desktop.controller.ts Fetches orgs from web app and merges into desktop persistence.
apps/jetstream-desktop/src/controllers/jetstream-data-sync.desktop.controller.ts Uses shared getTokens() helper.
apps/api/src/app/routes/web-extension-server.routes.ts Updates CSP for Google scripts/frames/connect + adds /google-config route.
apps/api/src/app/routes/desktop-app.routes.ts Updates CSP for Google scripts/frames/connect + adds /google-config and /orgs routes.
apps/api/src/app/controllers/web-extension.controller.ts Adds controller for returning Google config values.
apps/api/src/app/controllers/desktop-app.controller.ts Adds org/group fetch endpoint + Google config endpoint.
.claude/settings.local.json Updates local tool allowlist.
Comments suppressed due to low confidence (1)

libs/shared/ui-app-state/src/lib/ui-app-state.ts:55

  • DEFAULT_PROFILE now sets entitlements.googleDrive: true. Because abilities are derived directly from user.entitlements, this can grant Google Drive access to unauthenticated/unknown users (e.g., when profile fetch fails or when DEFAULT_PROFILE is used as a fallback). If the goal is to enable Drive for desktop/extension, gate it by environment/auth state instead of changing the global default entitlements.
  // FIXME: we want these true for the browser extension
  entitlements: {
    googleDrive: true,
    chromeExtension: false,
    desktop: false,
    recordSync: false,
  },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +77 to +83
getOrgs: {
controllerFn: () => getOrgs,
responseType: z.any(),
validators: {
hasSourceOrg: false,
} satisfies RouteValidator,
},
Comment on lines +108 to +112
} catch (ex) {
logger.error('[DOWNLOAD VALIDATION RECORDS]', ex);
} finally {
setDownloadRecordsLoading(false);
}
Comment on lines +334 to +341
if (accessToken && expiresAt) {
params.set('accessToken', accessToken);
params.set('accessTokenExpiresAt', String(expiresAt));
}

const pickerUrl = `${serverUrl}/web-extension/google-picker?${params.toString()}`;
popupRef.current = window.open(pickerUrl, 'jetstream-google-picker', 'popup,width=900,height=700');

Comment on lines +285 to +290
if (payload.accessToken) {
pickerParams.set('accessToken', payload.accessToken);
}
if (payload.accessTokenExpiresAt) {
pickerParams.set('accessTokenExpiresAt', `${payload.accessTokenExpiresAt}`);
}
Comment on lines +23 to +26
function buildDeepLinkUrl(nonce: string, params: Record<string, string>): string {
const searchParams = new URLSearchParams({ nonce, ...params });
return `jetstream://googlePicker?${searchParams.toString()}`;
}
Comment on lines +131 to +134
useNonInitialEffect(() => {
// eslint-disable-next-line react-hooks/rules-of-hooks
onFolderSelectedEvent(whichFolder === 'root' ? undefined : googleFolder?.folderId);
}, [whichFolder, googleFolder]);
@paustint
Copy link
Copy Markdown
Contributor Author

closing in favor of #1612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants