Skip to content

Commit 4c5e772

Browse files
committed
Added patch to expose file metadata URL in citation modal
1 parent 9ae06a3 commit 4c5e772

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/lib/components/chat/Messages/Citations/CitationModal.svelte

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,30 @@
160160
{/if}
161161
</div>
162162

163+
<!-- PATCH ADD LINK TO SOURCE -->
164+
{#if document?.metadata?.data?.url}
165+
<div
166+
class=" text-sm font-medium dark:text-gray-300 flex items-center gap-2 w-fit mb-1"
167+
>
168+
{$i18n.t('Source')}
169+
<Tooltip
170+
className="w-fit"
171+
content={$i18n.t('Open link')}
172+
placement="top-start"
173+
tippyOptions={{ duration: [500, 0] }}
174+
>
175+
<a
176+
class="hover:text-gray-500 dark:hover:text-gray-100 underline grow line-clamp-1"
177+
href={document.metadata.data.url}
178+
target="_blank"
179+
>
180+
{document.metadata.data.url}
181+
</a>
182+
</Tooltip>
183+
</div>
184+
{/if}
185+
<!-- PATCH ADD LINK TO SOURCE - END -->
186+
163187
{#if document.metadata?.html}
164188
<iframe
165189
class="w-full border-0 h-auto rounded-none"

0 commit comments

Comments
 (0)