feat: align terminal font settings with appearance fonts

- Terminal font dropdown now uses mono fonts from UI font options
- Unified font list between appearance section and terminal settings
- Terminal font persisted to GlobalSettings for import/export support
- Aligned global terminal settings popover with per-terminal popover:
  - Same settings in same order (Font Size, Run on New Terminal, Font Family, Scrollback, Line Height, Screen Reader)
  - Consistent styling (Radix Select instead of native select)
- Added terminal padding (12px vertical, 16px horizontal) for readability
This commit is contained in:
Stefan de Vogelaere
2026-01-17 10:18:11 +01:00
parent b771b51842
commit 3320b40d15
8 changed files with 227 additions and 80 deletions

View File

@@ -600,6 +600,13 @@ export function hydrateStoreFromSettings(settings: GlobalSettings): void {
worktreePanelCollapsed: settings.worktreePanelCollapsed ?? false,
lastProjectDir: settings.lastProjectDir ?? '',
recentFolders: settings.recentFolders ?? [],
// Terminal font (nested in terminalState)
...(settings.terminalFontFamily && {
terminalState: {
...current.terminalState,
fontFamily: settings.terminalFontFamily,
},
}),
});
// Hydrate setup wizard state from global settings (API-backed)
@@ -653,6 +660,7 @@ function buildSettingsUpdateFromStore(): Record<string, unknown> {
worktreePanelCollapsed: state.worktreePanelCollapsed,
lastProjectDir: state.lastProjectDir,
recentFolders: state.recentFolders,
terminalFontFamily: state.terminalState.fontFamily,
};
}

View File

@@ -35,6 +35,7 @@ const SETTINGS_FIELDS_TO_SYNC = [
'theme',
'fontFamilySans',
'fontFamilyMono',
'terminalFontFamily', // Maps to terminalState.fontFamily
'sidebarOpen',
'chatHistoryOpen',
'maxConcurrency',
@@ -159,6 +160,9 @@ export function useSettingsSync(): SettingsSyncState {
if (field === 'currentProjectId') {
// Special handling: extract ID from currentProject object
updates[field] = appState.currentProject?.id ?? null;
} else if (field === 'terminalFontFamily') {
// Special handling: map terminalState.fontFamily to terminalFontFamily
updates[field] = appState.terminalState.fontFamily;
} else {
updates[field] = appState[field as keyof typeof appState];
}
@@ -260,6 +264,8 @@ export function useSettingsSync(): SettingsSyncState {
for (const field of SETTINGS_FIELDS_TO_SYNC) {
if (field === 'currentProjectId') {
updates[field] = appState.currentProject?.id ?? null;
} else if (field === 'terminalFontFamily') {
updates[field] = appState.terminalState.fontFamily;
} else {
updates[field] = appState[field as keyof typeof appState];
}
@@ -322,6 +328,12 @@ export function useSettingsSync(): SettingsSyncState {
changed = true;
break;
}
} else if (field === 'terminalFontFamily') {
// Special handling: compare terminalState.fontFamily
if (newState.terminalState.fontFamily !== prevState.terminalState.fontFamily) {
changed = true;
break;
}
} else {
const key = field as keyof typeof newState;
if (newState[key] !== prevState[key]) {
@@ -403,6 +415,8 @@ export async function forceSyncSettingsToServer(): Promise<boolean> {
for (const field of SETTINGS_FIELDS_TO_SYNC) {
if (field === 'currentProjectId') {
updates[field] = appState.currentProject?.id ?? null;
} else if (field === 'terminalFontFamily') {
updates[field] = appState.terminalState.fontFamily;
} else {
updates[field] = appState[field as keyof typeof appState];
}
@@ -505,6 +519,13 @@ export async function refreshSettingsFromServer(): Promise<boolean> {
worktreePanelCollapsed: serverSettings.worktreePanelCollapsed ?? false,
lastProjectDir: serverSettings.lastProjectDir ?? '',
recentFolders: serverSettings.recentFolders ?? [],
// Terminal font (nested in terminalState)
...(serverSettings.terminalFontFamily && {
terminalState: {
...currentAppState.terminalState,
fontFamily: serverSettings.terminalFontFamily,
},
}),
});
// Also refresh setup wizard state