This commit is contained in:
Timothy Jaeryang Baek committed 2026-08-24 18:06:59 -04:00
1 parent 98ee2bdfd3
commit fd8cc2ba4a
14 files changed
+117 -18

No files matched your search

@@ -8,6 +8,7 @@
import FilePreview from '$lib/components/chat/FileNav/FilePreview.svelte';
import Icon from '$lib/components/chat/FileNav/Icon.svelte';
import { fileIconName } from '$lib/components/chat/FileNav/fileIcon';
import { normalizeDocumentTargetPage } from '$lib/utils/documentPreview';
export let item: any;
export let chatId = '';
@@ -42,6 +43,7 @@
$: path = String(item?.full_path || item?.path || '');
$: name = String(item?.name || path.split('/').filter(Boolean).at(-1) || 'file');
$: targetPage = normalizeDocumentTargetPage(item?.page);
$: selector = item?.terminal_selector;
$: terminal = resolveTerminal();
$: unavailable = !terminal;
@@ -165,7 +167,7 @@
function openInFiles() {
if (unavailable || !path) return;
showControls.set(true);
showFileNavPath.set(path);
showFileNavPath.set(targetPage ? { path, page: targetPage } : path);
}
async function downloadFile() {
@@ -249,6 +251,7 @@
{fileOfficeHtml}
{fileOfficeSlides}
{currentSlide}
{targetPage}
{excelSheetNames}
{selectedExcelSheet}
onSheetChange={loadExcelSheet}
@@ -187,7 +187,7 @@ function getInlineFileFromToolOutput(callItem?: OutputItem, resultItem?: OutputI
return null;
}
return result;
return result.page === undefined && args.page !== undefined ? { ...result, page: args.page } : result;
}
function buildToolCallToken(item: OutputItem, toolOutputByCallId: Record<string, OutputItem>) {