From cfe3abcf00bd53ae3ffb0b4b05554f5e3e59f349 Mon Sep 17 00:00:00 2001 From: Hibryda Date: Tue, 10 Mar 2026 02:55:38 +0100 Subject: [PATCH] fix(files): look up tab from reactive array before setting content --- v2/src/lib/components/Workspace/FilesTab.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/v2/src/lib/components/Workspace/FilesTab.svelte b/v2/src/lib/components/Workspace/FilesTab.svelte index bd4dd1e..a27b7a1 100644 --- a/v2/src/lib/components/Workspace/FilesTab.svelte +++ b/v2/src/lib/components/Workspace/FilesTab.svelte @@ -111,12 +111,15 @@ } activeTabPath = node.path; - // Load content + // Load content — must look up from reactive array, not local reference fileLoading = true; try { - tab.content = await readFileContent(node.path); + const content = await readFileContent(node.path); + const target = fileTabs.find(t => t.path === node.path); + if (target) target.content = content; } catch (e) { - tab.content = { type: 'Binary', message: `Error: ${e}` }; + const target = fileTabs.find(t => t.path === node.path); + if (target) target.content = { type: 'Binary', message: `Error: ${e}` }; } finally { fileLoading = false; }