From 147e07a52f421adfff0917d4957aa4aa5f644cd8 Mon Sep 17 00:00:00 2001 From: fraxle Date: Mon, 27 Jul 2026 20:06:15 +0100 Subject: [PATCH] 3.5.7 Fix unhidden column toggles in free version --- assets/css/table.css | 12 +++++ assets/js/app.js | 84 +++++++++++++++++++-------------- assets/js/components/DayTabs.js | 5 ++ 3 files changed, 66 insertions(+), 35 deletions(-) diff --git a/assets/css/table.css b/assets/css/table.css index c498584..99ae91e 100644 --- a/assets/css/table.css +++ b/assets/css/table.css @@ -797,6 +797,18 @@ text-align: left; } +/* Free tier: the button stays visible but opens the Extra upsell instead of + the Columns bar. Muted to read as locked, still obviously clickable. */ +.col-toggles-edit-btn--locked { + background: #efe6d2; + border-color: #c0b090; + color: #9a8060; +} + +.col-toggles-edit-btn--locked:hover { + color: #7a5c2a; +} + .col-toggles-edit-btn-icon { width: 12px; height: 12px; diff --git a/assets/js/app.js b/assets/js/app.js index 178e00b..57340f3 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -238,6 +238,12 @@ export function UTCIForecast() { const closeSearch = () => { setSearchOpen(false); setSearchClosing(true); }; const searchWrapRef = useRef(null); const [colTogglesOpen, setColTogglesOpen] = useState(false); + // Which column pills are offered in the Columns bar. The bar as a whole is + // Extra-only (see the isPro gate around col-toggles-body), so this just asks + // "is this column part of the current profile?" — Custom and Show All offer + // the lot, every other profile offers what it actually uses. + const colOffered = (key) => + activeProfile === 'custom' || activeProfile === 'showall' || !!activeCols[key]; const searchInputRef = useRef(null); const fscScrollRef = useRef(null); @@ -1060,8 +1066,14 @@ export function UTCIForecast() { Detailed - @@ -1097,39 +1109,41 @@ export function UTCIForecast() { ${[1, 2, 3, 4].map(n => html``)}
- ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['utciP']) : activeCols['utciP']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['vehicleT']) : activeCols['vehicleT']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['indoorT'] || activeCols['managedT']) : (activeCols['indoorT'] || activeCols['managedT'])) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['furSurfaceT']) : activeCols['furSurfaceT']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['pawT']) : activeCols['pawT']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['petShadeT']) : activeCols['petShadeT']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['petHomeT']) : activeCols['petHomeT']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['burn']) : activeCols['burn']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['utci']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['delta']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['tmrt']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['concreteT']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['soilT']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['soilT6']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['soilM']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['shadeT']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['air']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['rh']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['dew']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['precip']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['precipProb']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['lightning']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['cloud']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['vis']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['wind']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['dir']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['aqi']) && html``} - ${(isPro ? (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['pollen']) : activeCols['pollen']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['uvA']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['uvB']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['sun']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['direct']) && html``} - ${isPro && (activeProfile === 'custom' || activeProfile === 'showall' || activeCols['diffuse']) && html``} + ${isPro && html`<${Fragment}> + ${colOffered('utciP') && html``} + ${colOffered('vehicleT') && html``} + ${(colOffered('indoorT') || colOffered('managedT')) && html``} + ${colOffered('furSurfaceT') && html``} + ${colOffered('pawT') && html``} + ${colOffered('petShadeT') && html``} + ${colOffered('petHomeT') && html``} + ${colOffered('burn') && html``} + ${colOffered('utci') && html``} + ${colOffered('delta') && html``} + ${colOffered('tmrt') && html``} + ${colOffered('concreteT') && html``} + ${colOffered('soilT') && html``} + ${colOffered('soilT6') && html``} + ${colOffered('soilM') && html``} + ${colOffered('shadeT') && html``} + ${colOffered('air') && html``} + ${colOffered('rh') && html``} + ${colOffered('dew') && html``} + ${colOffered('precip') && html``} + ${colOffered('precipProb') && html``} + ${colOffered('lightning') && html``} + ${colOffered('cloud') && html``} + ${colOffered('vis') && html``} + ${colOffered('wind') && html``} + ${colOffered('dir') && html``} + ${colOffered('aqi') && html``} + ${colOffered('pollen') && html``} + ${colOffered('uvA') && html``} + ${colOffered('uvB') && html``} + ${colOffered('sun') && html``} + ${colOffered('direct') && html``} + ${colOffered('diffuse') && html``} + `}