diff --git a/branding/smb/smb-ui.patch b/branding/smb/smb-ui.patch index e27d29e..ef687b1 100644 --- a/branding/smb/smb-ui.patch +++ b/branding/smb/smb-ui.patch @@ -18,7 +18,7 @@ index 0f61ede9..2dcb8e7e 100644 : 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..a4b8926f 100644 +index 42fb3bd8..5ee25228 100644 --- a/web/src/ee/sections/SearchCard.tsx +++ b/web/src/ee/sections/SearchCard.tsx @@ -10,6 +10,7 @@ import { ValidSources } from "@/lib/types"; @@ -29,7 +29,7 @@ index 42fb3bd8..a4b8926f 100644 import Truncated from "@/refresh-components/texts/Truncated"; import { timeAgo } from "@opal/time"; import { useMemo } from "react"; -@@ -37,6 +38,25 @@ export default function SearchCard({ +@@ -37,6 +38,27 @@ export default function SearchCard({ document.is_internet || document.source_type === ValidSources.Web; function handleClick() { @@ -38,9 +38,11 @@ index 42fb3bd8..a4b8926f 100644 + // 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) { -+ // The full network path is in `link` (file://\\server\share\...); the -+ // semantic_identifier is now just the file name, shown as the label. ++ // The full network path is in metadata.logical_path (the search result does ++ // not always carry `link`); semantic_identifier is only the file name. ++ const logicalPath = document.metadata?.logical_path; + const path = ++ (typeof logicalPath === "string" ? logicalPath : undefined) || + document.link?.replace(/^file:\/\//, "") || + document.semantic_identifier || + document.document_id; @@ -56,7 +58,7 @@ index 42fb3bd8..a4b8926f 100644 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..2431a944 100644 +index ce7eab36..6e4baff3 100644 --- a/web/src/lib/search/utils.ts +++ b/web/src/lib/search/utils.ts @@ -1,5 +1,6 @@ @@ -66,7 +68,7 @@ index ce7eab36..2431a944 100644 // If we have a link, open it in a new tab (including if it's a file) // If above fails and we have a file, update the presenting document -@@ -7,6 +8,25 @@ export const openDocument = ( +@@ -7,6 +8,26 @@ export const openDocument = ( document: OnyxDocument, updatePresentingDocument?: (document: MinimalOnyxDocument) => void ) => { @@ -75,9 +77,10 @@ index ce7eab36..2431a944 100644 + // just fail. Instead, surface the logical path by copying it to the clipboard + // so the user can open the file directly on the share. + if (document.source_type === ValidSources.IngestionApi) { -+ // The full network path is in `link` (file://\\server\share\...); the -+ // semantic_identifier is now just the file name, shown as the label. ++ // The full network path is in metadata.logical_path (the citation object ++ // does not always carry `link`); semantic_identifier is only the file name. + const path = ++ document.metadata?.logical_path || + document.link?.replace(/^file:\/\//, "") || + document.semantic_identifier || + document.document_id;