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
This commit is contained in:
Alex Blank
2026-05-26 21:19:47 +02:00
parent 47962ed476
commit adda76a2ff
+2 -5
View File
@@ -64,11 +64,8 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
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 || "";