fix(update-center): handle missing apm and restore scrolling

This commit is contained in:
2026-04-16 11:11:06 +08:00
parent 120233cf56
commit e1ec526cb9
4 changed files with 41 additions and 35 deletions
@@ -91,6 +91,34 @@ const createStore = (
};
describe("UpdateCenterModal", () => {
it("constrains the update list so it can scroll with a visible scrollbar", () => {
const store = createStore({
items: Array.from({ length: 20 }, (_, index) =>
createItem({
taskKey: `aptss:spark-item-${index}`,
packageName: `spark-item-${index}`,
displayName: `Spark Item ${index}`,
}),
),
tasks: [],
warnings: [],
hasRunningTasks: false,
});
const { container } = render(UpdateCenterModal, {
props: {
show: true,
store,
},
});
const scrollContainer = container.querySelector(".scrollbar-muted");
expect(scrollContainer?.className).toContain("overflow-y-auto");
expect(scrollContainer?.className).toContain("flex-1");
expect(scrollContainer?.className).toContain("overscroll-contain");
});
it("renders source tags, running state, warnings, and migration marker", () => {
const store = createStore();
+1 -1
View File
@@ -42,7 +42,7 @@
</p>
</div>
<div class="min-h-0 flex-1">
<div class="flex min-h-0 flex-1">
<UpdateCenterList
:items="store.filteredItems.value"
:tasks="store.snapshot.value.tasks"
@@ -1,6 +1,6 @@
<template>
<div
class="min-h-0 overflow-y-auto overscroll-contain scrollbar-muted border-r border-slate-200/70 p-6 dark:border-slate-800/70"
class="min-h-0 flex-1 overflow-y-auto overscroll-contain scrollbar-muted border-r border-slate-200/70 p-6 dark:border-slate-800/70"
>
<div
v-if="items.length === 0"