From be723fa58b5b81e442f2c3fdf92049646ad14e38 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Sun, 26 Apr 2026 17:21:52 +0300 Subject: [PATCH] fix: organize appearance settings sections Separated theme and localization controls Added localized section title --- .../openchamber/OpenChamberVisualSettings.tsx | 272 +++++++++--------- .../ui/src/lib/i18n/messages/en.settings.ts | 1 + .../ui/src/lib/i18n/messages/es.settings.ts | 1 + .../src/lib/i18n/messages/pt-BR.settings.ts | 1 + .../ui/src/lib/i18n/messages/uk.settings.ts | 1 + .../src/lib/i18n/messages/zh-CN.settings.ts | 1 + 6 files changed, 147 insertions(+), 130 deletions(-) diff --git a/packages/ui/src/components/sections/openchamber/OpenChamberVisualSettings.tsx b/packages/ui/src/components/sections/openchamber/OpenChamberVisualSettings.tsx index 3a88572f..50869b5d 100644 --- a/packages/ui/src/components/sections/openchamber/OpenChamberVisualSettings.tsx +++ b/packages/ui/src/components/sections/openchamber/OpenChamberVisualSettings.tsx @@ -445,6 +445,8 @@ export const OpenChamberVisualSettings: React.FC const isVSCode = isVSCodeRuntime(); const hasAppearanceSettings = (shouldShow('theme') || shouldShow('pwaInstallName') || shouldShow('pwaOrientation') || shouldShow('timeFormat') || shouldShow('weekStart')) && !isVSCode; + const hasThemeSettings = shouldShow('theme') && !isVSCode; + const hasLocalizationSettings = (shouldShow('theme') || shouldShow('timeFormat') || shouldShow('weekStart')) && !isVSCode; const hasLayoutSettings = shouldShow('fontSize') || shouldShow('terminalFontSize') || shouldShow('spacing') || shouldShow('inputBarOffset'); const hasNavigationSettings = shouldShow('terminalQuickKeys') && !isMobile; const hasBehaviorSettings = shouldShow('mermaidRendering') @@ -580,10 +582,9 @@ export const OpenChamberVisualSettings: React.FC {/* --- Appearance & Themes --- */} {hasAppearanceSettings && ( -
-
- -
+
+ {hasThemeSettings && ( +
{t('settings.openchamber.visual.section.colorMode')}
@@ -593,149 +594,159 @@ export const OpenChamberVisualSettings: React.FC variant="chip" size="xs" aria-pressed={themeMode === option.value} - className="!font-normal" - onClick={() => setThemeMode(option.value)} - > + className="!font-normal" + onClick={() => setThemeMode(option.value)} + > {tUnsafe(option.labelKey)} ))}
-
-
-
- {t('settings.appearance.language.label')} - {t('settings.appearance.language.description')} +
+
+ {t('settings.openchamber.visual.field.lightTheme')} + +
+
+ {t('settings.openchamber.visual.field.darkTheme')} + +
- -
-
-
- {t('settings.openchamber.visual.field.lightTheme')} - setLocale(value as Locale)}> + + {label(locale)} - {lightThemes.map((theme) => ( - - {formatThemeLabel(theme.metadata.name, 'light')} + {locales.map((availableLocale) => ( + + {label(availableLocale)} ))}
-
- {t('settings.openchamber.visual.field.darkTheme')} - -
-
- {(shouldShow('timeFormat') || shouldShow('weekStart')) && ( -
- {shouldShow('timeFormat') && ( -
- {t('settings.openchamber.visual.field.timeFormat')} - -
- )} + {(shouldShow('timeFormat') || shouldShow('weekStart')) && ( +
+ {shouldShow('timeFormat') && ( +
+ {t('settings.openchamber.visual.field.timeFormat')} + +
+ )} - {shouldShow('weekStart') && ( -
- {t('settings.openchamber.visual.field.weekStartsOn')} - -
- )} -
- )} + {shouldShow('weekStart') && ( +
+ {t('settings.openchamber.visual.field.weekStartsOn')} + +
+ )} +
+ )} +
+ )} -
- - - - - - - {t('settings.openchamber.visual.field.themeImportInfoTooltip')} - - -
+ {(showPwaInstallNameSetting || showPwaOrientationSetting) && ( +
{showPwaInstallNameSetting && (
@@ -824,7 +835,8 @@ export const OpenChamberVisualSettings: React.FC
)} - + + )} )} diff --git a/packages/ui/src/lib/i18n/messages/en.settings.ts b/packages/ui/src/lib/i18n/messages/en.settings.ts index a0ad3c29..e28e5daa 100644 --- a/packages/ui/src/lib/i18n/messages/en.settings.ts +++ b/packages/ui/src/lib/i18n/messages/en.settings.ts @@ -1322,6 +1322,7 @@ export const settingsDict = { 'settings.voice.page.preview.voiceLine': 'Hello! I\'m {voiceName}. This is how I sound.', 'settings.voice.page.preview.customServerLine': 'Hello! This is a preview of the custom TTS server.', 'settings.openchamber.visual.section.colorMode': 'Color Mode', + 'settings.openchamber.visual.section.localization': 'Localization', 'settings.openchamber.visual.section.spacingAndLayout': 'Spacing & Layout', 'settings.openchamber.visual.section.navigation': 'Navigation', 'settings.openchamber.visual.section.chatRenderMode': 'Chat Render Mode', diff --git a/packages/ui/src/lib/i18n/messages/es.settings.ts b/packages/ui/src/lib/i18n/messages/es.settings.ts index 997854ac..403b98f5 100644 --- a/packages/ui/src/lib/i18n/messages/es.settings.ts +++ b/packages/ui/src/lib/i18n/messages/es.settings.ts @@ -1322,6 +1322,7 @@ export const settingsDict = { "settings.voice.page.preview.voiceLine": "¡Hola! Soy {voiceName}. Así suena mi voz.", "settings.voice.page.preview.customServerLine": "¡Hola! Esta es una previsualización del servidor TTS personalizado.", "settings.openchamber.visual.section.colorMode": "Modo de color", + "settings.openchamber.visual.section.localization": "Localización", "settings.openchamber.visual.section.spacingAndLayout": "Espaciado y diseño", "settings.openchamber.visual.section.navigation": "Navegación", "settings.openchamber.visual.section.chatRenderMode": "Modo de renderizado de chat", diff --git a/packages/ui/src/lib/i18n/messages/pt-BR.settings.ts b/packages/ui/src/lib/i18n/messages/pt-BR.settings.ts index 25af0a2e..91fb58ae 100644 --- a/packages/ui/src/lib/i18n/messages/pt-BR.settings.ts +++ b/packages/ui/src/lib/i18n/messages/pt-BR.settings.ts @@ -1322,6 +1322,7 @@ export const settingsDict = { "settings.voice.page.preview.voiceLine": "Olá! Sou {voiceName}. É assim que minha voz soa.", "settings.voice.page.preview.customServerLine": "Olá! Esta é uma prévia do servidor TTS personalizado.", "settings.openchamber.visual.section.colorMode": "Modo de cor", + "settings.openchamber.visual.section.localization": "Localização", "settings.openchamber.visual.section.spacingAndLayout": "Espaçamento e layout", "settings.openchamber.visual.section.navigation": "Navegação", "settings.openchamber.visual.section.chatRenderMode": "Modo de renderizado de chat", diff --git a/packages/ui/src/lib/i18n/messages/uk.settings.ts b/packages/ui/src/lib/i18n/messages/uk.settings.ts index 8d78d6c2..5f657219 100644 --- a/packages/ui/src/lib/i18n/messages/uk.settings.ts +++ b/packages/ui/src/lib/i18n/messages/uk.settings.ts @@ -1322,6 +1322,7 @@ export const settingsDict = { "settings.voice.page.preview.voiceLine": "Привіт! Я {voiceName}. Ось як я звучу.", "settings.voice.page.preview.customServerLine": "Привіт! Це попередній перегляд спеціального сервера TTS.", "settings.openchamber.visual.section.colorMode": "Режим теми", + "settings.openchamber.visual.section.localization": "Локалізація", "settings.openchamber.visual.section.spacingAndLayout": "Відступи й компонування", "settings.openchamber.visual.section.navigation": "Навігація", "settings.openchamber.visual.section.chatRenderMode": "Режим візуалізації чату", diff --git a/packages/ui/src/lib/i18n/messages/zh-CN.settings.ts b/packages/ui/src/lib/i18n/messages/zh-CN.settings.ts index a9406014..2a26c225 100644 --- a/packages/ui/src/lib/i18n/messages/zh-CN.settings.ts +++ b/packages/ui/src/lib/i18n/messages/zh-CN.settings.ts @@ -1322,6 +1322,7 @@ export const settingsDict = { 'settings.voice.page.preview.voiceLine': '你好!我是 {voiceName}。这是我的声音效果。', 'settings.voice.page.preview.customServerLine': '你好!这是自定义 TTS 服务器的预览。', 'settings.openchamber.visual.section.colorMode': '颜色模式', + 'settings.openchamber.visual.section.localization': '本地化', 'settings.openchamber.visual.section.spacingAndLayout': '间距与布局', 'settings.openchamber.visual.section.navigation': '导航', 'settings.openchamber.visual.section.chatRenderMode': '聊天渲染模式',