fix(web): keep terminal font settings reliable - #5397
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3838e53. Configure here.
ApprovabilityVerdict: Approved 6d25c32 Bug fix for terminal font settings with focused scope: improves font loading validation, fixes advanced/simple typography mode resolution, and enhances monospace detection. Changes are well-tested and the author owns this code area. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * fix(web): keep model picker shortcuts in sync by @t3dotgg in pingdotgg/t3code#5400 * fix(web): keep terminal font settings reliable by @StiensWout in pingdotgg/t3code#5397 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260805.1005...v0.0.32-nightly.20260805.1006 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1006

Problem
The typography controls could leave the terminal in two incorrect font states:
Fix
Validation
vp run --filter @t3tools/web typecheckvp lint --report-unused-disable-directiveson changed filesvp fmtandgit diff --checkFollow-up to #5103.
Generated with GPT-5.6 Sol in the Codex harness.
Note
Medium Risk
Touches terminal rendering metrics and font validation timing; some fonts that passed the old two-glyph check may now be rejected or fall back after load.
Overview
Fixes terminal typography so Advanced mode no longer ties an empty terminal font to the code font (code changes no longer move the live terminal), while simple mode still inherits the monospace preference for the terminal.
The Ghostty canvas path now preloads normal/bold/italic variants before accepting a custom face, and tightens monospace checks via
areFontAdvancesMonospaceacross multiple glyphs and styles (not justivsM). Latefonts.loadingdoneevents re-run validation and can fall back if a proportional face loads after an earlier pass.Settings previews and the terminal drawer share
resolveTerminalFontPreferenceandTYPOGRAPHY_ADVANCED_STORAGE_KEYso UI matches runtime behavior.Reviewed by Cursor Bugbot for commit 6d25c32. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix terminal font settings to load style variants before measuring and applying fonts
loadTerminalFontFamilyinsurface.tsto await all relevant font style variants before validating and applying a terminal font, replacing directdocument.fonts.loadcalls.GhosttyTerminalSurface.setFontnow uses an epoch counter to let the newest font request win, avoiding race conditions from overlapping async loads.resolveTerminalFontPreferencetoappearanceFonts.ts: in simple mode the terminal inherits the code font; in advanced mode it uses the terminal font setting independently.areFontAdvancesMonospaceas a reusable tolerance-based monospace check that fails open when canvas metrics are unavailable;isMonospaceFamilynow checks multiple style variants and rejects a family if any variant measures as proportional.Macroscope summarized 6d25c32.