From e69c210e0bbbef1fdc8d679b5dd235ae63285f2f Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sat, 25 Jul 2026 11:51:24 -0700 Subject: [PATCH] Move language setting to primary interface section Language is a first-class presentation preference alongside Theme and Zoom, so it shouldn't be buried in the Advanced disclosure. Advanced now contains only platform-chrome controls. --- .../settings/AppearanceInterfaceSection.tsx | 66 +++++++++---------- .../settings/AppearancePane.test.tsx | 16 +++++ 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/renderer/src/components/settings/AppearanceInterfaceSection.tsx b/src/renderer/src/components/settings/AppearanceInterfaceSection.tsx index 9d5bb1cbbab..112cae8572a 100644 --- a/src/renderer/src/components/settings/AppearanceInterfaceSection.tsx +++ b/src/renderer/src/components/settings/AppearanceInterfaceSection.tsx @@ -66,13 +66,14 @@ export function AppearanceInterfaceSection({ const titlebarEntry = getTitlebarEntries()[0] const typographyEntry = getTypographyEntries()[0] const zoomEntry = getZoomEntries()[0] + // Language is primary (with Theme/Zoom/Font); Advanced is platform chrome only. const advancedEntries = [ - ...(SHOW_UI_LANGUAGE_SETTING ? getLanguageEntries() : []), ...getTitlebarEntries(), ...getSystemTrayEntries({ showSystemTray: isDesktopWindows }), ...getMenuBarIconEntries({ showMenuBarIcon: isDesktopMac }) ] const showAdvanced = !isSearching || matchesSettingsSearch(searchQuery, advancedEntries) + const languageTitle = translate('settings.appearance.language.title', 'Language') return (
@@ -111,6 +112,36 @@ export function AppearanceInterfaceSection({ /> + {SHOW_UI_LANGUAGE_SETTING ? ( + + updateSettings({ uiLanguage: value as UiLanguage })} + > + + + + + {UI_LANGUAGE_CHOICES.map((choice) => ( + + {getUiLanguageChoiceLabel(choice, translate)} + + ))} + + + } + /> + + ) : null} +
- {SHOW_UI_LANGUAGE_SETTING ? ( - - updateSettings({ uiLanguage: value as UiLanguage })} - > - - - - - {UI_LANGUAGE_CHOICES.map((choice) => ( - - {getUiLanguageChoiceLabel(choice, translate)} - - ))} - - - } - /> - - ) : null} - { delete (window as unknown as { api?: unknown }).api }) + it('shows language as a primary interface control without opening Advanced', async () => { + // Language is a first-class presentation pref next to Theme — browsing + // Appearance → Interface must surface it without expanding Advanced. + mocks.state.settingsSearchQuery = '' + const container = await renderAppearancePane(getDefaultSettings('/tmp')) + const languageTrigger = container.querySelector( + '[data-slot="select-trigger"][aria-label="Language"]' + ) + + expect(languageTrigger).not.toBeNull() + // Advanced platform-chrome controls stay collapsed by default. + expect( + container.querySelector('button[role="switch"][aria-label="Titlebar App Name"]') + ).toBeNull() + }) + it('renders the language dropdown with system, english, chinese, korean, japanese, and spanish options', async () => { mocks.state.settingsSearchQuery = 'language' const updateSettings = vi.fn()