Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(web): inherit terminal size in simple typography (#5628)
Chris Deemingdaf8ee0b2f68
diff --git a/apps/web/src/appearanceFonts.test.ts b/apps/web/src/appearanceFonts.test.tsindex 5c642e33f..31a2f1d77 100644--- a/apps/web/src/appearanceFonts.test.ts+++ b/apps/web/src/appearanceFonts.test.ts@@ -11,6 +11,7 @@ import {cssFontFamilies,resolveDefaultFamilyLabel,resolveTerminalFontPreference,+ resolveTerminalFontSizePreference,} from "./appearanceFonts";describe("areFontAdvancesMonospace", () => {@@ -97,6 +98,16 @@ describe("resolveTerminalFontPreference", () => {});});+describe("resolveTerminalFontSizePreference", () => {+ it("inherits the code font size in simple mode", () => {+ expect(resolveTerminalFontSizePreference({ advanced: false, code: 15, terminal: 12 })).toBe(15);+ });++ it("keeps code and terminal font sizes independent in advanced mode", () => {+ expect(resolveTerminalFontSizePreference({ advanced: true, code: 15, terminal: 12 })).toBe(12);+ });+});+describe("font size clamping", () => {it("keeps sizes inside the ranges the UI can absorb", () => {expect(clampInterfaceFontSize(16)).toBe(16);diff --git a/apps/web/src/appearanceFonts.ts b/apps/web/src/appearanceFonts.tsindex 60801ef01..6053e5fb0 100644--- a/apps/web/src/appearanceFonts.ts+++ b/apps/web/src/appearanceFonts.ts@@ -41,6 +41,15 @@ export function resolveTerminalFontPreference(input: {return input.code;}+export function resolveTerminalFontSizePreference(input: {+ readonly advanced: boolean;+ readonly code: number;+ readonly terminal: number;+}): number {+ if (input.advanced) return input.terminal;+ return input.code;+}+function quoteFontFamilyName(name: string): string {const bare = name.trim();if (bare.length === 0) return "";diff --git a/apps/web/src/components/ThreadTerminalDrawer.tsx b/apps/web/src/components/ThreadTerminalDrawer.tsxindex 25b4abb3f..c59f682c4 100644--- a/apps/web/src/components/ThreadTerminalDrawer.tsx+++ b/apps/web/src/components/ThreadTerminalDrawer.tsx@@ -66,7 +66,11 @@ import { terminalEnvironment } from "../state/terminal";import { openTerminalLinkInPreview } from "./preview/openTerminalLinkInPreview";import { useAtomCommand } from "../state/use-atom-command";import { preventTerminalCloseShortcut } from "../lib/terminalCloseShortcut";-import { resolveTerminalFontPreference, TYPOGRAPHY_ADVANCED_STORAGE_KEY } from "../appearanceFonts";+import {+ resolveTerminalFontPreference,+ resolveTerminalFontSizePreference,+ TYPOGRAPHY_ADVANCED_STORAGE_KEY,+} from "../appearanceFonts";const MIN_DRAWER_HEIGHT = 180;const MAX_DRAWER_HEIGHT_RATIO = 0.75;@@ -341,7 +345,13 @@ export function TerminalViewport({terminal: settings.fontFamilyTerminal,}),);- const terminalFontSize = useClientSettings((settings) => settings.fontSizeTerminal);+ const terminalFontSize = useClientSettings((settings) =>+ resolveTerminalFontSizePreference({+ advanced: advancedTypography,+ code: settings.fontSizeCode,+ terminal: settings.fontSizeTerminal,+ }),+ );const terminalFontRef = useRef({ family: terminalFontFamily, size: terminalFontSize });const terminalSession = useAttachedTerminalSession({environmentId,diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsxindex bdfb83073..f9046f441 100644--- a/apps/web/src/components/settings/SettingsPanels.tsx+++ b/apps/web/src/components/settings/SettingsPanels.tsx@@ -100,6 +100,7 @@ import {isMonospaceFamily,resolveDefaultFamilyLabel,resolveTerminalFontPreference,+ resolveTerminalFontSizePreference,TYPOGRAPHY_ADVANCED_STORAGE_KEY,} from "../../appearanceFonts";import { CodeFontPreview, PromptFontPreview, TerminalFontPreview } from "./SettingsFontPreviews";@@ -1272,7 +1273,11 @@ function SimpleFontRows() {code: settings.fontFamilyCode,terminal: settings.fontFamilyTerminal,})}- size={settings.fontSizeTerminal}+ size={resolveTerminalFontSizePreference({+ advanced: false,+ code: settings.fontSizeCode,+ terminal: settings.fontSizeTerminal,+ })}/></>}