From 9d5ee012173eee280771defaaf89fd63271112a3 Mon Sep 17 00:00:00 2001 From: livdebus Date: Thu, 24 Sep 2026 20:51:16 +0200 Subject: [PATCH] fix(smb-ui): use metadata.smb_source instead of from_ingestion_api for SMB detection The previous attempt added document.from_ingestion_api to the SMB UI patch to distinguish API-ingested SMB files from normal File uploads after we switched the connector source from ingestion_api to file. This caused a TypeScript build error because from_ingestion_api is not exposed on the frontend document types (OnyxDocument / SearchDocWithContent). Fix: rely on document.metadata?.smb_source instead. - The connector injects metadata.smb_source on every SMB document (files and index), so it is a reliable discriminator. - Normal File uploads via the UI never carry this metadata key, so the preview-suppression and clipboard-copy behavior remains scoped to SMB docs only. Updated in both locations of branding/smb/smb-ui.patch: - SearchCard.tsx (licensed search view click handler) - lib/search/utils.ts (chat citation openDocument helper) --- branding/smb/smb-ui.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/branding/smb/smb-ui.patch b/branding/smb/smb-ui.patch index f8e9284..fdf1f06 100644 --- a/branding/smb/smb-ui.patch +++ b/branding/smb/smb-ui.patch @@ -37,7 +37,7 @@ index 42fb3bd8..5ee25228 100644 + // 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.from_ingestion_api || document.metadata?.smb_source) { ++ if (document.metadata?.smb_source) { + // 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; @@ -76,7 +76,7 @@ index ce7eab36..6e4baff3 100644 + // browsable link and no stored file to preview — a normal preview click would + // 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.from_ingestion_api || document.metadata?.smb_source) { ++ if (document.metadata?.smb_source) { + // 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 =