Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): configurable fonts and sizes under Settings → Appearance #5103

MergedStiensWout(GitHub profile, opens in a new tab)merged 48 commits intomain fromrefs/pull/5103/headmerged by juliusmarminge View on GitHub

What changed

Settings → Appearance gains a Fonts section: four surfaces, each with a family picker and a size slider, a live preview rendered in the resolved family and size, and a per-row reset.

SettingCoversSize range
Interface fonteverything outside code blocks and the terminal12–20px
Prompt fontthe composer textarea and its placeholder only12–20px
Code fontcode blocks, diffs, and file previews10–18px
Terminal fontterminal output8–20px

The family pickers are grouped by category (Sans serif / Monospace) and filtered to faces that are actually installed, probed with canvas metrics — document.fonts.check() reports true for absent families, so it cannot filter anything. "Custom…" accepts any name: it edits a local draft that commits 400ms after typing pauses (or on Enter/blur) and only once the name resolves, so the applied font holds while a partial name is typed.

Cell-grid surfaces stay monospace. The terminal draws on a fixed cell lattice, so a proportional face renders its text narrower than its own cells and strands the cursor to the right. The Code and Terminal pickers offer monospace faces only, and the renderer independently measures the requested family and falls back to the default when it is not monospace, so a previously stored value cannot leave the terminal in that state.

The terminal size adapts to its canvas. The preference is a ceiling: narrow panes (splits, the side panel) slide the rendered size down until a classic 80-column grid fits, down to an 8px legibility floor, and widening slides it back up. The measurement lives in fit(), so drags, splits, and window resizes all pass through it.

The composer context strip degrades instead of colliding. Its controls truncate, and once even truncated labels cannot fit they animate shut to icons (measured from laid-out content, with hysteresis, restoring as space returns).

Under the hood:

  • eight client settings in the contracts schema (four families, four sizes), persisted client-side like the other appearance preferences, all covered by Restore defaults
  • the --font-sans / --font-mono theme tokens move out of @theme inline so Tailwind utilities reference the variables; body, pre/code, and the @pierre/diffs shadow-root hooks route through them
  • the interface size drives the root font size (and with it every rem-based dimension); prompt and code sizes stay in absolute pixels so they do not scale twice
  • custom names are normalized and quoted before reaching CSS or the canvas font shorthand, where an unquoted non-ident name silently voids the whole declaration
  • font application survives async settings hydration, including terminals created while settings were still loading

Validation

  • full web suite (1760 tests), desktop settings tests, contracts tests
  • web + desktop + contracts typecheck, lint, formatting
  • end-to-end against a live dev server: picker filtering, live application per surface, reload persistence, terminal width fitting, and the strip's collapse/restore behaviour

🤖 Generated with Claude Code


Note

Medium Risk Interface font size drives root rem scaling app-wide, and typography touches terminal rendering and persisted client settings; preview local-fonts denial is an intentional security guard.

Overview Adds Settings → Appearance → Typography so users can pick interface, prompt, code, and terminal font families and sizes (with optional Advanced per-surface overrides, macOS font smoothing, and live previews on real composer/diff/Ghostty surfaces).

Runtime wiring: new client settings flow through FontAppearanceSync into CSS variables (--font-sans, --font-mono, --font-composer, size tokens); bundled DM Sans / JetBrains Mono are removed in favor of system stacks. Family pickers use the Local Font Access API where available, with canvas/DOM probing for installed and monospace faces.

Terminal: Ghostty honors preferences, rejects proportional fonts, shrinks size to keep ~80 columns in narrow panes, and reapplies fonts after async hydration. Composer context strip collapses labels to icons when space is tight. Preview browser sessions deliberately omit local-fonts permission so untrusted pages cannot fingerprint installed fonts.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 284ea9f7d0cee3c74697ebe40acb2b67936902b7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add configurable font family and size controls to Settings → Appearance

  • Adds a Typography section to the Appearance settings panel with font family and size controls for interface, prompt, code, and terminal surfaces, each with a live preview.
  • Introduces a FontFamilyPicker component that enumerates installed local fonts via the Local Font Access API with search and virtualized list rendering; falls back to a validated text input when the API is unavailable.
  • Adds CSS variable-driven typography (--font-sans, --font-mono, --font-composer, --font-size-prompt, --font-size-code) applied to document.documentElement at runtime via a new FontAppearanceSync root component.
  • Removes bundled DM Sans and JetBrains Mono font packages; the app now uses system UI fonts by default with user-configurable overrides.
  • Terminal font rendering now rejects proportional families, sanitizes family name quoting, and auto-reduces font size to ensure at least 80 columns fit within the available width.
  • Risk: .glass-opacity-slider CSS class and --glass-slider-* custom properties are renamed to .settings-slider / --settings-slider-*; any external references will break.
Macroscope summarized 284ea9f.

closes #4376

    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 8d549a6f-3824-4f8b-9a41-f675fb1ef973

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/316c0019e273b855d93509c9b3b72d57a463b9f1/apps/web/src/components/ThreadTerminalDrawer.tsx#L410

      If the user changes the terminal font while GhosttyTerminalSurface.create is pending, the new font is written to terminalFontFamilyRef but never applied to the live terminal — it keeps the old font until another font change or remount. The font-change effect runs while terminalRef.current is still null, so its setFont call is skipped, and after the async create completes using the old snapshot no effect reapplies the newer value. Consider re-reading terminalFontFamilyRef.current after create resolves and calling setFont if it differs from what was passed at construction.

      ✅ Resolved in d423e0034d894e7a743cbf68691711841836b5d0

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces a new user-facing feature (configurable fonts and sizes in Settings → Appearance) with substantial new components, font picker UI with Local Font Access API integration, and changes to how fonts render across all app surfaces. New features of this scope warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/7580c5d9e794265a7e46e9348cabf9ec06a42d73/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx#L80

      In the interactive picker branch, the environment label is rendered as a bare <SelectValue /> with no data-composer-label attribute, so useLabelsOverflow never accounts for it. When data-compact is set on the strip, the other labels collapse but the environment label stays full-width and truncated, breaking the overflow behavior. Add data-composer-label and the same compact-collapse classes to the <SelectValue /> (or its trigger) so it participates in the overflow measurement.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file @apps/web/src/components/BranchToolbarEnvironmentSelector.tsx around line 80:
      
      In the interactive picker branch, the environment label is rendered as a bare `<SelectValue />` with no `data-composer-label` attribute, so `useLabelsOverflow` never accounts for it. When `data-compact` is set on the strip, the other labels collapse but the environment label stays full-width and truncated, breaking the overflow behavior. Add `data-composer-label` and the same compact-collapse classes to the `<SelectValue />` (or its trigger) so it participates in the overflow measurement.
    6. Fixed in 805813ee7. The picker branch now wraps SelectValue in a data-composer-label span carrying the same truncate + collapse transition as the other labels, so it participates in the measurement and animates shut with them. Verified: every marked label goes to 0 width under data-compact and restores together.

    7. Sorry, I'm unable to act on this request because you do not have permissions within this repository.

    8. Any update on this? Having the ability to change font family & font size seems like a necessary feature

    9. @juliusmarminge this still needs some work; I'll be improving this tomorrow. Not yet happy on the UX

    10. apps/web/src/components/settings/SettingsPanels.tsx line 1222OutdatedResolvedby juliusmarminge
      apps/web/src/components/settings/SettingsPanels.tsx line 1379OutdatedResolvedby juliusmarminge
      apps/web/src/components/settings/SettingsPanels.logic.ts line 48OutdatedResolvedby juliusmarminge

Sign in to join this conversation.