From b909032e32229a69b76a58f14588ea3a5c527fae Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 1 Jan 2026 21:22:34 +0530 Subject: [PATCH] feat: enhance Google Drive connector functionality and UI - Added support for selecting both folders and files in the Google Drive connector configuration. - Updated the UI to reflect the selection of files alongside folders, improving user clarity. - Introduced a quick indexing feature for connectors, allowing users to start indexing without date selection. - Adjusted periodic sync settings to be disabled for Google Drive connectors, ensuring proper functionality. - Improved styling and accessibility across various components in the connector popup. --- .../assistant-ui/connector-popup.tsx | 3 + .../components/periodic-sync-config.tsx | 2 +- .../components/google-drive-config.tsx | 48 +++++++++--- .../views/connector-edit-view.tsx | 67 +++++++++++----- .../views/indexing-configuration-view.tsx | 15 ++-- .../hooks/use-connector-dialog.ts | 77 ++++++++++++++----- .../connectors/google-drive-folder-tree.tsx | 16 +--- 7 files changed, 160 insertions(+), 68 deletions(-) diff --git a/surfsense_web/components/assistant-ui/connector-popup.tsx b/surfsense_web/components/assistant-ui/connector-popup.tsx index 1e7150359..a83f32a09 100644 --- a/surfsense_web/components/assistant-ui/connector-popup.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup.tsx @@ -91,6 +91,7 @@ export const ConnectorIndicator: FC = () => { handleBackFromEdit, handleBackFromConnect, handleBackFromYouTube, + handleQuickIndexConnector, connectorConfig, setConnectorConfig, setIndexingConnectorConfig, @@ -225,6 +226,7 @@ export const ConnectorIndicator: FC = () => { frequencyMinutes={frequencyMinutes} isSaving={isSaving} isDisconnecting={isDisconnecting} + isIndexing={indexingConnectorIds.has(editingConnector.id)} onStartDateChange={setStartDate} onEndDateChange={setEndDate} onPeriodicEnabledChange={setPeriodicEnabled} @@ -232,6 +234,7 @@ export const ConnectorIndicator: FC = () => { onSave={() => handleSaveConnector(() => refreshConnectors())} onDisconnect={() => handleDisconnectConnector(() => refreshConnectors())} onBack={handleBackFromEdit} + onQuickIndex={editingConnector.connector_type !== "GOOGLE_DRIVE_CONNECTOR" ? () => handleQuickIndexConnector(editingConnector.id) : undefined} onConfigChange={setConnectorConfig} onNameChange={setConnectorName} /> diff --git a/surfsense_web/components/assistant-ui/connector-popup/components/periodic-sync-config.tsx b/surfsense_web/components/assistant-ui/connector-popup/components/periodic-sync-config.tsx index 1d22e6890..ee2792204 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/components/periodic-sync-config.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/components/periodic-sync-config.tsx @@ -37,7 +37,7 @@ export const PeriodicSyncConfig: FC = ({ {enabled && ( -
+