-
Notifications
You must be signed in to change notification settings - Fork 625
fix(ui): make update dialog scrollable #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,19 @@ | ||
| <template> | ||
| <Dialog :open="upgrade.showUpdateDialog" @update:open="upgrade.closeUpdateDialog"> | ||
| <DialogContent> | ||
| <DialogHeader> | ||
| <DialogContent class="max-h-[85dvh] sm:max-w-[720px] flex flex-col overflow-hidden"> | ||
| <DialogHeader class="shrink-0"> | ||
| <DialogTitle>{{ t(upgrade.hasUpdate ? 'update.newVersion' : 'update.alreadyUpToDate') }}</DialogTitle> | ||
| <DialogDescription> | ||
| <div class="space-y-2"> | ||
| <DialogDescription class="flex-1 min-h-0"> | ||
| <div class="flex min-h-0 flex-col space-y-2"> | ||
|
Comment on lines
+6
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactor to avoid semantic misuse of DialogDescription. The
Consider using a plain 🔎 Proposed refactor to use semantic structure <DialogHeader class="shrink-0">
<DialogTitle>{{ t(upgrade.hasUpdate ? 'update.newVersion' : 'update.alreadyUpToDate') }}</DialogTitle>
- <DialogDescription class="flex-1 min-h-0">
- <div class="flex min-h-0 flex-col space-y-2">
+ </DialogHeader>
+ <div class="flex-1 min-h-0 flex flex-col space-y-2 px-6">
<template v-if="upgrade.hasUpdate">
<p>{{ t('update.version') }}: {{ upgrade.updateInfo?.version }}</p>
<p>{{ t('update.releaseDate') }}: {{ upgrade.updateInfo?.releaseDate }}</p>
<p>{{ t('update.releaseNotes') }}:</p>
<ScrollArea class="max-h-[50dvh] pr-3">
<div class="whitespace-pre-line">
<NodeRenderer :isDark="themeStore.isDark" :content="upgrade.updateInfo?.releaseNotes"></NodeRenderer>
</div>
</ScrollArea>
<!-- 显示下载进度 -->
<div v-if="upgrade.isDownloading && upgrade.updateProgress" class="mt-4">
<p class="mb-2">
{{ t('update.downloading') }}: {{ Math.round(upgrade.updateProgress.percent) }}%
</p>
<progress class="w-full" :value="upgrade.updateProgress.percent" max="100"></progress>
<p class="text-xs mt-1">
{{ formatSize(upgrade.updateProgress.transferred) }} /
{{ formatSize(upgrade.updateProgress.total) }}
({{ formatSpeed(upgrade.updateProgress.bytesPerSecond) }})
</p>
</div>
</template>
<p class="mt-4" v-else-if="!upgrade.isSilent && !upgrade.hasUpdate">{{ t('update.alreadyUpToDateDesc') }} 🎉🎉🎉</p>
- </div>
- </DialogDescription>
- </DialogHeader>
+ </div>
<DialogFooter>Note: You may need to adjust the 🤖 Prompt for AI Agents |
||
| <template v-if="upgrade.hasUpdate"> | ||
| <p>{{ t('update.version') }}: {{ upgrade.updateInfo?.version }}</p> | ||
| <p>{{ t('update.releaseDate') }}: {{ upgrade.updateInfo?.releaseDate }}</p> | ||
| <p>{{ t('update.releaseNotes') }}:</p> | ||
| <p class="whitespace-pre-line"> | ||
| <NodeRenderer :isDark="themeStore.isDark" :content="upgrade.updateInfo?.releaseNotes"></NodeRenderer> | ||
| </p> | ||
| <ScrollArea class="max-h-[50dvh] pr-3"> | ||
| <div class="whitespace-pre-line"> | ||
| <NodeRenderer :isDark="themeStore.isDark" :content="upgrade.updateInfo?.releaseNotes"></NodeRenderer> | ||
| </div> | ||
| </ScrollArea> | ||
| <!-- 显示下载进度 --> | ||
| <div v-if="upgrade.isDownloading && upgrade.updateProgress" class="mt-4"> | ||
| <p class="mb-2"> | ||
|
|
@@ -64,6 +66,7 @@ import { | |
| DialogHeader, | ||
| DialogTitle | ||
| } from '@shadcn/components/ui/dialog' | ||
| import { ScrollArea } from '@shadcn/components/ui/scroll-area' | ||
| import { useUpgradeStore } from '@/stores/upgrade' | ||
| import NodeRenderer from 'markstream-vue' | ||
| import { useThemeStore } from '@/stores/theme' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 4674
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 92
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 454
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 5142
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 1164
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 50377
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 94
Replace Chinese comment with English equivalent on line 17.
The layout structure with
max-h-[85dvh]andmax-h-[50dvh]is correct and responsive across screen sizes. However, line 17 contains a Chinese comment (<!-- 显示下载进度 -->) which violates the coding guideline requiring all comments to be in English. Replace with<!-- Display download progress -->.🤖 Prompt for AI Agents