fix(briefing): remove redundant current-conditions block; patch live temp into WeatherCard
The standalone current-conditions div showed just a bare temperature with no forecast context, making the weather panel look incomplete. Now the live temperature from /weather/current is patched directly into the WeatherCard's current_temp so it stays fresh without a second display block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,10 @@ let currentWeatherTimer: ReturnType<typeof setInterval> | null = null
|
|||||||
async function loadCurrentConditions() {
|
async function loadCurrentConditions() {
|
||||||
try {
|
try {
|
||||||
currentConditions.value = await apiGet<CurrentConditions>('/api/briefing/weather/current')
|
currentConditions.value = await apiGet<CurrentConditions>('/api/briefing/weather/current')
|
||||||
|
// Patch the live temperature into the WeatherCard so it stays fresh
|
||||||
|
if (currentConditions.value?.temperature != null && weatherData.value.length > 0) {
|
||||||
|
weatherData.value[0] = { ...weatherData.value[0], current_temp: currentConditions.value.temperature }
|
||||||
|
}
|
||||||
} catch { /* silent — endpoint may not have locations configured */ }
|
} catch { /* silent — endpoint may not have locations configured */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,14 +264,6 @@ onMounted(async () => {
|
|||||||
<!-- Left column: Weather -->
|
<!-- Left column: Weather -->
|
||||||
<div class="briefing-left">
|
<div class="briefing-left">
|
||||||
<div class="panel-label">Weather</div>
|
<div class="panel-label">Weather</div>
|
||||||
<!-- Current conditions (live) -->
|
|
||||||
<div v-if="currentConditions && currentConditions.temperature != null" class="current-conditions">
|
|
||||||
<div class="cc-temp">{{ currentConditions.temperature }}°{{ currentConditions.temp_unit }}</div>
|
|
||||||
<div class="cc-desc">{{ currentConditions.description }}</div>
|
|
||||||
<div v-if="currentConditions.precip_next_3h?.some((p: number) => p > 0)" class="cc-precip">
|
|
||||||
Rain next 3h: {{ currentConditions.precip_next_3h.map((p: number) => `${p}%`).join(', ') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Forecast card -->
|
<!-- Forecast card -->
|
||||||
<template v-if="weatherData.length">
|
<template v-if="weatherData.length">
|
||||||
<WeatherCard
|
<WeatherCard
|
||||||
@@ -492,29 +488,6 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ── Current conditions (live) ─────────────────────────── */
|
/* ── Current conditions (live) ─────────────────────────── */
|
||||||
.current-conditions {
|
|
||||||
padding: 12px 16px;
|
|
||||||
background: var(--color-surface);
|
|
||||||
border: 1px solid var(--color-border);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.cc-temp {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-text);
|
|
||||||
line-height: 1.1;
|
|
||||||
}
|
|
||||||
.cc-desc {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: var(--color-text-secondary);
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
.cc-precip {
|
|
||||||
font-size: 0.78rem;
|
|
||||||
color: var(--color-accent-warm);
|
|
||||||
margin-top: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-empty {
|
.panel-empty {
|
||||||
font-size: 0.82rem;
|
font-size: 0.82rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user