From 208e71d3861ae2e8ea68d52bd58a07926b278553 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Thu, 29 Oct 2026 03:57:57 -0400 Subject: [PATCH] fix: deleting, renaming or adding a file keeps expanded folders listed in the Files tab (#33195) --- src/lib/components/chat/FileNav.svelte | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/components/chat/FileNav.svelte b/src/lib/components/chat/FileNav.svelte index 8c59ad3015..9bfcee70ef 100644 --- a/src/lib/components/chat/FileNav.svelte +++ b/src/lib/components/chat/FileNav.svelte @@ -1475,8 +1475,7 @@ uploading = false; if (selectedTerminal?.url === terminal.url && (chatId ?? undefined) === sessionId) { invalidateTreeCache(destination); - if (currentPath === destination && !selectedFile) - await loadDir(destination, { preserveTree: true }); + if (currentPath === destination && !selectedFile) await refreshBrowser(); } } }; @@ -1523,7 +1522,7 @@ result ? $i18n.t('Folder created') : $i18n.t('Failed to create folder') ); invalidateTreeCache(currentPath); - await loadDir(currentPath, { preserveTree: true }); + await refreshBrowser(); }; // ── File creation ──────────────────────────────────────────────────── @@ -1560,7 +1559,7 @@ result ? $i18n.t('File created') : $i18n.t('Failed to create file') ); invalidateTreeCache(currentPath); - await loadDir(currentPath, { preserveTree: true }); + await refreshBrowser(); }; // ── Delete ─────────────────────────────────────────────────────────── @@ -1575,7 +1574,7 @@ : $i18n.t('Failed to delete {{name}}', { name }) ); invalidateTreeCache(currentPath, path); - await loadDir(currentPath, { preserveTree: true }); + await refreshBrowser(); }; const requestDelete = (path: string, name: string) => { @@ -1660,7 +1659,7 @@ toast.success($i18n.t('Renamed to {{name}}', { name: newName })); } invalidateTreeCache(currentPath, oldPath); - await loadDir(currentPath, { preserveTree: true }); + await refreshBrowser(); }; // ── Multi-select ──────────────────────────────────────────────────── @@ -1737,7 +1736,7 @@ ); invalidateTreeCache(currentPath, ...paths); clearSelection(); - await loadDir(currentPath, { preserveTree: true }); + await refreshBrowser(); }; const bulkDownload = async () => {