Merge branch 'main' into codex/fix-cctv-session-admission

This commit is contained in:
Said Turksever authored and GitHub committed 2026-11-19 19:19:38 +00:00
commit f5f5f04b5d
35 files changed
+612 -193

No files matched your search

@@ -0,0 +1,3 @@
- The command dock's and Context's buttons and glyphs are now kit controls,
and the style buttons say whether they are pressed (manjunath22466,
samehkhamis, #1855).
@@ -0,0 +1,3 @@
- The small views' buttons and glyphs (locale picker, phone tabs, globe
actions and compass, News and rail cards, credits, the Omnibar guide's
rings and others) are now kit controls (manjunath22466, samehkhamis, #1856).
+46 -7
View File
@@ -97,8 +97,8 @@ header's search and expand, the imported files' row actions and the rail
chips' icons), the glyphs are `UiIcon`s with `:size="null"`, so the site
rules still size them. Core's pressable chips and pills (the rail cards'
chips and action chips, Recent Imagery's day chips, SWAP and ZOOM IN, map
sources, cities and places) are `UiButton`s too; the view context's place
and layer chips and the key setup chip are still plain buttons. `UiChip`
sources, cities and places, and the view context's place and layer chips)
are `UiButton`s too; the key setup chip is still a plain button. `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:
@@ -149,6 +149,23 @@ 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 command dock's buttons (the six style buttons, the two tray toggles,
Location's collapse and the search toggle, beside the pins and pills that
already were) are ghost `UiButton`s. The style buttons are pressed toggles
with `active` as their pressed class, so they now carry `aria-pressed`;
Normal is the pressed one until a style is published. Their glyphs, the
search 🔎 and the collapse + are text characters, not Material symbols, and
stay plain text. The Context panel's buttons (its two tabs, Contacts, the
cockpit entry and SEARCH NEARBY SITES, beside the header's search and
expand and the TR-3B chip) are ghost `UiButton`s; the tabs and Contacts
are `role="tab"` controls, chosen through `aria-selected` with their own
`active` class rather than `pressed`. The view context it shows while
nothing is picked (a worldwide tile that turns a layer on, an item's row,
the place and layer chips and Ask GEV) is on the kit too, and the glyphs of
all three are `UiIcon`s with `:size="null"`, so their site rules still size
them; an item's motion glyph keeps `role="img"` and its name, with the
kit's `aria-hidden` taken off (`src/ui/kit/commandDockControls.test.mjs`
pins it). Ask GEV's chat bubble stays inline SVG.
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
@@ -158,6 +175,22 @@ while a query is typed. The Filter button opens a disclosure and carries
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.
The small surfaces' buttons are ghost `UiButton`s: the locale picker's
button, the phone tab bar's tabs, the globe actions' Clear, Share, Reset
and north-up compass, the imagery divider's handle, the scene sharing
dialog's buttons, the layer group index's ticks, the title logo, Exit
clean view, the HUD's cockpit entry, a News card's face, a rail card's
header, a layer row's toggle, the credits line's Data attribution and the
camera calibration chips. None is a pressed toggle; the disclosures keep
`aria-expanded`. Their Material glyphs (the tabs', the globe actions', the
compass needle, the cockpit entry's and the celestial ring's sun and moon)
are `UiIcon`s with `:size="null"`, so the site rules still size them. The
locale picker's globe, caret and check and a News card's category icon stay
inline SVG. The Omnibar guide draws the extra rings of a step with several
targets in its template, as many as `view.subRings` says, rather than
building them in script; the Omnibar's one other `material-symbols-outlined`
is a stylesheet selector, and the layer disclosure only names a button in a
comment (`src/ui/kit/smallSurfacesControls.test.mjs` pins it).
`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
@@ -263,11 +296,17 @@ page declares no dark `color-scheme`. Selects and number fields are
and keeps native spinners dark; ranges are `.gev-quantitative-slider`, with
a feature supplying only its accent.
`t()` is not reactive. Words a view passes to a kit component as a prop
(`UiCloseButton`'s `label`) follow a locale change on the view's next
render, but words in a kit component's slot do not: the compiled slot does
not render the child again. A view whose words must follow the locale at
once passes the locale itself as a prop or key, as the credits line does.
`t()` is reactive only while the locale is bound to a ref (the app binds
it to vue-i18n's). Words a view passes to a kit component as a prop
(`UiCloseButton`'s `label`) follow the view's render at once. Words and
props read in a kit component's slot follow a tick later, in the child's
own update, and never when the locale is unbound; a slot that reads a
`v-for` variable is already redrawn with its view. A view whose owner
patches synchronously and reads the result at once (a News card, a rail
card, the credits line, the Omnibar guide's buttons) gives such a slot
under a named condition that is always true
(`<template v-if="redrawWithView" #default>`): Vue redraws a conditional
slot whenever its view is drawn.
## Phases
+2
View File
@@ -1350,6 +1350,8 @@
"src/ui/kit/welcomeControls.test.mjs",
"src/ui/kit/omnibarControls.test.mjs",
"src/ui/kit/storiesControls.test.mjs",
"src/ui/kit/smallSurfacesControls.test.mjs",
"src/ui/kit/commandDockControls.test.mjs",
"src/ui/styles/chip.css",
"src/ui/styles/empty-state.css",
"src/ui/rail/RailChips.vue",
+8 -2
View File
@@ -90,8 +90,14 @@ test('the ring renders its overlay in the viewer container', async (t) => {
['DIV', 'celestial-ring-outline'],
['CANVAS', 'celestial-ring-canvas celestial-sun-canvas'],
['CANVAS', 'celestial-ring-canvas celestial-moon-canvas'],
['SPAN', 'celestial-marker celestial-sun material-symbols-outlined'],
['SPAN', 'celestial-marker celestial-moon material-symbols-outlined'],
[
'SPAN',
'ui-icon material-symbols-outlined celestial-marker celestial-sun',
],
[
'SPAN',
'ui-icon material-symbols-outlined celestial-marker celestial-moon',
],
],
);
assert.equal(root.children[0].style.display, 'none');
+5 -5
View File
@@ -194,12 +194,12 @@ test('Cockpit vision cycle exposes every map preset exactly once', () => {
test('Contacts uses the approved radar icon', () => {
const button = html.match(
/<button id="global-context-flights-btn"[\s\S]*?<\/button>/,
/<button\b[^>]*\bid="global-context-flights-btn"[\s\S]*?<\/button>/,
);
assert.ok(button, 'Contacts button is missing');
assert.match(
button[0],
/material-symbols-outlined" aria-hidden="true">radar<\/span>/,
/material-symbols-outlined"[^>]*aria-hidden="true">radar<\/span>/,
);
});
@@ -369,11 +369,11 @@ test('Cockpit owns a focused shared Display portal and compact Radio controls',
assert.doesNotMatch(html, /data-cockpit-display-slot="presets"/);
assert.match(
html,
/id="clear-selected-layers"[^>]*aria-label="Clear selected data layers"/,
/<button\b(?=[^>]*\bid="clear-selected-layers")[^>]*aria-label="Clear selected data layers"/,
);
assert.match(
html,
/id="reset-globe-view"[^>]*aria-label="Reset to full globe view"/,
/<button\b(?=[^>]*\bid="reset-globe-view")[^>]*aria-label="Reset to full globe view"/,
);
assert.match(
css,
@@ -1231,7 +1231,7 @@ test('Cockpit Contact navigation omits the redundant Focus camera action', () =>
test('Global Context names its mixed contact cycle without changing the stable mode id', () => {
const match = html.match(
/<button id="global-context-flights-btn"[\s\S]*?<\/button>/,
/<button\b[^>]*\bid="global-context-flights-btn"[\s\S]*?<\/button>/,
);
assert.ok(match, 'Global Context contacts button is missing');
assert.match(match[0], />CONTACTS</);
+4 -4
View File
@@ -25,12 +25,12 @@ const css = readStylesheet(new URL('../style.css', import.meta.url));
test('Contacts stays in the keyboard sequence and Space Missions owns its rail item', () => {
const button = html.match(
/<button id="global-context-flights-btn"[\s\S]*?<\/button>/,
/<button\b[^>]*\bid="global-context-flights-btn"[\s\S]*?<\/button>/,
)?.[0];
assert.ok(button, 'Contacts control is missing');
assert.match(button, /role="tab"/);
assert.match(button, /tabindex="0"/);
const tag = contextView.match(/<button id="global-context-flights-btn"[^>]*>/)?.[0];
const tag = contextView.match(/<UiButton id="global-context-flights-btn"[^>]*>/)?.[0];
assert.ok(tag, 'Contacts control is missing from the view');
assert.doesNotMatch(tag, /:tabindex|:disabled|\sdisabled/);
assert.doesNotMatch(html, /id="global-context-missions-btn"/);
@@ -111,7 +111,7 @@ test('Context async action buttons remain focused while busy', () => {
assert.match(init, /if \(this\._installationsSearchBusy\) return;/);
assert.doesNotMatch(init, /\.disabled\s*=\s*true/);
const search = contextView.match(
/<button id="installations-search-btn"[^>]*>/,
/<UiButton id="installations-search-btn"[^>]*>/,
)?.[0];
assert.ok(search, 'nearby sites search is missing');
assert.doesNotMatch(search, /:disabled|\sdisabled/);
@@ -140,7 +140,7 @@ test('Context async action buttons remain focused while busy', () => {
'utf8',
);
const clearButton = globeActions.match(
/<button id="clear-selected-layers"[^>]*>/,
/<UiButton id="clear-selected-layers"[^>]*>/,
)?.[0];
assert.ok(clearButton, 'Clear selected layers button is missing');
assert.doesNotMatch(clearButton, /disabled(?!=")|:disabled=/);
+1 -1
View File
@@ -294,7 +294,7 @@ test('Location markup provides one named native disclosure linked to its popover
assert.match(locationToggleMarkup[2], /class="location-toolbar-label"/);
assert.doesNotMatch(locationToggleMarkup[2], /<button\b/);
assert.match(locationMarkup.slice(locationToggleMarkup.index + locationToggleMarkup[0].length),
/^\s*<button class="panel-collapse-btn" data-collapse-target="location-bar"/);
/^\s*<button type="button" class="[^"]*\bpanel-collapse-btn\b[^"]*"[^>]*\sdata-collapse-target="location-bar"/);
assert.match(locationMarkup, /<div id="location-bar-popover" class="dock-popover-content">/);
});
+1 -1
View File
@@ -349,7 +349,7 @@ test('the Visual Presets tray owns Map Source and the retired left panel is abse
);
assert.match(
html,
/<button id="control-panel-toggle"[\s\S]*?data-dock-toggle-target="control-panel"[\s\S]*?aria-controls="control-panel-popover"/,
/<button\b[^>]*\bid="control-panel-toggle"[\s\S]*?data-dock-toggle-target="control-panel"[\s\S]*?aria-controls="control-panel-popover"/,
'the compact wing must expose a semantic keyboard disclosure',
);
const panels = readFileSync(
+3 -2
View File
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { t } from '../../i18n/index.js';
import { useCctvStore } from '../stores/cctv.js';
import UiButton from '../kit/UiButton.vue';
// One click-to-type pose chip. The panel's delegated click starts an edit
// in CctvControls, which publishes it; the chip then holds a number input
@@ -42,7 +43,7 @@ function onBlur(event) {
</script>
<template>
<button
<UiButton
class="cctv-cal-value"
:data-cal-field="field"
:disabled="edit ? false : view?.calibration.disabled"
@@ -60,6 +61,6 @@ function onBlur(event) {
@click.stop /></template
><template v-else>{{
view?.calibration.values[field] ?? `${t(label)} --`
}}</template></button
}}</template></UiButton
>
</template>
+4 -1
View File
@@ -58,7 +58,10 @@ test('before ContextControls renders, the switch shows its initial markup', (t)
);
assert.equal(panel.hasAttribute('data-context-mode'), false);
const tab = $('global-context-flights-btn');
assert.equal(tab.className, 'context-mode-button');
assert.equal(
tab.className,
'ui-button ui-focus ui-button--ghost ui-button--accent context-mode-button',
);
assert.equal(tab.getAttribute('aria-selected'), 'false');
assert.equal(tab.getAttribute('tabindex'), '0');
assert.equal(tab.hasAttribute('aria-busy'), false);
+11 -3
View File
@@ -1,5 +1,6 @@
<script setup>
import { t } from '../../i18n/index.js';
import UiButton from '../kit/UiButton.vue';
import UiCloseButton from '../kit/UiCloseButton.vue';
import CreditItem from './CreditItem.vue';
@@ -33,6 +34,12 @@ const props = defineProps({
const SEPARATOR = ' · ';
/** A credit's key: the same text and link are one credit. */
const key = (credit) => `${credit.text}\u0000${credit.href ?? ''}`;
// The list button's words are the slot of a UiButton, which renders inside
// the button: a locale that is not bound to a ref changes nothing the button
// reads, and the owner patches synchronously and reads the result at once. A
// slot given under a condition (`redrawWithView`, always true) is redrawn
// whenever this view is, so the words follow a new locale with the rest.
const redrawWithView = true;
/** Keep `name`'s element for the owner. */
const keep = (name) => (element) => {
props.elements[name] = element?.$el ?? element;
@@ -46,16 +53,17 @@ const keep = (name) => (element) => {
><template v-for="(credit, i) in props.inline" :key="key(credit)"
>{{ i ? SEPARATOR : '' }}<CreditItem :credit="credit" /></template
>{{ props.inline.length && props.listed.length ? SEPARATOR : '' }}</span
><button
><UiButton
:ref="keep('expand')"
type="button"
class="gev-credits-expand"
aria-haspopup="dialog"
:aria-controls="props.panelId"
:aria-expanded="String(props.open)"
:hidden="props.listed.length === 0"
@click="props.onExpand()"
>{{ t('Data attribution') }}</button
><template v-if="redrawWithView" #default>{{
t('Data attribution')
}}</template></UiButton
></div
><div
:id="props.panelId"
+1 -1
View File
@@ -53,7 +53,7 @@ test('the divider renders on the body with its labels and slider', async (t) =>
assert.equal(after.title, 'After');
assert.equal(handle.tagName, 'BUTTON');
assert.equal(handle.type, 'button');
assert.equal(handle.className, 'split-handle');
assert.ok(handle.classList.contains('split-handle'));
assert.equal(handle.textContent, '↔');
assert.equal(handle.getAttribute('role'), 'slider');
assert.equal(handle.getAttribute('aria-label'), 'Divider');
+127
View File
@@ -0,0 +1,127 @@
// The command dock's and the Context panel's buttons and Material glyphs are
// the kit's: neither the dock, the Context view nor the view context it
// shows while nothing is picked hand-writes a <button> or a Material Symbols
// span. The dock's style buttons are pressed toggles with `active`, its
// glyphs (◯ ▦ 🌙 🌡️ ✦ ◐, the search 🔎 and the collapse +) are text
// characters, not Material symbols, and stay plain text. Context's tabs and
// its Contacts mode button are `role="tab"` controls: they say they are
// chosen with `aria-selected` and keep their own `active` class, never
// `aria-pressed`.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
/** A view's template block: everything outside script, style and comments. */
function template(file) {
const source = readFileSync(
new URL(`../views/${file}`, import.meta.url),
'utf8',
);
return source
.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
.replace(/<!--[\s\S]*?-->/g, '');
}
// A tag's attributes, read past quoted values so a handler's `=>` does not
// end the tag early.
const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
const tag = (pattern, flags = '') =>
new RegExp(pattern.replaceAll('ATTRS', ATTRS), flags);
const tags = (markup, name) =>
markup.match(tag(String.raw`<${name}\bATTRS>`, 'g')) ?? [];
const dock = template('CommandDockView.vue');
const context = template('ContextView.vue');
const inView = template('panels/ViewContext.vue');
const views = {
// The six style buttons, the two tray toggles and their pins, the map
// source chips, Location's collapse, its landmark and city pills and the
// search toggle.
'CommandDockView.vue': { markup: dock, buttons: 15, icons: 0, closes: 0 },
// Search and Expand in the header, the two tabs, Contacts, the cockpit
// entry, SEARCH NEARBY SITES and the TR-3B chip.
'ContextView.vue': { markup: context, buttons: 8, icons: 7, closes: 0 },
// An off layer's worldwide tile, an item's row, the place and layer chips
// and Ask GEV; a layer's Turn off is a UiCloseButton. The glyphs: the
// header's eye, a worldwide tile's (on and off), a layer group's, an
// item's motion and the layer chips' add.
'panels/ViewContext.vue': { markup: inView, buttons: 5, icons: 6, closes: 1 },
};
test('the dock and Context hand-write no button; each is a UiButton', () => {
for (const [file, { markup, buttons, closes }] of Object.entries(views)) {
assert.deepEqual(markup.match(/<button\b/gi) ?? [], [], file);
assert.deepEqual(markup.match(/<component\b/gi) ?? [], [], file);
assert.equal(tags(markup, 'UiButton').length, buttons, file);
assert.equal(tags(markup, 'UiCloseButton').length, closes, file);
}
});
test('the style buttons are pressed toggles with active', () => {
assert.doesNotMatch(dock, /v-class-toggle="\{[^"]*\bactive\b/);
const styles = tags(dock, 'UiButton').filter((b) =>
/class="style-btn"/.test(b),
);
assert.deepEqual(
styles.map((b) => b.match(/data-style="(\w+)"/)[1]),
['normal', 'retro', 'surveillance', 'thermal', 'anime', 'noir'],
);
for (const button of styles) {
const name = button.match(/data-style="(\w+)"/)[1];
assert.match(button, /\spressed-class="active"/, name);
// Normal stays the pressed one until a style is published.
assert.match(
button,
name === 'normal'
? /\s:pressed="!style \|\| style\.name === 'normal'"/
: new RegExp(String.raw`\s:pressed="style\?\.name === '${name}'"`),
name,
);
}
});
test('no tag hand-writes aria-pressed; the pressed toggles take :pressed', () => {
for (const [file, { markup }] of Object.entries(views))
assert.doesNotMatch(
markup,
tag(String.raw`<\w+\bATTRS\s:?aria-pressed`),
file,
);
const pressed = (markup) =>
tags(markup, 'UiButton').filter((b) => /\s:pressed=/.test(b)).length;
// The six styles, two pins, map sources, landmarks and cities.
assert.equal(pressed(dock), 11);
// Search, Expand and TR-3B.
assert.equal(pressed(context), 3);
assert.equal(pressed(inView), 0);
});
test("Context's tabs say they are chosen, not pressed", () => {
const tabs = tags(context, 'UiButton').filter((b) => /\srole="tab"/.test(b));
assert.equal(tabs.length, 3);
for (const button of tabs) {
assert.match(button, /\s:aria-selected=/);
assert.doesNotMatch(button, /\s:pressed=/);
assert.match(button, /\s(?::class|v-class-toggle)="\{ active: /);
}
});
test('they hand-write no Material glyph; each is a UiIcon', () => {
for (const [file, { markup, icons }] of Object.entries(views)) {
assert.deepEqual(
markup.match(/material-symbols-outlined/g) ?? [],
[],
file,
);
const found = tags(markup, 'UiIcon');
assert.equal(found.length, icons, file);
// Without it the kit writes an 18px size that beats the site rules.
for (const icon of found) assert.match(icon, /\s:size="null"/, file);
}
// An item's motion glyph is an image with its own name, not decoration.
const [motion] = tags(inView, 'UiIcon').filter((i) =>
/view-context__row-motion/.test(i),
);
assert.match(motion, /\srole="img"/);
assert.match(motion, /\s:aria-label=/);
assert.match(motion, /\s:aria-hidden="null"/);
});
+135
View File
@@ -0,0 +1,135 @@
// The small surfaces' buttons and Material glyphs are the kit's: the locale
// picker, the phone tab bar, the globe actions and compass, the imagery
// divider, the scene sharing dialog, the layer group index, the celestial
// ring, the title logo, Exit clean view, the HUD's cockpit entry, the News
// cards, the rail cards, the layer rows' toggles, the credits line and the
// camera calibration chips hand-write no <button> and no Material Symbols
// span. The Omnibar guide's extra rings are its template's, not built in
// script. The locale picker's globe, caret and check and a News card's
// category icon stay inline SVG: none is a Material symbol the page loads.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const read = (file) =>
readFileSync(new URL(`../${file}`, import.meta.url), 'utf8');
/** The template block: everything outside script, style and comments. */
const template = (file) =>
read(file)
.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
.replace(/<!--[\s\S]*?-->/g, '');
// An opening tag's attributes, quoted values may hold `>` (`() => x`).
const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
const tags = (markup, name) =>
markup.match(new RegExp(String.raw`<${name}\b${ATTRS}>`, 'g')) ?? [];
// Per file: its UiButtons, UiCloseButtons and UiIcons.
const SURFACES = {
'views/panels/LocalePicker.vue': [1, 0, 0],
'views/panels/PhoneTabBar.vue': [1, 0, 1],
'views/panels/GlobeCompass.vue': [1, 0, 1],
// Clear, share, tilt and reset; the clear, tilt and reset glyphs.
'views/panels/GlobeActions.vue': [4, 0, 3],
'views/panels/ImagerySplitView.vue': [1, 0, 0],
// The body's buttons and the footer's.
'views/panels/SceneDialog.vue': [2, 0, 0],
'views/panels/LayerSectionIndex.vue': [1, 0, 0],
// The sun and moon markers.
'views/panels/CelestialRing.vue': [0, 0, 2],
'views/panels/OmnibarGuide.vue': [3, 1, 0],
// The overlay targets' buttons and the title logo.
'views/SceneChromeView.vue': [2, 0, 0],
'views/DisplayControlsView.vue': [1, 0, 0],
'views/IntelHudView.vue': [1, 0, 1],
// The card's face and the selected card's clear chip.
'news/NewsCard.vue': [2, 0, 0],
'rail/RailCard.vue': [1, 0, 0],
'layerPanel/LayerRows.vue': [1, 0, 0],
'credits/CreditsView.vue': [1, 1, 0],
'cctv/CctvCalValue.vue': [1, 0, 0],
};
test('the small surfaces hand-write no button; each is a kit button', () => {
for (const [file, [buttons, closes]] of Object.entries(SURFACES)) {
const markup = template(file);
assert.deepEqual(markup.match(/<button\b/gi) ?? [], [], file);
assert.equal(tags(markup, 'UiButton').length, buttons, file);
assert.equal(tags(markup, 'UiCloseButton').length, closes, file);
}
});
test('the small surfaces hand-write no Material glyph; each is a UiIcon', () => {
for (const [file, [, , count]] of Object.entries(SURFACES)) {
const markup = template(file);
assert.deepEqual(
markup.match(/material-symbols-outlined/g) ?? [],
[],
file,
);
const icons = tags(markup, 'UiIcon');
assert.equal(icons.length, count, file);
// Without it the kit writes an 18px size that beats the sites' own rules.
for (const icon of icons) assert.match(icon, /\s:size="null"/, file);
}
});
test('the only inline SVG glyphs are the locale picker’s and a News category’s', () => {
for (const file of Object.keys(SURFACES)) {
const expected =
file === 'views/panels/LocalePicker.vue'
? 3
: file === 'news/NewsCard.vue'
? 1
: 0;
assert.equal(template(file).match(/<svg\b/g)?.length ?? 0, expected, file);
}
});
test('buttons whose owner patches synchronously redraw their contents with it', () => {
// A UiButton's slot renders inside the button, a tick after a change the
// button's own attributes do not carry; a conditional slot is redrawn with
// its view.
// How many of each file's first buttons the owner redraws and reads.
for (const [file, count] of [
['news/NewsCard.vue', 1],
['rail/RailCard.vue', 1],
['credits/CreditsView.vue', 1],
['views/panels/OmnibarGuide.vue', 3],
]) {
const markup = template(file);
const buttons = tags(markup, 'UiButton').slice(0, count);
assert.equal(buttons.length, count, file);
let from = 0;
for (const button of buttons) {
from = markup.indexOf(button, from) + button.length;
assert.match(
markup.slice(from),
/^\s*<template v-if="redrawWithView" #default\s*>/,
file,
);
}
assert.match(read(file), /const redrawWithView = true;/, file);
}
});
test('the Omnibar guide draws its extra rings in its template', () => {
const guide = template('views/panels/OmnibarGuide.vue');
assert.match(
guide,
/<div\s+v-for="i in view\.subRings"\s+:key="i"\s+class="gev-guide-ring gev-guide-ring--sub"\s*><\/div\s*>\s*<\/div\s*>\s*<\/Teleport/,
);
const owner = read('omnibarGuide.js');
assert.deepEqual(owner.match(/createElement\(/g), ['createElement(']);
assert.doesNotMatch(owner, /\.className\s*=|\.append\(/);
assert.match(owner, /view\.subRings = rest\.length;\s*paint\(\);/);
});
test('the layer disclosure builds no control', () => {
// Its one `<button` is a comment's word for the element Chromium focuses.
const disclosure = read('panelDisclosure.js');
assert.doesNotMatch(disclosure, /createElement|innerHTML|insertAdjacentHTML/);
const code = disclosure
.replace(/\/\/.*$/gm, '')
.replace(/\/\*[\s\S]*?\*\//g, '');
assert.doesNotMatch(code, /<button/);
});
+3 -3
View File
@@ -5,6 +5,7 @@ import RowRange from './RowRange.vue';
import RowSlider from './RowSlider.vue';
import RowSwitch from './RowSwitch.vue';
import RowText from './RowText.vue';
import UiButton from '../kit/UiButton.vue';
import { vClassToggle } from '../rail/classToggle.js';
// The data layer rows under their group headings. LayerPanel presents every
@@ -45,8 +46,7 @@ defineProps({
v-if="item.count"
:class="['data-count', { 'data-count-empty': item.count.empty }]"
:text="item.count.text"
/><button
type="button"
/><UiButton
:class="['data-toggle-btn', item.toggle.classes]"
:data-feed-state="item.toggle.feedState"
:aria-disabled="String(item.toggle.ariaDisabled)"
@@ -54,7 +54,7 @@ defineProps({
:title="item.toggle.title"
:aria-label="item.toggle.ariaLabel"
@click="onToggle(item.id)"
>{{ item.toggle.text }}</button
>{{ item.toggle.text }}</UiButton
></div
></div
><RowText tag="div" class="data-toggle-meta" :text="item.meta" /><template
+58 -51
View File
@@ -49,6 +49,11 @@ const meta = () =>
]
.filter(Boolean)
.join(' · ');
// The card's face is the slot of a UiButton, which renders inside the
// button: a new item alone would reach it only on a later tick, but the panel
// patches synchronously. A slot given under a condition (`redrawWithView`,
// always true) is redrawn whenever this card is, so it keeps up.
const redrawWithView = true;
</script>
<template>
@@ -58,60 +63,62 @@ const meta = () =>
:data-report-id="item.id"
:style="{ '--news-color': item.color }"
>
<button
type="button"
class="news-card__main ui-focus"
<UiButton
class="news-card__main"
:aria-expanded="open ? 'true' : 'false'"
@click="onChoose(item)"
><template v-if="redrawWithView" #default>
<span v-if="item.picture && !pictureFailed" class="news-card__thumb"
><img
:src="item.picture.url"
alt=""
loading="lazy"
decoding="async"
referrerpolicy="no-referrer"
v-on="{ error: dropPicture }"
/><span
v-if="item.picture.video && !clipFailed"
class="news-card__play"
role="img"
:aria-label="t('Video')"
>▶</span
><span v-if="item.picture.credit" class="news-card__credit">{{
item.picture.credit
}}</span></span
>
<span class="news-card__title">{{ item.title }}</span>
<span v-if="item.original" class="news-card__note">{{
t('English headline by the model')
}}</span>
<span class="news-card__meta ui-mono"
><span
class="news-card__marker"
:class="{ solid: item.solid }"
role="img"
:aria-label="item.severityLabel"
:title="item.severityLabel"
><svg viewBox="0 0 16 16" aria-hidden="true">
<path :d="item.icon" /></svg></span
><span v-if="item.severity >= 2" class="news-card__severity">{{
item.severityLabel
}}</span
>{{ item.severity >= 2 ? ` · ${meta()}` : meta() }}</span
>
<span v-if="item.sides" class="news-card__sides">{{ item.sides }}</span>
<span v-if="item.chips.length" class="news-card__chips"
><span
v-for="chip in item.chips"
:key="`${chip.kind}:${chip.label}`"
class="news-chip"
:class="`news-chip--${chip.kind}`"
>{{ chip.label }}</span
></span
>
<span v-if="item.via" class="news-card__via ui-mono">{{
item.via
}}</span>
</template></UiButton
>
<span v-if="item.picture && !pictureFailed" class="news-card__thumb"
><img
:src="item.picture.url"
alt=""
loading="lazy"
decoding="async"
referrerpolicy="no-referrer"
v-on="{ error: dropPicture }"
/><span
v-if="item.picture.video && !clipFailed"
class="news-card__play"
role="img"
:aria-label="t('Video')"
>▶</span
><span v-if="item.picture.credit" class="news-card__credit">{{
item.picture.credit
}}</span></span
>
<span class="news-card__title">{{ item.title }}</span>
<span v-if="item.original" class="news-card__note">{{
t('English headline by the model')
}}</span>
<span class="news-card__meta ui-mono"
><span
class="news-card__marker"
:class="{ solid: item.solid }"
role="img"
:aria-label="item.severityLabel"
:title="item.severityLabel"
><svg viewBox="0 0 16 16" aria-hidden="true">
<path :d="item.icon" /></svg></span
><span v-if="item.severity >= 2" class="news-card__severity">{{
item.severityLabel
}}</span
>{{ item.severity >= 2 ? ` · ${meta()}` : meta() }}</span
>
<span v-if="item.sides" class="news-card__sides">{{ item.sides }}</span>
<span v-if="item.chips.length" class="news-card__chips"
><span
v-for="chip in item.chips"
:key="`${chip.kind}:${chip.label}`"
class="news-chip"
:class="`news-chip--${chip.kind}`"
>{{ chip.label }}</span
></span
>
<span v-if="item.via" class="news-card__via ui-mono">{{ item.via }}</span>
</button>
<div v-if="open" class="news-card__open">
<video
v-if="item.picture?.video && !clipFailed"
+10 -6
View File
@@ -472,6 +472,9 @@ export function startGuide(steps, { title = '' } = {}) {
nextLabel: t('Next'),
nextHidden: false,
nextQuiet: false,
// The extra rings for a step's further targets, after the callout; the
// count only grows, and rings a step does not use are faded out.
subRings: 0,
// Announces each step once; the dialog itself is not a live region, so
// its buttons and progress are not read out on every change.
status: '',
@@ -511,7 +514,9 @@ export function startGuide(steps, { title = '' } = {}) {
const root = paint().component.subTree.children[0].el;
const ring = root.querySelector(':scope > .gev-guide-ring');
const callout = root.querySelector(':scope > .gev-guide-callout');
const subRings = [];
// The extra rings, read again from the rendered tree whenever more are
// drawn.
let subRings = [];
const live = steps.filter(Boolean);
let index = -1;
@@ -657,11 +662,10 @@ export function startGuide(steps, { title = '' } = {}) {
width: `${main.width + pad * 2}px`,
height: `${main.height + pad * 2}px`,
});
while (subRings.length < rest.length) {
const sub = doc.createElement('div');
sub.className = 'gev-guide-ring gev-guide-ring--sub';
root.append(sub);
subRings.push(sub);
if (subRings.length < rest.length) {
view.subRings = rest.length;
paint();
subRings = [...root.querySelectorAll(':scope > .gev-guide-ring--sub')];
}
subRings.forEach((sub, i) => {
const box = rest[i];
+36
View File
@@ -134,3 +134,39 @@ test('a walk started while Vue mounts something else still starts and ends', asy
assert.equal($('.gev-guide'), null);
assert.equal(document.activeElement, field);
});
test('each further target of a step gets its own ring after the callout', async (t) => {
const { target } = fixture(t);
const more = document.body.appendChild(document.createElement('button'));
const box = (left) => () => ({
left,
top: 20,
right: left + 30,
bottom: 50,
width: 30,
height: 30,
});
target.getBoundingClientRect = box(10);
more.getBoundingClientRect = box(100);
let targets = [target, more];
startGuide([{ targets: () => targets, text: () => 'Press these' }]);
const frame = () => new Promise((resolve) => requestAnimationFrame(resolve));
await settle();
await frame();
const subs = () => [...document.querySelectorAll('.gev-guide-ring--sub')];
assert.equal(subs().length, 1);
const [sub] = subs();
assert.equal(sub.className, 'gev-guide-ring gev-guide-ring--sub');
assert.equal(sub.parentElement, $('.gev-guide'));
assert.equal(sub.previousElementSibling, $('.gev-guide-callout'));
assert.equal(sub.childElementCount, 0);
assert.equal(sub.style.opacity, '1');
assert.equal(sub.style.left, '96px');
assert.equal(sub.style.width, '38px');
// A step with fewer targets keeps the ring, faded out.
targets = [target];
$('.gev-guide-ring').dispatchEvent(new Event('scroll', { bubbles: true }));
await frame();
assert.deepEqual(subs(), [sub]);
assert.equal(sub.style.opacity, '0');
});
+33 -23
View File
@@ -2,6 +2,7 @@
import { computed, onBeforeUnmount } from 'vue';
import RailCardBlocks from './RailCardBlocks.vue';
import UiBadge from '../kit/UiBadge.vue';
import UiButton from '../kit/UiButton.vue';
// One keyed card: a disclosure header and its blocks. The owner decides
// which card is open.
@@ -20,6 +21,12 @@ onBeforeUnmount(() => {
live = false;
});
const select = () => live && props.onOpen(props.card.id);
// The header's contents are the slot of a UiButton, which renders inside the
// button: a new card alone would reach them only on a later tick, but the
// owner patches synchronously and measures at once. A slot given under a
// condition (`redrawWithView`, always true) is redrawn whenever this card is,
// so it keeps up.
const redrawWithView = true;
</script>
<script>
@@ -32,33 +39,36 @@ const nextBodyId = () => ++bodies;
:class="`rail-card${cardClassName ? ` ${cardClassName}` : ''}${open ? ' is-open' : ''}`"
:data-card-id="card.id"
:data-open="String(open)"
><button
><UiButton
class="rail-card-header"
type="button"
:aria-controls="bodyId"
:aria-expanded="String(open)"
@click="select"
><span class="rail-card-labels"
><span class="rail-card-heading"
><span class="data-icon" aria-hidden="true" :hidden="!card.icon">{{
card.icon || ''
}}</span
><span class="rail-card-title rail-card-nowrap" :title="card.title">{{
card.title
}}</span></span
><UiBadge
:class="`gev-status-badge--plain rail-card-badge${badgeClassName ? ` ${badgeClassName}` : ''}`"
:hidden="!card.badge"
>{{ card.badge || '' }}</UiBadge
></span
><span class="rail-card-disclosure" aria-hidden="true">{{
open ? '▾' : '▸'
}}</span
><span
:class="`rail-card-compact${card.compactStatus ? ' status' : ''}`"
:hidden="open"
>{{ card.compact || '' }}</span
></button
><template v-if="redrawWithView" #default
><span class="rail-card-labels"
><span class="rail-card-heading"
><span class="data-icon" aria-hidden="true" :hidden="!card.icon">{{
card.icon || ''
}}</span
><span
class="rail-card-title rail-card-nowrap"
:title="card.title"
>{{ card.title }}</span
></span
><UiBadge
:class="`gev-status-badge--plain rail-card-badge${badgeClassName ? ` ${badgeClassName}` : ''}`"
:hidden="!card.badge"
>{{ card.badge || '' }}</UiBadge
></span
><span class="rail-card-disclosure" aria-hidden="true">{{
open ? '▾' : '▸'
}}</span
><span
:class="`rail-card-compact${card.compactStatus ? ' status' : ''}`"
:hidden="open"
>{{ card.compact || '' }}</span
></template
></UiButton
><div :id="bodyId" class="rail-card-body" :hidden="!open"
><RailCardBlocks
:blocks="card.blocks || []"
+19 -19
View File
@@ -72,45 +72,45 @@ function selectMapSource(chip) {
<div v-if="slot === 'control'" id="control-panel" v-panel-state="'control-panel'" class="panel-collapsible collapsed">
<div class="panel-glow"></div>
<div class="panel-inner">
<button id="control-panel-toggle" class="panel-header dock-tray-toggle" type="button"
<UiButton id="control-panel-toggle" class="panel-header dock-tray-toggle"
data-dock-toggle-target="control-panel" :aria-expanded="String(panels['control-panel']?.collapsed === false)"
aria-controls="control-panel-popover" :aria-label="trayWords('control-panel', t('VISUAL PRESETS'), t('Expand Visual Presets'))" :title="trayWords('control-panel', t('VISUAL PRESETS'), undefined)">
<span class="panel-title"><span class="dock-label-icon dock-label-icon-presets" aria-hidden="true"></span>{{ t('VISUAL PRESETS') }}</span>
<span class="panel-divider"></span>
</button>
</UiButton>
<div id="control-panel-popover" class="dock-popover-content">
<UiButton class="dock-pin-btn" data-pin-target="control-panel" :label="t('Pin visual presets')" :title="t('Keep visual presets open')" :pressed="!!panels['control-panel']?.pinned" @click="pin($event, 'control-panel')"><img src="/pin.svg" alt="" /></UiButton>
<div id="style-buttons" class="button-grid">
<button class="style-btn active" data-style="normal" @click="display.act('setStyle', 'normal')" v-class-toggle="{ ...(style && { active: style.name === 'normal' }) }" :title="t('Show the globe without a visual filter.')">
<UiButton class="style-btn" data-style="normal" :pressed="!style || style.name === 'normal'" pressed-class="active" @click="display.act('setStyle', 'normal')" :title="t('Show the globe without a visual filter.')">
<span class="btn-icon">◯</span>
<span class="btn-label">{{ t('Normal') }}</span>
<span class="btn-key">1</span>
</button>
<button class="style-btn" data-style="retro" @click="display.act('setStyle', 'retro')" v-class-toggle="{ ...(style && { active: style.name === 'retro' }) }" :title="t('Emulate a green phosphor CRT with scanlines and screen curvature.')">
</UiButton>
<UiButton class="style-btn" data-style="retro" :pressed="style?.name === 'retro'" pressed-class="active" @click="display.act('setStyle', 'retro')" :title="t('Emulate a green phosphor CRT with scanlines and screen curvature.')">
<span class="btn-icon">▦</span>
<span class="btn-label">{{ t('CRT') }}</span>
<span class="btn-key">2</span>
</button>
<button class="style-btn" data-style="surveillance" @click="display.act('setStyle', 'surveillance')" v-class-toggle="{ ...(style && { active: style.name === 'surveillance' }) }" :title="t('Simulate night-vision goggles with green intensification and a tube vignette.')">
</UiButton>
<UiButton class="style-btn" data-style="surveillance" :pressed="style?.name === 'surveillance'" pressed-class="active" @click="display.act('setStyle', 'surveillance')" :title="t('Simulate night-vision goggles with green intensification and a tube vignette.')">
<span class="btn-icon">🌙</span>
<span class="btn-label">{{ t('NVG') }}</span>
<span class="btn-key">3</span>
</button>
<button class="style-btn" data-style="thermal" @click="display.act('setStyle', 'thermal')" v-class-toggle="{ ...(style && { active: style.name === 'thermal' }) }" :title="t('Simulate FLIR-style thermal contrast. Turn up Ironbow for color.')">
</UiButton>
<UiButton class="style-btn" data-style="thermal" :pressed="style?.name === 'thermal'" pressed-class="active" @click="display.act('setStyle', 'thermal')" :title="t('Simulate FLIR-style thermal contrast. Turn up Ironbow for color.')">
<span class="btn-icon">🌡️</span>
<span class="btn-label">{{ t('FLIR') }}</span>
<span class="btn-key">4</span>
</button>
<button class="style-btn" data-style="anime" @click="display.act('setStyle', 'anime')" v-class-toggle="{ ...(style && { active: style.name === 'anime' }) }" :title="t('Apply bright cel-shaded color and illustrated outlines.')">
</UiButton>
<UiButton class="style-btn" data-style="anime" :pressed="style?.name === 'anime'" pressed-class="active" @click="display.act('setStyle', 'anime')" :title="t('Apply bright cel-shaded color and illustrated outlines.')">
<span class="btn-icon">✦</span>
<span class="btn-label">{{ t('Anime') }}</span>
<span class="btn-key">5</span>
</button>
<button class="style-btn" data-style="noir" @click="display.act('setStyle', 'noir')" v-class-toggle="{ ...(style && { active: style.name === 'noir' }) }" :title="t('Apply high-contrast monochrome film-noir grading.')">
</UiButton>
<UiButton class="style-btn" data-style="noir" :pressed="style?.name === 'noir'" pressed-class="active" @click="display.act('setStyle', 'noir')" :title="t('Apply high-contrast monochrome film-noir grading.')">
<span class="btn-icon">◐</span>
<span class="btn-label">{{ t('Noir') }}</span>
<span class="btn-key">6</span>
</button>
</UiButton>
</div>
<section class="map-source-section" aria-labelledby="map-source-label">
<div class="map-source-heading">
@@ -134,10 +134,10 @@ function selectMapSource(chip) {
<div class="panel-glow"></div>
<div class="location-inner">
<div class="location-toolbar">
<button id="location-bar-toggle" class="dock-tray-toggle" type="button" data-dock-toggle-target="location-bar" aria-controls="location-bar-popover" :aria-expanded="String(panels['location-bar']?.collapsed === false)" :aria-label="trayWords('location-bar', t('LOCATION'), t('Expand LOCATION'))" :title="trayWords('location-bar', t('LOCATION'), t('Expand LOCATION'))">
<UiButton id="location-bar-toggle" class="dock-tray-toggle" data-dock-toggle-target="location-bar" aria-controls="location-bar-popover" :aria-expanded="String(panels['location-bar']?.collapsed === false)" :aria-label="trayWords('location-bar', t('LOCATION'), t('Expand LOCATION'))" :title="trayWords('location-bar', t('LOCATION'), t('Expand LOCATION'))">
<span class="location-toolbar-label"><span class="dock-label-icon dock-label-icon-location" aria-hidden="true"></span>{{ t('LOCATION') }}</span>
</button>
<button class="panel-collapse-btn" data-collapse-target="location-bar" :title="t('Collapse panel')" @click="chrome.act('toggle', 'location-bar')">+</button>
</UiButton>
<UiButton class="panel-collapse-btn" data-collapse-target="location-bar" :title="t('Collapse panel')" @click="chrome.act('toggle', 'location-bar')">+</UiButton>
</div>
<div id="location-mini-status" class="location-mini-status" aria-live="polite">
<div id="location-mini-city" class="location-mini-city">{{ loc ? loc.status.city : t('📍 Location: --') }}</div>
@@ -150,9 +150,9 @@ function selectMapSource(chip) {
<div class="location-city-row">
<div id="location-pills" class="location-pills"><UiButton v-for="city in loc?.cities" :key="city.id" class="location-pill" :pressed="Boolean(city.active)" pressed-class="active" :data-location-id="city.id" @click="locationControls?.chooseCity(city.id)">{{ city.label }}</UiButton></div>
<div class="location-search-wrap">
<button id="search-toggle" class="search-toggle-btn" :title="t('Search any location')" @click="locationControls?.toggleSearch()">
<UiButton id="search-toggle" class="search-toggle-btn" :title="t('Search any location')" @click="locationControls?.toggleSearch()">
<span>&#x1F50E;</span>
</button>
</UiButton>
<input type="text" id="location-search" v-class-toggle="{ expanded: !!loc?.searchExpanded, searching: !!loc?.searching }" :placeholder="t('Search any location...')" autocomplete="off" spellcheck="false" :aria-label="t('Search location by name or coordinates')" :aria-invalid="loc?.searchOrigin !== 'omnibar' && loc?.searchError ? 'true' : null" :aria-describedby="loc?.searchOrigin !== 'omnibar' && loc?.searchError ? 'location-search-error' : null" />
</div>
</div>
+14 -14
View File
@@ -193,17 +193,17 @@ watch(
<div class="cyber-panel-body ui-scroll" data-rail-scroller>
<UiSearchField v-if="contextSearchOpen" ref="searchInput" v-model="contextSearchText" class="context-search" role="search" input-class="context-search__input" :label="searchHint" :placeholder="searchHint" autocomplete="off" spellcheck="false" :clear-label="t('Clear search')" clear-class="context-search__clear" @escape="closeContextSearch" />
<div v-if="availableTabs.length" class="context-tabs" role="tablist" :aria-label="t('Context tabs')">
<button id="context-tab-btn-view" type="button" role="tab" class="context-tabs__tab" :class="{ active: activeTab === 'view' }" :aria-selected="String(activeTab === 'view')" aria-controls="context-tab-view" :tabindex="activeTab === 'view' ? 0 : -1" @click="activeTab = 'view'" @keydown.left.prevent="switchTab" @keydown.right.prevent="switchTab">
<span class="material-symbols-outlined" aria-hidden="true">visibility</span><span class="context-tabs__label">{{ t('Inspector') }}</span>
</button>
<button id="context-tab-btn-props" type="button" role="tab" class="context-tabs__tab" :class="{ active: activeTab === 'props' }" :aria-selected="String(activeTab === 'props')" aria-controls="context-tab-props" :tabindex="activeTab === 'props' ? 0 : -1" @click="activeTab = 'props'" @keydown.left.prevent="switchTab" @keydown.right.prevent="switchTab">
<span class="material-symbols-outlined" aria-hidden="true">tune</span><span class="context-tabs__label">{{ t('Properties') }}</span>
</button>
<UiButton id="context-tab-btn-view" role="tab" class="context-tabs__tab" :class="{ active: activeTab === 'view' }" :aria-selected="String(activeTab === 'view')" aria-controls="context-tab-view" :tabindex="activeTab === 'view' ? 0 : -1" @click="activeTab = 'view'" @keydown.left.prevent="switchTab" @keydown.right.prevent="switchTab">
<UiIcon name="visibility" :size="null" /><span class="context-tabs__label">{{ t('Inspector') }}</span>
</UiButton>
<UiButton id="context-tab-btn-props" role="tab" class="context-tabs__tab" :class="{ active: activeTab === 'props' }" :aria-selected="String(activeTab === 'props')" aria-controls="context-tab-props" :tabindex="activeTab === 'props' ? 0 : -1" @click="activeTab = 'props'" @keydown.left.prevent="switchTab" @keydown.right.prevent="switchTab">
<UiIcon name="tune" :size="null" /><span class="context-tabs__label">{{ t('Properties') }}</span>
</UiButton>
</div>
<!-- Properties: settings of the layers that are on, one section each. -->
<div id="context-tab-props" class="context-props" :hidden="activeTab !== 'props'" role="tabpanel" aria-labelledby="context-tab-btn-props">
<section v-for="tab in LAYER_TABS" v-show="isShown(tab.id)" :key="tab.id" class="context-props__section">
<h4 class="context-props__heading"><span class="material-symbols-outlined" aria-hidden="true">{{ tab.icon }}</span>{{ t(tab.label) }}</h4>
<h4 class="context-props__heading"><UiIcon :name="tab.icon" :size="null" />{{ t(tab.label) }}</h4>
<ul v-if="affects(tab.id).length" class="context-props__layers">
<li v-for="layer in affects(tab.id)" :key="layer.id"><i :style="{ background: layer.color }" aria-hidden="true"></i>{{ layer.name }}</li>
</ul>
@@ -212,10 +212,10 @@ watch(
</div>
<RadioPanel />
<div class="global-context-modes" role="tablist" :aria-label="t('Context mode')">
<button id="global-context-flights-btn" class="context-mode-button" v-class-toggle="{ active: ctx?.flightsActive }" type="button" role="tab" tabindex="0" :aria-selected="String(ctx?.flightsActive ?? false)" :aria-disabled="ctx && String(ctx.busy)" :aria-busy="ctx && String(ctx.busy)" aria-controls="context-flights-view" :aria-label="t('CONTACTS')" :title="t('Cycles the nearest contacts of whatever type you select — planes, vessels, installations. Satellites track independently.')">
<span class="material-symbols-outlined" aria-hidden="true">radar</span>
<UiButton id="global-context-flights-btn" class="context-mode-button" v-class-toggle="{ active: ctx?.flightsActive }" role="tab" tabindex="0" :aria-selected="String(ctx?.flightsActive ?? false)" :aria-disabled="ctx && String(ctx.busy)" :aria-busy="ctx && String(ctx.busy)" aria-controls="context-flights-view" :aria-label="t('CONTACTS')" :title="t('Cycles the nearest contacts of whatever type you select — planes, vessels, installations. Satellites track independently.')">
<UiIcon name="radar" :size="null" />
<span>{{ t('CONTACTS') }}</span>
</button>
</UiButton>
</div>
<div id="context-mode-standby" class="context-mode-standby" :hidden="ctx?.enabled">
<strong>{{ t('SELECT CONTEXT') }}</strong>
@@ -223,11 +223,11 @@ watch(
</div>
<section id="context-flights-view" class="context-mode-view" role="tabpanel" aria-labelledby="global-context-flights-btn" :hidden="!ctx?.flightsActive">
<div class="global-context-actions" :aria-label="t('Contact Context actions')">
<button id="cockpit-entry" type="button" :hidden="!cockpit?.entryAvailable">
<span class="material-symbols-outlined" aria-hidden="true">{{ entry.icon }}</span>
<UiButton id="cockpit-entry" :hidden="!cockpit?.entryAvailable">
<UiIcon :name="entry.icon" :size="null" />
<span>{{ entry.label }}</span>
</button>
<button id="installations-search-btn" class="panel-layer-toggle" type="button" :aria-disabled="ctx && String(ctx.installationsBusy)" :aria-busy="ctx && String(ctx.installationsBusy)">{{ t('SEARCH NEARBY SITES') }}</button>
</UiButton>
<UiButton id="installations-search-btn" class="panel-layer-toggle" :aria-disabled="ctx && String(ctx.installationsBusy)" :aria-busy="ctx && String(ctx.installationsBusy)">{{ t('SEARCH NEARBY SITES') }}</UiButton>
<UiButton id="tr3b-toggle" class="tr3b-toggle" :pressed="!!cockpit?.tr3b?.converted" :hidden="!cockpit?.tr3b" :aria-label="t('Reclassify tracked contact as TR-3B')" :title="cockpit?.tr3b?.converted ? t('Restore real aircraft') : t('Reclassify as TR-3B')">🛸</UiButton>
</div>
<AwarenessPanel v-if="!contactsMatchCard" />
+2 -1
View File
@@ -2,11 +2,12 @@
import { t } from '../../i18n/index.js';
import { useDisplayStore } from '../stores/display.js';
import DisplayPanel from './panels/DisplayPanel.vue';
import UiButton from '../kit/UiButton.vue';
const display = useDisplayStore();
</script>
<template>
<DisplayPanel />
<button id="clean-view-exit" @click="display.act('exitCleanView')" :title="t('Return UI controls')">{{ t('EXIT CLEAN VIEW') }}</button>
<UiButton id="clean-view-exit" @click="display.act('exitCleanView')" :title="t('Return UI controls')">{{ t('EXIT CLEAN VIEW') }}</UiButton>
</template>
+5 -3
View File
@@ -4,6 +4,8 @@ import { storeToRefs } from 'pinia';
import { useHudStore } from '../stores/hud.js';
import { useCockpitStore } from '../stores/cockpit.js';
import { cockpitEntryFace } from '../cockpitPresentation.js';
import UiButton from '../kit/UiButton.vue';
import UiIcon from '../kit/UiIcon.vue';
// The readouts, visibility, layout variant and colors IntelHUD publishes.
const { hud } = storeToRefs(useHudStore());
@@ -56,10 +58,10 @@ const entry = computed(() =>
<div class="hud-readout"><div id="hud-gsd">{{ view.gsd }}</div></div>
<div class="hud-readout"><div id="hud-alt">{{ view.alt }}</div></div>
<div class="hud-readout"><div id="hud-ais-vessel" :class="['hud-ais-vessel', { active: view.vessel.active }]">{{ view.vessel.text }}</div></div>
<button id="cockpit-entry-readout" type="button" :hidden="!cockpit?.entryAvailable">
<span class="material-symbols-outlined" aria-hidden="true">{{ entry.icon }}</span>
<UiButton id="cockpit-entry-readout" :hidden="!cockpit?.entryAvailable">
<UiIcon :name="entry.icon" :size="null" />
<span>{{ entry.label }}</span>
</button>
</UiButton>
</div>
<div class="hud-bracket">┘</div>
</div>
+1 -1
View File
@@ -78,7 +78,7 @@ const vToastText = {
<!-- Title -->
<div id="title-bar">
<div class="title-glow"></div>
<h1 aria-labelledby="title-wordmark"><button type="button" class="title-logo brand-logo" data-logo-gaze data-logo-src="/logo.svg" :aria-label="t('Back to live at the starting view')" :title="t('Back to live at the starting view')" @click="globeActions.act('home')"><img src="/logo.svg" alt="" /></button> <span id="title-wordmark" translate="no">GOD'S EYE <span class="title-accent">VIEW</span></span></h1>
<h1 aria-labelledby="title-wordmark"><UiButton class="title-logo brand-logo" data-logo-gaze data-logo-src="/logo.svg" :aria-label="t('Back to live at the starting view')" :title="t('Back to live at the starting view')" @click="globeActions.act('home')"><img src="/logo.svg" alt="" /></UiButton> <span id="title-wordmark" translate="no">GOD'S EYE <span class="title-accent">VIEW</span></span></h1>
<p class="subtitle scene-text-holdout">{{ t('NO PLACE LEFT BEHIND') }}</p>
<div v-if="fps" class="frame-rate-readout scene-text-holdout" :hidden="!fps.visible" :title="t('Rendered globe frames per second · toggle with `')">{{ fps.text }}</div>
</div>
+2 -1
View File
@@ -1,6 +1,7 @@
<script setup>
import { storeToRefs } from 'pinia';
import { useCelestialRingStore } from '../../stores/celestialRing.js';
import UiIcon from '../../kit/UiIcon.vue';
// The full-globe sun/moon ring, inside the viewer's container, as the ring
// owner (src/celestialRing.js) presents it.
@@ -44,6 +45,6 @@ const markerStyle = (marker) =>
<template>
<Teleport v-if="ring" :to="ring.container">
<div :key="ring.id" id="celestial-ring-overlay" class="celestial-ring-overlay" :class="{ visible: ring.visible, disabled: !ring.enabled }" aria-hidden="true" :data-globe-visible="ring.globeVisible ?? undefined" :data-ephemeris-updates="ring.ephemerisUpdates ?? undefined"><div class="celestial-ring-outline" :style="outlineStyle(ring.outline)"></div><canvas v-ring-canvas="{ owner: ring.owner, kind: 'sun' }" class="celestial-ring-canvas celestial-sun-canvas" :style="layerStyle(ring.sun)"></canvas><canvas v-ring-canvas="{ owner: ring.owner, kind: 'moon' }" class="celestial-ring-canvas celestial-moon-canvas" :style="layerStyle(ring.moon)"></canvas><span class="celestial-marker celestial-sun material-symbols-outlined" :style="markerStyle(ring.sunMarker)">light_mode</span><span class="celestial-marker celestial-moon material-symbols-outlined" :style="markerStyle(ring.moonMarker)">dark_mode</span></div>
<div :key="ring.id" id="celestial-ring-overlay" class="celestial-ring-overlay" :class="{ visible: ring.visible, disabled: !ring.enabled }" aria-hidden="true" :data-globe-visible="ring.globeVisible ?? undefined" :data-ephemeris-updates="ring.ephemerisUpdates ?? undefined"><div class="celestial-ring-outline" :style="outlineStyle(ring.outline)"></div><canvas v-ring-canvas="{ owner: ring.owner, kind: 'sun' }" class="celestial-ring-canvas celestial-sun-canvas" :style="layerStyle(ring.sun)"></canvas><canvas v-ring-canvas="{ owner: ring.owner, kind: 'moon' }" class="celestial-ring-canvas celestial-moon-canvas" :style="layerStyle(ring.moon)"></canvas><UiIcon class="celestial-marker celestial-sun" name="light_mode" :size="null" :style="markerStyle(ring.sunMarker)" /><UiIcon class="celestial-marker celestial-moon" name="dark_mode" :size="null" :style="markerStyle(ring.moonMarker)" /></div>
</Teleport>
</template>
+8 -8
View File
@@ -20,18 +20,18 @@ const tilted = computed(() => Boolean(camera.value?.tilted));
<template>
<nav id="top-center-actions" :aria-label="t('Globe actions')">
<button id="clear-selected-layers" type="button" :aria-label="clearBusy ? t('Clearing selected data layers') : t('Clear selected data layers')" :aria-disabled="clearBusy == null ? undefined : String(clearBusy)" :aria-busy="clearBusy == null ? undefined : String(clearBusy)" :title="t('Turn off all selected data layers')" @click="act('clear')">
<span class="material-symbols-outlined" aria-hidden="true">layers_clear</span>
</button>
<button id="share-btn" type="button" :aria-label="t('Copy share link')" :title="t('Copy share link')" @click="act('share')">
<UiButton id="clear-selected-layers" :aria-label="clearBusy ? t('Clearing selected data layers') : t('Clear selected data layers')" :aria-disabled="clearBusy == null ? undefined : String(clearBusy)" :aria-busy="clearBusy == null ? undefined : String(clearBusy)" :title="t('Turn off all selected data layers')" @click="act('clear')">
<UiIcon name="layers_clear" :size="null" />
</UiButton>
<UiButton id="share-btn" :aria-label="t('Copy share link')" :title="t('Copy share link')" @click="act('share')">
<span class="share-icon" aria-hidden="true">&#x1F517;</span>
</button>
</UiButton>
<UiButton id="tilt-map-view" :aria-label="tilted ? t('Return map to straight-down view') : t('Tilt map to oblique view')" :pressed="tilted" :title="t('Toggle straight-down and tilted map views')" @click="act('tilt')">
<UiIcon name="view_in_ar" :size="null" />
</UiButton>
<GlobeCompass @click="act('northUp')" />
<button id="reset-globe-view" type="button" :aria-label="resetBusy ? t('Resetting to full globe view') : t('Reset to full globe view')" :title="t('Reset camera and return to full globe view')" @click="act('reset')">
<span class="material-symbols-outlined" aria-hidden="true">public</span>
</button>
<UiButton id="reset-globe-view" :aria-label="resetBusy ? t('Resetting to full globe view') : t('Reset to full globe view')" :title="t('Reset camera and return to full globe view')" @click="act('reset')">
<UiIcon name="public" :size="null" />
</UiButton>
</nav>
</template>
+5 -3
View File
@@ -3,6 +3,8 @@ import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { useGlobeActionsStore } from '../../stores/globeActions.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The north-up button: its needle and label follow the published heading,
// which changes on every frame a rotating camera draws. Before the camera
@@ -20,8 +22,8 @@ const label = computed(() =>
</script>
<template>
<button id="north-up-view" type="button" :aria-label="label" :data-north-up="heading == null ? undefined : String(heading === 0)" :style="heading == null ? undefined : { '--camera-heading': `${heading}deg` }" :title="t('Reset map bearing to north')" @click="$emit('click')">
<UiButton id="north-up-view" :aria-label="label" :data-north-up="heading == null ? undefined : String(heading === 0)" :style="heading == null ? undefined : { '--camera-heading': `${heading}deg` }" :title="t('Reset map bearing to north')" @click="$emit('click')">
<span class="camera-compass-n" aria-hidden="true">N</span>
<span class="camera-compass-needle material-symbols-outlined" aria-hidden="true">navigation</span>
</button>
<UiIcon class="camera-compass-needle" name="navigation" :size="null" />
</UiButton>
</template>
+2 -1
View File
@@ -1,6 +1,7 @@
<script setup>
import { storeToRefs } from 'pinia';
import { useImagerySplitStore } from '../../stores/imagerySplit.js';
import UiButton from '../../kit/UiButton.vue';
// The before/after imagery dividers, as their splits (src/ui/imagerySplit.js)
// present them. Each line is a direct child of the body, above the rails; its
@@ -11,6 +12,6 @@ const optional = (value) => value ?? undefined;
<template>
<Teleport to="body">
<div v-for="split in splits" :key="split.key" :id="optional(split.view.id)" data-globe-overlay :hidden="split.view.hidden"><span class="before" :title="optional(split.view.beforeTitle)">{{ split.view.beforeLabel }}</span><button type="button" :class="optional(split.view.handleClass)" role="slider" :aria-label="optional(split.view.ariaLabel)" aria-valuemin="0" aria-valuemax="100" aria-orientation="horizontal" :aria-valuenow="split.view.valueNow" :aria-valuetext="split.view.valueText" @pointerdown="split.controls.pointerdown($event)" @pointermove="split.controls.pointermove($event)" @pointerup="split.controls.pointerup($event)" @pointercancel="split.controls.pointerup($event)" @keydown="split.controls.keydown($event)">↔</button><span class="after" :title="optional(split.view.afterTitle)">{{ split.view.afterLabel }}</span></div>
<div v-for="split in splits" :key="split.key" :id="optional(split.view.id)" data-globe-overlay :hidden="split.view.hidden"><span class="before" :title="optional(split.view.beforeTitle)">{{ split.view.beforeLabel }}</span><UiButton :class="optional(split.view.handleClass)" role="slider" :aria-label="optional(split.view.ariaLabel)" aria-valuemin="0" aria-valuemax="100" aria-orientation="horizontal" :aria-valuenow="split.view.valueNow" :aria-valuetext="split.view.valueText" @pointerdown="split.controls.pointerdown($event)" @pointermove="split.controls.pointermove($event)" @pointerup="split.controls.pointerup($event)" @pointercancel="split.controls.pointerup($event)" @keydown="split.controls.keydown($event)">↔</UiButton><span class="after" :title="optional(split.view.afterTitle)">{{ split.view.afterLabel }}</span></div>
</Teleport>
</template>
+3 -3
View File
@@ -1,6 +1,7 @@
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue';
import { t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
// A slim index beside the Data Layers list: one tick per group (Movement,
// Cameras, Infrastructure…). Hovering a tick names its group, clicking it
@@ -102,10 +103,9 @@ onBeforeUnmount(() => {
<template>
<nav v-if="sections.length > 1" class="layer-section-index" :aria-label="t('Layer groups')">
<button
<UiButton
v-for="section in sections"
:key="section.i"
type="button"
class="layer-section-index__tick"
:class="{ 'is-current': section.i === current }"
:aria-label="t('Jump to {name}', { name: section.label })"
@@ -115,7 +115,7 @@ onBeforeUnmount(() => {
@mouseleave="hideTip"
@focus="showTip($event, section)"
@blur="hideTip"
></button>
></UiButton>
<Teleport to="body">
<span v-if="tip" class="layer-section-index__label"
:class="{ 'layer-section-index__label--before': tip.before }" :style="{ left: tip.left, top: tip.top }" aria-hidden="true">{{ tip.label }}</span>
+5 -4
View File
@@ -17,6 +17,7 @@ import {
localeOptionCode,
} from '../../localePicker.js';
import { vClassToggle } from '../../rail/classToggle.js';
import UiButton from '../../kit/UiButton.vue';
// The interface language picker. The model in localePicker.js holds the
// list, search, active option and keyboard rules; this renders it and wires
@@ -90,7 +91,7 @@ function close({ restoreFocus = false } = {}) {
render();
globalThis.removeEventListener('keydown', onWindowKeyDown, true);
document.removeEventListener('pointerdown', onDocumentPointerDown, true);
if (restoreFocus) button.value?.focus({ preventScroll: true });
if (restoreFocus) button.value?.$el.focus({ preventScroll: true });
}
// The list is closed on screen before the shell switches.
@@ -179,7 +180,7 @@ function onFocusOut(event) {
}
onMounted(() => {
if (props.focus) button.value?.focus({ preventScroll: true });
if (props.focus) button.value?.$el.focus({ preventScroll: true });
});
onBeforeUnmount(() => close());
@@ -188,11 +189,11 @@ defineExpose({ open, close, isOpen: () => model.open });
<template>
<div id="locale-picker" ref="root" class="locale-picker" v-class-toggle="{ 'is-open': view.open }" @focusout="onFocusOut">
<button ref="button" class="locale-picker-button" type="button" aria-haspopup="listbox" :aria-expanded="String(view.open)" :aria-controls="ids.popup" :aria-label="buttonLabel" :title="t('Change the interface language')" @click="onButtonClick" @keydown="onButtonKeyDown" @keyup="onButtonKeyUp">
<UiButton ref="button" class="locale-picker-button" aria-haspopup="listbox" :aria-expanded="String(view.open)" :aria-controls="ids.popup" :aria-label="buttonLabel" :title="t('Change the interface language')" @click="onButtonClick" @keydown="onButtonKeyDown" @keyup="onButtonKeyUp">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" class="locale-picker-globe"><path v-for="d in LOCALE_PICKER_ICONS.globe.stroke" :key="d" :d="d" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" /></svg>
<span class="locale-picker-code" translate="no" aria-hidden="true">{{ current.toUpperCase() }}</span>
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" class="locale-picker-caret"><path v-for="d in LOCALE_PICKER_ICONS.caret.fill" :key="d" :d="d" fill="currentColor" /></svg>
</button>
</UiButton>
<div :id="ids.popup" class="locale-picker-popup" :hidden="!view.open">
<div :id="ids.heading" class="locale-picker-heading">{{ t('Interface language') }}</div>
<input v-if="model.searchable" ref="search" class="locale-picker-search" type="search" autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" :aria-controls="ids.listbox" :aria-label="t('Search languages')" :placeholder="t('Search languages')" :aria-activedescendant="activeDescendant" @input="onSearchInput" />
+15 -4
View File
@@ -8,7 +8,9 @@ import UiCloseButton from '../../kit/UiCloseButton.vue';
// with the `view` it computes for each step and keeps the parts the template
// never binds: the guide's `visible` class, the callout's entrance replay
// (its `swap` class), place and side, the ring's and the extra rings' boxes,
// and focus. It finds those elements in the rendered tree itself.
// and focus. It finds those elements in the rendered tree itself. The extra
// rings, one per further target of a step, follow the callout; `view.subRings`
// says how many are drawn.
defineProps({
to: { type: Object, required: true },
view: { type: Object, required: true },
@@ -20,6 +22,11 @@ defineProps({
/** A progress segment's attributes: no class at all for one still to come. */
const dot = (name) => (name ? { class: name } : {});
// The buttons' words are the slot of a UiButton, which renders inside the
// button: a step that changes only a label would reach it a tick after the
// owner paints. A slot given under a condition (`redrawWithView`, always
// true) is redrawn whenever this view is, so it keeps up.
const redrawWithView = true;
</script>
<!-- Only line breaks inside tags: the markup has no whitespace between elements. -->
@@ -60,23 +67,27 @@ const dot = (name) => (name ? { class: name } : {});
class="gev-guide-skip"
:hidden="view.skipHidden"
@click="onSkip()"
>{{ view.skipLabel }}</UiButton
><template v-if="redrawWithView" #default>{{ view.skipLabel }}</template></UiButton
><UiButton
class="gev-guide-offer"
:hidden="view.offerHidden"
@click="onOffer()"
>{{ view.offerLabel }}</UiButton
><template v-if="redrawWithView" #default>{{ view.offerLabel }}</template></UiButton
><UiButton
class="gev-guide-next"
:class="{ quiet: view.nextQuiet }"
:hidden="view.nextHidden"
@click="onNext()"
>{{ view.nextLabel }}</UiButton
><template v-if="redrawWithView" #default>{{ view.nextLabel }}</template></UiButton
></span
></div
><p class="gev-guide-status" role="status" aria-live="polite">{{
view.status
}}</p></div
><div
v-for="i in view.subRings"
:key="i"
class="gev-guide-ring gev-guide-ring--sub"></div
></div
></Teleport
></template>
+3 -1
View File
@@ -4,6 +4,8 @@ import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { useDisplayStore } from '../../stores/display.js';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The phone shell's tab bar and sheet backdrop. They join the end of the
// page when the shell first publishes, after the scene's credits, and leave
@@ -19,7 +21,7 @@ const tabs = computed(() =>
<Teleport v-if="phone" to="body">
<div id="mobile-sheet-backdrop" :hidden="!phone.sheet"></div>
<nav id="mobile-tab-bar" :aria-label="t('Panels')" :aria-hidden="String(!phone.enabled)">
<button v-for="tab in tabs" :key="tab.sheet" type="button" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><span class="material-symbols-outlined mobile-tab-icon" aria-hidden="true">{{ tab.icon }}</span><span class="mobile-tab-label">{{ t(tab.label) }}</span></button>
<UiButton v-for="tab in tabs" :key="tab.sheet" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><UiIcon class="mobile-tab-icon" :name="tab.icon" :size="null" /><span class="mobile-tab-label">{{ t(tab.label) }}</span></UiButton>
</nav>
</Teleport>
</template>
+3 -2
View File
@@ -2,6 +2,7 @@
import { storeToRefs } from 'pinia';
import { computed, shallowRef } from 'vue';
import { t, tn } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiDialog from '../../kit/UiDialog.vue';
import { vStatusText } from '../../rail/statusText.js';
import { useSceneSharingStore } from '../../stores/sceneSharing.js';
@@ -47,14 +48,14 @@ const chooserStyle = (focused) => ({ padding: '3px 9px', border: '1px solid #397
<div>
<template v-for="item in bodyItems" :key="item.id">
<p v-if="item.kind === 'text'" style="margin: 8px 0">{{ item.value }}</p>
<button v-else-if="item.kind === 'button'" type="button" :style="buttonStyle" :disabled="item.disabled" v-bind="item.hook ? { [item.hook]: '' } : {}" @click="controls?.click(item.id)">{{ item.label }}</button>
<UiButton v-else-if="item.kind === 'button'" :style="buttonStyle" :disabled="item.disabled" v-bind="item.hook ? { [item.hook]: '' } : {}" @click="controls?.click(item.id)">{{ item.label }}</UiButton>
<label v-else-if="item.type === 'file'" :style="{ display: 'block', position: 'relative' }">{{ item.label }}<input type="file" :aria-label="item.label" :multiple="item.multiple" :webkitdirectory="item.directory || undefined" :style="fileInputStyle" @change="onFiles(item, $event)" @focus="focusedFile = item.id" @blur="focusedFile = null" /><span aria-hidden="true" :style="fileRowStyle"><span :style="chooserStyle(focusedFile === item.id)">{{ t('Choose files') }}</span><span>{{ chosenText(item) }}</span></span></label>
<label v-else style="display: block">{{ item.label }}<textarea v-if="item.multiline" rows="9" dir="ltr" spellcheck="false" :aria-label="item.label" :style="fieldStyle(true)" :value="item.value" @input="controls?.setValue(item.id, $event.target.value)"></textarea><input v-else :type="item.type" :aria-label="item.label" :style="fieldStyle(false)" :value="item.value" @input="controls?.setValue(item.id, $event.target.value)" /></label>
</template>
</div>
<p role="status" v-status-text="statusText"></p>
<div>
<button v-for="item in footerItems" :key="item.id" type="button" :style="buttonStyle" :disabled="item.disabled" :autofocus="item.autofocus || undefined" v-bind="item.hook ? { [item.hook]: '' } : {}" @click="controls?.click(item.id)">{{ item.label }}</button>
<UiButton v-for="item in footerItems" :key="item.id" :style="buttonStyle" :disabled="item.disabled" :autofocus="item.autofocus || undefined" v-bind="item.hook ? { [item.hook]: '' } : {}" @click="controls?.click(item.id)">{{ item.label }}</UiButton>
</div>
</UiDialog>
</template>
+31 -18
View File
@@ -10,7 +10,9 @@ import { shownLayerName } from '../../layerNames.js';
import { entityKind } from '../../../data/entityContext.js';
import SpotConditions from './SpotConditions.vue';
import SunDial from './SunDial.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import AltitudeGraph from './AltitudeGraph.vue';
// What the Context panel shows while nothing is picked: where the camera is
@@ -284,7 +286,7 @@ const distance = (km) =>
<h3 v-if="globeView" class="view-context__title">{{ t('Globe view') }}</h3>
<template v-else>
<header class="view-context__head">
<span class="material-symbols-outlined view-context__icon" aria-hidden="true">visibility</span>
<UiIcon class="view-context__icon" name="visibility" :size="null" />
<div class="view-context__kind">
<span>{{ t('In view') }}</span>
<span class="view-context__sub">{{ t('Nothing selected') }}</span>
@@ -298,11 +300,18 @@ const distance = (km) =>
<div v-if="globeView && worldTiles.length" class="view-context__world">
<h4>{{ t('Worldwide now') }}</h4>
<div class="view-context__world-grid">
<component :is="tile.on ? 'div' : 'button'" v-for="tile in worldTiles" :key="tile.id" :type="tile.on ? undefined : 'button'" class="view-context__world-tile" :class="{ 'is-off': !tile.on }" :title="tile.on ? undefined : t('Turn on {name}', { name: tile.name })" @click="tile.on ? undefined : turnOn(tile)">
<span class="material-symbols-outlined" aria-hidden="true">{{ tile.icon }}</span>
<strong>{{ tile.on ? (tile.count === null ? '…' : formatNumber(tile.count)) : t('Off') }}</strong>
<span>{{ tile.name }}</span>
</component>
<template v-for="tile in worldTiles" :key="tile.id">
<div v-if="tile.on" class="view-context__world-tile">
<UiIcon :name="tile.icon" :size="null" />
<strong>{{ tile.count === null ? '…' : formatNumber(tile.count) }}</strong>
<span>{{ tile.name }}</span>
</div>
<UiButton v-else class="view-context__world-tile is-off" :title="t('Turn on {name}', { name: tile.name })" @click="turnOn(tile)">
<UiIcon :name="tile.icon" :size="null" />
<strong>{{ t('Off') }}</strong>
<span>{{ tile.name }}</span>
</UiButton>
</template>
</div>
</div>
@@ -356,24 +365,28 @@ const distance = (km) =>
<p class="view-context__total">{{ totalLine }}</p>
<div v-for="group in groups" :key="group.layerId" class="view-context__group">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">{{ group.icon }}</span>
<UiIcon :name="group.icon" :size="null" />
<span>{{ shownLayerName(group.layerName, group.layerId) }}</span>
<span class="view-context__count">{{ group.count }}</span>
</h4>
<ul>
<li v-for="item in group.items" :key="item.key">
<button type="button" @click="store.select(item.identity, { fly: true })">
<span
<UiButton @click="store.select(item.identity, { fly: true })">
<!-- A motion glyph is an image with its own name, not decoration. -->
<UiIcon
v-if="motionOf(item)"
class="material-symbols-outlined view-context__row-motion"
class="view-context__row-motion"
:name="motionOf(item).icon"
:size="null"
:data-motion="item.identity.record.motion"
:title="motionOf(item).label()"
role="img"
:aria-label="motionOf(item).label()"
>{{ motionOf(item).icon }}</span>
:aria-hidden="null"
/>
<span class="view-context__row-title">{{ item.title }}</span>
<span class="view-context__row-meta">{{ distance(item.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
</div>
@@ -387,7 +400,7 @@ const distance = (km) =>
<div v-if="shownTowns.length" class="view-context__towns">
<h4>{{ t('Places in view') }}</h4>
<div class="view-context__chips">
<button v-for="town in shownTowns" :key="town.name" type="button" @click="goToTown(town)">{{ town.name }}</button>
<UiButton v-for="town in shownTowns" :key="town.name" @click="goToTown(town)">{{ town.name }}</UiButton>
</div>
</div>
@@ -396,16 +409,16 @@ const distance = (km) =>
<div v-if="offLayers.length && !globeView" class="view-context__towns">
<h4>{{ t('Show here') }}</h4>
<div class="view-context__chips">
<button v-for="layer in offLayers" :key="layer.id" type="button" class="view-context__chip--layer" @click="turnOn(layer)">
<span class="material-symbols-outlined" aria-hidden="true">add</span>{{ layer.name }}
</button>
<UiButton v-for="layer in offLayers" :key="layer.id" class="view-context__chip--layer" @click="turnOn(layer)">
<UiIcon name="add" :size="null" />{{ layer.name }}
</UiButton>
</div>
</div>
<div class="view-context__actions">
<button type="button" class="entity-card__action entity-card__action--ask" @click="store.askAboutView(groups)">
<UiButton class="entity-card__action entity-card__action--ask" @click="store.askAboutView(groups)">
<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 what's here") }}
</button>
</UiButton>
</div>
</section>
</template>