feat: add customizable UI fonts settings#275
feat: add customizable UI fonts settings#275bluelovers wants to merge 2 commits intoNeuralNomadsAI:devfrom
Conversation
- Add font settings UI in Appearance section - Implement input validation with normalizeFontFamily utility - Add CSS variables for sans-serif and monospace fonts - Fix dark theme CSS variables - Add internationalization support (6 languages) - Add CSS styles for font input fields This PR allows users to customize UI fonts with proper validation and default fallback.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Reviewed the latest PR state as a gatekeeper against the current branch tip, focusing on regressions and implementation quality. Assumption: this review is for the full current diff on top of Findings
Notes I did not see evidence of targeted tests covering font normalization, persistence/display after async config load, or Monaco font application. I also could not rely on a local typecheck/build signal in this workspace because dependencies are not installed here. -- |
PR: Customizable UI Fonts
Summary (English)
This PR implements customizable UI font settings, allowing users to specify custom sans-serif and monospace fonts for the interface. Users can enter custom font names in the Appearance settings section, and the system dynamically updates CSS variables to apply the new font settings.
Summary (中文精简版)
本 PR 实现了可自定义的 UI 字体设置功能,允许用户为界面指定无衬线字体和等宽字体。用户可以在设置界面的外观部分输入自定义字体名称,系统会动态更新 CSS 变量以应用新的字体设置。
Changes (English)
Core Features
--font-family-sans-userand--font-family-mono-userTechnical Implementation
fontFamilySansandfontFamilyMonofieldssetFontFamilySansandsetFontFamilyMonofunctionsnormalizeFontFamilyutility functionFiles Modified
packages/server/src/config/schema.tspackages/ui/src/stores/preferences.tsxpackages/ui/src/lib/settings/behavior-registry.tspackages/ui/src/components/settings/appearance-settings-section.tsxpackages/ui/src/styles/components/settings-screen.csspackages/ui/src/styles/tokens.csspackages/ui/src/lib/i18n/messages/*/settings.ts(6 files)Changes (中文简要说明)
核心功能
--font-family-sans-user和--font-family-mono-user技术实现
fontFamilySans和fontFamilyMono字段setFontFamilySans和setFontFamilyMono函数normalizeFontFamily工具函数Key Features (English)
Input Validation
" Inter "→ Normalized to"Inter"→ CSS variable:--font-family-sans-user: "Inter"""(empty) → Normalized toundefined→ Default:--font-family-sans-user: -apple-system" "(spaces only) → Normalized toundefined→ Default:-apple-systemundefined→ Default:-apple-system123(non-string) → Normalized toundefined→ Default:-apple-systemCSS Variables Structure
核心功能
输入验证
" Inter "→ 标准化为"Inter"→ CSS 变量:--font-family-sans-user: "Inter"""(空字符串)→ 标准化为undefined→ 默认值:--font-family-sans-user: -apple-system" "(只包含空格)→ 标准化为undefined→ 默认值:-apple-systemundefined→ 默认值:-apple-system123(非字符串)→ 标准化为undefined→ 默认值:-apple-systemCSS 变量结构
Testing Instructions (English)
Basic Test:
Default Fallback Test:
Edge Cases:
测试说明
基本测试:
默认值回退测试:
边界情况:
Checklist
normalizeFontFamilyfunction检查清单
normalizeFontFamily函数进行输入验证