fix: set terminal default to 8px and minimum to 4px
- Reduce MIN_FONT_SIZE from 8 to 4 for maximum text size reduction - Set default font size to 8px for both mobile and desktop - Allows very small terminal text for mobile viewport optimization Quality gates: TypeScript check passed, production build successful
This commit is contained in:
@@ -21,7 +21,7 @@ interface TerminalProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const FONT_SIZE_KEY = "terminal-font-size";
|
const FONT_SIZE_KEY = "terminal-font-size";
|
||||||
const MIN_FONT_SIZE = 8;
|
const MIN_FONT_SIZE = 4;
|
||||||
const MAX_FONT_SIZE = 24;
|
const MAX_FONT_SIZE = 24;
|
||||||
const RECONNECT_ATTEMPTS = 3;
|
const RECONNECT_ATTEMPTS = 3;
|
||||||
const RECONNECT_DELAY_BASE = 1000;
|
const RECONNECT_DELAY_BASE = 1000;
|
||||||
@@ -51,13 +51,13 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
|||||||
const activeModifierRef = useRef(activeModifier);
|
const activeModifierRef = useRef(activeModifier);
|
||||||
activeModifierRef.current = activeModifier;
|
activeModifierRef.current = activeModifier;
|
||||||
const [fontSize, setFontSize] = useState(() => {
|
const [fontSize, setFontSize] = useState(() => {
|
||||||
if (typeof window === "undefined") return isMobile ? 10 : 10;
|
if (typeof window === "undefined") return isMobile ? 8 : 8;
|
||||||
const stored = localStorage.getItem(FONT_SIZE_KEY);
|
const stored = localStorage.getItem(FONT_SIZE_KEY);
|
||||||
if (stored) {
|
if (stored) {
|
||||||
const parsed = parseInt(stored, 10);
|
const parsed = parseInt(stored, 10);
|
||||||
return Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, parsed));
|
return Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, parsed));
|
||||||
}
|
}
|
||||||
return isMobile ? 10 : 10;
|
return isMobile ? 8 : 8;
|
||||||
});
|
});
|
||||||
const lastPingRef = useRef<number>(0);
|
const lastPingRef = useRef<number>(0);
|
||||||
const heartbeatCheckRef = useRef<number | null>(null);
|
const heartbeatCheckRef = useRef<number | null>(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user