fix: synchronize raw app file operations through one effect

This commit is contained in:
Guilhem Lemouel
2026-09-22 10:23:57 +02:00
parent ccac92921a
commit 85e816373f
@@ -1010,7 +1010,6 @@
files = {}
}
delete files[path]
setFilesInIframe(files)
},
listBackendRunnables: () => {
return Object.entries(runnables).map(([key, runnable]) => ({
@@ -2162,14 +2161,6 @@
summary = entry.summary
data = structuredClone($state.snapshot(entry.data))
// If the open document survives into the new files, use the combined message
if (iframeDocument && isOpenableDocument(iframeDocument)) {
// Use combined setFilesAndSelect message to avoid race condition
setFilesAndSelectInIframe(entry.files, iframeDocument)
} else {
// Otherwise just set files normally
setFilesInIframe(entry.files)
}
populateRunnables()
} catch (error) {
console.error('Failed to apply entry:', error)
@@ -2367,13 +2358,7 @@
class="h-full overflow-y-auto relative"
>
<RawAppSidebar
bind:files={
() => files,
(newFiles) => {
files = newFiles
setFilesInIframe(newFiles ?? {})
}
}
bind:files
onSelectPath={handleSelectPath}
onSelectRunnable={(key) => select({ kind: 'runnable', key })}
onDeleteRunnable={deleteRunnable}