From 0b51972da12b470eacd8b31c3f8e482c2cb9800a Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Mon, 8 Dec 2025 10:53:55 +0000 Subject: [PATCH] Merge pull request #28503 from overleaf/mj-split-theme-list-dark-light-legacy [web] Split dark and light options in theme selector GitOrigin-RevId: 507c5a71269b360d23b246516487a0a072ee7d18 --- .../web/frontend/extracted-translations.json | 3 ++ .../settings/settings-editor-theme.tsx | 30 ++--------- .../settings/settings-menu-select.tsx | 14 ++--- .../settings-spell-check-language.tsx | 2 +- .../hooks/use-editor-theme-option-groups.tsx | 51 +++++++++++++++++++ .../editor-theme-setting.tsx | 30 ++--------- .../components/settings/dropdown-setting.tsx | 16 +++--- .../editor-settings/spell-check-setting.tsx | 2 +- services/web/locales/en.json | 3 ++ .../editor-left-menu.spec.tsx | 2 - 10 files changed, 79 insertions(+), 74 deletions(-) create mode 100644 services/web/frontend/js/features/editor-left-menu/hooks/use-editor-theme-option-groups.tsx diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index d5c3036882..1e76b160d5 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -381,6 +381,7 @@ "customizing_figures": "", "customizing_tables": "", "dark_mode_pdf_preview": "", + "dark_themes": "", "date_and_owner": "", "date_and_time": "", "dealing_with_errors": "", @@ -977,6 +978,7 @@ "leave_project": "", "leave_projects": "", "left": "", + "legacy_themes": "", "length_unit": "", "let_us_know": "", "let_us_know_how_we_can_help": "", @@ -985,6 +987,7 @@ "lets_get_you_set_up": "", "library": "", "licenses": "", + "light_themes": "", "limited_document_history": "", "limited_to_n_collaborators_per_project": "", "limited_to_n_collaborators_per_project_plural": "", diff --git a/services/web/frontend/js/features/editor-left-menu/components/settings/settings-editor-theme.tsx b/services/web/frontend/js/features/editor-left-menu/components/settings/settings-editor-theme.tsx index e8c50c86a6..d7db7c5c13 100644 --- a/services/web/frontend/js/features/editor-left-menu/components/settings/settings-editor-theme.tsx +++ b/services/web/frontend/js/features/editor-left-menu/components/settings/settings-editor-theme.tsx @@ -1,43 +1,19 @@ -import { useMemo } from 'react' import { useTranslation } from 'react-i18next' -import getMeta from '../../../../utils/meta' import { useProjectSettingsContext } from '../../context/project-settings-context' import SettingsMenuSelect from './settings-menu-select' -import type { Option } from './settings-menu-select' +import { useEditorThemesOptionGroups } from '../../hooks/use-editor-theme-option-groups' export default function SettingsEditorTheme() { const { t } = useTranslation() - const editorThemes = getMeta('ol-editorThemes') - const legacyEditorThemes = getMeta('ol-legacyEditorThemes') const { editorTheme, setEditorTheme } = useProjectSettingsContext() - const options = useMemo(() => { - const editorThemeOptions: Array