Skip to content

Add a Code font setting for editor, diffs, and code blocks - #201

Open
kotuke wants to merge 2 commits into
egoist:mainfrom
kotuke:add-code-font-setting
Open

kotuke wants to merge 2 commits into
egoist:mainfrom
kotuke:add-code-font-setting

Conversation

@kotuke

@kotuke kotuke commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Code in Waku is always JetBrains Mono. Size is already a setting; family is not. This adds a Code font picker on Settings → Appearance, modeled on Codex: a dropdown of installed monospaced faces, each row drawn in that face, with the current choice checked.

The default stays the bundled JetBrains Mono, so machines without extra coding fonts look the same as today.

Screenshots

From Waku Debug, Settings → Appearance.

Closed picker:

Code font setting

Font menu open (each name is rendered in that family):

Code font menu

The two PNGs on this branch are only for review. Drop them on merge if they should not live in tree.

Behavior

  • New code_font_family field in desktop app.json. Empty or oversized hand-edits fall back to JetBrains Mono; an unknown name is kept so it still round-trips if the font is installed later.
  • The picker lists the bundled default first, then installed monospaced families (catalog walk and advance-width check run once on a background thread).
  • Applies to the same surfaces as code font size: file editor, diffs, markdown code, and tool output.
  • Changing the family drops cached markdown flats and remeasures virtualized rows, same as a size change.

Out of scope

  • UI font family (still .SystemUIFont)
  • Font weight (Codex has Regular next to the family)
  • Terminal (still JetBrains Mono; code font size never applied there either)
  • Waku Web (--font-mono in CSS)

Follow-ups

  • A few non-coding monospaced faces can still appear (for example Ayuthaya, or a symbols face whose family name does not contain “symbol” / “nerd font”). Tighten the candidate filter if that shows up in review.
  • Optional: weight dropdown, and/or using the same family in the terminal.

Checks

cargo check --package waku --package waku-client
cargo test -p waku-client --lib persistence::tests
cargo test --lib fonts::tests md::render app::right_panel

Verified in Waku Debug: Settings → Appearance → Code font opens the picker; JetBrains Mono is selected by default.

Full cargo test / bun run protocol:check were not run on this machine (GPUI desktop compile is large). Happy to add those if wanted.

kotuke added 2 commits August 30, 2026 23:28
Appearance can pick an installed monospaced family for the file editor,
diffs, markdown code, and tool output. The default stays bundled
JetBrains Mono. Catalog listing runs off the UI thread.
Drop these PNGs on merge if they should not live in tree.
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.

1 participant