diff --git a/frontend/bun.lock b/frontend/bun.lock index 71b6283..46f8d26 100644 --- a/frontend/bun.lock +++ b/frontend/bun.lock @@ -8,6 +8,7 @@ "@kobalte/tailwindcss": "^0.9.0", "@solidjs/router": "^0.15.3", "@tabler/icons-solidjs": "^3.34.0", + "@tanstack/solid-virtual": "^3.13.12", "@tauri-apps/api": "^2.6.0", "@tauri-apps/plugin-dialog": "~2.3.0", "@tauri-apps/plugin-fs": "~2.4.0", @@ -275,6 +276,10 @@ "@tabler/icons-solidjs": ["@tabler/icons-solidjs@3.34.0", "", { "dependencies": { "@tabler/icons": "3.34.0" }, "peerDependencies": { "solid-js": "^1.4.7" } }, "sha512-O6RI1dz4o2MhsyMUk4tELySY25deyB+cHsREwQdYynB+8K9CncVgi9vlpG7lE14lmJ64edduDpCkMxqKdev5jQ=="], + "@tanstack/solid-virtual": ["@tanstack/solid-virtual@3.13.12", "", { "dependencies": { "@tanstack/virtual-core": "3.13.12" }, "peerDependencies": { "solid-js": "^1.3.0" } }, "sha512-0dS8GkBTmbuM9cUR6Jni0a45eJbd32CAEbZj8HrZMWIj3lu974NpGz5ywcomOGJ9GdeHuDaRzlwtonBbKV1ihQ=="], + + "@tanstack/virtual-core": ["@tanstack/virtual-core@3.13.12", "", {}, "sha512-1YBOJfRHV4sXUmWsFSf5rQor4Ss82G8dQWLRbnk3GA4jeP8hQt1hxXh0tmflpC0dz3VgEv/1+qwPyLeWkQuPFA=="], + "@tauri-apps/api": ["@tauri-apps/api@2.6.0", "", {}, "sha512-hRNcdercfgpzgFrMXWwNDBN0B7vNzOzRepy6ZAmhxi5mDLVPNrTpo9MGg2tN/F7JRugj4d2aF7E1rtPXAHaetg=="], "@tauri-apps/cli": ["@tauri-apps/cli@2.6.2", "", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.6.2", "@tauri-apps/cli-darwin-x64": "2.6.2", "@tauri-apps/cli-linux-arm-gnueabihf": "2.6.2", "@tauri-apps/cli-linux-arm64-gnu": "2.6.2", "@tauri-apps/cli-linux-arm64-musl": "2.6.2", "@tauri-apps/cli-linux-riscv64-gnu": "2.6.2", "@tauri-apps/cli-linux-x64-gnu": "2.6.2", "@tauri-apps/cli-linux-x64-musl": "2.6.2", "@tauri-apps/cli-win32-arm64-msvc": "2.6.2", "@tauri-apps/cli-win32-ia32-msvc": "2.6.2", "@tauri-apps/cli-win32-x64-msvc": "2.6.2" }, "bin": { "tauri": "tauri.js" } }, "sha512-s1/eyBHxk0wG1blLeOY2IDjgZcxVrkxU5HFL8rNDwjYGr0o7yr3RAtwmuUPhz13NO+xGAL1bJZaLFBdp+5joKg=="], diff --git a/frontend/package.json b/frontend/package.json index 5747fd3..c551722 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,6 +18,7 @@ "@kobalte/tailwindcss": "^0.9.0", "@solidjs/router": "^0.15.3", "@tabler/icons-solidjs": "^3.34.0", + "@tanstack/solid-virtual": "^3.13.12", "@tauri-apps/api": "^2.6.0", "@tauri-apps/plugin-dialog": "~2.3.0", "@tauri-apps/plugin-fs": "~2.4.0", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index f4cdc35..36c6138 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -8,6 +8,7 @@ import { Settings, Entity, SearchPage, + AllImages, } from "./pages"; import { SearchImageContextProvider } from "@contexts/SearchImageContext"; import { WithNotifications } from "@contexts/Notifications"; @@ -31,6 +32,7 @@ export const App = () => { + diff --git a/frontend/src/components/app-wrapper/dock.tsx b/frontend/src/components/app-wrapper/dock.tsx index 2e70b5a..2d2c84b 100644 --- a/frontend/src/components/app-wrapper/dock.tsx +++ b/frontend/src/components/app-wrapper/dock.tsx @@ -11,7 +11,7 @@ export const Dock: Component = () => { - + diff --git a/frontend/src/pages/all-images/index.tsx b/frontend/src/pages/all-images/index.tsx new file mode 100644 index 0000000..628553f --- /dev/null +++ b/frontend/src/pages/all-images/index.tsx @@ -0,0 +1,29 @@ +import { useSearchImageContext } from "@contexts/SearchImageContext"; +import { Component, For } from "solid-js"; +import { createVirtualizer } from "@tanstack/solid-virtual"; +import { ImageComponent } from "@components/image"; + +export const AllImages: Component = () => { + let scrollRef: HTMLDivElement | undefined; + + const { userImages } = useSearchImageContext(); + + const rowVirtualizer = createVirtualizer({ + count: userImages().length, + estimateSize: () => 400 / 3, + getScrollElement: () => scrollRef!, + overscan: 3, + }); + + return ( +
+
+ + {(item) => } + +
+
+ ); +}; diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index ce57c79..2d88d1d 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -5,3 +5,4 @@ export * from "./settings"; export * from "./login"; export * from "./entity"; export * from "./search"; +export * from "./all-images";