From 280d46b48dbbfabfa20a4fb9bcb1d4e0158f49e4 Mon Sep 17 00:00:00 2001 From: static Date: Fri, 2 Jan 2026 14:55:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=86=8C=ED=95=9C=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=86=A0=EB=A7=81=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/molecules/Categories.svelte | 44 +++++++++++++++++++ .../molecules/Categories/Categories.svelte | 33 -------------- .../molecules/Categories/Category.svelte | 26 ----------- .../components/molecules/Categories/index.ts | 2 - .../molecules/Categories/service.ts | 7 --- src/lib/components/molecules/index.ts | 4 +- src/lib/components/organisms/Gallery.svelte | 2 +- .../(fullscreen)/settings/cache/+page.svelte | 17 +++---- .../settings/thumbnail/+page.svelte | 8 +--- .../DirectoryEntries/DirectoryEntries.svelte | 42 +++++++++--------- src/routes/(main)/home/+page.svelte | 2 +- 11 files changed, 75 insertions(+), 112 deletions(-) create mode 100644 src/lib/components/molecules/Categories.svelte delete mode 100644 src/lib/components/molecules/Categories/Categories.svelte delete mode 100644 src/lib/components/molecules/Categories/Category.svelte delete mode 100644 src/lib/components/molecules/Categories/index.ts delete mode 100644 src/lib/components/molecules/Categories/service.ts diff --git a/src/lib/components/molecules/Categories.svelte b/src/lib/components/molecules/Categories.svelte new file mode 100644 index 0000000..b8d52bb --- /dev/null +++ b/src/lib/components/molecules/Categories.svelte @@ -0,0 +1,44 @@ + + + + +{#if categoriesWithName.length > 0} +
+ {#each categoriesWithName as category (category.id)} + onCategoryClick(category)} + actionButtonIcon={categoryMenuIcon} + onActionButtonClick={() => onCategoryMenuClick?.(category)} + > + + + {/each} +
+{/if} diff --git a/src/lib/components/molecules/Categories/Categories.svelte b/src/lib/components/molecules/Categories/Categories.svelte deleted file mode 100644 index 12398f6..0000000 --- a/src/lib/components/molecules/Categories/Categories.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - -{#if categoriesWithName.length > 0} -
- {#each categoriesWithName as category} - - {/each} -
-{/if} diff --git a/src/lib/components/molecules/Categories/Category.svelte b/src/lib/components/molecules/Categories/Category.svelte deleted file mode 100644 index 1613da5..0000000 --- a/src/lib/components/molecules/Categories/Category.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - - onclick(info)} - actionButtonIcon={menuIcon} - onActionButtonClick={() => onMenuClick?.(info)} -> - - diff --git a/src/lib/components/molecules/Categories/index.ts b/src/lib/components/molecules/Categories/index.ts deleted file mode 100644 index d8a70c2..0000000 --- a/src/lib/components/molecules/Categories/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "./Categories.svelte"; -export * from "./service"; diff --git a/src/lib/components/molecules/Categories/service.ts b/src/lib/components/molecules/Categories/service.ts deleted file mode 100644 index 2a2a3e0..0000000 --- a/src/lib/components/molecules/Categories/service.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DataKey } from "$lib/modules/filesystem"; - -export interface SelectedCategory { - id: number; - dataKey?: DataKey; - name: string; -} diff --git a/src/lib/components/molecules/index.ts b/src/lib/components/molecules/index.ts index 8edc84a..a36afcd 100644 --- a/src/lib/components/molecules/index.ts +++ b/src/lib/components/molecules/index.ts @@ -1,7 +1,7 @@ export * from "./ActionModal.svelte"; export { default as ActionModal } from "./ActionModal.svelte"; -export * from "./Categories"; -export { default as Categories } from "./Categories"; +export * from "./Categories.svelte"; +export { default as Categories } from "./Categories.svelte"; export { default as IconEntryButton } from "./IconEntryButton.svelte"; export * from "./labels"; export { default as SubCategories } from "./SubCategories.svelte"; diff --git a/src/lib/components/organisms/Gallery.svelte b/src/lib/components/organisms/Gallery.svelte index 40d4baf..dc9f157 100644 --- a/src/lib/components/organisms/Gallery.svelte +++ b/src/lib/components/organisms/Gallery.svelte @@ -62,7 +62,7 @@

{row.label}

{:else}
- {#each row.files as file} + {#each row.files as file (file.id)} {/each}
diff --git a/src/routes/(fullscreen)/settings/cache/+page.svelte b/src/routes/(fullscreen)/settings/cache/+page.svelte index 7884b20..1d6f0c4 100644 --- a/src/routes/(fullscreen)/settings/cache/+page.svelte +++ b/src/routes/(fullscreen)/settings/cache/+page.svelte @@ -15,7 +15,9 @@ } let fileCache: FileCache[] | undefined = $state(); - let fileCacheTotalSize = $state(0); + let fileCacheTotalSize = $derived( + fileCache?.reduce((acc, { index }) => acc + index.size, 0) ?? 0, + ); const deleteFileCache = async (fileId: number) => { await doDeleteFileCache(fileId); @@ -29,18 +31,9 @@ $masterKeyStore?.get(1)?.key!, ); fileCache = indexes - .map((index, i) => ({ - index, - info: infos.get(index.fileId)!, - })) + .map((index) => ({ index, info: infos.get(index.fileId)! })) .sort((a, b) => a.index.lastRetrievedAt.getTime() - b.index.lastRetrievedAt.getTime()); }); - - $effect(() => { - if (fileCache) { - fileCacheTotalSize = fileCache.reduce((acc, { index }) => acc + index.size, 0); - } - }); @@ -59,7 +52,7 @@

캐시를 삭제하더라도 원본 파일은 삭제되지 않아요.

- {#each fileCache as { index, info }} + {#each fileCache as { index, info } (info.id)} {/each}
diff --git a/src/routes/(fullscreen)/settings/thumbnail/+page.svelte b/src/routes/(fullscreen)/settings/thumbnail/+page.svelte index a5b658e..2c06964 100644 --- a/src/routes/(fullscreen)/settings/thumbnail/+page.svelte +++ b/src/routes/(fullscreen)/settings/thumbnail/+page.svelte @@ -7,11 +7,7 @@ import { bulkGetFileInfo } from "$lib/modules/filesystem"; import { masterKeyStore } from "$lib/stores"; import File from "./File.svelte"; - import { - persistentStates, - getGenerationStatus, - requestThumbnailGeneration, - } from "./service.svelte"; + import { persistentStates, requestThumbnailGeneration } from "./service.svelte"; import IconDelete from "~icons/material-symbols/delete"; @@ -55,7 +51,7 @@ {persistentStates.files.length}개 파일의 썸네일이 존재하지 않아요.

- {#each persistentStates.files as { info, status }} + {#each persistentStates.files as { info, status } (info.id)} {#if info.exists} {#if entries.length > 0} -
- 56} itemGap={4}> - {#snippet item(index)} - {@const entry = entries[index]!} - {#if entry.type === "parent"} - - - - {:else if entry.type === "directory"} - - {:else if entry.type === "file"} - - {:else} - - {/if} - {/snippet} - -
+ 56} itemGap={4} class="pb-[4.5rem]"> + {#snippet item(index)} + {@const entry = entries[index]!} + {#if entry.type === "parent"} + + + + {:else if entry.type === "directory"} + + {:else if entry.type === "file"} + + {:else} + + {/if} + {/snippet} + {:else}

폴더가 비어 있어요.

diff --git a/src/routes/(main)/home/+page.svelte b/src/routes/(main)/home/+page.svelte index bf94bad..bd3d92d 100644 --- a/src/routes/(main)/home/+page.svelte +++ b/src/routes/(main)/home/+page.svelte @@ -33,7 +33,7 @@ {#if mediaFiles.length > 0}
- {#each mediaFiles as file} + {#each mediaFiles as file (file.id)} {#if file.exists} goto(`/file/${id}`)} /> {/if}