From bd5373f57bce3a7461e9108edc1f174032d30258 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 19 Sep 2025 19:54:23 -0500 Subject: [PATCH] Simplify Preferences page --- src/lib/i18n.ts | 12 +++------ src/pages/Preferences.test.tsx | 10 +++----- src/pages/Preferences.tsx | 46 ++++++++++++++-------------------- 3 files changed, 25 insertions(+), 43 deletions(-) diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index cd2aae99..48e19e05 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -19,9 +19,7 @@ const resources = { // Preferences Page preferencesDescription: 'Manage your general application preferences and appearance settings.', - // Appearance Section - appearance: 'Appearance', - appearanceDescription: 'Customize how the application looks and feels.', + // Theme Section theme: 'Theme', themeDescription: 'Choose between light, dark, or system theme preference.', @@ -314,9 +312,7 @@ const resources = { // Preferences Page preferencesDescription: 'Gerencie suas preferências gerais da aplicação e configurações de aparência.', - // Appearance Section - appearance: 'Aparência', - appearanceDescription: 'Personalize como a aplicação se parece e funciona.', + // Theme Section theme: 'Tema', themeDescription: 'Escolha entre preferência de tema claro, escuro ou do sistema.', @@ -609,9 +605,7 @@ const resources = { // Preferences Page preferencesDescription: '管理您的应用程序偏好设置和外观设置。', - // Appearance Section - appearance: '外观', - appearanceDescription: '自定义应用程序的外观和感觉。', + // Theme Section theme: '主题', themeDescription: '选择浅色、深色或系统主题偏好。', diff --git a/src/pages/Preferences.test.tsx b/src/pages/Preferences.test.tsx index a169202d..37cbbe65 100644 --- a/src/pages/Preferences.test.tsx +++ b/src/pages/Preferences.test.tsx @@ -13,14 +13,11 @@ describe('Preferences', () => { // Should show the preferences title expect(screen.getByText('Preferences')).toBeInTheDocument(); - - // Should show appearance section - expect(screen.getByText('Appearance')).toBeInTheDocument(); - - // Should show theme and language labels + + // Should show theme and language labels at top level expect(screen.getByText('Theme')).toBeInTheDocument(); expect(screen.getByText('Language')).toBeInTheDocument(); - + // Should show language picker expect(screen.getByRole('combobox')).toBeInTheDocument(); }); @@ -34,7 +31,6 @@ describe('Preferences', () => { // Check for key translated strings expect(screen.getByText('Manage your general application preferences and appearance settings.')).toBeInTheDocument(); - expect(screen.getByText('Customize how the application looks and feels.')).toBeInTheDocument(); expect(screen.getByText('Select your preferred language for the interface.')).toBeInTheDocument(); }); }); \ No newline at end of file diff --git a/src/pages/Preferences.tsx b/src/pages/Preferences.tsx index 781139d2..ac62a581 100644 --- a/src/pages/Preferences.tsx +++ b/src/pages/Preferences.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { Button } from "@/components/ui/button"; import { ThemePicker } from "@/components/ThemePicker"; import { LanguagePicker } from "@/components/LanguagePicker"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; + import { Label } from "@/components/ui/label"; import { useIsMobile } from "@/hooks/useIsMobile"; import { useNavigate } from "react-router-dom"; @@ -50,35 +50,27 @@ export function Preferences() { )} - - - {t('appearance')} - - {t('appearanceDescription')} - - - -
- -
- -
-

- {t('themeDescription')} -

+
+
+ +
+
+

+ {t('themeDescription')} +

+
-
- -
- -
-

- {t('languageDescription')} -

+
+ +
+
- - +

+ {t('languageDescription')} +

+
+
); }