feat(desktop): adjustable font weight and line height (terminal, editor, chat)
Closed
RO
4mo ago+1906+1906+0123456789012345678901234567890123456789-14-14-01234567890123456789
What
Adds two new appearance controls — font weight (100–900) and line height (1–3) — to the Terminal and Editor font settings, alongside the existing family/size controls. They persist in local-db and apply live across all three text surfaces of the desktop app:
| Surface | How it's applied |
|---|---|
| Terminal (xterm) — incl. Claude Code & other CLI agents | Native xterm fontWeight + lineHeight options, on create and on live appearance updates (both the v1 cache and v2 runtime paths) |
| Editor + diff viewer (CodeMirror / Pierre) | fontWeight on the host; line height computed as fontSize * multiplier, replacing the previously hardcoded *1.5 |
| Markdown / chat prose | Body line-height + base font-weight follow the Editor settings via CSS variables; headings and bold text keep their own weights/line-heights |
Why
The only adjustable typography today is family + size. Users want denser or more breathable text and lighter/heavier weights — especially in the terminal, where Claude Code and other agents run.
Notes
- No behavior change when unset. Each surface keeps its existing default (terminal weight 400 / line-height 1.0; editor weight 400 / line-height 1.5; markdown styles keep their tuned defaults). The markdown CSS variables are only set when the user has an explicit override.
- Markdown prose intentionally tracks the Editor settings rather than introducing a third settings group; bold/heading semantics are preserved because those elements declare their own weights.
- The diff viewer (Pierre) has no
--diffs-font-weightvariable, so weight is set on the host element — non-bold (inheriting) tokens pick it up while keyword/emphasis token weights from the syntax theme stay intact. local-dbmigration0042_add_font_weight_line_heightadds four nullable columns (generated viadrizzle-kit generate).
Testing
bun run typecheck(desktop + local-db) — passbun run lint— clean (0)bun testforfont-settings, terminalfont-settle/ ws-transport — pass; extendedfont-settings.test.tswith weight/line-height validation + transform cases (32 tests pass)
Summary by cubic
Add adjustable font weight (100–900) and line height (1–3) to Terminal, Editor, and chat/markdown. Values persist in local-db, apply live across terminal runtime, editor/diff viewer, and markdown, and keep existing defaults when unset.
-
New Features
- Terminal: native
fontWeight/lineHeighton create and live updates; defaults 400 / 1.0. - Editor + diff viewer: host
fontWeight; line height = fontSize × multiplier (replaces fixed 1.5); syntax token weights unchanged; diff viewer sets--diffs-line-heightand host weight. - Chat/Markdown: prose follows editor via CSS vars (
--md-font-weight,--md-line-height) with fallbacks; headings/bold unchanged. - Settings: new weight/line-height inputs with validation (100–900 int, 1–3), rounds weight to nearest 100 on blur, live preview; tests cover bounds and passthrough.
- Terminal: native
-
Migration
0042_add_font_weight_line_heightadds four nullablesettingscolumns (terminal/editor weight and line height). No action needed.
Summary by CodeRabbit
-
New Features
- Font weight (100–900) and line-height (1–3) are now configurable for editor, terminal, and markdown, with per-component overrides and persisted settings.
- Settings UI: numeric inputs, live preview, and reset behavior for weight and line-height.
-
Style
- Markdown and theme styles now honor font-weight and line-height via CSS variables.
-
Tests
- Added validation and transformation tests covering bounds, fractional/nullable values, and edge cases.