diff --git a/branding/smb/smb-ui.patch b/branding/smb/smb-ui.patch index 3ccaed4..b57d1c7 100644 --- a/branding/smb/smb-ui.patch +++ b/branding/smb/smb-ui.patch @@ -17,6 +17,39 @@ index 0f61ede9..2dcb8e7e 100644 ? ccPairsIndexingStatus.cc_pair_status : ccPairsIndexingStatus.last_status == "not_started" ? ConnectorCredentialPairStatus.SCHEDULED +diff --git a/web/src/ee/sections/SearchCard.tsx b/web/src/ee/sections/SearchCard.tsx +index 42fb3bd8..b5244c75 100644 +--- a/web/src/ee/sections/SearchCard.tsx ++++ b/web/src/ee/sections/SearchCard.tsx +@@ -10,6 +10,7 @@ import { ValidSources } from "@/lib/types"; + import { MinimalOnyxDocument } from "@/lib/search/interfaces"; + import { Section } from "@/layouts/general-layouts"; + import { Interactive } from "@opal/core"; ++import { toast } from "@opal/layouts"; + import Truncated from "@/refresh-components/texts/Truncated"; + import { timeAgo } from "@opal/time"; + import { useMemo } from "react"; +@@ -37,6 +38,20 @@ export default function SearchCard({ + document.is_internet || document.source_type === ValidSources.Web; + + function handleClick() { ++ // AIDO: documents synced from SMB/network shares (ingestion API) have no ++ // browsable link and no stored file to preview — the preview pane would just ++ // fail. Copy the logical path to the clipboard so the user can open the file ++ // directly on the share. Mirrors openDocument() used by the chat view. ++ if (document.source_type === ValidSources.IngestionApi) { ++ const path = document.semantic_identifier || document.document_id; ++ if (path) { ++ void navigator.clipboard ++ ?.writeText(path) ++ .then(() => toast.success(path)) ++ .catch(() => undefined); ++ } ++ return; ++ } + if (document.link) { + window.open(document.link, "_blank", "noopener,noreferrer"); + return; diff --git a/web/src/lib/search/utils.ts b/web/src/lib/search/utils.ts index ce7eab36..2711f0b6 100644 --- a/web/src/lib/search/utils.ts