From 11fae79346a29e46da4a0fe7e51b88fc3f82cf4e Mon Sep 17 00:00:00 2001 From: Cyrus Gray <144336577+graycyrus@users.noreply.github.com> Date: Fri, 5 Jun 2026 17:45:10 +0530 Subject: [PATCH] feat(appearance): add global font size setting (#3120) (#3396) --- .../settings/panels/AppearancePanel.test.tsx | 48 ++++++++ .../settings/panels/AppearancePanel.tsx | 104 ++++++++++++++++++ app/src/lib/i18n/ar.ts | 12 ++ app/src/lib/i18n/bn.ts | 12 ++ app/src/lib/i18n/de.ts | 12 ++ app/src/lib/i18n/en.ts | 12 ++ app/src/lib/i18n/es.ts | 12 ++ app/src/lib/i18n/fr.ts | 12 ++ app/src/lib/i18n/hi.ts | 12 ++ app/src/lib/i18n/id.ts | 12 ++ app/src/lib/i18n/it.ts | 12 ++ app/src/lib/i18n/ko.ts | 12 ++ app/src/lib/i18n/pl.ts | 12 ++ app/src/lib/i18n/pt.ts | 12 ++ app/src/lib/i18n/ru.ts | 12 ++ app/src/lib/i18n/zh-CN.ts | 12 ++ app/src/providers/ThemeProvider.test.tsx | 32 ++++++ app/src/providers/ThemeProvider.tsx | 26 ++++- app/src/store/index.ts | 2 +- app/src/store/themeSlice.test.ts | 41 +++++++ app/src/store/themeSlice.ts | 27 ++++- app/src/test/test-utils.tsx | 5 +- 22 files changed, 443 insertions(+), 10 deletions(-) create mode 100644 app/src/components/settings/panels/AppearancePanel.test.tsx create mode 100644 app/src/providers/ThemeProvider.test.tsx create mode 100644 app/src/store/themeSlice.test.ts diff --git a/app/src/components/settings/panels/AppearancePanel.test.tsx b/app/src/components/settings/panels/AppearancePanel.test.tsx new file mode 100644 index 000000000..16de804c5 --- /dev/null +++ b/app/src/components/settings/panels/AppearancePanel.test.tsx @@ -0,0 +1,48 @@ +import { fireEvent, within } from '@testing-library/react'; +import { describe, expect, it, vi } from 'vitest'; + +import { renderWithProviders } from '../../../test/test-utils'; +import AppearancePanel from './AppearancePanel'; + +// Pass-through translator so assertions can target the i18n keys directly. +vi.mock('../../../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (key: string) => key }) })); + +vi.mock('../hooks/useSettingsNavigation', () => ({ + useSettingsNavigation: () => ({ breadcrumbs: [], navigateBack: vi.fn() }), +})); + +vi.mock('../components/SettingsHeader', () => ({ + default: ({ title }: { title: string }) =>