diff --git a/src/lib/components/chat/Messages/Citations.svelte b/src/lib/components/chat/Messages/Citations.svelte index 38d5a3a4b4..8fe7d2dd27 100644 --- a/src/lib/components/chat/Messages/Citations.svelte +++ b/src/lib/components/chat/Messages/Citations.svelte @@ -7,6 +7,7 @@ export let id = ''; export let sources = []; + export let readOnly = false; let citations = []; let showPercentage = false; @@ -26,12 +27,18 @@ if (citations[sourceIdx]?.source?.embed_url) { const embedUrl = citations[sourceIdx].source.embed_url; if (embedUrl) { - showControls.set(true); - showEmbeds.set(true); - embed.set({ - title: citations[sourceIdx]?.source?.name || 'Embedded Content', - url: embedUrl - }); + if (readOnly) { + // Open in new tab if readOnly + window.open(embedUrl, '_blank'); + return; + } else { + showControls.set(true); + showEmbeds.set(true); + embed.set({ + title: citations[sourceIdx]?.source?.name || 'Embedded Content', + url: embedUrl + }); + } } else { selectedCitation = citations[sourceIdx]; showCitationModal = true; diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 2a721e1428..f37ba904da 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -809,6 +809,7 @@ bind:this={citationsElement} id={message?.id} sources={message?.sources ?? message?.citations} + {readOnly} /> {/if}