set({ weather_style })} data-testid="signage-widget-weather-style"
options={['both', 'icon', 'text'].map(s => ({ value: s, label: t(`signage.widgets.weatherStyles.${s}`) }))} />
@@ -315,7 +319,27 @@ function BelowFields({ w, set, media, onMedia, extras, path, depth, selected, on
onChange={item => { onMedia(item); set({ media_id: item.id }) }} />
}
if (w.kind === 'message') return
- if (w.kind === 'weather') return {t('signage.widgets.weatherNeedsInternet')}
+ if (w.kind === 'weather') {
+ return (
+
+
+
+ set({ weather_details })} allLabel={t('signage.widgets.weatherNoDetails')}
+ data-testid="signage-widget-weather-details" options={WEATHER_DETAILS.map(d => ({ value: d, label: t(`signage.widgets.weatherDetail.${d}`) }))} />
+
+ {w.weather_layout === 'hourly' && (
+
+ set({ weather_hours: Number(v) })} options={[3, 4, 6, 8, 10, 12].map(n => ({ value: n, label: String(n) }))} />
+
+ )}
+
+ set({ weather_place })} label={t('signage.widgets.weatherPlaceLabel')} />
+
+
+
{t('signage.widgets.weatherNeedsInternet')}
+
+ )
+ }
if (w.kind === 'qr') {
return (
diff --git a/manager_dashboard/src/pages/signage/signageLogic.js b/manager_dashboard/src/pages/signage/signageLogic.js
index e0f476c..97d352e 100644
--- a/manager_dashboard/src/pages/signage/signageLogic.js
+++ b/manager_dashboard/src/pages/signage/signageLogic.js
@@ -174,7 +174,10 @@ export function cellWidget(kind) {
}
/** The weather's days, as one choice: from (0 today, 1 tomorrow, 2 the day after) and how many. */
-export const WEATHER_CHOICES = [[0, 1], [0, 2], [0, 3], [1, 1], [2, 1]]
+export const WEATHER_CHOICES = [[0, 1], [0, 2], [0, 3], [0, 5], [0, 7], [1, 1], [2, 1], [1, 3]]
+/** The weather's layouts and details (6R.18). */
+export const WEATHER_LAYOUTS = ['row', 'column', 'card', 'list', 'hourly']
+export const WEATHER_DETAILS = ['words', 'feels', 'humidity', 'wind', 'rain', 'sun', 'uv']
export const weatherChoice = w => `${w.weather_from || 0}-${w.weather_days || 1}`
/** The picked widget's index after moving the one at `from` to `to` (the list reordered). */
diff --git a/packages/i18n/locales/el/manager.json b/packages/i18n/locales/el/manager.json
index 10d80e4..b0ee326 100644
--- a/packages/i18n/locales/el/manager.json
+++ b/packages/i18n/locales/el/manager.json
@@ -1553,7 +1553,10 @@
"0-2": "Σήμερα και αύριο",
"0-3": "Σήμερα και τις 2 επόμενες",
"1-1": "Αύριο",
- "2-1": "Μεθαύριο"
+ "2-1": "Μεθαύριο",
+ "0-5": "Σήμερα και οι επόμενες 4 μέρες",
+ "0-7": "Όλη η εβδομάδα",
+ "1-3": "Αύριο και οι 2 επόμενες"
},
"menuEdit_one": "Προϊόντα και εμφάνιση ({{count}} προϊόν)",
"menuEdit_other": "Προϊόντα και εμφάνιση ({{count}} προϊόντα)",
@@ -1707,7 +1710,29 @@
"toMedia": "Φτιάξτε έναν στη σελίδα Πολυμέσα",
"add": "Προσθήκη εικόνων ή βίντεο",
"empty": "Η συλλογή είναι άδεια ακόμη: μένει κρυφή."
- }
+ },
+ "weatherLayout": "Διάταξη",
+ "weatherLayouts": {
+ "row": "Σε σειρά",
+ "column": "Σε στήλη",
+ "card": "Κάρτα",
+ "list": "Λίστα ημερών",
+ "hourly": "Οι επόμενες ώρες"
+ },
+ "weatherDetails": "Δείχνει επίσης",
+ "weatherNoDetails": "Τίποτα άλλο",
+ "weatherDetail": {
+ "words": "Τον καιρό με λέξεις",
+ "feels": "Αίσθηση θερμοκρασίας",
+ "humidity": "Υγρασία",
+ "wind": "Άνεμο",
+ "rain": "Πιθανότητα βροχής",
+ "sun": "Ανατολή και δύση",
+ "uv": "Δείκτη UV"
+ },
+ "weatherHours": "Ώρες",
+ "weatherPlace": "Η τοποθεσία",
+ "weatherPlaceLabel": "Δείχνει το όνομά της"
},
"tabs": {
"playlists": "Λίστες",
diff --git a/packages/i18n/locales/el/terminal.json b/packages/i18n/locales/el/terminal.json
index 725ea3d..37b903c 100644
--- a/packages/i18n/locales/el/terminal.json
+++ b/packages/i18n/locales/el/terminal.json
@@ -492,7 +492,22 @@
"title": "Βαθμονόμηση εικόνας: {{name}}",
"hint": "Στον διαχειριστή (Ψηφιακή σήμανση → Οθόνες) μετακινήστε κάθε άκρη μέχρι τα βέλη να ακουμπούν τις άκρες της οθόνης."
},
- "closed": "Κλειστά"
+ "closed": "Κλειστά",
+ "weather": {
+ "feels": "Αίσθηση {{t}}",
+ "today": "Σήμερα",
+ "words": {
+ "sun": "Ηλιοφάνεια",
+ "moon": "Αίθριος",
+ "cloud-sun": "Λίγα σύννεφα",
+ "cloud-moon": "Λίγα σύννεφα",
+ "cloud": "Συννεφιά",
+ "fog": "Ομίχλη",
+ "rain": "Βροχή",
+ "snow": "Χιόνι",
+ "storm": "Καταιγίδα"
+ }
+ }
},
"menuTablet": {
"title": "Μενού",
diff --git a/packages/i18n/locales/en/manager.json b/packages/i18n/locales/en/manager.json
index ddbbf2f..e169b65 100644
--- a/packages/i18n/locales/en/manager.json
+++ b/packages/i18n/locales/en/manager.json
@@ -1553,7 +1553,10 @@
"0-2": "Today and tomorrow",
"0-3": "Today and the next 2 days",
"1-1": "Tomorrow",
- "2-1": "The day after tomorrow"
+ "2-1": "The day after tomorrow",
+ "0-5": "Today and the next 4 days",
+ "0-7": "The whole week",
+ "1-3": "Tomorrow and the 2 days after"
},
"menuEdit_one": "Products and look ({{count}} product)",
"menuEdit_other": "Products and look ({{count}} products)",
@@ -1707,7 +1710,29 @@
"toMedia": "Make one on the Media page",
"add": "Add pictures or videos",
"empty": "Nothing in the gallery yet: it stays hidden."
- }
+ },
+ "weatherLayout": "Layout",
+ "weatherLayouts": {
+ "row": "In a row",
+ "column": "In a column",
+ "card": "A card",
+ "list": "A list of days",
+ "hourly": "The next hours"
+ },
+ "weatherDetails": "Also shows",
+ "weatherNoDetails": "Nothing more",
+ "weatherDetail": {
+ "words": "The weather in words",
+ "feels": "Feels like",
+ "humidity": "Humidity",
+ "wind": "Wind",
+ "rain": "Chance of rain",
+ "sun": "Sunrise and sunset",
+ "uv": "UV index"
+ },
+ "weatherHours": "Hours",
+ "weatherPlace": "The place",
+ "weatherPlaceLabel": "Show its name"
},
"tabs": {
"playlists": "Playlists",
diff --git a/packages/i18n/locales/en/terminal.json b/packages/i18n/locales/en/terminal.json
index d60a60e..54dbbc9 100644
--- a/packages/i18n/locales/en/terminal.json
+++ b/packages/i18n/locales/en/terminal.json
@@ -492,7 +492,22 @@
"title": "Calibrating the picture of {{name}}",
"hint": "In the manager (Signage → Screens), move each edge until the arrows touch the edges of the screen."
},
- "closed": "Closed"
+ "closed": "Closed",
+ "weather": {
+ "feels": "Feels like {{t}}",
+ "today": "Today",
+ "words": {
+ "sun": "Sunny",
+ "moon": "Clear",
+ "cloud-sun": "Partly cloudy",
+ "cloud-moon": "Partly cloudy",
+ "cloud": "Cloudy",
+ "fog": "Fog",
+ "rain": "Rain",
+ "snow": "Snow",
+ "storm": "Thunderstorm"
+ }
+ }
},
"menuTablet": {
"title": "Menu",
diff --git a/packages/signage/src/Slides.jsx b/packages/signage/src/Slides.jsx
index 12d5434..0e846cf 100644
--- a/packages/signage/src/Slides.jsx
+++ b/packages/signage/src/Slides.jsx
@@ -3,7 +3,7 @@
// they are inline styles, not tokens. Sizes scale with the screen (cqmin), so a slide looks the
// same on any TV.
import { useEffect, useRef, useState } from 'react'
-import { Camera, Cloud, CloudFog, CloudLightning, CloudMoon, CloudRain, CloudSnow, CloudSun, Globe, Lock, Mail, MapPin, MessageCircle, Moon, Music, Phone, Star, Sun, ThumbsUp, Wifi } from 'lucide-react'
+import { Camera, Cloud, CloudFog, CloudLightning, CloudMoon, CloudRain, CloudSnow, CloudSun, Droplets, Globe, Lock, Mail, MapPin, MessageCircle, Moon, Music, Phone, Star, Sun, SunDim, Sunrise, ThumbsUp, Thermometer, Umbrella, Wifi, Wind } from 'lucide-react'
import { QRCodeSVG } from 'qrcode.react'
import { BADGE_ICONS } from './badges'
import { cq, CQ_BOX } from './cq'
@@ -359,7 +359,7 @@ function widgetBody(w, ctx, fit, path) {
)
}
- if (w.kind === 'weather') return weatherBody(w, venue?.weather, unit, text, formatDate)
+ if (w.kind === 'weather') return weatherBody(w, venue?.weather, unit, text, formatDate, ctx.t)
if (w.kind === 'menu') return boxed(, 'menu')
if (w.kind === 'stack') return boxed(, 'stack')
// 6R.15
@@ -631,39 +631,138 @@ function contactBody(w, contact, unit, text) {
)
}
-/** The weather: now or a day of the forecast (today, tomorrow, the day after), and the next days;
- * its picture and degrees, only the picture or only the degrees (2026-11-21). */
-function weatherBody(w, wx, unit, text, formatDate) {
+/**
+ * The weather (5.4c; 6R.18 all the way): now or a day of the forecast and the next days, its
+ * picture and degrees (or one of them), laid out in a row, a column, a card, a list of days or the
+ * next hours; with the details chosen (feels like, humidity, wind, rain chance, sunrise / sunset,
+ * UV, in words) and the place's name. Older forecasts without the details just leave them out.
+ */
+function weatherBody(w, wx, unit, text, formatDate, t) {
if (!wx || wx.temperature == null) return null // no internet / no place: hidden (5.4c)
const from = w.weather_from || 0
const style = w.weather_style || 'both'
+ const layout = w.weather_layout || 'row'
const pic = style !== 'text'
const deg = style !== 'icon'
- const unitMark = wx.units === 'fahrenheit' ? '°F' : '°C'
+ const mark = wx.units === 'fahrenheit' ? '°F' : '°C'
const days = wx.days || []
const dayName = d => formatDate(`${d.date}T12:00:00Z`, 'weekday').slice(0, 3)
+ const r = n => Math.round(n)
const main = from === 0
- ? { icon: weatherIcon(wx.code, wx.is_day), label: `${Math.round(wx.temperature)}${unitMark}` }
- : days[from] && { icon: weatherIcon(days[from].code, true), label: `${dayName(days[from])} ${Math.round(days[from].max)}° / ${Math.round(days[from].min)}°` }
+ ? { icon: weatherIcon(wx.code, wx.is_day), label: `${r(wx.temperature)}${mark}`, day: days[0] }
+ : days[from] && { icon: weatherIcon(days[from].code, true), label: `${dayName(days[from])} ${r(days[from].max)}° / ${r(days[from].min)}°`, day: days[from] }
if (!main) return null
const rest = days.slice(from + 1, from + (w.weather_days || 1))
- const restText = d => `${Math.round(d.max)}° / ${Math.round(d.min)}°`
- const u = unit(6, (pic ? 6 + 1.5 : 0) + (deg ? textWidth(main.label.length, 4.4) : 0)
- + rest.length * (1.5 + (pic ? 3.4 : 0) + textWidth(4 + (deg ? 11 : 0), 2.4)))
+ const restText = d => `${r(d.max)}° / ${r(d.min)}°`
+ // the details chosen, those the forecast has
+ const want = new Set(w.weather_details || [])
+ const details = [
+ want.has('feels') && from === 0 && wx.feels_like != null && [Thermometer, t('signage.weather.feels', { t: `${r(wx.feels_like)}°` })],
+ want.has('humidity') && from === 0 && wx.humidity != null && [Droplets, `${r(wx.humidity)}%`],
+ want.has('wind') && (from === 0 ? wx.wind : main.day?.wind) != null && [Wind, `${r(from === 0 ? wx.wind : main.day.wind)} ${wx.wind_unit || 'km/h'}`],
+ want.has('rain') && main.day?.rain != null && [Umbrella, `${r(main.day.rain)}%`],
+ want.has('sun') && main.day?.sunrise && [Sunrise, `${main.day.sunrise} · ${main.day.sunset || ''}`],
+ want.has('uv') && main.day?.uv != null && [SunDim, `UV ${r(main.day.uv)}`],
+ ].filter(Boolean)
+ const words = want.has('words') ? t(`signage.weather.words.${main.icon}`) : ''
+ const place = w.weather_place && wx.place ? wx.place : ''
const MainIcon = ICONS[main.icon] || Cloud
+ const tw = textWidth
+ const detailW = details.length ? Math.max(...details.map(([, x]) => x.length)) + 2 : 0
+
+ if (layout === 'hourly') {
+ const hours = (wx.hours || []).slice(0, w.weather_hours || 6)
+ if (!hours.length) return null
+ const u = unit((place ? 3.2 : 0) + 3 + 5 + 3.6, hours.length * 9)
+ return (
+
+ {place &&
{place}}
+
+ {hours.map(h => {
+ const I = ICONS[weatherIcon(h.code, h.is_day)] || Cloud
+ return (
+
+ {h.time}
+ {pic && }
+ {deg && {r(h.temp)}°}
+
+ )
+ })}
+
+
+ )
+ }
+ if (layout === 'list') {
+ const list = days.slice(from, from + (w.weather_days || 3))
+ const u = unit((place ? 3.4 : 0) + list.length * 4.4, tw(4, 3) + 5 + tw(11, 3) + (want.has('rain') ? tw(5, 3) : 0) + 4)
+ return (
+
+ {place &&
{place}}
+
+ {list.map((d, n) => {
+ const I = ICONS[weatherIcon(d.code, true)] || Cloud
+ return (
+
+ {n === 0 && from === 0 ? t('signage.weather.today') : dayName(d)}
+
+ {restText(d)}
+ {want.has('rain') && {d.rain ?? '–'}%}
+
+ )
+ })}
+
+
+ )
+ }
+ const detailEls = (size, gapX) => details.map(([I, x], n) => (
+
+ {x}
+
+ ))
+ const restEls = (u, small) => rest.map(d => {
+ const DayIcon = ICONS[weatherIcon(d.code, true)] || Cloud
+ return (
+
+ {dayName(d)} {pic && }
+ {deg && restText(d)}
+
+ )
+ })
+ if (layout === 'column' || layout === 'card') {
+ const card = layout === 'card'
+ const lines = (place ? 1 : 0) + 1 + (words ? 0.8 : 0) + (card ? Math.ceil(details.length / 2) : details.length) * 0.7 + rest.length * 0.7
+ const width = Math.max((pic ? 9 : 0) + (deg ? tw(main.label.length, 6) : 0), card ? detailW * 2 * 2.4 * 0.6 + 3 : tw(detailW, 2.6), tw(16, 2.4), place ? tw(place.length, 2.8) : 0)
+ const u = unit(lines * 4.2 + 3, width + 2)
+ return (
+
+ {place &&
{place}}
+
+ {pic && }
+ {deg && {main.label}}
+
+ {words &&
{words}}
+ {details.length > 0 && (
+
+ {detailEls({ u, s: 2.6 }, u(0.6))}
+
+ )}
+ {rest.length > 0 &&
{restEls(u, 2.4)}
}
+
+ )
+ }
+ // a row (as before 6R.18), the place before it and the details after it
+ const u = unit(6 + (place || details.length ? 0 : 0), (place ? tw(place.length, 2.8) + 1.5 : 0) + (pic ? 6 + 1.5 : 0) + (deg ? tw(main.label.length, 4.4) : 0)
+ + (words ? tw(words.length, 2.6) + 1.5 : 0) + details.reduce((n, [, x]) => n + tw(x.length + 2, 2.4) + 1.5, 0)
+ + rest.length * (1.5 + (pic ? 3.4 : 0) + tw(4 + (deg ? 11 : 0), 2.4)))
return (
-
+
+ {place && {place}}
{pic && }
{deg && {main.label}}
- {rest.map(d => {
- const DayIcon = ICONS[weatherIcon(d.code, true)] || Cloud
- return (
-
- {dayName(d)} {pic && }
- {deg && restText(d)}
-
- )
- })}
+ {words && {words}}
+ {details.length > 0 && detailEls({ u, s: 2.4 }, u(0.5))}
+ {restEls(u, 2.4)}
)
}