From 0fd3589313381ad54d7e9c6b150c3809ea8bbfa6 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 2 Jan 2026 22:06:39 +0000 Subject: [PATCH] feat: Consolidate font size settings; adjust increment to 0.05 Co-authored-by: aider (gemini/gemini-2.5-pro) --- webclient/src/App.js | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/webclient/src/App.js b/webclient/src/App.js index be19b46..296a5ab 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -22,9 +22,7 @@ function App() { const [waitingWorker, setWaitingWorker] = useState(null); const [settingsOpen, setSettingsOpen] = useState(false); const defaultBodyFontSize = 1.0; - const defaultStoryFontSize = 1.2; const [bodyFontSize, setBodyFontSize] = useState(Number(localStorage.getItem('bodyFontSize')) || defaultBodyFontSize); - const [storyFontSize, setStoryFontSize] = useState(Number(localStorage.getItem('storyFontSize')) || defaultStoryFontSize); const updateCache = useCallback((key, value) => { cache.current[key] = value; @@ -52,14 +50,8 @@ function App() { const changeBodyFontSize = (amount) => { const newSize = bodyFontSize + amount; - setBodyFontSize(parseFloat(newSize.toFixed(1))); - localStorage.setItem('bodyFontSize', newSize.toFixed(1)); - }; - - const changeStoryFontSize = (amount) => { - const newSize = storyFontSize + amount; - setStoryFontSize(parseFloat(newSize.toFixed(1))); - localStorage.setItem('storyFontSize', newSize.toFixed(1)); + setBodyFontSize(parseFloat(newSize.toFixed(2))); + localStorage.setItem('bodyFontSize', newSize.toFixed(2)); }; const resetBodyFontSize = () => { @@ -67,13 +59,7 @@ function App() { localStorage.removeItem('bodyFontSize'); }; - const resetStoryFontSize = () => { - setStoryFontSize(defaultStoryFontSize); - localStorage.removeItem('storyFontSize'); - }; - const bodyFontSettingsChanged = bodyFontSize !== defaultBodyFontSize; - const storyFontSettingsChanged = storyFontSize !== defaultStoryFontSize; useEffect(() => { const onSWUpdate = e => { @@ -126,16 +112,6 @@ function App() { document.documentElement.style.fontSize = `${bodyFontSize}rem`; }, [bodyFontSize]); - useEffect(() => { - const styleId = 'story-font-size-style'; - let style = document.getElementById(styleId); - if (!style) { - style = document.createElement('style'); - style.id = styleId; - document.head.appendChild(style); - } - style.innerHTML = `.story-text { font-size: ${storyFontSize}em !important; }`; - }, [storyFontSize]); const fullScreenAvailable = document.fullscreenEnabled || document.mozFullscreenEnabled || @@ -156,19 +132,12 @@ function App() {
-

Body Font Size

- - {bodyFontSize.toFixed(1)} - +

Font Size

+ + {bodyFontSize.toFixed(2)} +
-
-

Story Font Size

- - {storyFontSize.toFixed(1)} - - -
}