From 966006db6a152b49921f4a09757428b055926240 Mon Sep 17 00:00:00 2001 From: Andreas Weyer Date: Fri, 16 Jan 2026 15:49:43 +0000 Subject: [PATCH] Update shorten line names (legend, tooltip, buttons) based on window width --- src/App.tsx | 22 ++- src/components/simulation-chart.tsx | 223 +++++++++++++++++++--------- src/locales/de.ts | 3 + src/locales/en.ts | 3 + 4 files changed, 175 insertions(+), 76 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 2062a3c..3293d3b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -49,6 +49,19 @@ const MedPlanAssistant = () => { setShowDisclaimer(true); }; + // Use shorter button labels on narrow screens to keep the pin control visible + const [useCompactButtons, setUseCompactButtons] = React.useState(false); + + React.useEffect(() => { + const updateCompact = () => { + setUseCompactButtons(window.innerWidth < 520); // tweakable threshold + }; + + updateCompact(); + window.addEventListener('resize', updateCompact); + return () => window.removeEventListener('resize', updateCompact); + }, []); + const { appState, updateNestedState, @@ -113,19 +126,19 @@ const MedPlanAssistant = () => { {/* Both Columns - Chart */}
-
-
+
+