diff --git a/frontend/src/routes/files/+page.svelte b/frontend/src/routes/files/+page.svelte index f261f8a..82840e3 100644 --- a/frontend/src/routes/files/+page.svelte +++ b/frontend/src/routes/files/+page.svelte @@ -13,10 +13,13 @@ import { selectionStore, selectionActive } from '$lib/stores/selection'; import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; import BulkTagEditor from '$lib/components/file/BulkTagEditor.svelte'; + import { tick } from 'svelte'; import { parseDslFilter } from '$lib/utils/dsl'; import type { File, FileCursorPage, Pool, PoolOffsetPage } from '$lib/api/types'; import { appSettings } from '$lib/stores/appSettings'; + let scrollContainer = $state(); + let uploader = $state<{ open: () => void } | undefined>(); let confirmDeleteFiles = $state(false); @@ -121,6 +124,12 @@ } finally { loading = false; } + // If the loaded content doesn't fill the viewport yet (no scrollbar), + // keep loading until it does or there's nothing left. + await tick(); + if (hasMore && scrollContainer && scrollContainer.scrollHeight <= scrollContainer.clientHeight) { + void loadMore(); + } } function applyFilter(filter: string | null) { @@ -244,7 +253,7 @@ {/if} -
+
{#if error} {/if}