chore: 发布v5.2.1版本并优化布局交互

1. 调整AppGrid和主容器的高度样式,替换calc(100vh - 140px)为100%适配布局
2. 为下载队列添加滚轮隐藏/显示动画和交互逻辑
3. 优化主内容区域的flex布局结构,修复滚动和容器收缩问题
This commit is contained in:
2026-07-17 21:12:50 +08:00
parent 61f5cc954c
commit 37217cd6fb
4 changed files with 52 additions and 24 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "spark-store",
"version": "5.2.0",
"version": "5.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "spark-store",
"version": "5.2.0",
"version": "5.2.1",
"license": "GPL-3.0",
"dependencies": {
"@tailwindcss/vite": "^4.1.18",
+15 -14
View File
@@ -45,9 +45,9 @@
/>
</aside>
<main class="h-full min-h-0 flex-1">
<main class="flex h-full min-h-0 flex-1 flex-col">
<div
class="sticky top-10 z-30 border-b border-slate-200/70 bg-slate-50 px-4 py-4 lg:px-10 dark:border-slate-800/70 dark:bg-slate-950"
class="sticky top-10 z-30 shrink-0 border-b border-slate-200/70 bg-slate-50 px-4 py-4 lg:px-10 dark:border-slate-800/70 dark:bg-slate-950"
>
<AppHeader
:search-query="searchQuery"
@@ -67,12 +67,13 @@
activeTab !== 'home' &&
Object.keys(displayCategories).length > 0
"
class="shrink-0"
:categories="displayCategories"
:selected-category="selectedCategory"
:category-counts="categoryCounts"
@select-category="selectSubCategory"
/>
<div class="px-4 py-6 lg:px-10">
<div class="flex min-h-0 flex-1 flex-col px-4 py-6 lg:px-10">
<FavoriteFolderManager
v-if="currentView === 'favorites'"
:folders="favoriteFolders"
@@ -87,9 +88,7 @@
@open-detail="openDetail"
/>
<template v-else-if="activeTab === 'home'">
<div
class="max-h-[calc(100vh-8rem)] overflow-y-auto pr-2 scrollbar-nowidth"
>
<div class="h-full overflow-y-auto pr-2 scrollbar-nowidth">
<HomeView
:links="homeLinks"
:loading="homeLoading"
@@ -99,14 +98,16 @@
</div>
</template>
<template v-else>
<AppGrid
:apps="filteredApps"
:loading="effectiveLoading"
:scroll-key="activeTab + '-' + selectedCategory"
:store-filter="storeFilter"
:show-origin="storeFilter === 'both' && !isHomeListTab"
@open-detail="handleAppCardOpenDetail"
/>
<div class="min-h-0 flex-1">
<AppGrid
:apps="filteredApps"
:loading="effectiveLoading"
:scroll-key="activeTab + '-' + selectedCategory"
:store-filter="storeFilter"
:show-origin="storeFilter === 'both' && !isHomeListTab"
@open-detail="handleAppCardOpenDetail"
/>
</div>
</template>
</div>
</main>
+3 -6
View File
@@ -18,10 +18,7 @@
</div>
<!-- 应用数量较少时使用普通网格带滚动 -->
<div
v-else-if="!loading && apps.length <= 50"
class="non-virtual-scroller"
>
<div v-else-if="!loading && apps.length <= 50" class="non-virtual-scroller">
<div class="grid gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4">
<AppCard
v-for="(app, index) in apps"
@@ -176,14 +173,14 @@ const gridRows = computed(() => {
<style scoped>
.scroller {
height: calc(100vh - 140px); /* 调整高度 */
height: 100%;
overflow-y: auto;
padding: 0; /* 移除内边距 */
margin: -24px -16px; /* 抵消父容器的 px-4 py-6 */
}
.non-virtual-scroller {
height: calc(100vh - 140px);
height: 100%;
overflow-y: auto;
}
+32 -2
View File
@@ -1,6 +1,12 @@
<template>
<div
class="fixed inset-x-4 bottom-4 z-40 rounded-3xl border border-slate-200/70 bg-white shadow-2xl dark:border-slate-800/70 dark:bg-slate-900 sm:left-auto sm:right-6 sm:w-96"
ref="queueRef"
class="fixed inset-x-4 bottom-4 z-40 rounded-3xl border border-slate-200/70 bg-white shadow-2xl transition-all duration-200 dark:border-slate-800/70 dark:bg-slate-900 sm:left-auto sm:right-6 sm:w-96"
:class="
isHidden
? 'pointer-events-none translate-y-[calc(100%+1rem)] opacity-0'
: 'translate-y-0 opacity-100'
"
>
<div
class="flex items-center justify-between px-5 py-4"
@@ -130,7 +136,7 @@
</template>
<script setup lang="ts">
import { ref, computed } from "vue";
import { computed, onMounted, onUnmounted, ref } from "vue";
import type { DownloadItem } from "../global/typedefinition";
const props = defineProps<{
@@ -147,6 +153,30 @@ const emit = defineEmits<{
}>();
const isExpanded = ref(false);
const isHidden = ref(false);
const queueRef = ref<HTMLElement | null>(null);
const onWheel = (event: WheelEvent) => {
if (queueRef.value?.contains(event.target as Node) || event.deltaY === 0) {
return;
}
if (event.deltaY > 0) {
isExpanded.value = false;
isHidden.value = true;
return;
}
isHidden.value = false;
};
onMounted(() => {
document.addEventListener("wheel", onWheel, { passive: true, capture: true });
});
onUnmounted(() => {
document.removeEventListener("wheel", onWheel, { capture: true });
});
const completedDownloads = computed(() => {
return props.downloads.filter((d) => d.status === "completed").length;