From 54b88d9c8973110a27f3e94b1f225841dca23df6 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 11 Sep 2025 12:06:49 +0800 Subject: [PATCH] refactor(ui): redesign update notification to match Linear design system - Replace gradient background with solid colors and subtle borders - Remove decorative Info icon from settings panel that had no functionality - Change update badge icon from Sparkles to Download for better clarity - Simplify update button states with consistent blue primary color - Remove all gradient effects in favor of flat design - Unify hover states and transitions across all update-related UI The update notification now seamlessly integrates with the app's Linear-inspired aesthetic, providing a clean and non-intrusive user experience. --- src/components/SettingsModal.tsx | 16 ++++++---------- src/components/UpdateBadge.tsx | 32 +++++++++++++++++--------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx index 95f993b..95cf8ac 100644 --- a/src/components/SettingsModal.tsx +++ b/src/components/SettingsModal.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import { X, Info, RefreshCw, FolderOpen, Download, ExternalLink } from "lucide-react"; +import { X, RefreshCw, FolderOpen, Download, ExternalLink } from "lucide-react"; import { getVersion } from "@tauri-apps/api/app"; import "../lib/tauri-api"; import { relaunchApp } from "../lib/updater"; @@ -192,11 +192,7 @@ export default function SettingsModal({ onClose }: SettingsModalProps) {
-
- +

CC Switch @@ -222,10 +218,10 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { disabled={isCheckingUpdate || isDownloading} className={`px-3 py-1.5 text-xs font-medium rounded-lg transition-all ${ isCheckingUpdate || isDownloading - ? "bg-white dark:bg-gray-700 text-gray-400 dark:text-gray-500" + ? "bg-gray-100 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed" : hasUpdate - ? "bg-gradient-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 text-white" - : "bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 text-blue-500 dark:text-blue-400" + ? "bg-blue-500 hover:bg-blue-600 dark:bg-blue-600 dark:hover:bg-blue-700 text-white" + : "bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 text-blue-500 dark:text-blue-400 border border-gray-200 dark:border-gray-600" }`} > {isDownloading ? ( @@ -241,7 +237,7 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { ) : hasUpdate ? ( - 点击更新 {updateInfo?.availableVersion} + 更新到 v{updateInfo?.availableVersion} ) : ( "检查更新" diff --git a/src/components/UpdateBadge.tsx b/src/components/UpdateBadge.tsx index f217c48..21fa340 100644 --- a/src/components/UpdateBadge.tsx +++ b/src/components/UpdateBadge.tsx @@ -1,9 +1,9 @@ -import { X, Sparkles } from "lucide-react"; +import { X, Download } from "lucide-react"; import { useUpdate } from "../contexts/UpdateContext"; interface UpdateBadgeProps { className?: string; - onClick?: () => void; // 点击徽标的回调(例如打开设置) + onClick?: () => void; } export function UpdateBadge({ className = "", onClick }: UpdateBadgeProps) { @@ -17,12 +17,13 @@ export function UpdateBadge({ className = "", onClick }: UpdateBadgeProps) { return (

- - - 新版本 {updateInfo.availableVersion} + > + + + v{updateInfo.availableVersion}
);