Put news on the globe, with a feed panel in the right rail

Events ▸ News draws the last 24 hours of reports from curated hotspots
(Ukraine–Russia, Israel–Gaza–Lebanon, Iran–Hormuz, Yemen–Red Sea, Sudan,
Sahel) and developing situations elsewhere, from any server that answers the
`/api/news` read routes.

- Globe: one marker per merged event, clamped to the ground and culled at the
  horizon; one beacon per hotspot when zoomed out and a pulsing beacon for a
  developing situation; hotspot outlines with disputed areas dotted and
  labelled by who administers and who claims them; picture cards for at most
  ten major or fast-growing events with two or more sources, never
  overlapping, switchable off.
- Panel: hotspot chips, a severity filter (significant and above by default),
  categories, minor news off by default, and a scrolling list of event cards
  with picture, headline, place, sources, age and the sides that reported it.
  "In view" lists what is near the map below 3,000 km once the camera
  settles. A card flies the globe to its event and opens it with a link to
  the publisher. Reduced motion stops the pulse and the flights.
- Core serves no news itself: the local server proxies GEV_NEWS_ORIGIN when it
  is set, and answers 503 unavailable otherwise, so the layer reads "not
  configured" once instead of retrying.
- Share token 9 (enabled-only); voice stays off for this layer.
This commit is contained in:
Denis Groshev committed 2026-11-06 00:45:24 +01:00
1 parent 2d9d518946
commit 5bb489d1fb
48 files changed
+3394 -53

No files matched your search

+9
View File
@@ -147,6 +147,15 @@ export class LayerBindings {
fires.attachShellServices({ imageryHost: this.services.imageryHost });
this._weatherShellModules.push(fires);
}
// News flies to a chosen report or hotspot through the same release.
const news = this._dataManager?.layers?.get('news')?.module;
if (typeof news?.attachShellServices === 'function') {
news.attachShellServices({
runNavigation: (navigate) =>
this.runImmediateNavigation('news', navigate),
});
this._weatherShellModules.push(news);
}
}
_persistAwarenessSelection(event, cleared = false) {
+1
View File
@@ -37,6 +37,7 @@ export const LAYER_NAME_KEYS = Object.freeze({
'gnss-integrity': msg('GNSS Integrity'),
'drone-airspace': msg('Prohibited & Restricted Airspace'),
's2-ghostmaps': msg('S2 GhostMaps'),
news: msg('News'),
wind: msg('Wind'),
'weather-radar': msg('Rain radar'),
'weather-satellite': msg('Satellite clouds'),
+20
View File
@@ -11,6 +11,7 @@ import {
} from './layerNames.js';
export { localizeLayerName } from './layerNames.js';
import { createWeatherPanel } from './weatherPanel.js';
import { createNewsPanel } from './newsPanel.js';
import { translateFeedError, translateStatusLine } from './statusText.js';
import {
formatNumber,
@@ -78,6 +79,7 @@ const PANEL_GROUPS = [
'fire-perimeters',
'gnss-integrity',
's2-ghostmaps',
'news',
],
},
{
@@ -310,6 +312,11 @@ export class LayerPanel {
container?.ownerDocument?.getElementById?.('weather-panel-body'),
setLayerParams: this.setLayerParams,
});
this._newsPanel?.destroy();
this._newsPanel = createNewsPanel({
container: container?.ownerDocument?.getElementById?.('news-panel-body'),
setLayerParams: this.setLayerParams,
});
this._mountRecentImagery();
this._renderToggles();
}
@@ -345,6 +352,8 @@ export class LayerPanel {
this._releaseBindings();
this._weatherPanel?.destroy();
this._weatherPanel = null;
this._newsPanel?.destroy();
this._newsPanel = null;
this._recentImageryPanel?.destroy();
this._recentImageryPanel = null;
this._recentImageryFactory = null;
@@ -409,10 +418,12 @@ export class LayerPanel {
onLocaleChange(() => {
this._paint();
this._refreshWeatherPanel();
this._refreshNewsPanel();
}),
);
this._paint();
this._refreshWeatherPanel();
this._refreshNewsPanel();
}
/** Present every row from the layers' current state and render them. */
@@ -641,6 +652,15 @@ export class LayerPanel {
}
this._paint();
this._refreshWeatherPanel();
this._refreshNewsPanel();
}
/** Feed the News rail panel the view the news layer publishes while on. */
_refreshNewsPanel() {
const layer = this.getAll().find(({ id }) => id === 'news');
this._newsPanel?.update(
layer?.enabled ? this._rowControlsFor(layer.id)?.feed || null : null,
);
}
_buildMetaText(layer) {
+127
View File
@@ -0,0 +1,127 @@
<script setup>
import { ref, watch } from 'vue';
import { t } from '../../i18n/index.js';
import UiButton from '../kit/UiButton.vue';
// One event in the News panel: the publisher's
// picture when the event has one, the headline, a mono meta line (severity
// marker, category, place, sources, age), who reported it, and its
// attestation and media chips. A click chooses it (the layer flies there and
// opens its card on the globe); open, it shows the summary, the other sides'
// reports and the link to the original article. The layer computes every
// value shown (feedCardView in src/layers/news/model.js).
const props = defineProps({
item: { type: Object, required: true },
open: { type: Boolean, default: false },
onChoose: { type: Function, default: () => {} },
onClear: { type: Function, default: () => {} },
});
// A picture the publisher no longer serves leaves the card without one.
const pictureFailed = ref(false);
const dropPicture = () => {
pictureFailed.value = true;
};
watch(
() => props.item.picture?.url,
() => (pictureFailed.value = false),
);
const meta = () =>
[
props.item.category,
props.item.place &&
(props.item.placedByModel
? t('{place} (placed by model)', { place: props.item.place })
: props.item.place),
props.item.sources,
props.item.age,
]
.filter(Boolean)
.join(' · ');
</script>
<template>
<article
class="news-card"
:class="{ 'is-open': open, 'is-unmapped': !item.mappable }"
:data-report-id="item.id"
:style="{ '--news-color': item.color }"
>
<button
type="button"
class="news-card__main ui-focus"
:aria-expanded="open ? 'true' : 'false'"
@click="onChoose(item)"
>
<span v-if="item.picture && !pictureFailed" class="news-card__thumb"
><img
:src="item.picture.url"
alt=""
loading="lazy"
decoding="async"
referrerpolicy="no-referrer"
v-on="{ error: dropPicture }"
/><span v-if="item.picture.credit" class="news-card__credit">{{
item.picture.credit
}}</span></span
>
<span class="news-card__title">{{ item.title }}</span>
<span v-if="item.original" class="news-card__note">{{
t('English headline by the model')
}}</span>
<span class="news-card__meta ui-mono"
><span
class="news-card__marker"
:class="{ solid: item.solid }"
role="img"
:aria-label="item.severityLabel"
:title="item.severityLabel"
><svg viewBox="0 0 16 16" aria-hidden="true">
<path :d="item.icon" /></svg></span
>{{ meta() }}</span
>
<span v-if="item.sides" class="news-card__sides">{{ item.sides }}</span>
<span v-if="item.chips.length" class="news-card__chips"
><span
v-for="chip in item.chips"
:key="`${chip.kind}:${chip.label}`"
class="news-chip"
:class="`news-chip--${chip.kind}`"
>{{ chip.label }}</span
></span
>
</button>
<div v-if="open" class="news-card__open">
<p v-if="item.original" class="news-card__original">{{
item.original
}}</p>
<p v-if="item.snippet" class="news-card__snippet">{{ item.snippet }}</p>
<p v-if="!item.mappable" class="news-card__note">
{{ t('Not placed on the map') }}
</p>
<ul v-if="item.others.length" class="news-card__others">
<li v-for="other in item.others" :key="other.url">
<span class="news-card__side ui-mono">{{ other.side }}</span
><a :href="other.url" target="_blank" rel="noopener noreferrer"
>{{ other.publisher }}: {{ other.title }}</a
>
</li>
</ul>
<div class="news-card__actions">
<a
class="news-card__link"
:href="item.url"
target="_blank"
rel="noopener noreferrer"
>{{ item.sourceLink }}</a
>
<UiButton
class="data-toggle-chip news-card__clear"
type="button"
@click="onClear()"
>{{ t('Close') }}</UiButton
>
</div>
</div>
</article>
</template>
+217
View File
@@ -0,0 +1,217 @@
<script setup>
import { computed } from 'vue';
import { t } from '../../i18n/index.js';
import UiButton from '../kit/UiButton.vue';
import UiEmpty from '../kit/UiEmpty.vue';
import UiSelect from '../kit/UiSelect.js';
import RailChips from '../rail/RailChips.vue';
import NewsCard from './NewsCard.vue';
// The News panel: the last 24 hours only. Hotspot chips, filters, the chosen
// event, "In view" (reports near the view centre while the camera is low)
// and a continuous feed, newest first. It renders the `feed` view the news
// layer publishes and acts only through `onParams`.
const props = defineProps({
view: { type: Object, default: null },
onParams: { type: Function, default: () => {} },
});
const filters = computed(() => props.view?.filters ?? {});
const chips = computed(() =>
(props.view?.hotspots ?? []).map((chip) => ({
id: chip.id,
label: `${chip.label} ${chip.count}`,
active: chip.active,
title: chip.label,
})),
);
const severityOptions = computed(() => {
const levels = props.view?.severities ?? [];
return [
{ value: '0', label: t('Any severity') },
...levels.slice(1, 3).map((level) => ({
value: String(level.value),
label: t('{severity} and above', { severity: level.label }),
})),
...levels.slice(3).map((level) => ({
value: String(level.value),
label: t('{severity} only', { severity: level.label }),
})),
];
});
const categoryOptions = computed(() => [
{ value: 'all', label: t('All categories') },
...(props.view?.categories ?? []),
]);
const selectedId = computed(() => props.view?.selected?.id ?? null);
// The chosen event leads the panel unless the feed already shows it open.
const selectedApart = computed(() => {
const chosen = props.view?.selected;
if (!chosen) return null;
const listed =
props.view.items.some((item) => item.id === chosen.id) ||
(props.view.inView.active &&
props.view.inView.items.some((item) => item.id === chosen.id));
return listed ? null : chosen;
});
const status = computed(() => {
const view = props.view;
if (!view) return '';
if (view.error) return view.error;
if (view.loading && !view.items.length) return t('Reading the news…');
return '';
});
const setFilter = (name, value) =>
props.onParams({ filters: { [name]: value } });
function choose(item) {
if (item.id === selectedId.value) props.onParams({ clear: true });
else props.onParams({ reportId: item.id, focus: true });
}
const clear = () => props.onParams({ clear: true });
</script>
<template>
<section
v-if="view"
class="news-readout"
:aria-label="t('News, last 24 hours')"
>
<p class="news-readout__window ui-mono">{{ t('Last 24 h') }}</p>
<div class="news-readout__chips" role="group" :aria-label="t('Hotspots')">
<RailChips
:chips="chips"
:on-select="(chip) => setFilter('hotspot', chip.id)"
/>
</div>
<div class="news-readout__filters">
<UiSelect
class="gev-field news-filter"
:aria-label="t('Severity')"
:model-value="String(filters.minSeverity ?? 2)"
:options="severityOptions"
@update:model-value="setFilter('minSeverity', Number($event))"
/>
<UiSelect
class="gev-field news-filter"
:aria-label="t('Category')"
:model-value="filters.category ?? 'all'"
:options="categoryOptions"
@update:model-value="setFilter('category', $event)"
/>
<label class="news-toggle"
><input
type="checkbox"
:checked="filters.includeMinor === true"
@change="setFilter('includeMinor', $event.target.checked)"
/><span>{{ t('Include minor news') }}</span></label
>
<label class="news-toggle"
><input
type="checkbox"
:checked="filters.cards !== false"
@change="setFilter('cards', $event.target.checked)"
/><span>{{ t('Show event cards') }}</span></label
>
</div>
<NewsCard
v-if="selectedApart"
class="news-readout__selected"
:item="selectedApart"
open
:on-choose="choose"
:on-clear="clear"
/>
<section
v-if="view.inView.active"
class="news-readout__section"
:aria-label="t('In view')"
>
<h3 class="news-readout__head ui-mono">{{ t('In view') }}</h3>
<p v-if="view.inView.error" class="news-readout__status">
{{ view.inView.error }}
</p>
<UiEmpty
v-else-if="!view.inView.items.length && !view.inView.loading"
class="news-readout__empty"
:title="t('Nothing reported near here in the last 24 h')"
/>
<ol
v-else
class="news-readout__list"
:class="{ 'is-stale': view.inView.loading }"
:aria-busy="view.inView.loading ? 'true' : 'false'"
>
<li v-for="item in view.inView.items" :key="item.id">
<NewsCard
:item="item"
:open="item.id === selectedId"
:on-choose="choose"
:on-clear="clear"
/>
</li>
</ol>
</section>
<section class="news-readout__section" :aria-label="t('Latest news')">
<h3 class="news-readout__head ui-mono">{{ t('Latest') }}</h3>
<ol
v-if="view.items.length"
class="news-readout__list news-readout__feed"
>
<li v-for="item in view.items" :key="item.id">
<NewsCard
:item="item"
:open="item.id === selectedId"
:on-choose="choose"
:on-clear="clear"
/>
</li>
</ol>
<UiEmpty
v-else-if="!view.loading && !view.error"
class="news-readout__empty"
:title="t('No news matches these filters in the last 24 h')"
/>
<div class="news-readout__footer">
<span class="news-readout__status" role="status">{{ status }}</span>
<UiButton
v-if="view.hasMore && !view.loading"
class="data-toggle-chip"
type="button"
@click="onParams({ loadMore: true })"
>{{ t('Load older news') }}</UiButton
>
</div>
</section>
<details class="news-legend">
<summary>{{ t('How to read the map') }}</summary>
<p>{{ t('Colour: severity · icon: type of event') }}</p>
<ul class="news-legend__severity">
<li
v-for="level in view.severities"
:key="level.value"
:style="{ '--news-color': level.color }"
>
{{ level.label }}
</li>
</ul>
<p>{{
t(
'Solid rim: reported by both sides or independently. Dashed rim: a claim. Thin rim: one source, or one side’s own press.',
)
}}</p>
<p>{{
t(
'Larger: more sources · fainter: older. Picture card: a major or fast-growing event with two or more sources.',
)
}}</p>
<p>{{
t('Side labels describe the source, not whether a report is true.')
}}</p>
</details>
</section>
</template>
+73
View File
@@ -0,0 +1,73 @@
import { h, render as renderVue } from 'vue';
import NewsFeed from './news/NewsFeed.vue';
const LAYER_ID = 'news';
const LOAD_MORE_MARGIN_PX = 160;
// Remounting must not reopen a panel the reader already collapsed.
const appearedPanels = new WeakSet();
const set = (node, key, value) => {
if (node[key] !== value) node[key] = value;
};
/**
* The News rail panel (`#news-panel`): it renders the `feed` view the news
* layer publishes through its row controls, shows itself only while the
* layer is on, and acts only through setLayerParams. Near the bottom of its
* scroller it asks for the next older page, once per page.
*/
export function createNewsPanel({ container, setLayerParams = () => {} } = {}) {
const document = container?.ownerDocument;
if (!document?.createElement) return null;
const panel = container.closest?.('#news-panel');
const count = panel?.querySelector('#news-panel-count');
const onParams = (params) =>
setLayerParams(LAYER_ID, params, { origin: 'user' });
let view = null;
let destroyed = false;
let requestedAt = -1;
function render() {
if (destroyed) return;
renderVue(h(NewsFeed, { view, onParams }), container);
const hidden = !view;
if (panel) set(panel, 'hidden', hidden);
if (count) set(count, 'textContent', String(view?.items.length ?? 0));
if (!hidden && panel && !appearedPanels.has(panel)) {
appearedPanels.add(panel);
// First appearance opens the panel unless a stored or shared collapse
// choice exists (marked by the panel chrome when it restored the state).
const preference = panel.dataset?.collapsedPreference;
if (
panel.classList?.contains('collapsed') &&
(preference === undefined || preference === 'default')
)
panel.querySelector('[data-collapse-target="news-panel"]')?.click();
}
}
const onScroll = () => {
if (!view?.hasMore || view.loading) return;
const remaining =
container.scrollHeight - container.scrollTop - container.clientHeight;
if (remaining > LOAD_MORE_MARGIN_PX) return;
if (requestedAt === view.items.length) return;
requestedAt = view.items.length;
onParams({ loadMore: true });
};
container.addEventListener?.('scroll', onScroll, { passive: true });
return {
/** Show the layer's feed view, or hide the panel with null. */
update(next) {
view = next || null;
render();
},
destroy() {
destroyed = true;
container.removeEventListener?.('scroll', onScroll);
renderVue(null, container);
if (panel) set(panel, 'hidden', true);
if (count) set(count, 'textContent', '0');
},
};
}
+223
View File
@@ -0,0 +1,223 @@
import '../testSupport/registerDom.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { createNewsPanel } from './newsPanel.js';
import {
NEWS_CATEGORIES,
NEWS_SEVERITY,
categoryLabel,
feedCardView,
normalizeFilters,
} from '../layers/news/model.js';
const NOW = Date.parse('2026-10-28T10:00:00Z');
const report = (id, extra = {}) => ({
id,
title: `Report ${id}`,
url: `https://www.example.com/${id}`,
publishedAt: '2026-10-28T09:00:00.000Z',
publisher: 'Example',
side: 'UA',
category: 'strike',
severity: 2,
geo: { lat: 50, lon: 36, place: 'Kharkiv', mappable: true },
pins: [{ lat: 50, lon: 36, place: 'Kharkiv', mappable: true }],
event: null,
media: [],
...extra,
});
const big = report('big', {
severity: 3,
titleEn: 'Strike on Kharkiv',
title: 'Удар по Харкову',
media: ['video'],
event: {
size: 4,
severity: 3,
status: 'both-sides',
lastAt: '2026-10-28T09:50:00.000Z',
sides: [
{ side: 'UA', title: 'a', url: 'https://a.test/', publisher: 'A' },
{ side: 'RU', title: 'b', url: 'https://b.test/', publisher: 'B' },
],
image: { url: 'https://a.test/p.jpg', publisher: 'A' },
},
});
function view(extra = {}) {
return {
filters: normalizeFilters(),
hotspots: [
{ id: 'all', label: 'All', count: 7, active: true },
{ id: 'ua-ru-war', label: 'Ukraine–Russia', count: 7, active: false },
],
categories: Object.keys(NEWS_CATEGORIES).map((id) => ({
value: id,
label: categoryLabel(id),
})),
severities: NEWS_SEVERITY.map((level, index) => ({
value: index,
label: level.label,
color: level.color,
})),
items: [feedCardView(big, NOW), feedCardView(report('lone'), NOW)],
inView: { active: false, loading: false, error: null, items: [] },
selected: null,
hasMore: true,
loading: false,
error: null,
...extra,
};
}
function fixture() {
document.body.innerHTML = `
<div id="news-panel" class="collapsed" hidden>
<span id="news-panel-count">0</span>
<button data-collapse-target="news-panel"></button>
<div id="news-panel-body"></div>
</div>`;
const panel = document.getElementById('news-panel');
let opened = 0;
panel
.querySelector('[data-collapse-target]')
.addEventListener('click', () => {
opened++;
panel.classList.remove('collapsed');
});
const calls = [];
const news = createNewsPanel({
container: document.getElementById('news-panel-body'),
setLayerParams: (id, params, options) => calls.push([id, params, options]),
});
return { news, panel, calls, opened: () => opened };
}
test('the panel shows the last 24 h as event cards and opens once', () => {
const { news, panel, opened } = fixture();
news.update(null);
assert.equal(panel.hidden, true);
news.update(view());
assert.equal(panel.hidden, false);
assert.equal(opened(), 1);
assert.equal(document.getElementById('news-panel-count').textContent, '2');
assert.equal(
panel.querySelector('.news-readout__window').textContent,
'Last 24 h',
);
assert.deepEqual(
[...panel.querySelectorAll('.data-toggle-chip[data-chip-id]')].map(
(chip) => chip.textContent,
),
['All 7', 'Ukraine–Russia 7'],
);
const [first, second] = panel.querySelectorAll(
'.news-readout__feed .news-card',
);
assert.equal(
first.querySelector('.news-card__title').textContent,
'Strike on Kharkiv',
);
assert.equal(
first.querySelector('.news-card__note').textContent,
'English headline by the model',
);
assert.equal(
first.querySelector('.news-card__meta').textContent,
'Strike · Kharkiv · 4 sources · 10 min',
);
assert.equal(
first.querySelector('.news-card__marker').getAttribute('aria-label'),
'Major',
);
assert.equal(
first.querySelector('.news-card__sides').textContent,
'Reported by UA sources · RU sources',
);
assert.deepEqual(
[...first.querySelectorAll('.news-chip')].map((c) => c.textContent),
['Reported by both sides', 'Video'],
);
const img = first.querySelector('.news-card__thumb img');
assert.equal(img.getAttribute('src'), 'https://a.test/p.jpg');
assert.equal(img.getAttribute('referrerpolicy'), 'no-referrer');
assert.equal(first.querySelector('.news-card__credit').textContent, 'A');
// A lone report has no picture.
assert.equal(second.querySelector('.news-card__thumb'), null);
// A later update does not reopen a panel the reader collapsed.
panel.classList.add('collapsed');
news.update(view());
assert.equal(opened(), 1);
news.destroy();
assert.equal(panel.hidden, true);
});
test('a card click flies there; open, it links the source and closes', () => {
const { news, panel, calls } = fixture();
news.update(view());
panel.querySelector('.news-card__main').click();
assert.deepEqual(calls.at(-1), [
'news',
{ reportId: 'big', focus: true },
{ origin: 'user' },
]);
news.update(view({ selected: feedCardView(big, NOW) }));
const open = panel.querySelector('.news-card.is-open');
const link = open.querySelector('.news-card__link');
assert.equal(link.textContent, 'Source: example.com ↗');
assert.equal(link.getAttribute('href'), 'https://www.example.com/big');
assert.equal(link.getAttribute('rel'), 'noopener noreferrer');
assert.equal(
open.querySelector('.news-card__original').textContent,
'Удар по Харкову',
);
open.querySelector('.news-card__main').click();
assert.deepEqual(calls.at(-1)[1], { clear: true });
news.destroy();
});
test('filters, In view and empty or failed reads', () => {
const { news, panel, calls } = fixture();
news.update(view());
assert.equal(panel.querySelector('[aria-label="In view"]'), null);
const severity = panel.querySelector('select[aria-label="Severity"]');
assert.equal(severity.value, '2');
severity.value = '3';
severity.dispatchEvent(new Event('change'));
assert.deepEqual(calls.at(-1)[1], { filters: { minSeverity: 3 } });
const [minor, cards] = panel.querySelectorAll('.news-toggle input');
assert.equal(minor.checked, false);
assert.equal(cards.checked, true);
cards.checked = false;
cards.dispatchEvent(new Event('change'));
assert.deepEqual(calls.at(-1)[1], { filters: { cards: false } });
panel.querySelector('[data-chip-id="ua-ru-war"]').click();
assert.deepEqual(calls.at(-1)[1], { filters: { hotspot: 'ua-ru-war' } });
news.update(
view({
inView: { active: true, loading: false, error: null, items: [] },
items: [],
hasMore: false,
}),
);
const section = panel.querySelector('[aria-label="In view"]');
assert.match(
section.textContent,
/Nothing reported near here in the last 24 h/,
);
assert.match(
panel.textContent,
/No news matches these filters in the last 24 h/,
);
assert.equal(panel.querySelector('.news-readout__footer button'), null);
news.update(
view({ items: [], error: 'News feed unavailable', hasMore: false }),
);
assert.equal(
panel.querySelector('.news-readout__status').textContent,
'News feed unavailable',
);
news.destroy();
});
+2
View File
@@ -17,6 +17,7 @@ const SHARE_PANEL_STATE_SPECS = Object.freeze([
{ id: 'data-panel' },
{ id: 'cctv-panel' },
{ id: 'weather-panel' },
{ id: 'news-panel' },
{ id: 'recent-imagery-panel' },
{ id: 'street-level-panel' },
{ id: 'radio-panel' },
@@ -41,6 +42,7 @@ const COCKPIT_ENTRY_COLLAPSE_PANEL_IDS = Object.freeze([
'data-panel',
'cctv-panel',
'weather-panel',
'news-panel',
'recent-imagery-panel',
'street-level-panel',
'scene-panel',
+3
View File
@@ -95,6 +95,7 @@ export class PanelLayoutController {
this._ppToggles = document.getElementById('pp-toggles');
this._cctvPanel = document.getElementById('cctv-panel');
this._weatherPanel = document.getElementById('weather-panel');
this._newsPanel = document.getElementById('news-panel');
this._recentImageryPanel = document.getElementById('recent-imagery-panel');
this._streetLevelPanel = document.getElementById('street-level-panel');
}
@@ -191,6 +192,7 @@ export class PanelLayoutController {
for (const panel of [
this._cctvPanel,
this._weatherPanel,
this._newsPanel,
this._recentImageryPanel,
this._streetLevelPanel,
]) {
@@ -206,6 +208,7 @@ export class PanelLayoutController {
this._ppToggles,
this._cctvPanel,
this._weatherPanel,
this._newsPanel,
this._recentImageryPanel,
this._streetLevelPanel,
globalContextPanel,
+1
View File
@@ -22,6 +22,7 @@ export const PANEL_RAIL_ITEMS = Object.freeze({
'pp-toggles': { icon: 'tune', label: msg('DISPLAY') },
'cctv-panel': { icon: 'videocam', label: msg('CCTV') },
'weather-panel': { icon: 'partly_cloudy_day', label: msg('WEATHER') },
'news-panel': { icon: 'public', label: msg('NEWS') },
'recent-imagery-panel': {
icon: 'satellite_alt',
label: msg('RECENT IMAGERY'),
+378
View File
@@ -0,0 +1,378 @@
/* News rail panel (#news-panel): the last 24 hours as a doom-scroll of event
cards drawn with GEV's own tokens. Colour is
severity only (the layer sets --news-color per card); never a side. The
rail owns placement and height; only the body scrolls. */
.news-panel-inner {
position: relative;
display: flex;
flex-direction: column;
gap: 8px;
min-height: 0;
max-height: 100%;
box-sizing: border-box;
padding: 14px;
border: 1px solid var(--glass-border);
border-radius: var(--panel-radius);
background: var(--glass-bg);
backdrop-filter: blur(24px) saturate(1.4);
-webkit-backdrop-filter: blur(24px) saturate(1.4);
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.5),
0 0 0 1px rgba(255, 255, 255, 0.03) inset,
0 1px 0 rgba(255, 255, 255, 0.06) inset;
}
#news-panel .panel-glow {
position: absolute;
inset: -18px;
background: radial-gradient(
ellipse at center,
rgba(0, 212, 255, 0.16) 0%,
transparent 65%
);
filter: blur(16px);
opacity: 0.25;
pointer-events: none;
}
#news-panel .panel-header {
flex: 0 0 auto;
}
#news-panel-count {
color: var(--text-secondary);
font: 9px var(--font-mono);
}
#news-panel-body {
min-height: 0;
max-height: calc(var(--right-stack-max-height, 50svh) - 64px);
overflow-y: auto;
overscroll-behavior: contain;
}
#news-panel.collapsed #news-panel-body,
#news-panel[hidden] {
display: none !important;
}
#right-context-rail > #news-panel {
position: relative;
inset: auto;
flex: 0 0 auto;
width: 100%;
max-height: 100%;
pointer-events: auto;
}
#right-context-rail > #news-panel:not(.collapsed) {
display: flex;
flex-direction: column;
flex-shrink: 1;
min-height: 0;
}
#right-context-rail.layout-focus > #news-panel:not(.collapsed) {
flex: 0 1 var(--right-panel-allocated-height);
height: var(--right-panel-allocated-height);
min-height: 0;
max-height: var(--right-panel-allocated-height);
}
#right-context-rail.layout-focus
> #news-panel:not(.collapsed)
.news-panel-inner {
height: 100%;
}
#right-context-rail[data-rail-measuring]
> #news-panel:not(.collapsed)
> .news-panel-inner {
height: auto !important;
}
#right-context-rail #news-panel.collapsed {
width: var(--right-display-collapsed-width);
margin-inline-start: auto;
}
#right-context-rail #news-panel.collapsed .news-panel-inner {
height: 50px;
min-height: 50px;
padding-bottom: 10px;
}
@media (max-width: 720px) {
#right-context-rail #news-panel.collapsed {
width: 100%;
}
}
:root[data-ui-theme='cyber'] .news-panel-inner {
border-radius: 0;
clip-path: var(--cyber-panel-frame);
box-shadow: var(--cyber-panel-shadow);
}
.news-readout {
display: flex;
flex-direction: column;
gap: 10px;
min-width: 0;
color: var(--text-primary);
font: 11px/1.4 var(--font-sans);
}
.news-readout__window,
.news-readout__head {
margin: 0;
color: var(--text-secondary);
font: 600 9px var(--font-mono);
letter-spacing: 0.12em;
text-transform: uppercase;
}
.news-readout__chips {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.news-readout__filters {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 6px;
}
.news-filter {
min-width: 0;
}
.news-toggle {
display: flex;
align-items: center;
gap: 6px;
color: var(--text-secondary);
font-size: 10px;
cursor: pointer;
}
.news-toggle input {
accent-color: var(--accent);
}
.news-readout__section {
display: flex;
flex-direction: column;
gap: 6px;
}
.news-readout__list {
display: flex;
flex-direction: column;
gap: 6px;
margin: 0;
padding: 0;
list-style: none;
}
.news-readout__list.is-stale {
opacity: 0.5;
}
.news-readout__status,
.news-readout__empty {
color: var(--text-dim);
font: 10px var(--font-mono);
}
.news-readout__footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.news-card {
border: 1px solid var(--glass-border);
border-inline-start: 3px solid var(--news-color, var(--glass-border));
border-radius: 6px;
background: rgba(255, 255, 255, 0.02);
}
.news-card:hover,
.news-card.is-open {
border-color: var(--glass-border-hover);
border-inline-start-color: var(--news-color);
background: rgba(0, 212, 255, 0.06);
}
.news-card.is-unmapped .news-card__title {
color: var(--text-secondary);
}
.news-card__main {
display: grid;
grid-template-columns: 96px 1fr;
column-gap: 8px;
row-gap: 3px;
width: 100%;
padding: 6px;
border: 0;
background: transparent;
color: inherit;
font: inherit;
text-align: start;
cursor: pointer;
}
.news-card__main > :not(.news-card__thumb) {
grid-column: 1 / -1;
}
.news-card__thumb ~ * {
grid-column: 2 !important;
}
.news-card__thumb {
position: relative;
grid-row: 1 / span 5;
width: 96px;
height: 64px;
overflow: hidden;
border-radius: 4px;
background: var(--bg-dark);
}
.news-card__thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
.news-card__credit {
position: absolute;
inset-inline-end: 0;
bottom: 0;
max-width: 100%;
overflow: hidden;
padding: 0 4px;
background: rgba(0, 0, 0, 0.6);
color: var(--text-primary);
font-size: 8px;
text-overflow: ellipsis;
white-space: nowrap;
}
.news-card__title {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
font-size: 12px;
font-weight: 600;
line-height: 1.3;
}
.news-card__note,
.news-card__sides {
color: var(--text-secondary);
font-size: 10px;
}
.news-card__meta {
display: flex;
align-items: center;
gap: 5px;
min-width: 0;
color: var(--text-secondary);
font: 10px var(--font-mono);
}
.news-card__marker {
flex: none;
display: inline-grid;
place-items: center;
width: 14px;
height: 14px;
border: 1px solid rgba(0, 0, 0, 0.8);
border-radius: 50%;
background: var(--news-color);
}
.news-card__marker svg {
width: 9px;
height: 9px;
fill: none;
stroke: var(--bg-dark);
stroke-width: 1.8;
stroke-linecap: round;
stroke-linejoin: round;
}
.news-card__marker.solid svg {
fill: var(--bg-dark);
stroke: none;
}
.news-card__chips {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.news-chip {
padding: 1px 6px;
border: 1px solid var(--glass-border-hover);
border-radius: 999px;
color: var(--text-secondary);
font: 9px var(--font-mono);
}
.news-chip--official,
.news-chip--confirmed {
border-color: rgba(0, 212, 255, 0.45);
color: var(--text-primary);
}
.news-chip--claimed {
border-style: dashed;
}
.news-card__open {
display: flex;
flex-direction: column;
gap: 6px;
padding: 0 8px 8px;
}
.news-card__original,
.news-card__snippet {
margin: 0;
color: var(--text-primary);
font-size: 11px;
}
.news-card__original {
color: var(--text-secondary);
}
.news-card__others {
display: flex;
flex-direction: column;
gap: 3px;
margin: 0;
padding: 0;
list-style: none;
font-size: 10px;
}
.news-card__others a,
.news-card__link {
color: var(--accent);
text-decoration: none;
overflow-wrap: anywhere;
}
.news-card__others a:hover,
.news-card__link:hover {
text-decoration: underline;
}
.news-card__side {
margin-inline-end: 6px;
color: var(--text-secondary);
}
.news-card__actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
font: 10px var(--font-mono);
}
.news-legend {
color: var(--text-secondary);
font-size: 10px;
}
.news-legend summary {
cursor: pointer;
}
.news-legend p {
margin: 4px 0;
}
.news-legend__severity {
display: flex;
flex-wrap: wrap;
gap: 4px 10px;
margin: 4px 0;
padding: 0;
list-style: none;
}
.news-legend__severity li::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
margin-inline-end: 4px;
border-radius: 50%;
background: var(--news-color);
}
@media (prefers-reduced-motion: no-preference) {
.news-card,
.news-readout__list {
transition:
background var(--transition-fast),
border-color var(--transition-fast),
opacity var(--transition-fast);
}
}
+4
View File
@@ -36,6 +36,10 @@ const sceneRuntime = computed(() => scenePanel.value?.runtime ?? '');
<template #badge><span id="weather-panel-count" :aria-label="t('Active weather products')">0</span></template>
<div id="weather-panel-body" class="ui-scroll" data-rail-scroller></div>
</RailPanel>
<RailPanel id="news-panel" hidden :title="t('NEWS')" sideways rail-scroller>
<template #badge><span id="news-panel-count" :aria-label="t('News items in the feed')">0</span></template>
<div id="news-panel-body" class="ui-scroll" data-rail-scroller></div>
</RailPanel>
<RailPanel id="recent-imagery-panel" hidden :title="t('RECENT IMAGERY')" sideways rail-scroller>
<template #badge><span id="recent-imagery-panel-count" :aria-label="t('Imagery days in the box')"></span></template>
<div id="recent-imagery-panel-body" class="ui-scroll" data-rail-scroller></div>