From fbeee59e99f47c9ff4fb0f114f78eb9dc85f2967 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 21 Oct 2026 11:47:14 +0900 Subject: [PATCH] refac --- src/lib/components/chat/FileNav.svelte | 5 +++++ .../components/chat/FileNav/FileEntryRow.svelte | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/lib/components/chat/FileNav.svelte b/src/lib/components/chat/FileNav.svelte index 113aa1f098..d4b06a1cf3 100644 --- a/src/lib/components/chat/FileNav.svelte +++ b/src/lib/components/chat/FileNav.svelte @@ -1514,6 +1514,10 @@ }; // ── File creation ──────────────────────────────────────────────────── + const startNewFileIn = async (path: string) => { + if (await loadDir(path)) await startNewFile(); + }; + const startNewFile = async () => { if (!currentWritable) return; creatingFile = true; @@ -2556,6 +2560,7 @@ : undefined} onDownload={downloadFile} onNewFolder={startNewFolderIn} + onNewFile={startNewFileIn} onDelete={requestDelete} onMove={handleMovePaths} onRename={handleRename} diff --git a/src/lib/components/chat/FileNav/FileEntryRow.svelte b/src/lib/components/chat/FileNav/FileEntryRow.svelte index c85d0d7772..aa93e41cac 100644 --- a/src/lib/components/chat/FileNav/FileEntryRow.svelte +++ b/src/lib/components/chat/FileNav/FileEntryRow.svelte @@ -25,6 +25,7 @@ export let onOpen: (entry: FileEntry) => void = () => {}; export let onNewFolder: ((path: string) => void) | undefined = undefined; + export let onNewFile: ((path: string) => void) | undefined = undefined; export let onSelectForComparison: (() => void) | undefined = undefined; export let onCompareWithSelected: (() => void) | undefined = undefined; export let comparisonPath: string | null = null; @@ -406,6 +407,21 @@
{$i18n.t('New Folder')}
{/if} + {#if entry.type === 'directory' && onNewFile} + + {/if} {#if entry.type === 'file' && onSelectForComparison}