From 812b1fff4c61630ca0a1b33fa2b648c88cb03349 Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Sun, 21 Jun 2026 11:58:01 -0400 Subject: [PATCH] fix(web): stop spurious page refresh on account menu open; plugin log auto-refresh as switch Two unrelated frontend fixes: - LanguageSelector mounts each time the sidebar account dropdown opens and unconditionally called i18n.changeLanguage() on mount, emitting a languageChanged event even when the language was unchanged. That handed every useTranslation() consumer a fresh `t` reference, re-running effects keyed on `t` (e.g. the plugins page system-status fetch) and surfacing as a page "refresh". Guard the call so it only fires on an actual change. - Plugin logs auto-refresh control changed from a toggle Button to a Switch + Label; the on/off button i18n keys are replaced by a single static logsAutoRefresh label across all 8 locales. --- .../plugin-logs/PluginLogs.tsx | 26 +++++++++++-------- web/src/components/ui/language-selector.tsx | 11 +++++++- web/src/i18n/locales/en-US.ts | 3 +-- web/src/i18n/locales/es-ES.ts | 3 +-- web/src/i18n/locales/ja-JP.ts | 3 +-- web/src/i18n/locales/ru-RU.ts | 3 +-- web/src/i18n/locales/th-TH.ts | 3 +-- web/src/i18n/locales/vi-VN.ts | 3 +-- web/src/i18n/locales/zh-Hans.ts | 3 +-- web/src/i18n/locales/zh-Hant.ts | 3 +-- 10 files changed, 33 insertions(+), 28 deletions(-) diff --git a/web/src/app/home/plugins/components/plugin-installed/plugin-logs/PluginLogs.tsx b/web/src/app/home/plugins/components/plugin-installed/plugin-logs/PluginLogs.tsx index bc535ba5c..a58198b66 100644 --- a/web/src/app/home/plugins/components/plugin-installed/plugin-logs/PluginLogs.tsx +++ b/web/src/app/home/plugins/components/plugin-installed/plugin-logs/PluginLogs.tsx @@ -3,6 +3,8 @@ import { httpClient } from '@/app/infra/http/HttpClient'; import { useTranslation } from 'react-i18next'; import { PluginLogEntry } from '@/app/infra/entities/plugin'; import { Button } from '@/components/ui/button'; +import { Switch } from '@/components/ui/switch'; +import { Label } from '@/components/ui/label'; import { Select, SelectContent, @@ -116,17 +118,19 @@ export default function PluginLogs({ /> {t('plugins.logsRefresh')} - +
+ + +