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; }