diff --git a/apps/frontend/src/renderer/components/AppUpdateNotification.tsx b/apps/frontend/src/renderer/components/AppUpdateNotification.tsx index 2238aee3..7bd00f30 100644 --- a/apps/frontend/src/renderer/components/AppUpdateNotification.tsx +++ b/apps/frontend/src/renderer/components/AppUpdateNotification.tsx @@ -1,24 +1,20 @@ -import { useState, useEffect, useMemo } from 'react'; -import { - Download, - RefreshCw, - CheckCircle2, - AlertCircle -} from 'lucide-react'; -import { Button } from './ui/button'; -import { Progress } from './ui/progress'; +import { useState, useEffect, useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import { Download, RefreshCw, CheckCircle2, AlertCircle, ExternalLink } from "lucide-react"; +import { Button } from "./ui/button"; +import { Progress } from "./ui/progress"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, - DialogTitle -} from './ui/dialog'; -import type { - AppUpdateAvailableEvent, - AppUpdateProgress -} from '../../shared/types'; + DialogTitle, +} from "./ui/dialog"; +import type { AppUpdateAvailableEvent, AppUpdateProgress } from "../../shared/types"; + +const CLAUDE_CODE_CHANGELOG_URL = + "https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md"; /** * Simple markdown renderer for release notes @@ -28,23 +24,32 @@ function ReleaseNotesRenderer({ markdown }: { markdown: string }) { const html = useMemo(() => { const result = markdown // Escape HTML - .replace(/&/g, '&') - .replace(//g, '>') + .replace(/&/g, "&") + .replace(//g, ">") // Headers (### Header ->
)
.replace(/`([^`]+)`/g, '$1')
// List items (- item -> )
- .replace(/^- (.+)$/gm, ' $1 ')
+ .replace(
+ /^- (.+)$/gm,
+ "$1 "
+ )
// Wrap consecutive list items
.replace(/(]*>.*?<\/li>\n?)+/g, '$&
')
// Line breaks for remaining lines
.replace(/\n\n/g, '')
- .replace(/\n/g, '
');
+ .replace(/\n/g, "
");
return result;
}, [markdown]);
@@ -62,6 +67,7 @@ function ReleaseNotesRenderer({ markdown }: { markdown: string }) {
* Shows when a new app version is available and handles download/install workflow
*/
export function AppUpdateNotification() {
+ const { t } = useTranslation(["dialogs"]);
const [isOpen, setIsOpen] = useState(false);
const [updateInfo, setUpdateInfo] = useState(null);
const [downloadProgress, setDownloadProgress] = useState(null);
@@ -109,12 +115,14 @@ export function AppUpdateNotification() {
try {
const result = await window.electronAPI.downloadAppUpdate();
if (!result.success) {
- setDownloadError(result.error || 'Failed to download update');
+ setDownloadError(
+ result.error || t("dialogs:appUpdate.downloadError", "Failed to download update")
+ );
setIsDownloading(false);
}
} catch (error) {
- console.error('Failed to download app update:', error);
- setDownloadError('Failed to download update');
+ console.error("Failed to download app update:", error);
+ setDownloadError(t("dialogs:appUpdate.downloadError", "Failed to download update"));
setIsDownloading(false);
}
};
@@ -137,10 +145,13 @@ export function AppUpdateNotification() {
- App Update Available
+ {t("dialogs:appUpdate.title", "App Update Available")}
- A new version of Auto Claude is ready to download
+ {t(
+ "dialogs:appUpdate.description",
+ "A new version of Auto Claude is ready to download"
+ )}
@@ -150,14 +161,13 @@ export function AppUpdateNotification() {
- New Version
-
-
- {updateInfo.version}
+ {t("dialogs:appUpdate.newVersion", "New Version")}
+ {updateInfo.version}
{updateInfo.releaseDate && (
- Released {new Date(updateInfo.releaseDate).toLocaleDateString()}
+ {t("dialogs:appUpdate.released", "Released")}{" "}
+ {new Date(updateInfo.releaseDate).toLocaleDateString()}
)}
@@ -178,18 +188,36 @@ export function AppUpdateNotification() {
)}
+ {/* Claude Code Changelog Link */}
+
+
{/* Download Progress */}
{isDownloading && downloadProgress && (
- Downloading...
+
+ {t("dialogs:appUpdate.downloading", "Downloading...")}
+
{Math.round(downloadProgress.percent)}%
- {(downloadProgress.transferred / 1024 / 1024).toFixed(2)} MB / {(downloadProgress.total / 1024 / 1024).toFixed(2)} MB
+ {(downloadProgress.transferred / 1024 / 1024).toFixed(2)} MB /{" "}
+ {(downloadProgress.total / 1024 / 1024).toFixed(2)} MB
)}
@@ -206,39 +234,39 @@ export function AppUpdateNotification() {
{isDownloaded && (
- Update downloaded successfully! Click Install to restart and apply the update.
+
+ {t(
+ "dialogs:appUpdate.updateDownloaded",
+ "Update downloaded successfully! Click Install to restart and apply the update."
+ )}
+
)}
-