diff --git a/package.json b/package.json index fd09920..5d9526a 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "vite": "^8.0.3" }, "dependencies": { + "@tanstack/vue-virtual": "^3.13.37", "@vitejs/plugin-vue": "^6.0.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9ac70e1..0694a99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@tanstack/vue-virtual': + specifier: ^3.13.37 + version: 3.13.37(vue@3.5.32) '@vitejs/plugin-vue': specifier: ^6.0.5 version: 6.0.5(vite@8.0.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)(jiti@2.6.1))(vue@3.5.32) @@ -561,6 +564,14 @@ packages: peerDependencies: vite: ^5.2.0 || ^6 || ^7 || ^8 + '@tanstack/virtual-core@3.17.9': + resolution: {integrity: sha512-M8Bzy7CCMvUjRiuoHVH9mRjyUVczRs8v8RcUEphLFGc445ZP4KQ15Y1sLqhQqJi/HgGJrxfCHnEnIX0x9mVrBg==} + + '@tanstack/vue-virtual@3.13.37': + resolution: {integrity: sha512-1QNT8EXVKUx537/qvn/tFGs48eITBrrTWcyaMVjD4SCpij7E1LksbXZQLqkXBoJ9lfOVely/8Fgzqe/olQ+drw==} + peerDependencies: + vue: ^2.7.0 || ^3.0.0 + '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} @@ -922,6 +933,7 @@ packages: lucide-vue-next@1.0.0: resolution: {integrity: sha512-V6SPvx1IHTj/UY+FrIYWV5faISsPSb8BnWSFDxAtezWKvWc9ZZ40PDrdu1/Qb5vg4lHWr1hs1BAMGVGm6V1Xdg==} + deprecated: Package deprecated. Please use @lucide/vue instead. peerDependencies: vue: '>=3.0.1' @@ -1486,6 +1498,13 @@ snapshots: tailwindcss: 4.2.2 vite: 8.0.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)(jiti@2.6.1) + '@tanstack/virtual-core@3.17.9': {} + + '@tanstack/vue-virtual@3.13.37(vue@3.5.32)': + dependencies: + '@tanstack/virtual-core': 3.17.9 + vue: 3.5.32 + '@tybys/wasm-util@0.10.1': dependencies: tslib: 2.8.1 diff --git a/webui/src/apps.css b/webui/src/apps.css index 7933983..be2b7e3 100644 --- a/webui/src/apps.css +++ b/webui/src/apps.css @@ -61,9 +61,6 @@ /* App List */ .app-list-container { - display: flex; - flex-direction: column; - gap: var(--spacing-s); max-height: 60vh; overflow-y: auto; border-radius: var(--border-radius-m); @@ -74,6 +71,21 @@ display: none; } +/* 虚拟滚动:spacer 撑起总高度,行绝对定位; + 行间距由 item 的 padding-bottom 提供,保证测量行高包含间距 */ +.app-virtual-spacer { + position: relative; + width: 100%; +} + +.app-virtual-item { + position: absolute; + top: 0; + left: 0; + width: 100%; + padding-bottom: var(--spacing-s); +} + .app-list-item { display: flex; flex-direction: column; diff --git a/webui/src/views/AppsView.vue b/webui/src/views/AppsView.vue index 9662a83..7afd321 100644 --- a/webui/src/views/AppsView.vue +++ b/webui/src/views/AppsView.vue @@ -1,6 +1,7 @@