mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
refactor: reduce code duplication in font settings and sync logic
Address CodeRabbit review feedback: - Create getEffectiveFont helper to deduplicate getEffectiveFontSans/Mono - Extract getSettingsFieldValue and hasSettingsFieldChanged helpers - Create reusable FontSelector component for font selection UI - Refactor project-theme-section and appearance-section to use FontSelector
This commit is contained in:
47
apps/ui/src/components/shared/font-selector.tsx
Normal file
47
apps/ui/src/components/shared/font-selector.tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@/components/ui/select';
|
||||||
|
import { DEFAULT_FONT_VALUE } from '@/config/ui-font-options';
|
||||||
|
|
||||||
|
interface FontOption {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FontSelectorProps {
|
||||||
|
id: string;
|
||||||
|
value: string;
|
||||||
|
options: readonly FontOption[];
|
||||||
|
placeholder: string;
|
||||||
|
onChange: (value: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reusable font selector component with live preview styling
|
||||||
|
*/
|
||||||
|
export function FontSelector({ id, value, options, placeholder, onChange }: FontSelectorProps) {
|
||||||
|
return (
|
||||||
|
<Select value={value} onValueChange={onChange}>
|
||||||
|
<SelectTrigger id={id} className="w-full">
|
||||||
|
<SelectValue placeholder={placeholder} />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
{options.map((option) => (
|
||||||
|
<SelectItem key={option.value} value={option.value}>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
fontFamily: option.value === DEFAULT_FONT_VALUE ? undefined : option.value,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{option.label}
|
||||||
|
</span>
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,3 +5,6 @@ export {
|
|||||||
type UseModelOverrideOptions,
|
type UseModelOverrideOptions,
|
||||||
type UseModelOverrideResult,
|
type UseModelOverrideResult,
|
||||||
} from './use-model-override';
|
} from './use-model-override';
|
||||||
|
|
||||||
|
// Font Components
|
||||||
|
export { FontSelector } from './font-selector';
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import {
|
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from '@/components/ui/select';
|
|
||||||
import { Palette, Moon, Sun, Type } from 'lucide-react';
|
import { Palette, Moon, Sun, Type } from 'lucide-react';
|
||||||
import { darkThemes, lightThemes, type Theme } from '@/config/theme-options';
|
import { darkThemes, lightThemes, type Theme } from '@/config/theme-options';
|
||||||
import {
|
import {
|
||||||
@@ -17,6 +10,7 @@ import {
|
|||||||
} from '@/config/ui-font-options';
|
} from '@/config/ui-font-options';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { useAppStore } from '@/store/app-store';
|
import { useAppStore } from '@/store/app-store';
|
||||||
|
import { FontSelector } from '@/components/shared';
|
||||||
import type { Project } from '@/lib/electron';
|
import type { Project } from '@/lib/electron';
|
||||||
|
|
||||||
interface ProjectThemeSectionProps {
|
interface ProjectThemeSectionProps {
|
||||||
@@ -305,25 +299,13 @@ export function ProjectThemeSection({ project }: ProjectThemeSectionProps) {
|
|||||||
<Label htmlFor="ui-font-select" className="text-sm">
|
<Label htmlFor="ui-font-select" className="text-sm">
|
||||||
Project UI Font
|
Project UI Font
|
||||||
</Label>
|
</Label>
|
||||||
<Select value={fontSansLocal} onValueChange={handleFontSansChange}>
|
<FontSelector
|
||||||
<SelectTrigger id="ui-font-select" className="w-full">
|
id="ui-font-select"
|
||||||
<SelectValue placeholder="Default (Geist Sans)" />
|
value={fontSansLocal}
|
||||||
</SelectTrigger>
|
options={UI_SANS_FONT_OPTIONS}
|
||||||
<SelectContent>
|
placeholder="Default (Geist Sans)"
|
||||||
{UI_SANS_FONT_OPTIONS.map((option) => (
|
onChange={handleFontSansChange}
|
||||||
<SelectItem key={option.value} value={option.value}>
|
/>
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
fontFamily:
|
|
||||||
option.value === DEFAULT_FONT_VALUE ? undefined : option.value,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{option.label}
|
|
||||||
</span>
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -358,25 +340,13 @@ export function ProjectThemeSection({ project }: ProjectThemeSectionProps) {
|
|||||||
<Label htmlFor="code-font-select" className="text-sm">
|
<Label htmlFor="code-font-select" className="text-sm">
|
||||||
Project Code Font
|
Project Code Font
|
||||||
</Label>
|
</Label>
|
||||||
<Select value={fontMonoLocal} onValueChange={handleFontMonoChange}>
|
<FontSelector
|
||||||
<SelectTrigger id="code-font-select" className="w-full">
|
id="code-font-select"
|
||||||
<SelectValue placeholder="Default (Geist Mono)" />
|
value={fontMonoLocal}
|
||||||
</SelectTrigger>
|
options={UI_MONO_FONT_OPTIONS}
|
||||||
<SelectContent>
|
placeholder="Default (Geist Mono)"
|
||||||
{UI_MONO_FONT_OPTIONS.map((option) => (
|
onChange={handleFontMonoChange}
|
||||||
<SelectItem key={option.value} value={option.value}>
|
/>
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
fontFamily:
|
|
||||||
option.value === DEFAULT_FONT_VALUE ? undefined : option.value,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{option.label}
|
|
||||||
</span>
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import {
|
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from '@/components/ui/select';
|
|
||||||
import { Palette, Moon, Sun, Type } from 'lucide-react';
|
import { Palette, Moon, Sun, Type } from 'lucide-react';
|
||||||
import { darkThemes, lightThemes } from '@/config/theme-options';
|
import { darkThemes, lightThemes } from '@/config/theme-options';
|
||||||
import {
|
import {
|
||||||
@@ -16,6 +9,7 @@ import {
|
|||||||
} from '@/config/ui-font-options';
|
} from '@/config/ui-font-options';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { useAppStore } from '@/store/app-store';
|
import { useAppStore } from '@/store/app-store';
|
||||||
|
import { FontSelector } from '@/components/shared';
|
||||||
import type { Theme } from '../shared/types';
|
import type { Theme } from '../shared/types';
|
||||||
|
|
||||||
interface AppearanceSectionProps {
|
interface AppearanceSectionProps {
|
||||||
@@ -165,25 +159,13 @@ export function AppearanceSection({ effectiveTheme, onThemeChange }: AppearanceS
|
|||||||
<Label htmlFor="global-ui-font-select" className="text-sm">
|
<Label htmlFor="global-ui-font-select" className="text-sm">
|
||||||
UI Font
|
UI Font
|
||||||
</Label>
|
</Label>
|
||||||
<Select value={fontSansValue} onValueChange={handleFontSansChange}>
|
<FontSelector
|
||||||
<SelectTrigger id="global-ui-font-select" className="w-full">
|
id="global-ui-font-select"
|
||||||
<SelectValue placeholder="Default (Geist Sans)" />
|
value={fontSansValue}
|
||||||
</SelectTrigger>
|
options={UI_SANS_FONT_OPTIONS}
|
||||||
<SelectContent>
|
placeholder="Default (Geist Sans)"
|
||||||
{UI_SANS_FONT_OPTIONS.map((option) => (
|
onChange={handleFontSansChange}
|
||||||
<SelectItem key={option.value} value={option.value}>
|
/>
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
fontFamily:
|
|
||||||
option.value === DEFAULT_FONT_VALUE ? undefined : option.value,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{option.label}
|
|
||||||
</span>
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
Used for headings, labels, and UI text
|
Used for headings, labels, and UI text
|
||||||
</p>
|
</p>
|
||||||
@@ -194,25 +176,13 @@ export function AppearanceSection({ effectiveTheme, onThemeChange }: AppearanceS
|
|||||||
<Label htmlFor="global-code-font-select" className="text-sm">
|
<Label htmlFor="global-code-font-select" className="text-sm">
|
||||||
Code Font
|
Code Font
|
||||||
</Label>
|
</Label>
|
||||||
<Select value={fontMonoValue} onValueChange={handleFontMonoChange}>
|
<FontSelector
|
||||||
<SelectTrigger id="global-code-font-select" className="w-full">
|
id="global-code-font-select"
|
||||||
<SelectValue placeholder="Default (Geist Mono)" />
|
value={fontMonoValue}
|
||||||
</SelectTrigger>
|
options={UI_MONO_FONT_OPTIONS}
|
||||||
<SelectContent>
|
placeholder="Default (Geist Mono)"
|
||||||
{UI_MONO_FONT_OPTIONS.map((option) => (
|
onChange={handleFontMonoChange}
|
||||||
<SelectItem key={option.value} value={option.value}>
|
/>
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
fontFamily:
|
|
||||||
option.value === DEFAULT_FONT_VALUE ? undefined : option.value,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{option.label}
|
|
||||||
</span>
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
Used for code blocks and monospaced text
|
Used for code blocks and monospaced text
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -79,6 +79,41 @@ const SETTINGS_FIELDS_TO_SYNC = [
|
|||||||
// Fields from setup store to sync
|
// Fields from setup store to sync
|
||||||
const SETUP_FIELDS_TO_SYNC = ['isFirstRun', 'setupComplete', 'skipClaudeSetup'] as const;
|
const SETUP_FIELDS_TO_SYNC = ['isFirstRun', 'setupComplete', 'skipClaudeSetup'] as const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to extract a settings field value from app state
|
||||||
|
* Handles special cases for nested/mapped fields
|
||||||
|
*/
|
||||||
|
function getSettingsFieldValue(
|
||||||
|
field: (typeof SETTINGS_FIELDS_TO_SYNC)[number],
|
||||||
|
appState: ReturnType<typeof useAppStore.getState>
|
||||||
|
): unknown {
|
||||||
|
if (field === 'currentProjectId') {
|
||||||
|
return appState.currentProject?.id ?? null;
|
||||||
|
}
|
||||||
|
if (field === 'terminalFontFamily') {
|
||||||
|
return appState.terminalState.fontFamily;
|
||||||
|
}
|
||||||
|
return appState[field as keyof typeof appState];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to check if a settings field changed between states
|
||||||
|
*/
|
||||||
|
function hasSettingsFieldChanged(
|
||||||
|
field: (typeof SETTINGS_FIELDS_TO_SYNC)[number],
|
||||||
|
newState: ReturnType<typeof useAppStore.getState>,
|
||||||
|
prevState: ReturnType<typeof useAppStore.getState>
|
||||||
|
): boolean {
|
||||||
|
if (field === 'currentProjectId') {
|
||||||
|
return newState.currentProject?.id !== prevState.currentProject?.id;
|
||||||
|
}
|
||||||
|
if (field === 'terminalFontFamily') {
|
||||||
|
return newState.terminalState.fontFamily !== prevState.terminalState.fontFamily;
|
||||||
|
}
|
||||||
|
const key = field as keyof typeof newState;
|
||||||
|
return newState[key] !== prevState[key];
|
||||||
|
}
|
||||||
|
|
||||||
interface SettingsSyncState {
|
interface SettingsSyncState {
|
||||||
/** Whether initial settings have been loaded from API */
|
/** Whether initial settings have been loaded from API */
|
||||||
loaded: boolean;
|
loaded: boolean;
|
||||||
@@ -157,15 +192,7 @@ export function useSettingsSync(): SettingsSyncState {
|
|||||||
// Build updates object from current state
|
// Build updates object from current state
|
||||||
const updates: Record<string, unknown> = {};
|
const updates: Record<string, unknown> = {};
|
||||||
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
||||||
if (field === 'currentProjectId') {
|
updates[field] = getSettingsFieldValue(field, appState);
|
||||||
// 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];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include setup wizard state (lives in a separate store)
|
// Include setup wizard state (lives in a separate store)
|
||||||
@@ -262,13 +289,7 @@ export function useSettingsSync(): SettingsSyncState {
|
|||||||
// (migration has already hydrated the store from server/localStorage)
|
// (migration has already hydrated the store from server/localStorage)
|
||||||
const updates: Record<string, unknown> = {};
|
const updates: Record<string, unknown> = {};
|
||||||
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
||||||
if (field === 'currentProjectId') {
|
updates[field] = getSettingsFieldValue(field, appState);
|
||||||
updates[field] = appState.currentProject?.id ?? null;
|
|
||||||
} else if (field === 'terminalFontFamily') {
|
|
||||||
updates[field] = appState.terminalState.fontFamily;
|
|
||||||
} else {
|
|
||||||
updates[field] = appState[field as keyof typeof appState];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (const field of SETUP_FIELDS_TO_SYNC) {
|
for (const field of SETUP_FIELDS_TO_SYNC) {
|
||||||
updates[field] = setupState[field as keyof typeof setupState];
|
updates[field] = setupState[field as keyof typeof setupState];
|
||||||
@@ -322,24 +343,9 @@ export function useSettingsSync(): SettingsSyncState {
|
|||||||
// Check if any synced field changed
|
// Check if any synced field changed
|
||||||
let changed = false;
|
let changed = false;
|
||||||
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
||||||
if (field === 'currentProjectId') {
|
if (hasSettingsFieldChanged(field, newState, prevState)) {
|
||||||
// Special handling: compare currentProject IDs
|
changed = true;
|
||||||
if (newState.currentProject?.id !== prevState.currentProject?.id) {
|
break;
|
||||||
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]) {
|
|
||||||
changed = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,13 +419,7 @@ export async function forceSyncSettingsToServer(): Promise<boolean> {
|
|||||||
|
|
||||||
const updates: Record<string, unknown> = {};
|
const updates: Record<string, unknown> = {};
|
||||||
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
for (const field of SETTINGS_FIELDS_TO_SYNC) {
|
||||||
if (field === 'currentProjectId') {
|
updates[field] = getSettingsFieldValue(field, appState);
|
||||||
updates[field] = appState.currentProject?.id ?? null;
|
|
||||||
} else if (field === 'terminalFontFamily') {
|
|
||||||
updates[field] = appState.terminalState.fontFamily;
|
|
||||||
} else {
|
|
||||||
updates[field] = appState[field as keyof typeof appState];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const setupState = useSetupStore.getState();
|
const setupState = useSetupStore.getState();
|
||||||
for (const field of SETUP_FIELDS_TO_SYNC) {
|
for (const field of SETUP_FIELDS_TO_SYNC) {
|
||||||
|
|||||||
@@ -149,6 +149,31 @@ export function getStoredTheme(): ThemeMode | null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to get effective font value with validation
|
||||||
|
* Returns the font to use (project override -> global -> null for default)
|
||||||
|
* @param projectFont - The project-specific font override
|
||||||
|
* @param globalFont - The global font setting
|
||||||
|
* @param fontOptions - The list of valid font options for validation
|
||||||
|
*/
|
||||||
|
function getEffectiveFont(
|
||||||
|
projectFont: string | undefined,
|
||||||
|
globalFont: string | null,
|
||||||
|
fontOptions: readonly { value: string; label: string }[]
|
||||||
|
): string | null {
|
||||||
|
const isValidFont = (font: string | null | undefined): boolean => {
|
||||||
|
if (!font || font === DEFAULT_FONT_VALUE) return true;
|
||||||
|
return fontOptions.some((opt) => opt.value === font);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (projectFont) {
|
||||||
|
if (!isValidFont(projectFont)) return null; // Fallback to default if font not in list
|
||||||
|
return projectFont === DEFAULT_FONT_VALUE ? null : projectFont;
|
||||||
|
}
|
||||||
|
if (!isValidFont(globalFont)) return null; // Fallback to default if font not in list
|
||||||
|
return globalFont === DEFAULT_FONT_VALUE ? null : globalFont;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save theme to localStorage for immediate persistence
|
* Save theme to localStorage for immediate persistence
|
||||||
* This is used as a fallback when server settings can't be loaded
|
* This is used as a fallback when server settings can't be loaded
|
||||||
@@ -1873,43 +1898,13 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getEffectiveFontSans: () => {
|
getEffectiveFontSans: () => {
|
||||||
const currentProject = get().currentProject;
|
const { currentProject, fontFamilySans } = get();
|
||||||
// Return project override if set, otherwise global, otherwise null for default
|
return getEffectiveFont(currentProject?.fontFamilySans, fontFamilySans, UI_SANS_FONT_OPTIONS);
|
||||||
// 'default' value means explicitly using default font, so return null for CSS
|
|
||||||
// Also validate that the font is in the available options list
|
|
||||||
const isValidFont = (font: string | null | undefined): boolean => {
|
|
||||||
if (!font || font === DEFAULT_FONT_VALUE) return true;
|
|
||||||
return UI_SANS_FONT_OPTIONS.some((opt) => opt.value === font);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (currentProject?.fontFamilySans) {
|
|
||||||
const font = currentProject.fontFamilySans;
|
|
||||||
if (!isValidFont(font)) return null; // Fallback to default if font not in list
|
|
||||||
return font === DEFAULT_FONT_VALUE ? null : font;
|
|
||||||
}
|
|
||||||
const globalFont = get().fontFamilySans;
|
|
||||||
if (!isValidFont(globalFont)) return null; // Fallback to default if font not in list
|
|
||||||
return globalFont === DEFAULT_FONT_VALUE ? null : globalFont;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getEffectiveFontMono: () => {
|
getEffectiveFontMono: () => {
|
||||||
const currentProject = get().currentProject;
|
const { currentProject, fontFamilyMono } = get();
|
||||||
// Return project override if set, otherwise global, otherwise null for default
|
return getEffectiveFont(currentProject?.fontFamilyMono, fontFamilyMono, UI_MONO_FONT_OPTIONS);
|
||||||
// 'default' value means explicitly using default font, so return null for CSS
|
|
||||||
// Also validate that the font is in the available options list
|
|
||||||
const isValidFont = (font: string | null | undefined): boolean => {
|
|
||||||
if (!font || font === DEFAULT_FONT_VALUE) return true;
|
|
||||||
return UI_MONO_FONT_OPTIONS.some((opt) => opt.value === font);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (currentProject?.fontFamilyMono) {
|
|
||||||
const font = currentProject.fontFamilyMono;
|
|
||||||
if (!isValidFont(font)) return null; // Fallback to default if font not in list
|
|
||||||
return font === DEFAULT_FONT_VALUE ? null : font;
|
|
||||||
}
|
|
||||||
const globalFont = get().fontFamilyMono;
|
|
||||||
if (!isValidFont(globalFont)) return null; // Fallback to default if font not in list
|
|
||||||
return globalFont === DEFAULT_FONT_VALUE ? null : globalFont;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Feature actions
|
// Feature actions
|
||||||
|
|||||||
Reference in New Issue
Block a user