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:
2026-04-10 08:43:30 -04:00
parent 3b8d40fea3
commit c1bc73da8e
+4 -31
View File
@@ -74,6 +74,10 @@ let currentWeatherTimer: ReturnType<typeof setInterval> | null = null
async function loadCurrentConditions() {
try {
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 */ }
}
@@ -260,14 +264,6 @@ onMounted(async () => {
<!-- Left column: Weather -->
<div class="briefing-left">
<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 -->
<template v-if="weatherData.length">
<WeatherCard
@@ -492,29 +488,6 @@ onMounted(async () => {
}
/* ── 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 {
font-size: 0.82rem;