mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Merge remote-tracking branch 'origin/main' into samehkhamis/kit-sweep-stories
# Conflicts: # docs/VUE-MIGRATION.md
This commit is contained in:
commit
e9f69d90a2
30 files changed
+626
-146
No files matched your search
@@ -0,0 +1,7 @@
|
||||
- `F` now collapses and reopens the Data Layers panel the way the panel's own
|
||||
button does, and its rail entry stays. Before, `F` hid the panel together
|
||||
with its rail entry, so only another `F` brought it back. When `F` or a
|
||||
panel's collapse button hides a panel that holds the focus, including one
|
||||
the opened panel folds away, the focus moves to that panel's rail entry;
|
||||
in Cockpit, focus in the Contact card it folds moves to the card's expand
|
||||
button (asturksever, #1598).
|
||||
@@ -0,0 +1,2 @@
|
||||
- The welcome card's buttons and glyphs are now kit controls, with the same
|
||||
look and behaviour (manjunath22466, samehkhamis, #1848).
|
||||
@@ -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).
|
||||
@@ -0,0 +1,2 @@
|
||||
- The Layer Finder's buttons and glyphs are now kit controls, with the same
|
||||
look and behaviour (manjunath22466, samehkhamis, #1851).
|
||||
@@ -3350,7 +3350,10 @@ Browser acceptance: `QA_BASE_URL=http://127.0.0.1:4173 node scripts/qa-segmented
|
||||
|
||||
`ui/input` supplies the bubbling application shortcut listener and generated
|
||||
shader-parameter rows. Number/style keys, H/O/V/F/D/C actions, native form-control
|
||||
typing and Escape behavior retain their existing mappings. A shortcut key held
|
||||
typing and Escape behavior retain their existing mappings. `F` collapses and
|
||||
reopens Data Layers the way the panel's own collapse button does, so its rail
|
||||
entry stays; if focus was inside the panel, it moves to that rail entry.
|
||||
A shortcut key held
|
||||
with Cmd, Ctrl or Alt runs no shortcut, so the browser's own chord (Cmd+C to
|
||||
copy, Cmd+F to find, Cmd+1 to switch tab) does not also toggle CCTV, the layers
|
||||
panel or a style; Shift does not count, and Escape dismisses search either way.
|
||||
|
||||
+41
-3
@@ -83,12 +83,22 @@ 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 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.
|
||||
Every button in the Stories views (the Stories entry and its popup and
|
||||
toast, Explore, the Story screen, its header, rail, timeline and context
|
||||
panel) is a ghost `UiButton`. Explore's topic chips and map pins, the
|
||||
@@ -109,6 +119,34 @@ ghost `UiButton`s, and its search, row and chip glyphs are `UiIcon`s with
|
||||
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
|
||||
`active`, while Search keeps its own `active` binding, which also stays on
|
||||
while a query is typed. The Filter button opens a disclosure and carries
|
||||
`aria-expanded`, not `aria-pressed`. Every glyph its own template draws is
|
||||
a `UiIcon` with `:size="null"`, so `layer-finder.css` still sizes them
|
||||
(`src/ui/kit/layerFinderControls.test.mjs` pins it); the search field's
|
||||
magnifier is `UiSearchField`'s own span.
|
||||
`UiSelect` renders the bare native select (Core's labels sit outside it or
|
||||
come as an `aria-label`) with `v-model`, `options` and `disabled`;
|
||||
options that carry their own attributes come through the slot, a caller's
|
||||
|
||||
@@ -1343,6 +1343,10 @@
|
||||
"src/ui/kit/UiDialog.vue",
|
||||
"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/kit/storiesControls.test.mjs",
|
||||
"src/ui/styles/chip.css",
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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</);
|
||||
|
||||
@@ -110,7 +110,7 @@ function harness({ hidden = false, selected = true, noChips = false } = {}) {
|
||||
window.performance = { now: () => now };
|
||||
document.defaultView = window;
|
||||
const methods = new Function('createHoverDisclosure', 'collapsePanelOnEscape', 'document', 'window', 'clearTimeout', 'performance', 'requestAnimationFrame', 't', 'msg', 'readPanelState',
|
||||
`return ({${shellMethod('_initAutoHoverPanel').toString()},\n${shellMethod('_collapsePanelOnEscape').toString()},\n${shellMethod('setPanelCollapsed').toString()},\n${shellMethod('_presentPanel').toString()},\n${shellMethod('_shownPanel').toString()}});`)(
|
||||
`return ({${shellMethod('_initAutoHoverPanel').toString()},\n${shellMethod('_collapsePanelOnEscape').toString()},\n${shellMethod('_railFocusStand').toString()},\n${shellMethod('setPanelCollapsed').toString()},\n${shellMethod('_presentPanel').toString()},\n${shellMethod('_shownPanel').toString()}});`)(
|
||||
createHoverDisclosure, collapsePanelOnEscape, document, window, (id) => timers.delete(id), { now: () => now }, () => {}, t, msg, readPanelState,
|
||||
);
|
||||
const saves = [];
|
||||
|
||||
@@ -42,7 +42,7 @@ function panelFixture({ id = 'data-panel', nested = false, nestedCollapsed = fal
|
||||
disclosure.closest = () => panel;
|
||||
}
|
||||
const document = { getElementById: (candidate) => candidate === id ? panel : null };
|
||||
const manager = new Function('document', 'getComputedStyle', 'collapsePanelOnEscape', `return {${method('_collapsePanelOnEscape', '_togglePanel')}};`)(document, (el) => ({ visibility: el.visibility ?? 'visible' }), collapsePanelOnEscape);
|
||||
const manager = new Function('document', 'getComputedStyle', 'collapsePanelOnEscape', `return {${method('_collapsePanelOnEscape', '_togglePanel')}, ${method('_railFocusStand', '_setCommandDockPanelPinState')}};`)(document, (el) => ({ visibility: el.visibility ?? 'visible' }), collapsePanelOnEscape);
|
||||
manager.setPanelCollapsed = (candidate, value, options) => {
|
||||
assert.equal(candidate, id);
|
||||
assert.equal(value, true);
|
||||
|
||||
@@ -637,6 +637,7 @@ export class StyleManager extends ShellFacade {
|
||||
_toggleOrbit: (...args) => this._toggleOrbit(...args),
|
||||
toggleCleanView: (...args) => this.toggleCleanView(...args),
|
||||
_toggleCctvEnabled: (...args) => this._toggleCctvEnabled(...args),
|
||||
_togglePanel: (panelId) => this._panelChrome._togglePanel(panelId),
|
||||
_setBloomEnabled: (...args) => this._setBloomEnabled(...args),
|
||||
_setBloomIntensity: (...args) => this._setBloomIntensity(...args),
|
||||
_setSharpenEnabled: (...args) => this._setSharpenEnabled(...args),
|
||||
|
||||
@@ -64,8 +64,8 @@ export class DisplayBindings {
|
||||
},
|
||||
toggleOrbit: () => this._toggleOrbit(),
|
||||
toggleCleanView: () => this.toggleCleanView(),
|
||||
toggleLayers: () =>
|
||||
document.getElementById('data-panel').classList.toggle('active'),
|
||||
// Same collapse as the panel's own button, so its rail entry stays.
|
||||
toggleLayers: () => this._togglePanel('data-panel'),
|
||||
cycleDetection: () => {
|
||||
this.shareLinkManager?.claimRestoreLane?.('visual');
|
||||
this.claimDetection();
|
||||
|
||||
@@ -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%');
|
||||
|
||||
@@ -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) ?? [], []);
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
// The Layer Finder's buttons and Material glyphs are the kit's: its template
|
||||
// hand-writes no <button>, aria-pressed, Material Symbols span or inline SVG.
|
||||
// Its search field is a UiSearchField.
|
||||
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 finder = template('LayerFinder.vue');
|
||||
|
||||
test('the Layer Finder hand-writes no button; each is a UiButton', () => {
|
||||
assert.deepEqual(finder.match(/<button\b/gi) ?? [], []);
|
||||
// Search, Filter, the Status and Category options, and the two chips.
|
||||
assert.equal(finder.match(/<UiButton\b/g)?.length, 6);
|
||||
assert.equal(finder.match(/<UiSearchField\b/g)?.length, 1);
|
||||
});
|
||||
|
||||
test('its pressed toggles leave aria-pressed to UiButton', () => {
|
||||
assert.deepEqual(finder.match(/aria-pressed/g) ?? [], []);
|
||||
const pressed = finder.match(/<UiButton\b[^>]*:pressed=[^>]*>/g) ?? [];
|
||||
// Search and the Status and Category options.
|
||||
assert.equal(pressed.length, 3);
|
||||
// Only the options' active class follows their pressed state; Search's
|
||||
// also stays on while a query is typed, so it keeps its own binding.
|
||||
assert.equal(
|
||||
pressed.filter((tag) => tag.includes('pressed-class="active"')).length,
|
||||
2,
|
||||
);
|
||||
assert.match(
|
||||
finder,
|
||||
/id="layer-finder-search-btn"[^>]*:class="\{ active: searching \|\| query \}"/,
|
||||
);
|
||||
});
|
||||
|
||||
test('the Layer Finder hand-writes no Material glyph; each is a UiIcon', () => {
|
||||
assert.deepEqual(finder.match(/material-symbols-outlined/g) ?? [], []);
|
||||
assert.deepEqual(finder.match(/<svg\b/gi) ?? [], []);
|
||||
const icons = finder.match(/<UiIcon\b[^>]*>/g) ?? [];
|
||||
// Search, Filter, the two option radios and the two chips' close.
|
||||
assert.equal(icons.length, 6);
|
||||
// Without it the kit writes an 18px size that beats layer-finder.css.
|
||||
for (const icon of icons) assert.match(icon, /:size="null"/);
|
||||
});
|
||||
@@ -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]),
|
||||
['◎', '▣', '✈', '□', '✨', '🔍'],
|
||||
);
|
||||
});
|
||||
@@ -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"/);
|
||||
});
|
||||
+41
-16
@@ -205,22 +205,7 @@ export class PanelChrome {
|
||||
beforeCollapse: () => {
|
||||
if (panelId === 'location-bar') this._closeLocationSearch?.();
|
||||
},
|
||||
// A desktop side panel hides entirely once collapsed; its rail item
|
||||
// takes the focus its own disclosure can no longer hold.
|
||||
returnFocusTo: () => {
|
||||
const panel = document.getElementById(panelId);
|
||||
if (!panel?.getClientRects || panel.getClientRects().length > 0)
|
||||
return null;
|
||||
const item = document.querySelector?.(
|
||||
`.ui-rail [data-rail-item="${panelId}"]`,
|
||||
);
|
||||
return item &&
|
||||
!item.disabled &&
|
||||
item.getClientRects().length > 0 &&
|
||||
getComputedStyle(item).visibility === 'visible'
|
||||
? item
|
||||
: null;
|
||||
},
|
||||
returnFocusTo: () => this._railFocusStand(panelId),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -229,9 +214,49 @@ export class PanelChrome {
|
||||
if (this._disposed || !this._disclosurePanelIds?.has(panelId)) return;
|
||||
const panel = document.getElementById(panelId);
|
||||
if (!panel) return;
|
||||
// Opening a panel folds others too (the side accordion, Cockpit's
|
||||
// Contact card): note which open ones hold the focus.
|
||||
const focused = document.activeElement;
|
||||
const holders = [...this._disclosurePanelIds]
|
||||
.map((id) => document.getElementById(id))
|
||||
.filter((el) => el?.contains(focused) && !this._shownPanel(el).collapsed);
|
||||
const cockpit = this.cockpitView;
|
||||
const contactHeld =
|
||||
cockpit?.active &&
|
||||
!cockpit.contextCollapsed &&
|
||||
document.getElementById('cockpit-context')?.contains(focused);
|
||||
this.setPanelCollapsed(panelId, !this._shownPanel(panel).collapsed, {
|
||||
explicit: true,
|
||||
});
|
||||
const stand =
|
||||
contactHeld && cockpit.contextCollapsed
|
||||
? document.getElementById('cockpit-context-toggle')
|
||||
: holders
|
||||
.filter((el) => this._shownPanel(el).collapsed)
|
||||
.map((el) => this._railFocusStand(el.id))
|
||||
.find(Boolean);
|
||||
stand?.focus({ preventScroll: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* A desktop side panel hides entirely once collapsed; its rail item takes
|
||||
* the focus its own disclosure can no longer hold. Null while the panel or
|
||||
* the item is not shown.
|
||||
* @param {string} panelId Panel element id.
|
||||
*/
|
||||
_railFocusStand(panelId) {
|
||||
const panel = document.getElementById(panelId);
|
||||
if (!panel?.getClientRects || panel.getClientRects().length > 0)
|
||||
return null;
|
||||
const item = document.querySelector?.(
|
||||
`.ui-rail [data-rail-item="${panelId}"]`,
|
||||
);
|
||||
return item &&
|
||||
!item.disabled &&
|
||||
item.getClientRects().length > 0 &&
|
||||
getComputedStyle(item).visibility === 'visible'
|
||||
? item
|
||||
: null;
|
||||
}
|
||||
|
||||
_setCommandDockPanelPinState(
|
||||
|
||||
@@ -14,6 +14,8 @@ import PanelCollapseButton from './rail/PanelCollapseButton.vue';
|
||||
import RailPanel from './rail/RailPanel.vue';
|
||||
import UiPanel from './kit/UiPanel.vue';
|
||||
import { usePanelChromeStore } from './stores/panelChrome.js';
|
||||
import { useDisplayStore } from './stores/display.js';
|
||||
import { DisplayBindings } from './displayBindings.js';
|
||||
import CommandDockView from './views/CommandDockView.vue';
|
||||
|
||||
function mount(t, component) {
|
||||
@@ -487,3 +489,164 @@ test('the accordion closes peers through the real store, and opens them again',
|
||||
assert.equal(panels[0].className, '');
|
||||
chrome.destroy();
|
||||
});
|
||||
|
||||
test('F collapses Data Layers like its button and keeps its rail entry', (t) => {
|
||||
document.body.innerHTML = `
|
||||
<nav class="ui-rail"><button data-rail-item="data-panel" style="visibility: visible"></button></nav>
|
||||
<div id="data-panel" class="active"><button class="panel-collapse-btn" data-collapse-target="data-panel"></button></div>`;
|
||||
const panel = document.getElementById('data-panel');
|
||||
const item = document.querySelector('[data-rail-item="data-panel"]');
|
||||
panel.getClientRects = () =>
|
||||
panel.classList.contains('collapsed') ? [] : [{}];
|
||||
item.getClientRects = () => [{}];
|
||||
const store = usePanelChromeStore(createPinia());
|
||||
const chrome = panelChrome(store);
|
||||
followPanelState(store, 'data-panel', panel);
|
||||
chrome._disclosurePanelIds = new Set(['data-panel']);
|
||||
const bindings = new DisplayBindings({
|
||||
viewer: null,
|
||||
services: { isScopeMaskEnabled: () => false, cycleDetectionMode() {} },
|
||||
elements: { _locationSearch: document.createElement('input') },
|
||||
operations: {
|
||||
_setScope() {},
|
||||
_togglePanel: (panelId) => chrome._togglePanel(panelId),
|
||||
},
|
||||
readState: () => ({}),
|
||||
claimDetection() {},
|
||||
displayStore: useDisplayStore(createPinia()),
|
||||
});
|
||||
bindings._initUI();
|
||||
t.after(() => {
|
||||
bindings.destroy();
|
||||
chrome.destroy();
|
||||
});
|
||||
const press = (init = {}) =>
|
||||
document.activeElement.dispatchEvent(
|
||||
new KeyboardEvent('keydown', { key: 'f', bubbles: true, ...init }),
|
||||
);
|
||||
|
||||
panel.querySelector('button').focus();
|
||||
press();
|
||||
assert.equal(store.panels['data-panel']?.collapsed, true);
|
||||
assert.ok(document.activeElement === item, 'focus moves to the rail');
|
||||
assert.ok(panel.classList.contains('collapsed'));
|
||||
// `active` is what shows Data Layers at all (layers.css).
|
||||
assert.ok(panel.classList.contains('active'));
|
||||
press({ metaKey: true });
|
||||
assert.equal(store.panels['data-panel'].collapsed, true, 'Cmd+F is not ours');
|
||||
press();
|
||||
assert.equal(store.panels['data-panel'].collapsed, false);
|
||||
assert.ok(!panel.classList.contains('collapsed'));
|
||||
assert.ok(panel.classList.contains('active'));
|
||||
});
|
||||
|
||||
test('F that folds a focused peer hands the focus to a rail entry', (t) => {
|
||||
document.body.innerHTML = `
|
||||
<nav class="ui-rail">
|
||||
<button data-rail-item="data-panel" style="visibility: visible"></button>
|
||||
<button data-rail-item="pp-toggles" style="visibility: visible"></button>
|
||||
</nav>
|
||||
<div id="left-panel-stack">
|
||||
<div id="data-panel" data-panel-id="data-panel" class="active collapsed"><button class="panel-collapse-btn" data-collapse-target="data-panel"></button></div>
|
||||
<div id="pp-toggles" data-panel-id="pp-toggles"><button class="panel-collapse-btn" data-collapse-target="pp-toggles"></button><button id="crt2">CRT 2</button></div>
|
||||
</div>`;
|
||||
const stack = document.getElementById('left-panel-stack');
|
||||
const store = usePanelChromeStore(createPinia());
|
||||
const chrome = new PanelChrome({
|
||||
elements: { _leftPanelStack: stack },
|
||||
operations: { _showToast() {}, _syncCctvPanelViewport() {} },
|
||||
readHud: () => ({ visible: false, getVariant: () => null }),
|
||||
readCockpit: () => null,
|
||||
readShareLinks: () => null,
|
||||
readInitialShare: () => null,
|
||||
readScrollRestoreOwner: () => null,
|
||||
readDisplayScrollTop: () => 0,
|
||||
store,
|
||||
});
|
||||
for (const id of ['data-panel', 'pp-toggles']) {
|
||||
const panel = document.getElementById(id);
|
||||
panel.getClientRects = () =>
|
||||
panel.classList.contains('collapsed') ? [] : [{}];
|
||||
followPanelState(store, id, panel);
|
||||
}
|
||||
for (const item of document.querySelectorAll('[data-rail-item]'))
|
||||
item.getClientRects = () => [{}];
|
||||
chrome._disclosurePanelIds = new Set(['data-panel', 'pp-toggles']);
|
||||
const bindings = new DisplayBindings({
|
||||
viewer: null,
|
||||
services: { isScopeMaskEnabled: () => false, cycleDetectionMode() {} },
|
||||
elements: { _locationSearch: document.createElement('input') },
|
||||
operations: {
|
||||
_setScope() {},
|
||||
_togglePanel: (panelId) => chrome._togglePanel(panelId),
|
||||
},
|
||||
readState: () => ({}),
|
||||
claimDetection() {},
|
||||
displayStore: useDisplayStore(createPinia()),
|
||||
});
|
||||
bindings._initUI();
|
||||
t.after(() => {
|
||||
bindings.destroy();
|
||||
chrome.destroy();
|
||||
});
|
||||
|
||||
const crt2 = document.getElementById('crt2');
|
||||
crt2.focus();
|
||||
assert.equal(document.activeElement, crt2);
|
||||
crt2.dispatchEvent(new KeyboardEvent('keydown', { key: 'f', bubbles: true }));
|
||||
assert.equal(
|
||||
store.panels['data-panel']?.collapsed,
|
||||
false,
|
||||
'Data Layers opens',
|
||||
);
|
||||
const visual = document.getElementById('pp-toggles');
|
||||
assert.ok(
|
||||
visual.classList.contains('collapsed'),
|
||||
'the accordion folds Visual',
|
||||
);
|
||||
assert.ok(
|
||||
document.activeElement?.matches?.('.ui-rail [data-rail-item]'),
|
||||
`focus lands on a rail entry, not inside the hidden peer (got ${document.activeElement?.id || document.activeElement?.tagName})`,
|
||||
);
|
||||
});
|
||||
|
||||
test('opening Data Layers in Cockpit hands the focus from the folded Contact card to its toggle', (t) => {
|
||||
document.body.innerHTML = `
|
||||
<div id="left-panel-stack">
|
||||
<div id="data-panel" data-panel-id="data-panel" class="active collapsed"><button class="panel-collapse-btn" data-collapse-target="data-panel"></button></div>
|
||||
</div>
|
||||
<aside id="cockpit-context"><button id="cockpit-context-toggle"></button><button id="cockpit-weather-toggle"></button></aside>`;
|
||||
const store = usePanelChromeStore(createPinia());
|
||||
const cockpit = {
|
||||
active: true,
|
||||
contextCollapsed: false,
|
||||
setContextCollapsed(collapsed) {
|
||||
this.contextCollapsed = collapsed;
|
||||
},
|
||||
setSignalCollapsed() {},
|
||||
scheduleContextLayout() {},
|
||||
};
|
||||
const chrome = new PanelChrome({
|
||||
elements: { _leftPanelStack: document.getElementById('left-panel-stack') },
|
||||
operations: { _showToast() {}, _syncCctvPanelViewport() {} },
|
||||
readHud: () => ({ visible: false, getVariant: () => null }),
|
||||
readCockpit: () => cockpit,
|
||||
readShareLinks: () => null,
|
||||
readInitialShare: () => null,
|
||||
readScrollRestoreOwner: () => null,
|
||||
readDisplayScrollTop: () => 0,
|
||||
store,
|
||||
});
|
||||
t.after(() => chrome.destroy());
|
||||
followPanelState(store, 'data-panel', document.getElementById('data-panel'));
|
||||
chrome._disclosurePanelIds = new Set(['data-panel']);
|
||||
document.getElementById('cockpit-weather-toggle').focus();
|
||||
chrome._togglePanel('data-panel');
|
||||
assert.equal(
|
||||
store.panels['data-panel']?.collapsed,
|
||||
false,
|
||||
'Data Layers opens',
|
||||
);
|
||||
assert.equal(cockpit.contextCollapsed, true, 'Contact folds for it');
|
||||
assert.equal(document.activeElement?.id, 'cockpit-context-toggle');
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import PanelRailView from './PanelRailView.vue';
|
||||
import { PANEL_RAIL_HOST_CLASS, PANEL_RAIL_ITEMS } from './panelRailCatalog.js';
|
||||
import { PANEL_RAIL_HOST_CLASS } from './panelRailCatalog.js';
|
||||
import { usePanelStore } from './stores/panels.js';
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,6 @@ export class PanelNavigation {
|
||||
? [...stack.children]
|
||||
.filter((panel) => panel.matches('[data-panel-id]'))
|
||||
.map((panel) => {
|
||||
const shownBy = PANEL_RAIL_ITEMS[panel.id]?.shownBy;
|
||||
return {
|
||||
id: panel.id,
|
||||
title:
|
||||
@@ -79,9 +78,7 @@ export class PanelNavigation {
|
||||
.querySelector('.panel-title, .pp-header-label')
|
||||
?.textContent.trim() || panel.id,
|
||||
open: !panel.classList.contains('collapsed'),
|
||||
available:
|
||||
!panel.hidden &&
|
||||
(!shownBy || panel.classList.contains(shownBy)),
|
||||
available: !panel.hidden,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
|
||||
@@ -22,8 +22,6 @@ function panel(id, { collapsed = true, hidden = false, title = '' } = {}) {
|
||||
element.className = collapsed
|
||||
? 'panel-collapsible collapsed'
|
||||
: 'panel-collapsible';
|
||||
// Data Layers shows only while `active` (the `f` shortcut toggles it).
|
||||
if (id === 'data-panel') element.classList.add('active');
|
||||
element.hidden = hidden;
|
||||
if (title) element.innerHTML = `<span class="panel-title">${title}</span>`;
|
||||
return element;
|
||||
@@ -132,8 +130,8 @@ test('the rails follow disclosure and availability changes', async () => {
|
||||
['global-context-panel', 'false'],
|
||||
['host-panel', 'false'],
|
||||
]);
|
||||
// `f` hides Data Layers outright, so the rail stops offering it.
|
||||
document.getElementById('data-panel').classList.remove('active');
|
||||
// A hidden panel leaves its rail.
|
||||
document.getElementById('data-panel').hidden = true;
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
await nextTick();
|
||||
assert.deepEqual(railItems(left), [['scene-panel', 'true']]);
|
||||
|
||||
@@ -7,16 +7,11 @@ export const PANEL_RAIL_HOST_CLASS = 'gev-panel-rail';
|
||||
export const PANEL_RAIL_FALLBACK_ICON = 'more_horiz';
|
||||
|
||||
/**
|
||||
* How each side panel appears on its rail. Labels are the panels' own titles.
|
||||
* `shownBy` names a class the panel needs to be shown at all (`f` toggles
|
||||
* Data Layers' `active`). `context` is the label's translation context.
|
||||
* How each side panel appears on its rail. Labels are the panels' own titles;
|
||||
* `context` is the label's translation context.
|
||||
*/
|
||||
export const PANEL_RAIL_ITEMS = Object.freeze({
|
||||
'data-panel': {
|
||||
icon: 'layers',
|
||||
label: msg('DATA LAYERS'),
|
||||
shownBy: 'active',
|
||||
},
|
||||
'data-panel': { icon: 'layers', label: msg('DATA LAYERS') },
|
||||
'utilities-panel': { icon: 'handyman', label: msg('UTILITIES') },
|
||||
'scene-panel': { icon: 'movie', label: msg('AUTHORING') },
|
||||
// `context` keeps the panel's name apart from the satellite class of the
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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">◎</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">□</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">✨</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">🔍</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>
|
||||
@@ -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 />
|
||||
|
||||
@@ -22,6 +22,8 @@ const finder = {
|
||||
<script setup>
|
||||
import { nextTick, onBeforeUnmount, onMounted, ref, watch, computed } from 'vue';
|
||||
import { msg, t } from '../../../i18n/index.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
import UiIcon from '../../kit/UiIcon.vue';
|
||||
import UiSearchField from '../../kit/UiSearchField.vue';
|
||||
|
||||
// Search and filter for the Data Layers list. The rows are rendered elsewhere
|
||||
@@ -185,7 +187,8 @@ async function toggleFilter() {
|
||||
}
|
||||
function closeFilter({ refocus = false } = {}) {
|
||||
filtering.value = false;
|
||||
if (refocus) triggerEl.value?.focus();
|
||||
// The trigger is a UiButton; its root is the button.
|
||||
if (refocus) triggerEl.value?.$el?.focus();
|
||||
}
|
||||
function onMenuKey(event) {
|
||||
if (event.key === 'Escape') {
|
||||
@@ -223,37 +226,37 @@ if (props.part === 'buttons') {
|
||||
|
||||
<template>
|
||||
<template v-if="part === 'buttons'">
|
||||
<button id="layer-finder-search-btn" type="button" class="layer-finder__btn" :class="{ active: searching || query }" :aria-pressed="String(searching)" :aria-label="t('Search layers')" :title="t('Search layers')" @click="toggleSearch">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">search</span>
|
||||
</button>
|
||||
<UiButton id="layer-finder-search-btn" class="layer-finder__btn" :class="{ active: searching || query }" :pressed="Boolean(searching)" :aria-label="t('Search layers')" :title="t('Search layers')" @click="toggleSearch">
|
||||
<UiIcon name="search" :size="null" />
|
||||
</UiButton>
|
||||
<span ref="filterEl" class="layer-finder__filter">
|
||||
<button ref="triggerEl" type="button" class="layer-finder__btn" :class="{ active: show !== 'all' || category }" :aria-expanded="String(filtering)" aria-controls="layer-finder-menu" :aria-label="t('Filter layers')" :title="t('Filter layers')" @click="toggleFilter">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">filter_list</span>
|
||||
</button>
|
||||
<UiButton ref="triggerEl" class="layer-finder__btn" :class="{ active: show !== 'all' || category }" :aria-expanded="String(filtering)" aria-controls="layer-finder-menu" :aria-label="t('Filter layers')" :title="t('Filter layers')" @click="toggleFilter">
|
||||
<UiIcon name="filter_list" :size="null" />
|
||||
</UiButton>
|
||||
<span v-if="filtering" id="layer-finder-menu" ref="menuEl" class="layer-finder__menu" role="group" :aria-label="t('Filter layers')" @keydown="onMenuKey">
|
||||
<span role="group" :aria-label="t('Status')">
|
||||
<span class="layer-finder__menu-head" aria-hidden="true">{{ t('Status') }}</span>
|
||||
<button v-for="s in SHOWS" :key="s.id" type="button" :aria-pressed="String(show === s.id)" :class="{ active: show === s.id }" @click="show = s.id">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">{{ show === s.id ? 'radio_button_checked' : 'radio_button_unchecked' }}</span>{{ t(s.label) }}
|
||||
</button>
|
||||
<UiButton v-for="s in SHOWS" :key="s.id" :pressed="show === s.id" pressed-class="active" @click="show = s.id">
|
||||
<UiIcon :name="show === s.id ? 'radio_button_checked' : 'radio_button_unchecked'" :size="null" />{{ t(s.label) }}
|
||||
</UiButton>
|
||||
</span>
|
||||
<span v-if="categories.length" role="group" :aria-label="t('Category')">
|
||||
<span class="layer-finder__menu-head" aria-hidden="true">{{ t('Category') }}</span>
|
||||
<button v-for="c in categories" :key="c.key" type="button" :aria-pressed="String(category === c.key)" :class="{ active: category === c.key }" @click="pickCategory(c.key)">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">{{ category === c.key ? 'radio_button_checked' : 'radio_button_unchecked' }}</span>{{ c.label }}
|
||||
</button>
|
||||
<UiButton v-for="c in categories" :key="c.key" :pressed="category === c.key" pressed-class="active" @click="pickCategory(c.key)">
|
||||
<UiIcon :name="category === c.key ? 'radio_button_checked' : 'radio_button_unchecked'" :size="null" />{{ c.label }}
|
||||
</UiButton>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
<div v-else-if="searching || narrowed" class="layer-finder__bar">
|
||||
<UiSearchField v-if="searching" v-model="query" tag="label" class="layer-finder__field" input-id="layer-finder-input" :label="t('Search layers')" :placeholder="t('Search layers…')" @escape="(event) => { event.preventDefault(); closeSearch(); }" />
|
||||
<button v-if="show !== 'all'" type="button" class="layer-finder__chip" @click="show = 'all'">
|
||||
{{ show === 'on' ? t('On') : t('Off') }}<span class="material-symbols-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button v-if="category" type="button" class="layer-finder__chip" @click="category = ''">
|
||||
{{ categoryLabel }}<span class="material-symbols-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<UiButton v-if="show !== 'all'" class="layer-finder__chip" @click="show = 'all'">
|
||||
{{ show === 'on' ? t('On') : t('Off') }}<UiIcon name="close" :size="null" />
|
||||
</UiButton>
|
||||
<UiButton v-if="category" class="layer-finder__chip" @click="category = ''">
|
||||
{{ categoryLabel }}<UiIcon name="close" :size="null" />
|
||||
</UiButton>
|
||||
<p v-if="narrowed && shown === 0" class="layer-finder__empty" role="status">{{ t('No layers match') }}</p>
|
||||
</div>
|
||||
</template>
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user