From a1639921ac44841041a78c3c1892e99c7fd1dfbc Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Fri, 19 Jun 2026 10:03:24 -0500 Subject: [PATCH] fix(desktop): offer a Restart gateway action on messaging save/toggle toasts The "setup saved" and "platform enabled/disabled" toasts told users their change needs a gateway restart but left it a separate hunt. Attach a "Restart gateway" action (the shared runGatewayRestart), and reword the copy to state the pending consequence ("...takes effect after a gateway restart") now that the button carries the verb. Updated all 4 locales. --- apps/desktop/src/app/messaging/index.tsx | 9 +++++++-- apps/desktop/src/i18n/en.ts | 4 ++-- apps/desktop/src/i18n/ja.ts | 4 ++-- apps/desktop/src/i18n/zh-hant.ts | 4 ++-- apps/desktop/src/i18n/zh.ts | 4 ++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/desktop/src/app/messaging/index.tsx b/apps/desktop/src/app/messaging/index.tsx index 7fc6ce212ef..f7f3eaa91e2 100644 --- a/apps/desktop/src/app/messaging/index.tsx +++ b/apps/desktop/src/app/messaging/index.tsx @@ -17,6 +17,7 @@ import { type Translations, useI18n } from '@/i18n' import { AlertTriangle, ExternalLink, Save, Trash2 } from '@/lib/icons' import { cn } from '@/lib/utils' import { notify, notifyError } from '@/store/notifications' +import { runGatewayRestart } from '@/store/system-actions' import { useRefreshHotkey } from '../hooks/use-refresh-hotkey' import { useRouteEnumParam } from '../hooks/use-route-enum-param' @@ -97,6 +98,8 @@ function fieldCopy(field: MessagingEnvVarInfo, m: Translations['messaging']) { export function MessagingView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...props }: MessagingViewProps) { const { t } = useI18n() const m = t.messaging + // Both save/toggle toasts offer the same one-click restart. + const restartGatewayAction = { label: t.commandCenter.restartGateway, onClick: () => void runGatewayRestart() } const [platforms, setPlatforms] = useState(null) const [edits, setEdits] = useState({}) const [query, setQuery] = useState('') @@ -197,7 +200,8 @@ export function MessagingView({ setStatusbarItemGroup: _setStatusbarItemGroup, . notify({ kind: 'success', title: enabled ? m.platformEnabled(platform.name) : m.platformDisabled(platform.name), - message: m.restartToApply + message: m.restartToApply, + action: restartGatewayAction }) } catch (err) { notifyError(err, m.failedUpdate(platform.name)) @@ -222,7 +226,8 @@ export function MessagingView({ setStatusbarItemGroup: _setStatusbarItemGroup, . notify({ kind: 'success', title: m.setupSaved(platform.name), - message: m.restartToReconnect + message: m.restartToReconnect, + action: restartGatewayAction }) } catch (err) { notifyError(err, m.failedSave(platform.name)) diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts index 7d2f54a5bfc..221d2b4792c 100644 --- a/apps/desktop/src/i18n/en.ts +++ b/apps/desktop/src/i18n/en.ts @@ -831,9 +831,9 @@ export const en: Translations = { disableAria: name => `Disable ${name}`, platformEnabled: name => `${name} enabled`, platformDisabled: name => `${name} disabled`, - restartToApply: 'Restart the gateway for this change to take effect.', + restartToApply: 'This change takes effect after a gateway restart.', setupSaved: name => `${name} setup saved`, - restartToReconnect: 'Restart the gateway to reconnect with the new credentials.', + restartToReconnect: 'New credentials take effect after a gateway restart.', keyCleared: key => `${key} cleared`, setupUpdated: name => `${name} setup was updated.`, failedUpdate: name => `Failed to update ${name}`, diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts index 467732dc992..c1b9e7e10c6 100644 --- a/apps/desktop/src/i18n/ja.ts +++ b/apps/desktop/src/i18n/ja.ts @@ -952,9 +952,9 @@ export const ja = defineLocale({ disableAria: name => `${name} を無効にする`, platformEnabled: name => `${name} を有効にしました`, platformDisabled: name => `${name} を無効にしました`, - restartToApply: 'この変更を有効にするにはゲートウェイを再起動してください。', + restartToApply: 'この変更はゲートウェイの再起動後に有効になります。', setupSaved: name => `${name} の設定を保存しました`, - restartToReconnect: '新しい認証情報で再接続するにはゲートウェイを再起動してください。', + restartToReconnect: '新しい認証情報はゲートウェイの再起動後に有効になります。', keyCleared: key => `${key} をクリアしました`, setupUpdated: name => `${name} の設定が更新されました。`, failedUpdate: name => `${name} の更新に失敗しました`, diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts index 1ece58d86a6..0da0af98037 100644 --- a/apps/desktop/src/i18n/zh-hant.ts +++ b/apps/desktop/src/i18n/zh-hant.ts @@ -924,9 +924,9 @@ export const zhHant = defineLocale({ disableAria: name => `停用 ${name}`, platformEnabled: name => `${name} 已啟用`, platformDisabled: name => `${name} 已停用`, - restartToApply: '重新啟動閘道後此變更才會生效。', + restartToApply: '此變更將在閘道重新啟動後生效。', setupSaved: name => `${name} 設定已儲存`, - restartToReconnect: '重新啟動閘道以使用新憑證重新連線。', + restartToReconnect: '新憑證將在閘道重新啟動後生效。', keyCleared: key => `${key} 已清除`, setupUpdated: name => `${name} 設定已更新。`, failedUpdate: name => `更新 ${name} 失敗`, diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts index 30e3a69b247..958fa336649 100644 --- a/apps/desktop/src/i18n/zh.ts +++ b/apps/desktop/src/i18n/zh.ts @@ -1021,9 +1021,9 @@ export const zh: Translations = { disableAria: name => `禁用 ${name}`, platformEnabled: name => `${name} 已启用`, platformDisabled: name => `${name} 已禁用`, - restartToApply: '重启网关后此更改才会生效。', + restartToApply: '此更改将在网关重启后生效。', setupSaved: name => `${name} 设置已保存`, - restartToReconnect: '重启网关以使用新凭据重新连接。', + restartToReconnect: '新凭据将在网关重启后生效。', keyCleared: key => `${key} 已清除`, setupUpdated: name => `${name} 设置已更新。`, failedUpdate: name => `更新 ${name} 失败`,