AGC 更新提示增加 X 关闭按钮 (#276)
Project CI / Frontend tests (push) Successful in 8m49s
Project CI / Repository checks (push) Successful in 8m50s
Project CI / Backend tests (push) Successful in 10m3s
Project CI / Native shell tests (push) Failing after 20m52s

## 变更内容
- 为 AGC 更新提示增加可访问的 X 关闭按钮。
- 复用现有 dismiss 逻辑,手动关闭后立即移除提示。
- 增加关闭按钮的 hover、禁用和图标样式。

## 验证
- npm --prefix apps/ai-game-creator-shell run typecheck
- npm exec vitest run apps/ai-game-creator-shell/tests/appUpdate.test.ts
- npm run check:encoding
- git diff --check

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/276
Reviewed-by: 段舒康 <kdletters@qq.com>
Co-authored-by: 孔令弘 <ink29535@proton.me>
Co-committed-by: 孔令弘 <ink29535@proton.me>
This commit was merged in pull request #276.
This commit is contained in:
2026-09-04 11:24:21 +08:00
committed by 段舒康
parent f5f94111ca
commit 8d13e868bd
2 changed files with 32 additions and 1 deletions
@@ -1,5 +1,5 @@
import { listen } from '@tauri-apps/api/event';
import { Download, LoaderCircle } from 'lucide-react';
import { Download, LoaderCircle, X } from 'lucide-react';
import { useEffect, useState } from 'react';
import { APP_VERSION } from '../app/appMetadata';
@@ -117,6 +117,16 @@ export function AppUpdateNotice() {
>
{isDownloading ? '正在下载…' : '下载更新'}
</button>
<button
type="button"
className="app-update-close"
onClick={dismiss}
disabled={isDownloading}
aria-label="关闭更新提示"
title="关闭"
>
<X size={18} aria-hidden="true" />
</button>
</aside>
{downloadState !== 'idle' ? (
<div
+21
View File
@@ -75,6 +75,27 @@ body {
cursor: wait;
opacity: 0.65;
}
.app-update-notice .app-update-close {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: 0;
border-radius: 6px;
background: transparent;
color: #8d6a58;
cursor: pointer;
}
.app-update-notice .app-update-close:hover {
background: rgb(199 101 61 / 12%);
color: #4a220f;
}
.app-update-notice .app-update-close:disabled {
cursor: wait;
opacity: 0.5;
}
.app-update-overlay {
position: fixed;