Skip to content

The agent that grows with you

fix(desktop): complete locales and reuse CopyButton for full changelog copy

Brooklyn Nicholson6f2a01fce7a2
diff --git a/apps/desktop/src/app/updates-overlay.tsx b/apps/desktop/src/app/updates-overlay.tsx
index e3f11ae7a00..ee79476d62e 100644
--- a/apps/desktop/src/app/updates-overlay.tsx
+++ b/apps/desktop/src/app/updates-overlay.tsx
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'
import { BrandMark } from '@/components/brand-mark'
import { SyncStatusCard } from '@/components/sync-status-card'
import { Button } from '@/components/ui/button'
-import { writeClipboardText } from '@/components/ui/copy-button'
+import { CopyButton, writeClipboardText } from '@/components/ui/copy-button'
import {
Dialog,
DialogContent,
@@ -25,10 +25,10 @@ import type {
UpdaterMechanismClient
} from '@/global'
import { useI18n } from '@/i18n'
-import { buildCommitChangelog, formatFullChangelogText, type CommitGroup } from '@/lib/commit-changelog'
+import { buildCommitChangelog, type CommitGroup, formatFullChangelogText } from '@/lib/commit-changelog'
import { AlertCircle, Check, Copy, Terminal } from '@/lib/icons'
-import { cn } from '@/lib/utils'
import { resolveUpdateCopy, type UpdateTarget } from '@/lib/update-copy'
+import { cn } from '@/lib/utils'
import {
$backendUpdateApply,
$backendUpdateChecking,
@@ -295,14 +295,7 @@ function IdleView({
copy: u
})
- const [logCopied, setLogCopied] = useState(false)
-
- const handleCopyFullLog = () => {
- void writeClipboardText(formatFullChangelogText(commits, behind, status.branch)).then(() => {
- setLogCopied(true)
- window.setTimeout(() => setLogCopied(false), 1800)
- })
- }
+ const handleCopyFullLog = () => formatFullChangelogText(commits, behind, status.branch)
return (
<div className="grid gap-5 px-6 pb-6 pt-7 pr-8">
@@ -330,23 +323,15 @@ function IdleView({
</div>
{commits.length > 0 && (
- <button
- className="group flex w-full items-center justify-center gap-2 rounded-lg border border-border/50 bg-transparent px-3 py-2 text-xs font-medium text-muted-foreground transition-colors hover:border-border hover:bg-muted/30 hover:text-foreground"
- onClick={handleCopyFullLog}
- type="button"
+ <CopyButton
+ buttonSize="sm"
+ buttonVariant="outline"
+ className="w-full font-medium"
+ label={u.copyFullLog}
+ text={handleCopyFullLog}
>
- {logCopied ? (
- <>
- <Check className="size-3.5 text-emerald-600 dark:text-emerald-400" />
- {u.copied}
- </>
- ) : (
- <>
- <Copy className="size-3.5" />
- {u.copyFullLog}
- </>
- )}
- </button>
+ {u.copyFullLog}
+ </CopyButton>
)}
<div className="grid gap-2">
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 36bc332f925..f3e192c276a 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -2675,6 +2675,7 @@ export const ar = defineLocale({
updateNow: 'التحديث الآن',
maybeLater: 'ربما لاحقا',
moreChanges: count => `+ ${count} تغيير${count === 1 ? '' : 'ات'} إضافي مُضمَّن.`,
+ copyFullLog: 'نسخ سجل التغييرات الكامل',
manualTitle: 'التحديث من الطرفية',
manualUnavailableTitle: 'لا يمكن التحديث من هنا',
manualBody: 'لقد ثبّتت Hermes من سطر الأوامر، لذا تُجرى التحديثات من هناك أيضا. الصق هذا في طرفيتك:',
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index 5a111ddb6a7..51e3748cca5 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -4635,6 +4635,7 @@ export const deOverrides = {
updateNow: 'Jetzt aktualisieren',
maybeLater: 'Später',
moreChanges: count => `+ ${count} weitere Änderung${count === 1 ? '' : 'en'} enthalten.`,
+ copyFullLog: 'Vollständiges Änderungsprotokoll kopieren',
manualTitle: 'Über Ihr Terminal aktualisieren',
manualUnavailableTitle: 'Aktualisierung hier nicht möglich',
manualBody:
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index 148ad33a029..5c6f155a27e 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -4628,6 +4628,7 @@ export const esOverrides = {
updateNow: 'Actualizar ahora',
maybeLater: 'Quizá más tarde',
moreChanges: count => `+ ${count} ${count === 1 ? 'cambio incluido' : 'cambios incluidos'}.`,
+ copyFullLog: 'Copiar el registro de cambios completo',
manualTitle: 'Actualizar desde la terminal',
manualUnavailableTitle: 'No se puede actualizar desde aquí',
manualBody:
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index b902b5f13f2..a524c9aa72e 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -4648,6 +4648,7 @@ export const frOverrides = {
maybeLater: 'Peut-être plus tard',
moreChanges: count =>
`+ ${count} ${count === 1 ? 'changement supplémentaire inclus' : 'changements supplémentaires inclus'}.`,
+ copyFullLog: 'Copier le journal complet des modifications',
manualTitle: 'Mise à jour depuis votre terminal',
manualUnavailableTitle: 'Mise à jour impossible ici',
manualBody:
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 55e8aeb5236..137b18b1307 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -3292,6 +3292,7 @@ export const ru = defineLocale({
updateNow: 'Обновить сейчас',
maybeLater: 'Возможно позже',
moreChanges: count => `+ ещё ${count} ${RU_NOUN(count, 'изменение', 'изменения', 'изменений')} включено.`,
+ copyFullLog: 'Скопировать полный список изменений',
manualTitle: 'Обновление из терминала',
manualUnavailableTitle: 'Обновление здесь недоступно',
manualBody: