Skip to content

feat(settings): support custom font families and weights - #1074

Open
TwinklerG wants to merge 1 commit into
agegr:mainfrom
TwinklerG:feat/custom-font-family-weight
Open

TwinklerG wants to merge 1 commit into
agegr:mainfrom
TwinklerG:feat/custom-font-family-weight

Conversation

@TwinklerG

@TwinklerG TwinklerG commented Oct 5, 2026 •

Copy link
Copy Markdown

Closes #1073

Summary

Extend the existing font-size controls with custom font families and base weights in Settings → General → Appearance.

  • Configure interface/chat and monospace (code, tool output, terminal) fonts independently, with comma-separated font-name lists, weights from 100–900, live previews, and separate resets.
  • Persist preferences in the current browser, restore them on app startup, and synchronize them across tabs without changing chat width or font size.
  • Use fonts installed on the browser's device and retain the default fallback stacks. Custom font settings do not upload or download fonts; font-name input is treated as data rather than arbitrary CSS.
  • Preserve explicit heading and emphasis weights, apply monospace weights to code/source/diff views, and remeasure existing chat drafts when the interface font changes.
  • Update and refit existing terminals without restarting their shells or SSE streams.
  • Add English, Simplified Chinese, and Traditional Chinese labels, documentation, unit tests, and browser regression coverage.

Validation

  • node_modules/.bin/tsc --noEmit --incremental false
  • npm run lint
  • 121 targeted tests passed, covering the font preference helpers/store and affected chat, settings, code-view, and terminal components.
  • git diff --cached --check before committing.
  • npm run test:e2e — passed locally in Chromium at desktop (1280px) and mobile (390px) widths. Includes font families and weights, persistence, cross-tab synchronization, independent resets, preserved emphasis, and draft resizing.
  • npm run test:terminal — passed locally in Chromium at desktop (1440px) and mobile (390px) widths. Includes live terminal font/weight updates without shell or SSE restarts, persistence after refresh, and terminal lifecycle regressions.

The initial local E2E attempt was blocked by a stale .next/dev/lock. After confirming that its recorded process had exited and no Next dev server was running, the stale file was backed up and both suites completed successfully. No feature-code changes were needed.

Add separate interface/chat and monospace font preferences with live previews, browser persistence, fallback stacks, independent resets, and cross-tab synchronization. Update code rendering, draft sizing, and terminal fonts without restarting terminal sessions; add unit and browser regression coverage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] 支持自定义字体(font-family)和字重(font-weight)

1 participant