diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-calendar-config.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-calendar-config.tsx deleted file mode 100644 index 6f282d892..000000000 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-calendar-config.tsx +++ /dev/null @@ -1,14 +0,0 @@ -"use client"; - -import type { FC } from "react"; -import type { SearchSourceConnector } from "@/contracts/types/connector.types"; - -interface ComposioCalendarConfigProps { - connector: SearchSourceConnector; - onConfigChange?: (config: Record) => void; - onNameChange?: (name: string) => void; -} - -export const ComposioCalendarConfig: FC = () => { - return
; -}; diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-gmail-config.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-gmail-config.tsx deleted file mode 100644 index 494e1362f..000000000 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-gmail-config.tsx +++ /dev/null @@ -1,14 +0,0 @@ -"use client"; - -import type { FC } from "react"; -import type { SearchSourceConnector } from "@/contracts/types/connector.types"; - -interface ComposioGmailConfigProps { - connector: SearchSourceConnector; - onConfigChange?: (config: Record) => void; - onNameChange?: (name: string) => void; -} - -export const ComposioGmailConfig: FC = () => { - return
; -}; diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/live-connector-connected-card.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/live-connector-connected-card.tsx new file mode 100644 index 000000000..dddd4210a --- /dev/null +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/live-connector-connected-card.tsx @@ -0,0 +1,48 @@ +"use client"; + +import { CheckCircle2 } from "lucide-react"; +import type { FC } from "react"; +import { getConnectorTypeDisplay } from "@/lib/connectors/utils"; +import { + COMPOSIO_CONNECTORS, + CRAWLERS, + OAUTH_CONNECTORS, + OTHER_CONNECTORS, +} from "../../constants/connector-constants"; +import type { ConnectorConfigProps } from "../index"; + +// Catalog descriptions keyed by connector type, reused as the capability line so +// the copy stays in sync with the catalog cards. +const DESCRIPTION_BY_TYPE = new Map( + [...OAUTH_CONNECTORS, ...COMPOSIO_CONNECTORS, ...OTHER_CONNECTORS, ...CRAWLERS].map((c) => [ + c.connectorType, + c.description, + ]) +); + +/** + * Fallback manage view for live connectors that are neither MCP-backed nor have + * a dedicated config component (native/Composio Gmail & Calendar). There is + * nothing to configure, so we just confirm the connection and echo what the + * agent can do — no Trusted Tools (that feature is MCP-only, see the backend + * `_ensure_mcp_connector_for_user`). + */ +export const LiveConnectorConnectedCard: FC = ({ connector }) => { + const capability = + DESCRIPTION_BY_TYPE.get(connector.connector_type) ?? + `connect to ${getConnectorTypeDisplay(connector.connector_type)}`; + + return ( +
+
+
+ +
+
+

Connected

+

{capability}.

+
+
+
+ ); +}; diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx index a994a3db2..8f332df65 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx @@ -55,12 +55,8 @@ const configMap: Record Promise<{ default: FC ({ default: m.ObsidianConfig })), COMPOSIO_GOOGLE_DRIVE_CONNECTOR: () => import("./components/composio-drive-config").then((m) => ({ default: m.ComposioDriveConfig })), - COMPOSIO_GMAIL_CONNECTOR: () => - import("./components/composio-gmail-config").then((m) => ({ default: m.ComposioGmailConfig })), - COMPOSIO_GOOGLE_CALENDAR_CONNECTOR: () => - import("./components/composio-calendar-config").then((m) => ({ - default: m.ComposioCalendarConfig, - })), + // Composio Gmail/Calendar have nothing to configure; the edit view falls back + // to LiveConnectorConnectedCard for live connectors without a config here. }; const componentCache = new Map(); diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx index 4874ded34..38de72107 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx @@ -20,6 +20,7 @@ import { PeriodicSyncConfig } from "../../components/periodic-sync-config"; import { VisionLLMConfig } from "../../components/vision-llm-config"; import { LIVE_CONNECTOR_TYPES } from "../../constants/connector-constants"; import { getConnectorDisplayName } from "../../tabs/all-connectors-tab"; +import { LiveConnectorConnectedCard } from "../components/live-connector-connected-card"; import { MCPServiceConfig } from "../components/mcp-service-config"; import { getConnectorConfigComponent } from "../index"; @@ -124,8 +125,13 @@ export const ConnectorEditView: FC = ({ // Get connector-specific config component (MCP-backed connectors use a generic view) const ConnectorConfigComponent = useMemo(() => { if (isMCPBacked) return MCPServiceConfig; - return getConnectorConfigComponent(connector.connector_type); - }, [connector.connector_type, isMCPBacked]); + // Live connectors without a dedicated config (native/Composio Gmail & + // Calendar) fall back to a simple "Connected" card instead of a blank body. + return ( + getConnectorConfigComponent(connector.connector_type) ?? + (isLive ? LiveConnectorConnectedCard : null) + ); + }, [connector.connector_type, isMCPBacked, isLive]); const [isScrolled, setIsScrolled] = useState(false); const [hasMoreContent, setHasMoreContent] = useState(false); const [showDisconnectConfirm, setShowDisconnectConfirm] = useState(false); @@ -201,7 +207,7 @@ export const ConnectorEditView: FC = ({ {/* Fixed Header */}
@@ -262,7 +268,7 @@ export const ConnectorEditView: FC = ({
@@ -362,7 +368,7 @@ export const ConnectorEditView: FC = ({
{/* Fixed Footer - Action buttons */} -
+
{showDisconnectConfirm ? (