feat(ui): render the Weather readout as one component

createWeatherPanel() computes the readout it shows (forecast and event
cards, the observed group's scope, the history timeline state and observed
cards) and renders WeatherReadout synchronously into the panel body, so a
newly opened card is still revealed after measuring. The hand-built hosts
and the separate card and timeline builders are gone; markup, open-card
choice, first appearance and teardown are unchanged.
This commit is contained in:
Sameh Khamis committed 2026-10-30 18:48:46 -07:00
1 parent ce6040bde1
commit a318376203
4 files changed
+103 -63

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
<script setup>
import { t } from '../../i18n/index.js';
import RailCards from '../rail/RailCards.vue';
import RailTimeline from '../rail/RailTimeline.vue';
// Active weather: forecast and event cards, then the observed products with
// their shared history timeline. The owner computes every value shown.
defineProps({
view: { type: Object, required: true },
onParams: { type: Function, default: () => {} },
onOpen: { type: Function, default: () => {} },
transport: { type: Object, required: true },
});
</script>
<template>
<section
class="weather-readout"
:hidden="view.hidden"
:aria-label="t('Active weather')"
><div class="weather-cards"
><RailCards
:cards="view.cards"
card-class-name="weather-card"
badge-class-name="weather-coverage"
:on-params="onParams"
:on-open="onOpen" /></div
><section
class="weather-observed-group"
:hidden="!view.observed"
:aria-label="t('Observed history')"
><h3 class="panel-title">{{ t('Observed history') }}</h3
><div class="weather-observed-scope">{{ view.scope }}</div
><div class="weather-timeline-block" :hidden="!view.observed"
><RailTimeline
:state="view.timeline"
slider-class-name="weather-timeline"
:heading="false"
:on-commit="transport.onCommit"
:on-preview="transport.onPreview"
:on-step="transport.onStep"
:on-latest="transport.onLatest"
:on-play="transport.onPlay" /></div
><div class="weather-cards"
><RailCards
:cards="view.observedCards"
card-class-name="weather-card"
badge-class-name="weather-coverage"
:on-params="onParams"
:on-open="onOpen" /></div></section
></section>
</template>