Skip to content

Commit f2f17ae

Browse files
authored
fix(ui): make update dialog scrollable
fix(ui): make update dialog scrollable
1 parent 01468a0 commit f2f17ae

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/renderer/src/components/ui/UpdateDialog.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<template>
22
<Dialog :open="upgrade.showUpdateDialog" @update:open="upgrade.closeUpdateDialog">
3-
<DialogContent>
4-
<DialogHeader>
3+
<DialogContent class="max-h-[85dvh] sm:max-w-[720px] flex flex-col overflow-hidden">
4+
<DialogHeader class="shrink-0">
55
<DialogTitle>{{ t(upgrade.hasUpdate ? 'update.newVersion' : 'update.alreadyUpToDate') }}</DialogTitle>
6-
<DialogDescription>
7-
<div class="space-y-2">
6+
<DialogDescription class="flex-1 min-h-0">
7+
<div class="flex min-h-0 flex-col space-y-2">
88
<template v-if="upgrade.hasUpdate">
99
<p>{{ t('update.version') }}: {{ upgrade.updateInfo?.version }}</p>
1010
<p>{{ t('update.releaseDate') }}: {{ upgrade.updateInfo?.releaseDate }}</p>
1111
<p>{{ t('update.releaseNotes') }}:</p>
12-
<p class="whitespace-pre-line">
13-
<NodeRenderer :isDark="themeStore.isDark" :content="upgrade.updateInfo?.releaseNotes"></NodeRenderer>
14-
</p>
12+
<ScrollArea class="max-h-[50dvh] pr-3">
13+
<div class="whitespace-pre-line">
14+
<NodeRenderer :isDark="themeStore.isDark" :content="upgrade.updateInfo?.releaseNotes"></NodeRenderer>
15+
</div>
16+
</ScrollArea>
1517
<!-- 显示下载进度 -->
1618
<div v-if="upgrade.isDownloading && upgrade.updateProgress" class="mt-4">
1719
<p class="mb-2">
@@ -64,6 +66,7 @@ import {
6466
DialogHeader,
6567
DialogTitle
6668
} from '@shadcn/components/ui/dialog'
69+
import { ScrollArea } from '@shadcn/components/ui/scroll-area'
6770
import { useUpgradeStore } from '@/stores/upgrade'
6871
import NodeRenderer from 'markstream-vue'
6972
import { useThemeStore } from '@/stores/theme'

0 commit comments

Comments
 (0)