Skip to content

header, temperature metric or US customary#904

Open
MichaelWheeley wants to merge 3 commits intoaccius:Stagingfrom
MichaelWheeley:header_metric_temperature
Open

header, temperature metric or US customary#904
MichaelWheeley wants to merge 3 commits intoaccius:Stagingfrom
MichaelWheeley:header_metric_temperature

Conversation

@MichaelWheeley
Copy link
Copy Markdown
Contributor

@MichaelWheeley MichaelWheeley commented Apr 12, 2026

What does this PR do?

uses global temperature units selection to show C or F in header but not both

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

How to test

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

Screenshots (if visual change)

WAS
was Screenshot 2026-04-12 093034

BECOMES
becomes F Screenshot 2026-04-12 093547

OR
become celcius Screenshot 2026-04-12 093457

@ceotjoe
Copy link
Copy Markdown
Collaborator

ceotjoe commented Apr 13, 2026

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

@alanhargreaves
Copy link
Copy Markdown
Collaborator

alanhargreaves commented Apr 14, 2026

@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.

Copy link
Copy Markdown
Owner

@accius accius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — Header temperature unit

Small, clean change. Honors the user's allUnits.temp preference instead of always showing both units.

Minor suggestions (non-blocking):

  1. Defensive defaulting: const allUnits = config.allUnits || {}; is good — consider making it config?.allUnits || {} in case config is ever undefined on first render (other spots in this file destructure it from props so it should be set, but the guard is cheap).

  2. Reuse elsewhere: other places in the app (e.g. weather panel, dx weather) already handle this by passing allUnits down; consider a tiny formatTempC(rawC, allUnits.temp) helper in utils/ to avoid the inline ternary scattering if this pattern is repeated.

  3. 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.

  4. 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.

@MichaelWheeley MichaelWheeley marked this pull request as draft April 14, 2026 16:29
@MichaelWheeley
Copy link
Copy Markdown
Contributor Author

@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.

done.
image

@MichaelWheeley
Copy link
Copy Markdown
Contributor Author

@accius

Minor suggestions (non-blocking):

  1. Defensive defaulting: const allUnits = config.allUnits || {}; is good — consider making it config?.allUnits || {} in case config is ever undefined on first render (other spots in this file destructure it from props so it should be set, but the guard is cheap).

Noted, removed temperature formatting to utils/formatWeather.js and passed config?.allUnits

  1. Reuse elsewhere: other places in the app (e.g. weather panel, dx weather) already handle this by passing allUnits down; consider a tiny formatTempC(rawC, allUnits.temp) helper in utils/ to avoid the inline ternary scattering if this pattern is repeated.

Done with addtional exported formatters, please review.

  1. 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.

Per separate discussion added dual temperature to the mouse-over.

  1. Checklist — please tick the "tested in Dark/Light/Retro + mobile" boxes; this is a header change so it's quick to verify.

Checked and done!

@MichaelWheeley MichaelWheeley marked this pull request as ready for review April 14, 2026 18:00
@MichaelWheeley MichaelWheeley requested a review from accius April 14, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants