Typeset a weather value's unit against its numbers
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- next.js, typescript
- Ambito
- frontend
Direzione di ricerca
Read src/components/forecast/weatherUnits.ts, WeatherValue.tsx, and __tests__/server/weatherUnits.server.test.ts; the issue describes a measured implementation on the beyond-parity-weather-units branch. First get a forecaster's opinion on the open choice among the three display options, then compare the selected behavior with the listed real-world value shapes and tests. Done means the display decision is settled and the chosen behavior is verified across both table formats, with prose and other non-simple values unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Attach a weather table's unit to the numbers it measures, instead of trailing the whole value.
| today | proposed |
|---|---|
20 to 25 F |
20° to 25° F |
5 to 8 " |
5" to 8" |
0.4 to 0.9 " |
0.4" to 0.9" |
The dangling inch mark is the case that prompted this — 5 to 8 " reads as a typo.
Filed separately because this changes how forecaster-entered data is displayed. #1135's approach is re-implementation, not redesign: "Holding presentation constant means any difference is a defect — a question we can answer." This is a deliberate difference, so it needs its own decision rather than riding along in a parity PR.
Approach, already built and measured
Branch: beyond-parity-weather-units — one commit on top of the parity work in #1219. Cherry-pick or rebase it; it is not abandoned spike code.
The wire data is semi-structured. value is free text a forecaster typed; unit is a separate field on the row. Surveyed across real products:
| center | unit |
value looks like |
|---|---|---|
| SNFAC | F |
20 to 25, -3 to 3 |
| SNFAC | " |
0, 0 to 1, 5-10 |
| SAC | none | Cloudy. Snow levels Below 5500 feet. Chance of precipitation is 95%. |
| BTAC | F / mph |
0, -1, 17 |
| BTAC | in |
6.0 / 0.36 — a snow/water pair in one cell |
So the split is on the unit, not the value. Some units read as a symbol on each number; others are words that belong after the whole value.
- Tight (
",%,F,C,°F,°C) → threaded into the numbers. For the temperature scales the degree sign is ours and the scale letter still trails, muted:20° to 25° F. - Everything else (
mph,in, …) → unchanged, trailing and muted. - Fires only when the whole value is a bare number or a simple
A to B/A-Brange. Prose,6.0 / 0.36, blanks and-pass through untouched.
Rebuilding the string from the captured parts rather than replacing numbers in place keeps a negative low legible — -3-2 stays -3°-2° instead of flipping the sign on the high end.
src/components/forecast/weatherUnits.ts is the pure helper; WeatherValue.tsx is shared by both table formats so a temperature reads the same whichever shape a center's product arrives in. 19 tests in __tests__/server/weatherUnits.server.test.ts pin the real-world shapes above, including every one that must pass through unchanged.
The open question
The degree sign is inferred. The wire sends F, not °F — we add the ° because a row whose unit is F is a temperature. Defensible, but it is a glyph the forecaster did not type.
Three ways to go, in order of how much they touch:
- As built — degree signs on temperatures, inch marks on snow.
- Inch marks only.
5" to 8"uses the unit character the wire already sends and invents nothing; temperatures stay20 to 25 F. 20 to 25 °F— no per-number sign, but the unit reads as one token instead of a bare trailing letter.
Option 2 is the conservative pick and still fixes the case that prompted this.
Worth a forecaster's opinion before shipping any of them.
- Lingua principale
- TypeScript
- Stelle
- 6
- Fork
- 2
- Merge medio
- 1g 11h
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NWACus/web
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement needs-triage tenant:a3
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NWACus/web#1190 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NWACus/web#1154 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Media browser returns "Not found" for repositories using the SHA-256 object formatForse già presa @adamchodera l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Follow-ups from #312Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
janhesters/remixcn#318 ·
I maintainer di solito rispondono entro 1 giorno
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
danielmiessler/LifeOS#3150 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·