From adda76a2ffca2737411a2e6c7fb9ea515360ae7c Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Tue, 26 May 2026 21:19:47 +0200 Subject: [PATCH] fix: remove viewport-based font size calculation causing jump on mobile The calculateFontSize() function was overriding the font size on mobile based on viewport width (vw/25), causing the terminal to display at ~15px while the internal state was 8px. When pressing A-, it would jump from 15px to 7px. Now it respects the actual fontSize state consistently. Quality gates: TypeScript check passed, production build successful --- apps/web/src/components/terminal.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/terminal.tsx b/apps/web/src/components/terminal.tsx index fe9ded6..cafa024 100644 --- a/apps/web/src/components/terminal.tsx +++ b/apps/web/src/components/terminal.tsx @@ -64,11 +64,8 @@ export const TerminalComponent: React.FC = ({ const isUnmountingRef = useRef(false); const calculateFontSize = useCallback(() => { - if (!isMobile) return fontSize; - const vw = window.innerWidth; - const calculated = Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, vw / 25)); - return Math.round(calculated); - }, [isMobile, fontSize]); + return fontSize; + }, [fontSize]); const connectWebSocket = useCallback(() => { const apiUrl = import.meta.env.VITE_API_BASE_URL || "";