header, temperature metric or US customary#904
header, temperature metric or US customary#904MichaelWheeley wants to merge 3 commits intoaccius:Stagingfrom
Conversation
|
I'm not sure about this. On one hand it is adjusting the metrics like we do in other areas. On the other hand it is the only reference to both metrics systems on the dashboard. PR itself is fine, it's a general UX design question. Do we want to keep reference to the other metrics system within the header? @accius @alanhargreaves |
|
@MichaelWheeley indicated that the change was for consistency and I think I can live with that. I do like the idea of adding both temperatures to the mouseover display. If you could add that to this PR, I think we have a winner. |
accius
left a comment
There was a problem hiding this comment.
Review — Header temperature unit
Small, clean change. Honors the user's allUnits.temp preference instead of always showing both units.
Minor suggestions (non-blocking):
-
Defensive defaulting:
const allUnits = config.allUnits || {};is good — consider making itconfig?.allUnits || {}in caseconfigis ever undefined on first render (other spots in this file destructure it from props so it should be set, but the guard is cheap). -
Reuse elsewhere: other places in the app (e.g. weather panel, dx weather) already handle this by passing
allUnitsdown; consider a tinyformatTempC(rawC, allUnits.temp)helper inutils/to avoid the inline ternary scattering if this pattern is repeated. -
Loss of dual display: some users may actually prefer both. Worth confirming with the wider user base — but I think following the global unit setting is the right default.
-
Checklist — please tick the "tested in Dark/Light/Retro + mobile" boxes; this is a header change so it's quick to verify.
Approved in spirit — happy to merge once the quick test-checks are confirmed.
|
Noted, removed temperature formatting to utils/formatWeather.js and passed config?.allUnits
Done with addtional exported formatters, please review.
Per separate discussion added dual temperature to the mouse-over.
Checked and done! |

What does this PR do?
uses global temperature units selection to show C or F in header but not both
Type of change
How to test
Checklist
server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)var(--accent-cyan), etc.).bak,.old,console.logdebug lines, or test scripts includedScreenshots (if visual change)
WAS

BECOMES

OR
