Merge remote-tracking branch 'origin/main' into samehkhamis/kit-sweep-layer-finder

# Conflicts:
#	docs/VUE-MIGRATION.md
#	scripts/format-scope.json
This commit is contained in:
Sameh Khamis committed 2026-11-19 04:32:21 -08:00
commit 7ba6d86485
19 files changed
+372 -97

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
- The Omnibar's mic, suggestion strip chips and glyphs are now kit controls,
with the same look and behaviour (manjunath22466, samehkhamis, #1847).
+2
View File
@@ -0,0 +1,2 @@
- The welcome card's buttons and glyphs are now kit controls, with the same
look and behaviour (manjunath22466, samehkhamis, #1848).
+2
View File
@@ -0,0 +1,2 @@
- The Visual panel's buttons and glyphs are now kit controls, with the same
look and behaviour (manjunath22466, samehkhamis, #1849).
@@ -0,0 +1,2 @@
- The entity card's buttons and glyphs are now kit controls, with the same
look and behaviour (manjunath22466, samehkhamis, #1850).
+40 -3
View File
@@ -83,12 +83,49 @@ segmented group in Core is a `UiSegmented`; the old `segmentedControl.js`
adapter is gone.
`UiButton` adds `pressedClass`, Core's class on a pressed toggle (most use
`active`); its pressed classes toggle through `classList`, so a class other
code adds (a voice highlight) survives a press. Every pressed toggle in the
views is a `UiButton` except Bhote Koshi's cinematic button and the
tilt-map button, whose owners still write their state into the DOM. Core's
code adds (a voice highlight) survives a press. Not every pressed toggle in
the views is one yet: the context view,
the Stories screens and a few panel buttons still hand-write theirs, and
Bhote Koshi's cinematic button and the tilt-map button have owners that
write their state into the DOM. Core's
pressable chips and pills (rail card chips, map sources, cities and places)
are `UiButton`s too; `UiChip` is a non-interactive label chip, used by
the voice card.
The welcome card's buttons (SKIP, the three start tiles, BROWSE STORIES,
BACK and the main NEXT / ENTER GOD MODE action) are ghost `UiButton`s:
the start tiles are pressed toggles, and all but SKIP keep `aria-disabled`
rather than `disabled`, so they stay focusable while the card is busy. Its
tile, tip, Stories and arrow glyphs are `UiIcon`s with `:size="null"`, so
first-run.css still sizes them (`src/ui/kit/welcomeControls.test.mjs` pins
it). God mode's preview globe and callouts stay inline SVG drawings, and
its outbound links stay links.
The Omnibar's mic (a pressed toggle with `active`) and its suggestion
strip's chips (options, so `aria-current` rather than `pressed`) are
ghost `UiButton`s, and its search, row and chip glyphs are `UiIcon`s with
`:size="null"`, so its own rules still size them
(`src/ui/kit/omnibarControls.test.mjs` pins it). The mic's and the chat
row's glyphs stay inline SVG, since no Material symbol the page loads
draws them, and its field is its own combobox rather than a
`UiSearchField`.
The Visual panel's buttons (its presets and map sources, HUD, Sonar,
Detection, 3D, Clean UI, Celestial, Bloom, Sharpen and Reset to default) are
ghost `UiButton`s. HUD, Sonar, 3D, Celestial, Bloom and Sharpen are
pressed toggles with `active` as their pressed class; Detection sets its own
`active` and `panoptic` classes, and Clean UI is not a pressed toggle (its
owner marks it `active`). The panel's Scope, Celestial,
sky, application-row and Reset glyphs are `UiIcon`s with `:size="null"`, so
the panel's rules still size them (`src/ui/kit/visualControls.test.mjs` pins
it). The toggles' other glyphs (◎ ▣ ✈ □ ✨ 🔍) and the presets' style glyphs
are text characters, not Material symbols, and stay plain spans.
The entity card's buttons are ghost `UiButton`s: its four preview buttons
(Photos, Route, 3D, Cockpit view) are pressed toggles with `active`, Follow
is one with `entity-card__action--on`, and the cockpit entry, Fly to and
Ask GEV are plain buttons; so are the camera preview's bigger-view and More
info buttons and the nearby lists' rows (`SpotConditions`, which the
context view shows too). Their glyphs are `UiIcon`s with `:size="null"`,
so entity-card.css and spot-conditions.css still size them
(`src/ui/kit/entityCardControls.test.mjs` pins it). Ask GEV's chat bubble
stays inline SVG, since no Material symbol the page loads draws it.
The Layer Finder's buttons (Search, Filter, the filter menu's Status and
Category options and the bar's two clear chips) are ghost `UiButton`s.
Search and the options are pressed toggles; the options' pressed class is
+4
View File
@@ -1344,6 +1344,10 @@
"src/ui/kit/UiDialog.test.mjs",
"src/ui/kit/dialogs.test.mjs",
"src/ui/kit/layerFinderControls.test.mjs",
"src/ui/kit/entityCardControls.test.mjs",
"src/ui/kit/visualControls.test.mjs",
"src/ui/kit/welcomeControls.test.mjs",
"src/ui/kit/omnibarControls.test.mjs",
"src/ui/styles/chip.css",
"src/ui/styles/empty-state.css",
"src/ui/rail/RailChips.vue",
+4 -4
View File
@@ -444,14 +444,14 @@ const MUTATIONS = [
{
defect: 'a mission tile is dropped from the menu',
file: 'html',
from: ' <button type="button" data-first-run-start="space-missions"',
to: ' <button type="button" data-first-run-start-disabled="space-missions"',
from: ' <UiButton data-first-run-start="space-missions"',
to: ' <UiButton data-first-run-start-disabled="space-missions"',
},
{
defect: "the menu order stops matching the owner's",
file: 'html',
from: '<button type="button" data-first-run-start="environmental"',
to: '<button type="button" data-first-run-start="zzz-environmental"',
from: '<UiButton data-first-run-start="environmental"',
to: '<UiButton data-first-run-start="zzz-environmental"',
},
{
defect: 'the "don\'t show again" checkbox loses its hook',
+1 -1
View File
@@ -946,7 +946,7 @@ test('the card closes without a keyboard: the ESC hint is a button, kept on phon
);
assert.match(
header,
/<button type="button" class="first-run-dismiss" data-first-run-dismiss>/,
/<button type="button" class="[^"]*\bfirst-run-dismiss\b[^"]*" data-first-run-dismiss>/,
);
assert.match(header, />SKIP · ESC</);
assert.match(header, />SKIP</);
+5 -1
View File
@@ -72,7 +72,11 @@ function settings(store) {
test('before VisualSettings renders, the panel shows its initial markup', (t) => {
const { $ } = fixture(t);
assert.equal($('bloom-toggle').className, 'pp-toggle-btn');
// Beside the kit's ui-* classes, the toggle carries only its own.
assert.deepEqual(
[...$('bloom-toggle').classList].filter((name) => !name.startsWith('ui-')),
['pp-toggle-btn'],
);
assert.equal($('bloom-slider-row').className, 'pp-slider-row');
assert.equal($('bloom-intensity-slider').value, '0');
assert.equal($('bloom-intensity-value').textContent, '0%');
+84
View File
@@ -0,0 +1,84 @@
// The entity card's buttons and Material glyphs are the kit's: neither its
// template nor the camera preview and nearby lists it renders hand-writes a
// <button> or a Material Symbols span. The Ask GEV button's chat bubble is
// not a Material symbol the page loads, so it stays drawn as inline SVG; the
// hero views (model, route globe, cockpit view, ground view, graphs) draw
// their own pictures and have no controls.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
/** A view's template block: everything outside script and style. */
function template(file) {
const source = readFileSync(
new URL(`../views/panels/${file}`, import.meta.url),
'utf8',
);
return source.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '');
}
const card = template('EntityCard.vue');
const camera = template('CctvPreview.vue');
const nearby = template('SpotConditions.vue');
const heroViews = [
'AircraftModelHero.vue',
'RouteGlobe.vue',
'FlightCockpitView.vue',
'SatelliteGroundView.vue',
'PreviewHud.vue',
'AltitudeGraph.vue',
].map(template);
test('the entity card hand-writes no button; each is a UiButton', () => {
for (const markup of [card, camera, nearby, ...heroViews])
assert.deepEqual(markup.match(/<button\b/gi) ?? [], []);
// Photos, Route, 3D, Cockpit view, the cockpit entry, Fly to, Follow and
// Ask GEV.
assert.equal(card.match(/<UiButton\b/g)?.length, 8);
assert.equal(card.match(/<UiCloseButton\b/g)?.length, 1);
// A camera's bigger view and More info; its popup closes with a UiCloseButton.
assert.equal(camera.match(/<UiButton\b/g)?.length, 2);
assert.equal(camera.match(/<UiCloseButton\b/g)?.length, 1);
// The traffic, hazard, alert and other nearby rows.
assert.equal(nearby.match(/<UiButton\b/g)?.length, 4);
});
test('the preview switch and Follow are pressed toggles with their classes', () => {
const previews = card.match(/<UiButton v-if="\w+" :pressed[^>]*>/g) ?? [];
assert.equal(previews.length, 4);
for (const button of previews) {
assert.match(button, /pressed-class="active"/);
assert.doesNotMatch(button, /aria-pressed|:class=/);
}
assert.match(
card,
/<UiButton v-if="store\.canFollow\(\)" class="entity-card__action" :pressed="Boolean\(store\.isFollowing\(\)\)" pressed-class="entity-card__action--on"/,
);
});
test('the entity card hand-writes no Material glyph; each is a UiIcon', () => {
for (const markup of [card, camera, nearby, ...heroViews])
assert.deepEqual(markup.match(/material-symbols-outlined/g) ?? [], []);
const counts = [
// The preview switch's three, the hero glyph, the header icon, the
// warning, the route's plane, the route note and the three actions.
[card, 11],
// Bigger view, the popup's camera and More info.
[camera, 3],
// The two weather glyphs, five headings and three row glyphs.
[nearby, 10],
];
for (const [markup, count] of counts) {
const icons = markup.match(/<UiIcon\b[^>]*>/g) ?? [];
assert.equal(icons.length, count);
// Without it the kit writes an 18px size that beats the card's own rules.
for (const icon of icons) assert.match(icon, /:size="null"/);
}
});
test('the only inline SVG glyph is the Ask GEV chat bubble', () => {
const svgs = [...card.matchAll(/<svg\b[\s\S]*?<\/svg\s*>/g)].map((m) => m[0]);
assert.equal(svgs.length, 1);
assert.match(svgs[0], /<path d="M4 5h16v11H9l-5 4z" \/>/);
for (const markup of [camera, nearby])
assert.deepEqual(markup.match(/<svg\b/gi) ?? [], []);
});
+37
View File
@@ -0,0 +1,37 @@
// The Omnibar's buttons and Material glyphs are the kit's: its template
// hand-writes no <button> and no Material Symbols span. Its two inline SVG
// glyphs (the mic and the chat row's bubble) are not Material symbols the
// page loads, so they stay as they are drawn.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const source = readFileSync(
new URL('../views/panels/Omnibar.vue', import.meta.url),
'utf8',
);
/** The template block: everything outside script and style. */
const template = source.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '');
test('the Omnibar hand-writes no button; each is a UiButton', () => {
assert.deepEqual(template.match(/<button\b/gi) ?? [], []);
assert.equal(template.match(/<UiButton\b/g)?.length, 2);
});
test('the Omnibar hand-writes no Material glyph; each is a UiIcon', () => {
assert.deepEqual(template.match(/material-symbols-outlined/g) ?? [], []);
const icons = template.match(/<UiIcon\b[^>]*>/g) ?? [];
assert.equal(icons.length, 3);
// Without it the kit writes an 18px size that beats the Omnibar's own rules.
for (const icon of icons) assert.match(icon, /:size="null"/);
});
test('the only inline SVG glyphs are the mic and the chat row bubble', () => {
const svgs = [...template.matchAll(/<svg\b[\s\S]*?<\/svg\s*>/g)].map(
(m) => m[0],
);
assert.equal(svgs.length, 2);
assert.match(svgs[0], /<rect x="9" y="3" width="6" height="11" rx="3" \/>/);
assert.match(svgs[1], /class="omnibar-item-icon"/);
assert.match(svgs[1], /<path d="M4 5h16v11H9l-5 4z" \/>/);
});
+53
View File
@@ -0,0 +1,53 @@
// The Visual panel's buttons and Material glyphs are the kit's: neither its
// template nor the presets it renders hand-writes a <button>, a Material
// Symbols span or an inline SVG. The toggles' text glyphs (◎ ▣ ✈ □ ✨ 🔍)
// and the presets' style glyphs are characters, not Material symbols, so
// they stay text the panel's rules size.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
/** A view's template block: everything outside script and style. */
function template(file) {
const source = readFileSync(
new URL(`../views/panels/${file}`, import.meta.url),
'utf8',
);
return source.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '');
}
const panel = template('DisplayPanel.vue');
const presets = template('VisualPresets.vue');
test('the Visual panel hand-writes no button; each is a UiButton', () => {
for (const markup of [panel, presets])
assert.deepEqual(markup.match(/<button\b/gi) ?? [], []);
// HUD, Sonar, Detection, 3D, Clean UI, Celestial, Bloom, Sharpen and
// Reset to default.
assert.equal(panel.match(/<UiButton\b/g)?.length, 9);
// The style presets and the map source chips.
assert.equal(presets.match(/<UiButton\b/g)?.length, 2);
// Scope, the sky rows and the application's toggle rows.
assert.equal(panel.match(/<UiCheckbox\b/g)?.length, 3);
// 3D model coverage and detection label allocation.
assert.equal(panel.match(/<UiSegmented\b/g)?.length, 2);
});
test('the Visual panel hand-writes no Material glyph; each is a UiIcon', () => {
for (const markup of [panel, presets]) {
assert.deepEqual(markup.match(/material-symbols-outlined/g) ?? [], []);
assert.deepEqual(markup.match(/<svg\b/gi) ?? [], []);
}
const icons = panel.match(/<UiIcon\b[^>]*>/g) ?? [];
// Scope, Celestial, the sky rows, the application's rows and Reset.
assert.equal(icons.length, 5);
// Without it the kit writes an 18px size that beats the panel's own rules.
for (const icon of icons) assert.match(icon, /:size="null"/);
});
test('the toggles keep their text glyphs as plain spans', () => {
const glyphs = [...panel.matchAll(/<span class="pp-icon">([^<]*)<\/span>/g)];
assert.deepEqual(
glyphs.map((m) => m[1]),
['&#x25CE;', '&#x25A3;', '&#x2708;', '&#x25A1;', '&#x2728;', '&#x1F50D;'],
);
});
+37
View File
@@ -0,0 +1,37 @@
// The welcome card's buttons and Material glyphs are the kit's: its template
// hand-writes no <button> and no Material Symbols span, and its one box is a
// UiCheckbox. Its two inline SVGs (God mode's globe and its callouts) are
// drawings, not glyphs, and its outbound links stay links.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const source = readFileSync(
new URL('../views/WelcomeView.vue', import.meta.url),
'utf8',
);
/** The template block: everything outside script and style. */
const template = source.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '');
test('the welcome card hand-writes no button; each is a UiButton', () => {
assert.deepEqual(template.match(/<button\b/gi) ?? [], []);
// SKIP, the three start tiles, BROWSE STORIES, BACK and the main action.
assert.equal(template.match(/<UiButton\b/g)?.length, 7);
assert.equal(template.match(/<UiCheckbox\b/g)?.length, 1);
});
test('the welcome card hand-writes no Material glyph; each is a UiIcon', () => {
assert.deepEqual(template.match(/material-symbols-outlined/g) ?? [], []);
const icons = template.match(/<UiIcon\b[^>]*>/g) ?? [];
// The three tiles, the three tips, the Stories card and the main arrow.
assert.equal(icons.length, 8);
// Without it the kit writes an 18px size that beats first-run.css's rules.
for (const icon of icons) assert.match(icon, /:size="null"/);
});
test('the only inline SVGs are God mode preview drawings', () => {
const svgs = [...template.matchAll(/<svg\b[^>]*>/g)].map((m) => m[0]);
assert.equal(svgs.length, 2);
assert.match(svgs[0], /class="first-run-globe"/);
assert.match(svgs[1], /class="first-run-callouts"/);
});
+22 -20
View File
@@ -3,7 +3,9 @@ import { storeToRefs } from 'pinia';
import { nextTick, ref, watch } from 'vue';
import { msg, t } from '../../i18n/index.js';
import { FIRST_RUN_LINKS, environmentalLabel } from '../../firstRunCopy.js';
import UiButton from '../kit/UiButton.vue';
import UiCheckbox from '../kit/UiCheckbox.vue';
import UiIcon from '../kit/UiIcon.vue';
import { useFirstRunStore } from '../stores/firstRun.js';
import { useStoriesStore } from '../stores/stories.js';
@@ -165,10 +167,10 @@ function onSuppress(event) {
<!-- A button, not just a hint: phones and tablets have no ESC key. It
closes exactly as ESC does, for this session only. Touch screens
see SKIP; a keyboard sees SKIP · ESC (first-run.css). -->
<button type="button" class="first-run-dismiss" data-first-run-dismiss @click="controls?.dismiss()">
<UiButton class="first-run-dismiss" data-first-run-dismiss @click="controls?.dismiss()">
<span class="first-run-dismiss-key">{{ t('SKIP · ESC') }}</span>
<span class="first-run-dismiss-touch">{{ t('SKIP') }}</span>
</button>
</UiButton>
</header>
<h2 id="first-run-title">{{ t(TITLES[step - 1]) }}</h2>
<p class="first-run-step-announcement" role="status" aria-live="polite" aria-atomic="true">{{ t(TITLES[step - 1]) }}</p>
@@ -207,22 +209,22 @@ function onSuppress(event) {
<section class="first-run-section" aria-labelledby="first-run-start-heading">
<h3 id="first-run-start-heading" class="first-run-section-title">{{ t('Start with') }}</h3>
<div class="first-run-missions first-run-missions--tiles" role="group" aria-labelledby="first-run-start-heading">
<button type="button" data-first-run-start="space-missions" :aria-pressed="String(start === 'space-missions')" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('space-missions')">
<span class="material-symbols-outlined" aria-hidden="true">rocket_launch</span>
<UiButton data-first-run-start="space-missions" :pressed="start === 'space-missions'" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('space-missions')">
<UiIcon name="rocket_launch" :size="null" />
<span><strong>{{ t('SPACE MISSIONS') }}</strong><small>{{ t('Launches, spacecraft and orbital context') }}</small></span>
</button>
<button type="button" data-first-run-start="environmental" :aria-pressed="String(start === 'environmental')" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('environmental')">
<span class="material-symbols-outlined" aria-hidden="true">local_fire_department</span>
</UiButton>
<UiButton data-first-run-start="environmental" :pressed="start === 'environmental'" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('environmental')">
<UiIcon name="local_fire_department" :size="null" />
<!-- The title is ENVIRONMENTAL_LABEL_CHOICE's label once initialized. -->
<!-- Subcopy names BOTH feeds this tile turns on, because the launcher
optimizes for the fully configured experience (owner ruling,
2026-08-23) — see the mission table in src/firstRunExperience.js. -->
<span><strong data-first-run-environmental-title>{{ launcher?.environmentalTitle ?? environmentalLabel().title }}</strong><small>{{ launcher?.environmentalSub ?? t(ENVIRONMENTAL_SUB) }}</small></span>
</button>
<button type="button" data-first-run-start="explore" :aria-pressed="String(start === 'explore')" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('explore')">
<span class="material-symbols-outlined" aria-hidden="true">public</span>
</UiButton>
<UiButton data-first-run-start="explore" :pressed="start === 'explore'" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('explore')">
<UiIcon name="public" :size="null" />
<span><strong>{{ t('EXPLORE MANUALLY') }}</strong><small>{{ t('Begin with a clean globe') }}</small></span>
</button>
</UiButton>
</div>
</section>
@@ -230,17 +232,17 @@ function onSuppress(event) {
<div v-else key="3" class="first-run-step">
<ul class="first-run-tips">
<li class="first-run-tip first-run-tip--search">
<span class="first-run-tip-art" aria-hidden="true"><span class="material-symbols-outlined">search</span><i class="first-run-tip-caret"></i></span>
<span class="first-run-tip-art" aria-hidden="true"><UiIcon name="search" :size="null" /><i class="first-run-tip-caret"></i></span>
<strong>{{ t('Search places') }}</strong>
<small>{{ t('Type a place into the search bar.') }}</small>
</li>
<li class="first-run-tip first-run-tip--layers">
<span class="first-run-tip-art" aria-hidden="true"><span class="material-symbols-outlined">layers</span><i class="first-run-tip-dot"></i></span>
<span class="first-run-tip-art" aria-hidden="true"><UiIcon name="layers" :size="null" /><i class="first-run-tip-dot"></i></span>
<strong>{{ t('Turn on layers') }}</strong>
<small>{{ t('Turn layers on to see flights, ships, cameras, weather and more.') }}</small>
</li>
<li class="first-run-tip first-run-tip--context">
<span class="first-run-tip-art" aria-hidden="true"><span class="material-symbols-outlined">my_location</span><i class="first-run-tip-ring"></i></span>
<span class="first-run-tip-art" aria-hidden="true"><UiIcon name="my_location" :size="null" /><i class="first-run-tip-ring"></i></span>
<strong>{{ t('Click anything') }}</strong>
<small>{{ t('Select a map item to see its details.') }}</small>
</li>
@@ -248,12 +250,12 @@ function onSuppress(event) {
<section class="first-run-section" aria-labelledby="first-run-deeper-heading">
<h3 id="first-run-deeper-heading" class="first-run-section-title">{{ t('Go deeper') }}</h3>
<div v-if="stories.available" class="first-run-link-card first-run-stories">
<div class="first-run-preview first-run-preview--stories" aria-hidden="true"><span class="material-symbols-outlined">movie</span></div>
<div class="first-run-preview first-run-preview--stories" aria-hidden="true"><UiIcon name="movie" :size="null" /></div>
<div class="first-run-link-body">
<p class="first-run-mode-title"><strong translate="no">GEV Stories</strong> <span class="first-run-tag">{{ t('NEW') }}</span></p>
<p class="first-run-mode-copy">{{ t('Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.') }}</p>
</div>
<button type="button" class="first-run-link-button" data-first-run-stories :aria-disabled="String(settling || launcher?.busy === 'true')" @click="openStories">{{ t('BROWSE STORIES') }}</button>
<UiButton class="first-run-link-button" data-first-run-stories :aria-disabled="String(settling || launcher?.busy === 'true')" @click="openStories">{{ t('BROWSE STORIES') }}</UiButton>
</div>
</section>
@@ -304,10 +306,10 @@ function onSuppress(event) {
<p class="first-run-note" data-first-run-status role="status" aria-live="polite">{{ launcher?.status ?? '' }}</p>
<!-- The card's main action: God mode, starting where the selected tile
says (a clean globe by default). -->
<button v-if="step > 1" type="button" class="first-run-back" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="go(step - 1, $event)">{{ t('BACK') }}</button>
<button type="button" class="first-run-enter" :data-first-run-choice="step === STEPS ? start : undefined" :data-first-run-next="step < STEPS ? '' : undefined" data-first-run-primary aria-describedby="first-run-title first-run-description" @pointerdown="onPrimaryDown" @keydown.enter="onPrimaryKeydown" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="onPrimary">
{{ step < STEPS ? t('NEXT') : t('ENTER GOD MODE') }} <span class="material-symbols-outlined" aria-hidden="true">arrow_forward</span>
</button>
<UiButton v-if="step > 1" class="first-run-back" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="go(step - 1, $event)">{{ t('BACK') }}</UiButton>
<UiButton class="first-run-enter" :data-first-run-choice="step === STEPS ? start : undefined" :data-first-run-next="step < STEPS ? '' : undefined" data-first-run-primary aria-describedby="first-run-title first-run-description" @pointerdown="onPrimaryDown" @keydown.enter="onPrimaryKeydown" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="onPrimary">
{{ step < STEPS ? t('NEXT') : t('ENTER GOD MODE') }} <UiIcon name="arrow_forward" :size="null" />
</UiButton>
</div>
</aside>
+9 -7
View File
@@ -4,7 +4,9 @@ import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useCctvStore } from '../../stores/cctv.js';
import { usePanelChromeStore } from '../../stores/panelChrome.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// A selected camera's card: a thumbnail of its latest frame, a few facts,
// and a button that opens the full CCTV panel. The frame and facts come from
@@ -68,15 +70,15 @@ function openPanel() {
<img v-if="src" :src="src" :alt="name || t('Camera frame')" />
<span v-else>{{ t('Acquiring frame…') }}</span>
<span v-if="sourceBadge?.label" class="cctv-preview__badge">{{ sourceBadge.label }}</span>
<button v-if="src" type="button" class="cctv-preview__expand" :aria-label="t('Show a bigger view')" :title="t('Show a bigger view')" @click="big = true">
<span class="material-symbols-outlined" aria-hidden="true">open_in_full</span>
</button>
<UiButton v-if="src" class="cctv-preview__expand" :label="t('Show a bigger view')" @click="big = true">
<UiIcon name="open_in_full" :size="null" />
</UiButton>
</div>
<Teleport to="body">
<div v-if="big" class="cctv-popup" role="dialog" :aria-label="name || t('Camera view')" @click.self="big = false">
<figure class="cctv-popup__card">
<header class="cctv-popup__head">
<span class="material-symbols-outlined" aria-hidden="true">videocam</span>
<UiIcon name="videocam" :size="null" />
<strong>{{ name || t('Camera view') }}</strong>
<span v-if="sourceBadge?.label" class="cctv-popup__badge">{{ sourceBadge.label }}</span>
<UiCloseButton class="cctv-popup__close" glyph="icon" :label="t('Close')" @click="big = false" />
@@ -94,8 +96,8 @@ function openPanel() {
<dd>{{ fact.value }}</dd>
</div>
</dl>
<button type="button" class="entity-card__action cctv-preview__more" @click="openPanel">
<span class="material-symbols-outlined" aria-hidden="true">videocam</span>{{ t('More info') }}
</button>
<UiButton class="entity-card__action cctv-preview__more" @click="openPanel">
<UiIcon name="videocam" :size="null" />{{ t('More info') }}
</UiButton>
</section>
</template>
+16 -15
View File
@@ -12,6 +12,7 @@ import UiSlider from '../../kit/UiSlider.js';
import { useDisplayStore } from '../../stores/display.js';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSelect from '../../kit/UiSelect.js';
import { StyleParameterRows } from '../../styleParameters.js';
import VisualPresets from './VisualPresets.vue';
@@ -85,10 +86,10 @@ const allocationOptions = computed(() => [
<p class="pp-section-heading">{{ t('Overlay') }}</p>
<Teleport :to="cockpitPortal?.hud ?? 'body'" :disabled="!cockpitPortal?.hud">
<div class="pp-toggle-group">
<button class="pp-toggle-btn" :class="{ active: hud?.visible }" :aria-pressed="String(Boolean(hud?.visible))" id="hud-toggle" @click="act('toggleHud')" :title="t('Intelligence HUD (H)')">
<UiButton class="pp-toggle-btn" :pressed="Boolean(hud?.visible)" pressed-class="active" id="hud-toggle" @click="act('toggleHud')" :title="t('Intelligence HUD (H)')">
<span class="pp-icon">&#x25CE;</span>
<span class="pp-label" translate="no">HUD</span>
</button>
</UiButton>
<div class="pp-slider-row" :class="{ visible: hud?.visible }" id="hud-layout-row">
<span class="pp-slider-mini-label">{{ t('Layout') }}</span>
<UiSelect id="hud-layout-select" class="pp-select gev-field gev-field--compact" :model-value="hud?.variant ?? 'tactical'" @update:model-value="act('setHudLayout', $event)" :aria-label="t('HUD layout')">
@@ -184,7 +185,7 @@ const allocationOptions = computed(() => [
</Teleport>
<div class="pp-toggle-group">
<UiCheckbox class="pp-toggle-btn pp-scope-toggle" :title="t('Scope — the circular viewport mask')" input-id="scope-toggle" trailing :model-value="scopeOn" @update:model-value="act('setScopeEnabled', $event)">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">adjust</span>
<UiIcon class="pp-icon" name="adjust" :size="null" />
<span class="pp-label">{{ t('Scope') }}</span>
</UiCheckbox>
<div class="pp-slider-row visible" id="scope-slider-row">
@@ -198,21 +199,21 @@ const allocationOptions = computed(() => [
<span class="pp-slider-value" id="scope-opacity-value">{{ pct(scopeOpacity) }}</span>
</div>
</div>
<button class="pp-toggle-btn" id="clean-view-toggle" @click="act('toggleCleanView')" :title="t('Hide UI chrome')">
<UiButton class="pp-toggle-btn" id="clean-view-toggle" @click="act('toggleCleanView')" :title="t('Hide UI chrome')">
<span class="pp-icon">&#x25A1;</span>
<span class="pp-label">{{ t('Clean UI') }}</span>
</button>
</UiButton>
<p class="pp-section-heading">{{ t('Effects') }}</p>
<div class="pp-toggle-group">
<UiButton class="pp-toggle-btn" :pressed="celestial?.active ?? false" pressed-class="active" id="celestial-toggle" @click="act('toggleCelestial')" :title="celestialTitle" :disabled="celestial ? !celestial.supported : undefined" :aria-disabled="celestial ? String(!celestial.supported) : undefined">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">flare</span>
<UiIcon class="pp-icon" name="flare" :size="null" />
<span class="pp-label">{{ t('Celestial') }}</span>
</UiButton>
</div>
<!-- Sky: only where the renderer has a sky to set. -->
<div v-if="sky" class="pp-toggle-group" id="sky-group">
<UiCheckbox v-for="row in skyRows" :key="row.key" class="pp-toggle-btn pp-scope-toggle" :id="`sky-${row.key}-row`" :input-id="`sky-${row.key}-toggle`" trailing :model-value="sky.switches[row.key]" @update:model-value="act('setSkySwitch', row.key, $event)">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">{{ row.icon }}</span>
<UiIcon class="pp-icon" :name="row.icon" :size="null" />
<span class="pp-label">{{ row.label }}</span>
</UiCheckbox>
<div class="pp-slider-row visible" id="sky-milkyway-row">
@@ -225,7 +226,7 @@ const allocationOptions = computed(() => [
<div v-for="group in groups" :key="group.id" class="pp-toggle-group" :id="`${group.id}-group`">
<template v-for="row in group.rows" :key="row.id">
<UiCheckbox v-if="row.kind === 'toggle'" class="pp-toggle-btn pp-scope-toggle" :title="row.title" :input-id="`${group.id}-${row.id}-toggle`" trailing :model-value="row.checked" @update:model-value="row.onChange?.($event)">
<span v-if="row.icon" class="pp-icon material-symbols-outlined" aria-hidden="true">{{ row.icon }}</span>
<UiIcon v-if="row.icon" class="pp-icon" :name="row.icon" :size="null" />
<span class="pp-label">{{ row.label }}</span>
</UiCheckbox>
<div v-else-if="row.kind === 'note'" class="pp-slider-row visible" :id="`${group.id}-${row.id}`">
@@ -239,28 +240,28 @@ const allocationOptions = computed(() => [
</template>
</div>
<div class="pp-toggle-group">
<button class="pp-toggle-btn" :class="{ active: view?.bloom.active }" :aria-pressed="String(Boolean(view?.bloom.active))" id="bloom-toggle" @click="act('toggleBloom')" :title="t('Bloom / Glow')">
<UiButton class="pp-toggle-btn" :pressed="Boolean(view?.bloom.active)" pressed-class="active" id="bloom-toggle" @click="act('toggleBloom')" :title="t('Bloom / Glow')">
<span class="pp-icon">&#x2728;</span>
<span class="pp-label">{{ t('Bloom') }}</span>
</button>
</UiButton>
<div class="pp-slider-row" :class="{ visible: view?.bloom.active }" id="bloom-slider-row">
<UiSlider class="pp-slider" id="bloom-intensity-slider" @update:model-value="act('setBloomIntensity', $event)" min="0" max="200" :model-value="view?.bloom.intensity ?? 0" :aria-label="t('Bloom intensity')" />
<span class="pp-slider-value" id="bloom-intensity-value">{{ pct(view?.bloom.intensity ?? 0) }}</span>
</div>
</div>
<div class="pp-toggle-group">
<button class="pp-toggle-btn" :class="{ active: view?.sharpen.active }" :aria-pressed="String(Boolean(view?.sharpen.active))" id="sharpen-toggle" @click="act('toggleSharpen')" :title="t('Sharpening')">
<UiButton class="pp-toggle-btn" :pressed="Boolean(view?.sharpen.active)" pressed-class="active" id="sharpen-toggle" @click="act('toggleSharpen')" :title="t('Sharpening')">
<span class="pp-icon">&#x1F50D;</span>
<span class="pp-label">{{ t('Sharpen') }}</span>
</button>
</UiButton>
<div class="pp-slider-row" :class="{ visible: view?.sharpen.active }" id="sharpen-slider-row">
<UiSlider class="pp-slider" id="sharpen-intensity-slider" @update:model-value="act('setSharpenIntensity', $event)" min="0" max="100" :model-value="view?.sharpen.intensity ?? 49" :aria-label="t('Sharpen intensity')" />
<span class="pp-slider-value" id="sharpen-intensity-value">{{ pct(view?.sharpen.intensity ?? 49) }}</span>
</div>
</div>
<button type="button" class="pp-reset-btn" :title="t('Reset Visual to its defaults: Normal look, HUD, scope, labels and effects')" @click="act('resetVisual')">
<span class="material-symbols-outlined" aria-hidden="true">restart_alt</span>{{ t('Reset to default') }}
</button>
<UiButton class="pp-reset-btn" :title="t('Reset Visual to its defaults: Normal look, HUD, scope, labels and effects')" @click="act('resetVisual')">
<UiIcon name="restart_alt" :size="null" />{{ t('Reset to default') }}
</UiButton>
</div>
</div>
</template>
+23 -20
View File
@@ -10,7 +10,9 @@ import AltitudeGraph from './AltitudeGraph.vue';
import { contextNeedle, contextSearchText, matchesContextSearch } from '../../contextSearch.js';
import RouteGlobe from './RouteGlobe.vue';
import CctvPreview from './CctvPreview.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import { useCctvStore } from '../../stores/cctv.js';
import SpotConditions from './SpotConditions.vue';
import { shownLayerName } from '../../layerNames.js';
@@ -365,10 +367,10 @@ watch(
<AircraftModelHero v-if="modelKnown" :key="card.key" class="entity-hero__layer" :class="{ 'is-shown': activeFlightPreview === 'model' }" :active="activeFlightPreview === 'model'" :aircraft="card.aircraftModel" :heading="card.heading || 0" :callouts="callouts" @failed="modelFailed = true" @cycle="showOtherView" />
<FlightCockpitView v-if="cockpitMade && cockpitKnown" :key="`cockpit-${card.key}`" class="entity-hero__layer" :class="{ 'is-shown': activeFlightPreview === 'cockpit' }" :active="activeFlightPreview === 'cockpit'" :lat="card.lat" :lon="card.lon" :altitude-m="card.altitudeM" :heading="card.heading" :speed-mps="card.speedMps" @failed="onCockpitFailed" />
<div v-if="cockpitKnown || (routeKnown && modelKnown) || (photoAvailable && (routeKnown || modelKnown))" class="entity-card__preview-switch" role="group" :aria-label="t('Preview')">
<button v-if="photoAvailable" type="button" :class="{ active: activeFlightPreview === 'photo' }" :aria-pressed="String(activeFlightPreview === 'photo')" :aria-label="t('Photos')" :title="t('Photos')" @click="choosePreview('photo')"><span class="material-symbols-outlined" aria-hidden="true">photo_camera</span></button>
<button v-if="routeKnown" type="button" :class="{ active: activeFlightPreview === 'route' }" :aria-pressed="String(activeFlightPreview === 'route')" :aria-label="t('Route')" :title="t('Route')" @click="choosePreview('route')"><span class="material-symbols-outlined" aria-hidden="true">timeline</span></button>
<button v-if="modelKnown" type="button" :class="{ active: activeFlightPreview === 'model' }" :aria-pressed="String(activeFlightPreview === 'model')" :title="t('3D model')" @click="choosePreview('model')">{{ t('3D') }}</button>
<button v-if="cockpitKnown" type="button" :class="{ active: activeFlightPreview === 'cockpit' }" :aria-pressed="String(activeFlightPreview === 'cockpit')" :aria-label="t('Cockpit view')" :title="t('Cockpit view')" @click="choosePreview('cockpit')"><span class="material-symbols-outlined" aria-hidden="true">visibility</span></button>
<UiButton v-if="photoAvailable" :pressed="activeFlightPreview === 'photo'" pressed-class="active" :label="t('Photos')" @click="choosePreview('photo')"><UiIcon name="photo_camera" :size="null" /></UiButton>
<UiButton v-if="routeKnown" :pressed="activeFlightPreview === 'route'" pressed-class="active" :label="t('Route')" @click="choosePreview('route')"><UiIcon name="timeline" :size="null" /></UiButton>
<UiButton v-if="modelKnown" :pressed="activeFlightPreview === 'model'" pressed-class="active" :title="t('3D model')" @click="choosePreview('model')">{{ t('3D') }}</UiButton>
<UiButton v-if="cockpitKnown" :pressed="activeFlightPreview === 'cockpit'" pressed-class="active" :label="t('Cockpit view')" @click="choosePreview('cockpit')"><UiIcon name="visibility" :size="null" /></UiButton>
</div>
</template>
<a v-else-if="heroKind === 'photo'" :key="photo.src" class="entity-hero__layer entity-hero__photo is-shown" :href="photo.link || undefined" target="_blank" rel="noopener">
@@ -379,7 +381,7 @@ watch(
<CctvPreview v-else-if="heroKind === 'camera'" :camera-id="card.identity?.id || ''" />
<!-- No imagery for it yet: its icon, with its headline figures beside it. -->
<div v-else class="entity-hero__placeholder" :class="{ 'entity-hero__placeholder--bare': props.withContacts || !tiles.length }">
<span class="material-symbols-outlined entity-hero__glyph" aria-hidden="true">{{ card.icon }}</span>
<UiIcon class="entity-hero__glyph" :name="card.icon" :size="null" />
<div v-if="!props.withContacts && tiles.length" class="entity-hero__figures">
<div v-for="fact in tiles" :key="fact.field" class="entity-hero__figure">
<strong>{{ factFigure(fact).number }}<small v-if="factFigure(fact).unit">{{ factFigure(fact).unit }}</small></strong>
@@ -391,7 +393,7 @@ watch(
</div>
<header class="entity-card__head">
<span class="material-symbols-outlined entity-card__icon" aria-hidden="true">{{ card.icon }}</span>
<UiIcon class="entity-card__icon" :name="card.icon" :size="null" />
<div class="entity-card__name">
<span class="entity-card__kind">{{ kindLine }}</span>
<h3 class="entity-card__title">{{ shownTitle }}</h3>
@@ -406,14 +408,14 @@ watch(
</div>
<div v-if="card.warnings?.length" class="entity-card__warning" role="alert">
<span class="material-symbols-outlined" aria-hidden="true">warning</span>
<UiIcon name="warning" :size="null" />
<span>{{ card.warnings.map((warning, index) => sayWords(card.warningWords?.[index], warning)).join(' · ') }}</span>
</div>
<div v-if="card.route" class="entity-card__route" :class="{ 'entity-card__route--unverified': !card.route.verified, 'entity-card__route--progress': routeProgress }">
<strong>{{ card.route.from }}</strong>
<span class="entity-card__route-line" :style="routeProgress ? { '--route-share': `${(routeProgress.share * 100).toFixed(1)}%` } : null" aria-hidden="true">
<span class="material-symbols-outlined">flight</span>
<UiIcon name="flight" :size="null" />
</span>
<strong>{{ card.route.to }}</strong>
</div>
@@ -435,7 +437,7 @@ watch(
class="entity-card__route-note"
:title="t('The scheduled route for this flight number does not match where the plane is; it may be another leg of the same flight.')"
>
<span class="material-symbols-outlined" aria-hidden="true">warning</span>{{ t('Scheduled · unverified: does not match where the plane is') }}
<UiIcon name="warning" :size="null" />{{ t('Scheduled · unverified: does not match where the plane is') }}
</p>
<div v-if="!props.withContacts && tiles.length && heroKind !== 'none' && !contextNeedle" class="entity-card__tiles" :style="{ gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))` }">
@@ -462,20 +464,21 @@ watch(
<div class="entity-card__actions">
<!-- On an aircraft or a satellite, Cockpit leads: it is the action people come for. -->
<button v-if="store.canCockpit()" type="button" class="entity-card__action entity-card__action--primary" data-entity-cockpit-entry @click="store.cockpit()">
<span class="material-symbols-outlined" aria-hidden="true">{{ card.layerId === 'satellites' ? 'satellite_alt' : 'flight' }}</span>{{ card.layerId === 'satellites' ? t('Enter orbital view') : t('Enter Cockpit') }}
</button>
<UiButton v-if="store.canCockpit()" class="entity-card__action entity-card__action--primary" data-entity-cockpit-entry @click="store.cockpit()">
<UiIcon :name="card.layerId === 'satellites' ? 'satellite_alt' : 'flight'" :size="null" />{{ card.layerId === 'satellites' ? t('Enter orbital view') : t('Enter Cockpit') }}
</UiButton>
<div class="entity-card__action-row">
<button type="button" class="entity-card__action" @click="store.flyTo()">
<span class="material-symbols-outlined" aria-hidden="true">my_location</span>{{ t('Fly to') }}
</button>
<button v-if="store.canFollow()" type="button" class="entity-card__action" :class="{ 'entity-card__action--on': store.isFollowing() }" :aria-pressed="String(store.isFollowing())" @click="store.follow()">
<span class="material-symbols-outlined" aria-hidden="true">navigation</span>{{ store.isFollowing() ? t('Following') : t('Follow') }}
</button>
<UiButton class="entity-card__action" @click="store.flyTo()">
<UiIcon name="my_location" :size="null" />{{ t('Fly to') }}
</UiButton>
<UiButton v-if="store.canFollow()" class="entity-card__action" :pressed="Boolean(store.isFollowing())" pressed-class="entity-card__action--on" @click="store.follow()">
<UiIcon name="navigation" :size="null" />{{ store.isFollowing() ? t('Following') : t('Follow') }}
</UiButton>
</div>
<button type="button" class="entity-card__action entity-card__action--ask" @click="store.ask()">
<!-- The chat bubble is no Material symbol the page loads, so it stays drawn. -->
<UiButton class="entity-card__action entity-card__action--ask" @click="store.ask()">
<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z" /></svg>{{ t('Ask GEV about {name}', { name: shownTitle }) }}
</button>
</UiButton>
</div>
<slot />
+9 -8
View File
@@ -16,6 +16,8 @@ import { useGlobeActionsStore } from '../../stores/globeActions.js';
import { useLocationStore } from '../../stores/location.js';
import { useOmnibarStore } from '../../stores/omnibar.js';
import { useVoiceStore } from '../../stores/voice.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// One field for places, layers and questions. Places run through the location
// controls, layers through the shell's omnibar actions, and anything else can
@@ -1028,7 +1030,7 @@ watch(
<section id="gev-omnibar" :class="{ 'has-results': showResults }" :aria-label="t('Search')">
<div class="omnibar-field">
<span class="omnibar-edge" aria-hidden="true"></span>
<span class="material-symbols-outlined omnibar-search-icon" aria-hidden="true">search</span>
<UiIcon class="omnibar-search-icon" name="search" :size="null" />
<input
ref="input"
id="gev-omnibar-input"
@@ -1055,9 +1057,9 @@ watch(
@blur="focused = false"
/>
<kbd class="omnibar-kbd" aria-hidden="true">{{ shortcut }}</kbd>
<button type="button" class="omnibar-mic" :class="{ active: voiceOn }" :disabled="!voice.controls" :aria-pressed="String(voiceOn)" :aria-label="t('Talk to GEV')" :title="t('Talk to GEV')" @click="onMic(true)">
<UiButton class="omnibar-mic" :pressed="voiceOn" pressed-class="active" :disabled="!voice.controls" :label="t('Talk to GEV')" @click="onMic(true)">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><rect x="9" y="3" width="6" height="11" rx="3" /><path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21" /></svg>
</button>
</UiButton>
</div>
<div v-show="showResults" ref="results" class="omnibar-results" :class="{ 'has-feedback': showFeedback }">
<p id="omnibar-error" v-show="showFeedback" role="alert">{{ feedback }}</p>
@@ -1065,11 +1067,10 @@ watch(
<li v-if="strip" class="omnibar-strip" role="group" :aria-label="strip.title">
<span class="omnibar-strip__title" aria-hidden="true">{{ strip.title }}</span>
<div ref="stripChips" class="omnibar-strip__chips" role="presentation" @wheel="onStripWheel">
<button
<UiButton
v-for="(chip, index) in strip.chips"
:id="`gev-omnibar-chip-${index}`"
:key="chip.key"
type="button"
tabindex="-1"
class="omnibar-strip__chip"
:class="{ active: chip.pressed, focused: inStrip && index === chipIndex }"
@@ -1079,8 +1080,8 @@ watch(
@mousedown.prevent
@click="chooseChip(chip)"
>
<span class="material-symbols-outlined" aria-hidden="true">{{ chip.icon }}</span>{{ chip.name }}
</button>
<UiIcon :name="chip.icon" :size="null" />{{ chip.name }}
</UiButton>
</div>
</li>
<li
@@ -1095,7 +1096,7 @@ watch(
@click="choose(item)"
@mousemove="inStrip = false"
>
<span v-if="item.icon" class="material-symbols-outlined omnibar-item-icon" aria-hidden="true">{{ item.icon }}</span>
<UiIcon v-if="item.icon" class="omnibar-item-icon" :name="item.icon" :size="null" />
<svg v-else class="omnibar-item-icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z" /></svg>
<span class="omnibar-item-label">{{ item.label }}</span>
<small>{{ item.hint }}</small>
+20 -18
View File
@@ -5,6 +5,8 @@ import { compassName, hazardsNear, regionalBrief, weatherLook } from '../../spot
import { distanceKm } from '../../../data/entityContext.js';
import { CONTEXT_RADIUS_STEPS, contextRadiusKm, setContextRadiusKm } from '../../contextRadius.js';
import { contextNeedle, matchesContextSearch } from '../../contextSearch.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSlider from '../../kit/UiSlider.js';
import { sayWords, useEntityCardStore } from '../../stores/entityCard.js';
import { useOmnibarStore } from '../../stores/omnibar.js';
@@ -265,7 +267,7 @@ const sources = computed(() => {
<template v-if="entity">
<div v-if="weather || entity" class="spot-conditions__weather" :class="{ 'spot-conditions__weather--timed': entity }">
<template v-if="weather">
<span class="material-symbols-outlined spot-conditions__weather-icon" aria-hidden="true">{{ look.icon }}</span>
<UiIcon class="spot-conditions__weather-icon" :name="look.icon" :size="null" />
<div class="spot-conditions__weather-now">
<strong>{{ round(weather.temperatureC) }}°C</strong>
<span>{{ t(look.label) }}<template v-if="Number.isFinite(weather.apparentTemperatureC)"> · {{ t('feels {n}°', { n: round(weather.apparentTemperatureC) }) }}</template></span>
@@ -298,18 +300,18 @@ const sources = computed(() => {
<div v-for="block in trafficBlocks" v-show="!searching || block.items.length" :key="block.id" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">{{ block.icon }}</span>
<UiIcon :name="block.icon" :size="null" />
<span>{{ block.title }}</span>
<span class="spot-conditions__count">{{ block.count }}</span>
</h4>
<ul v-if="block.items.length">
<li v-for="item in block.items" :key="item.key">
<button type="button" @click="store.select(item.identity, { fly: true })">
<UiButton @click="store.select(item.identity, { fly: true })">
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ item.title }}</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(item.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
<p v-else class="spot-conditions__none">{{ block.none }}</p>
@@ -317,14 +319,14 @@ const sources = computed(() => {
<div v-show="!searching || shownHazards.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">warning</span>
<UiIcon name="warning" :size="null" />
<span>{{ t('Hazards within {radius}', { radius: radiusText }) }}</span>
<span class="spot-conditions__count" :class="{ 'spot-conditions__count--hot': hazards.length }">{{ loading ? '…' : searching ? shownHazards.length : hazards.length }}</span>
</h4>
<ul v-if="shownHazards.length">
<li v-for="hazard in shownHazards" :key="`${hazard.kind}-${hazard.title}-${hazard.distanceKm}`" :class="`spot-conditions__hazard--${hazard.kind}`">
<button type="button" @click="flyTo(hazard)">
<span class="material-symbols-outlined" aria-hidden="true">{{ hazard.icon }}</span>
<UiButton @click="flyTo(hazard)">
<UiIcon :name="hazard.icon" :size="null" />
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ hazard.title }}</span>
<span v-if="hazard.detail || hazard.time" class="spot-conditions__row-detail">{{ [hazard.detail, ago(hazard.time)].filter(Boolean).join(' · ') }}</span>
@@ -333,7 +335,7 @@ const sources = computed(() => {
</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(hazard.distanceKm) }} {{ t(hazard.direction) }}</span>
</button>
</UiButton>
</li>
</ul>
<p v-else-if="!loading" class="spot-conditions__none">{{ t('No earthquakes, tropical storms or wildfires reported within {radius}.', { radius: radiusText }) }}</p>
@@ -341,40 +343,40 @@ const sources = computed(() => {
<div v-if="alerts.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">emergency_home</span>
<UiIcon name="emergency_home" :size="null" />
<span>{{ t('Broadcast alerts within {radius}', { radius: radiusText }) }}</span>
<span class="spot-conditions__count spot-conditions__count--hot">{{ alerts.length }}</span>
</h4>
<ul>
<li v-for="alert in alerts" :key="alert.key" class="spot-conditions__hazard--alert">
<button type="button" @click="store.select(alert.identity, { fly: true })">
<span class="material-symbols-outlined" aria-hidden="true">{{ alert.icon }}</span>
<UiButton @click="store.select(alert.identity, { fly: true })">
<UiIcon :name="alert.icon" :size="null" />
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ alert.title }}</span>
<span class="spot-conditions__row-detail">{{ sayWords(alert.words, alert.text) }}</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(alert.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
</div>
<div v-if="groups?.other.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">layers</span>
<UiIcon name="layers" :size="null" />
<span>{{ t('Also within {radius}', { radius: radiusText }) }}</span>
<span class="spot-conditions__count">{{ groups.other.length }}</span>
</h4>
<ul>
<li v-for="item in groups.other" :key="item.key">
<button type="button" @click="store.select(item.identity, { fly: true })">
<span class="material-symbols-outlined" aria-hidden="true">{{ item.icon }}</span>
<UiButton @click="store.select(item.identity, { fly: true })">
<UiIcon :name="item.icon" :size="null" />
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ item.title }}</span>
<span class="spot-conditions__row-detail">{{ shownLayerName(item.layerName, item.layerId) }}</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(item.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
</div>
@@ -384,7 +386,7 @@ const sources = computed(() => {
<slot name="before-weather" />
<div v-if="weather || entity" class="spot-conditions__weather" :class="{ 'spot-conditions__weather--timed': entity }">
<template v-if="weather">
<span class="material-symbols-outlined spot-conditions__weather-icon" aria-hidden="true">{{ look.icon }}</span>
<UiIcon class="spot-conditions__weather-icon" :name="look.icon" :size="null" />
<div class="spot-conditions__weather-now">
<strong>{{ round(weather.temperatureC) }}°C</strong>
<span>{{ t(look.label) }}<template v-if="Number.isFinite(weather.apparentTemperatureC)"> · {{ t('feels {n}°', { n: round(weather.apparentTemperatureC) }) }}</template></span>
@@ -407,7 +409,7 @@ const sources = computed(() => {
<div v-if="articles.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">newspaper</span>
<UiIcon name="newspaper" :size="null" />
<span>{{ t('Local news') }}</span>
<span v-if="brief?.newsQuery" class="spot-conditions__query">{{ brief.newsQuery }}</span>
</h4>