fix(web): keep terminal font settings reliable #5397
MergedStiensWout(GitHub profile, opens in a new tab)merged 5 commits into
main fromrefs/pull/5397/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/web/src/appearanceFonts.ts lines 40 to 41OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -25,3 +25,17 @@2525 export const DEFAULT_CODE_FONT_STACK =2626 '"SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace';272728+export const TYPOGRAPHY_ADVANCED_STORAGE_KEY = "t3code:typography-advanced";29+30+/**31+ * Simple typography treats the terminal as another monospace surface. In32+ * Advanced mode an empty terminal preference means the terminal default,33+ * keeping later code-font changes isolated to code surfaces.34+ */35+export function resolveTerminalFontPreference(input: {36+ readonly advanced: boolean;37+ readonly code: string;38+ readonly terminal: string;39+}): string {40+ if (input.advanced) return input.terminal;41+ return input.terminal.trim() || input.code;
StiensWout(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/web/src/terminal/ghostty/surface.ts line 758Resolvedby StiensWout(GitHub profile, opens in a new tab)@@ -706,3 +743,10 @@706743707744 private readonly onFontsLoaded = () => {708745 if (this.disposed) return;746+ // A face may become available after an earlier fallback measurement. Run747+ // the fixed-width guard again before using its newly loaded metrics.748+ const fontFamily = terminalFontFamily(this.requestedFontFamily);749+ if (fontFamily !== this.fontFamily) {750+ this.fontFamily = fontFamily;751+ this.applyFontMetrics();752+ return;
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this2a04db1
juliusmarminge closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
bb7faec0-b271-47f5-81fe-6822c8532528You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.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.
❤️ Share