Merge remote-tracking branch 'origin/main' into samehkhamis/kit-sweep-missions-radio

# Conflicts:
#	docs/VUE-MIGRATION.md
#	scripts/format-scope.json
This commit is contained in:
Sameh Khamis committed 2026-11-19 13:50:26 -08:00
commit 0f6db03e12
57 files changed
+1291 -243

No files matched your search

+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>
+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');
+150
View File
@@ -0,0 +1,150 @@
// The AI chat panel's and the voice control's buttons and Material glyphs
// are the kit's: neither their templates nor the voice card and panel
// layout buttons they render hand-write a <button> or a Material Symbols
// span. Their other glyphs (the chat bubble, the globe, attach, send and
// stop, expand and the two Back chevrons) are inline SVG drawn with their own
// strokes, which no Material symbol the page loads draws the same, so they
// stay SVG. The voice panel's Preview and Settings are tabs (`role="tab"`
// with `aria-selected`), not pressed toggles, and DISMISS is a text button,
// not a cross, so it is a UiButton rather than a UiCloseButton. The chat's
// message box, file picker and the minutes field stay native: the kit has
// no text area, file or number field. The voice modules build no controls
// in script.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync, readdirSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
/** A view's template block: everything outside script, style and comments. */
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, '')
.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 views = {
// Settings, the quick prompts, an attachment's remove, Attach layer,
// Attach a file, Expand conversation, the command suggestions, Expand
// chat, Add attachment and Send / Stop reply.
'ChatPanel.vue': {
UiButton: 10,
UiCloseButton: 1,
UiIcon: 1,
UiSelect: 1,
svgs: 5,
},
// The tier button (dock and panel), the mic, Open AI chat, Back to chat,
// Back to voice, the Preview and Settings tabs and DISMISS.
'VoiceControl.vue': {
UiButton: 9,
UiCloseButton: 1,
UiIcon: 2,
UiSelect: 3,
UiCheckbox: 2,
svgs: 3,
},
'VoiceCard.vue': { UiButton: 0, UiCloseButton: 1, UiIcon: 0, svgs: 0 },
// Dock and minimize.
'PanelLayoutButtons.vue': { UiButton: 2, UiIcon: 0, svgs: 2 },
'VoiceVisualizer.vue': { UiButton: 0, UiIcon: 0, svgs: 1 },
};
const markup = Object.fromEntries(
Object.keys(views).map((file) => [file, template(file)]),
);
test('the chat and voice views hand-write no button; each is the kit', () => {
for (const [file, counts] of Object.entries(views)) {
assert.deepEqual(markup[file].match(/<button\b/gi) ?? [], [], file);
for (const name of ['UiButton', 'UiCloseButton', 'UiSelect', 'UiCheckbox'])
assert.equal(tags(markup[file], name).length, counts[name] ?? 0, file);
}
});
test('the pressed toggles take the kit pressed state', () => {
for (const [file, view] of Object.entries(markup))
assert.doesNotMatch(view, /aria-pressed/, file);
const voice = tags(markup['VoiceControl.vue'], 'UiButton');
const tiers = voice.filter((button) => /id="gev-voice-tier"/.test(button));
assert.equal(tiers.length, 2);
for (const tier of tiers)
assert.match(tier, /\s:pressed="Boolean\(view\.tier\.pressed\)"/);
// The mic writes no aria-pressed while its owner has no state for it.
assert.match(
markup['VoiceControl.vue'],
tag(
String.raw`<UiButton\s+id="gev-voice-button"ATTRS\s:pressed="view\.button\.pressed \?\? undefined"`,
),
);
assert.match(
markup['PanelLayoutButtons.vue'],
tag(
String.raw`<UiButton\s+data-layout-dockATTRS\s:pressed="props\.docked"`,
),
);
// The panel tabs are tabs: selected, never pressed.
const tabs = voice.filter((button) => /role="tab"/.test(button));
assert.equal(tabs.length, 2);
for (const button of tabs) {
assert.match(button, /\s:aria-selected="/);
assert.doesNotMatch(button, /\s:pressed=/);
}
});
test('the views hand-write no Material glyph; each is a UiIcon the site sizes', () => {
for (const [file, { UiIcon, svgs }] of Object.entries(views)) {
assert.deepEqual(markup[file].match(/material-symbols/g) ?? [], [], file);
const icons = tags(markup[file], 'UiIcon');
assert.equal(icons.length, UiIcon, file);
// Without it the kit writes an 18px size that beats voice-cost.css and
// voice-card.css.
for (const icon of icons) assert.match(icon, /\s:size="null"/, file);
assert.equal(markup[file].match(/<svg\b/g)?.length ?? 0, svgs, file);
}
assert.match(
markup['ChatPanel.vue'],
/<UiIcon name="settings" class="gev-voice-settings-icon" :size="null" \/>/,
);
assert.equal(
markup['VoiceControl.vue'].match(
/<UiIcon name="(?:visibility|settings)" class="gev-voice-panel-tab-icon" :size="null" \/>/g,
)?.length,
2,
);
});
test('the only native fields left are the message box, file picker and minutes', () => {
const inputs = Object.values(markup).flatMap((view) => tags(view, 'input'));
assert.equal(inputs.length, 2);
assert.match(inputs[0], /id="gev-chat-file" type="file"/);
assert.match(inputs[1], /id="gev-voice-timeout-input" type="number"/);
assert.equal(tags(markup['ChatPanel.vue'], 'textarea').length, 1);
for (const view of Object.values(markup)) {
assert.deepEqual(view.match(/<select\b/gi) ?? [], []);
assert.doesNotMatch(view, /type="(?:checkbox|range)"/);
}
});
test('the voice modules build no buttons or Material glyphs in script', () => {
const root = fileURLToPath(new URL('../../voice/', import.meta.url));
const modules = readdirSync(root, { recursive: true })
.filter((file) => file.endsWith('.js') && !/test|Harness/.test(file))
.map((file) => path.join(root, file));
assert.ok(modules.length > 50);
for (const file of modules) {
const source = readFileSync(file, 'utf8');
assert.doesNotMatch(source, /createElement\(\s*['"]button/, file);
assert.doesNotMatch(source, /<button\b|material-symbols/, file);
}
});
+148
View File
@@ -0,0 +1,148 @@
// The Cockpit HUD's controls and glyphs are the kit's: no Cockpit view
// hand-writes a <button>, a Material Symbols span, a select, a checkbox or a
// range. Its buttons are ghost UiButtons that keep their ids, classes and
// labels for the Cockpit controller's listeners and the cockpit stylesheets;
// its glyphs are UiIcons with `:size="null"`, so those stylesheets still size
// them. The utility strip's −, ◀ ▶ and transport glyphs and the orbital
// zoom's − and + are text characters, not Material symbols, and stay text.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readdirSync, 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, '');
}
const views = {
// The vision selector's Previous, Current and Next, Look ahead, and the
// view switcher's Reset and Exit; the speed and altitude rims' pointers,
// the two vision chevrons, the reticle, the heading caret and the view
// switcher's two glyphs.
'CockpitView.vue': { buttons: 6, icons: 8 },
// Display's and Radio's collapse and launcher buttons, Radio's Enable,
// Previous, Play and Next, and the desktop rail's two items and glyphs.
'panels/CockpitUtilityControls.vue': { buttons: 10, icons: 2 },
// Previous, Next, Auto, the card's collapse and the three page tabs; the
// first, second and fourth draw a glyph.
'panels/CockpitBriefing.vue': { buttons: 7, icons: 3 },
// Previous, Next, the card's collapse and Weather; three of them draw a
// glyph, and the nearest contact's arrow is the fourth.
'panels/CockpitContext.vue': { buttons: 4, icons: 4 },
// A signal row's target and its chevron.
'panels/CockpitSignalList.vue': { buttons: 1, icons: 1 },
// TLE, Nadir, Zoom out, Zoom in and Sensor.
'panels/CockpitOrbital.vue': { buttons: 5, icons: 0 },
// The range step.
'panels/CockpitRadar.vue': { buttons: 1, icons: 0 },
// The flight plan's arrow.
'panels/CockpitRoute.vue': { buttons: 0, icons: 1 },
// Readouts only.
'panels/CockpitProgress.vue': { buttons: 0, icons: 0 },
'panels/CockpitRollingValue.vue': { buttons: 0, icons: 0 },
};
// 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 markup = Object.fromEntries(
Object.keys(views).map((file) => [file, template(file)]),
);
test('every Cockpit view is in the list above', () => {
const dir = (sub) =>
readdirSync(new URL(`../views/${sub}`, import.meta.url))
.filter((name) => /^Cockpit.*\.vue$/.test(name))
.map((name) => sub + name);
assert.deepEqual(
[...dir(''), ...dir('panels/')].sort(),
Object.keys(views).sort(),
);
});
test('the Cockpit views hand-write no button; each is a UiButton', () => {
for (const [file, { buttons }] of Object.entries(views)) {
assert.deepEqual(markup[file].match(/<button\b/gi) ?? [], [], file);
assert.equal(
markup[file].match(/<UiButton\b/g)?.length ?? 0,
buttons,
file,
);
}
});
test('the Cockpit views hand-write no select, checkbox or range', () => {
for (const [file, view] of Object.entries(markup)) {
assert.deepEqual(view.match(/<(select|input)\b/gi) ?? [], [], file);
}
// The compact Radio volume.
assert.equal(
markup['panels/CockpitUtilityControls.vue'].match(/<UiSlider\b/g)?.length,
1,
);
});
test('the pressed toggles take the kit pressed state', () => {
for (const view of Object.values(markup))
assert.doesNotMatch(view, tag(String.raw`<\w+\bATTRS\s:?aria-pressed`));
const pressed = Object.values(markup).flatMap(
(view) =>
view.match(tag(String.raw`<UiButton\bATTRS\s:pressed=ATTRS>`, 'g')) ?? [],
);
// Radio's Enable, the briefing's Auto and the Contact card's Weather.
assert.equal(pressed.length, 3);
for (const button of pressed) assert.match(button, /:pressed="Boolean\(/);
assert.match(
markup['panels/CockpitUtilityControls.vue'],
tag(
String.raw`<UiButton\s+id="cockpit-radio-enable-btn"ATTRS\s:pressed="Boolean\(cockpit\?\.enable\.active\)" pressed-class="active"`,
),
);
assert.match(
markup['panels/CockpitBriefing.vue'],
tag(
String.raw`<UiButton\s+id="cockpit-brief-auto"ATTRS\s:pressed="Boolean\(b\.autoRotate\)"`,
),
);
assert.match(
markup['panels/CockpitContext.vue'],
tag(
String.raw`<UiButton\s+id="cockpit-weather-toggle"ATTRS\s:pressed="Boolean\(c\.weather\)"`,
),
);
});
test('the Cockpit views hand-write no Material glyph; each is a UiIcon', () => {
for (const [file, { icons }] of Object.entries(views)) {
assert.deepEqual(
markup[file].match(/material-symbols-outlined/g) ?? [],
[],
file,
);
const found =
markup[file].match(tag(String.raw`<UiIcon\bATTRS>`, 'g')) ?? [];
assert.equal(found.length, icons, file);
// Without it the kit writes an 18px size that beats the cockpit's rules.
for (const icon of found) assert.match(icon, /\s:size="null"/, file);
}
});
test('the heading caret outranks the kit icon rule that loads after it', () => {
const css = readFileSync(
new URL('../styles/cockpit.css', import.meta.url),
'utf8',
);
// kit.css's `.ui-icon` sets display and line-height with one class and
// loads after cockpit.css, so a one-class caret rule would lose to it.
assert.match(
css,
/\n\.cockpit-compass \.cockpit-heading-caret \{\n {2}display: block;/,
);
assert.doesNotMatch(css, /\n\.cockpit-heading-caret \{/);
});
+126
View File
@@ -0,0 +1,126 @@
// UTILITIES ▸ Draw (its toggle, Clear, the colour swatches and the drawn
// shapes' rows), Import and the Street Level panel are on the kit: none of
// them hand-writes a <button>, a Material Symbols span, a select, a checkbox
// or a range. The Draw toggle is a pressed toggle with `active`. The colour
// swatches are `role="radio"` buttons: they say they are chosen with
// `aria-checked` and their own `active` class, never `aria-pressed`. A drawn
// shape's show/hide renames itself (Show …, Hide …) rather than being pressed.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const source = (file) =>
readFileSync(new URL(`../views/panels/${file}`, import.meta.url), 'utf8');
/** A view's template block: everything outside script, style and comments. */
const template = (file) =>
source(file)
.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 views = {
// Draw and Clear.
'DrawControls.vue': { buttons: 2, icons: 1, closes: 0 },
// The five colours, one v-for.
'DrawSwatches.vue': { buttons: 1, icons: 0, closes: 0 },
// A row's swatch, show/hide, the application's actions and fly to; remove
// is a UiCloseButton.
'DrawMarkList.vue': { buttons: 4, icons: 3, closes: 1 },
// Import and a file's row actions.
'GeoImport.vue': { buttons: 2, icons: 2, closes: 0 },
// The status toggle, EXPAND and the nearest-imagery button; the viewer's
// close. EXPAND's ⤢ ⤡ and the errors' ⚠ are text, not Material symbols.
'StreetLevelPanel.vue': { buttons: 3, icons: 0, closes: 1 },
};
const markup = Object.fromEntries(
Object.keys(views).map((file) => [file, template(file)]),
);
test('the Draw, Import and Street Level views hand-write no button', () => {
for (const [file, { buttons, closes }] of Object.entries(views)) {
const html = markup[file];
assert.deepEqual(html.match(/<button\b/gi) ?? [], [], file);
assert.deepEqual(html.match(/<component\b/gi) ?? [], [], file);
assert.equal(tags(html, 'UiButton').length, buttons, file);
assert.equal(tags(html, 'UiCloseButton').length, closes, file);
}
});
test('they hand-write no select, checkbox or range', () => {
for (const [file, html] of Object.entries(markup)) {
assert.deepEqual(html.match(/<select\b/gi) ?? [], [], file);
assert.doesNotMatch(
html,
tag(String.raw`<input\bATTRS\stype="(?:checkbox|range)"`),
file,
);
}
// SINCE is the kit's range.
assert.equal(tags(markup['StreetLevelPanel.vue'], 'UiSlider').length, 1);
});
test('they hand-write no Material glyph; each is a UiIcon sized by the site', () => {
for (const [file, { icons }] of Object.entries(views)) {
const html = markup[file];
assert.deepEqual(html.match(/material-symbols-outlined/g) ?? [], [], file);
const found = tags(html, '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);
}
// Draw's and Import's glyphs keep pp-icon, which sizes them.
for (const file of ['DrawControls.vue', 'GeoImport.vue']) {
const [icon] = tags(markup[file], 'UiIcon');
assert.match(icon, /\sclass="pp-icon"/, file);
}
});
test('no tag hand-writes aria-pressed; Draw is a pressed toggle with active', () => {
for (const [file, html] of Object.entries(markup))
assert.doesNotMatch(
html,
tag(String.raw`<\w+\bATTRS\s:?aria-pressed`),
file,
);
const [draw] = tags(markup['DrawControls.vue'], 'UiButton').filter((b) =>
/\sid="draw-toggle"/.test(b),
);
assert.match(draw, /\s:pressed="draw\?\.active \?\? false"/);
assert.match(draw, /\spressed-class="active"/);
const [clear] = tags(markup['DrawControls.vue'], 'UiButton').filter((b) =>
/\sid="draw-clear"/.test(b),
);
assert.doesNotMatch(clear, /\s:pressed=/);
// A shape's show/hide says what it does in its name, not by being pressed.
for (const button of tags(markup['DrawMarkList.vue'], 'UiButton'))
assert.doesNotMatch(button, /\s:pressed=/);
});
test('the colour swatches are radios chosen by aria-checked, never pressed', () => {
const [swatch] = tags(markup['DrawSwatches.vue'], 'UiButton');
assert.match(swatch, /\srole="radio"/);
assert.match(
swatch,
/\s:aria-checked="String\(color === props\.modelValue\)"/,
);
assert.match(swatch, /\s:class="\{ active: color === props\.modelValue \}"/);
assert.doesNotMatch(swatch, /\s:pressed=|\spressed-class=/);
});
test('code that focuses a converted button reaches its element', () => {
// A template ref on a component holds the component, not the button.
assert.match(
source('DrawSwatches.vue'),
/:ref="\(swatch\) => \(buttons\[index\] = swatch\?\.\$el\)"/,
);
assert.match(
source('GeoImport.vue'),
/importButton\.value\?\.\$el\.focus\(\)/,
);
});
+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 || []"
+4 -3
View File
@@ -417,9 +417,10 @@ export class ShareRestoration {
this._layerStateRestorePromise = this._layerStateCoordinator.start({
shareLayerState: this._initialShareState?.layerState || null,
shareCreatedAtMs: this._initialShareState?.sharedAtMs ?? null,
// Any valid camera/style share isolates recipient-local preferences,
// including legacy and malformed-v2 layer payloads.
allowLocalState: !this._initialShareState,
// A link restores what it carries; a bare address is a clean start
// with the default layers. Saved layer choices never come back on
// their own, so clearing the address always resets the view.
allowLocalState: false,
});
if (this._initialShareSelectionSuperseded) {
this._layerStateCoordinator.cancelPendingShareTracking(
+3 -1
View File
@@ -703,7 +703,9 @@ html:not([lang='en']) .cockpit-roll-token.is-separator {
color: var(--cockpit-accent);
font-size: 12px;
}
.cockpit-heading-caret {
/* Inside the compass, so it outranks the kit icon's own display and
line height. */
.cockpit-compass .cockpit-heading-caret {
display: block;
height: 20px;
color: var(--cockpit-accent);
+22 -20
View File
@@ -17,6 +17,8 @@ import CockpitProgress from './panels/CockpitProgress.vue';
import CockpitRadar from './panels/CockpitRadar.vue';
import CockpitRollingValue from './panels/CockpitRollingValue.vue';
import CockpitUtilityControls from './panels/CockpitUtilityControls.vue';
import UiButton from '../kit/UiButton.vue';
import UiIcon from '../kit/UiIcon.vue';
// The Cockpit HUD. The Cockpit controller presents the instruments, the
// destination arrow and the vision selector on every HUD update; until it
@@ -171,7 +173,7 @@ const tickStyle = (tick) =>
<span v-for="(tick, index) in hud.speedRim.ticks" :key="index" data-speed-rim-tick :hidden="tick.hidden" :class="{ major: tick.major }" :style="tickStyle(tick)"><b>{{ tick.label }}</b><i></i></span>
</div>
<div class="cockpit-altitude-rim-pointer">
<span class="material-symbols-outlined">arrow_right</span>
<UiIcon name="arrow_right" :size="null" />
<strong id="cockpit-speed-rim-value">{{ hud.speedRim.value }}</strong>
</div>
</div>
@@ -183,7 +185,7 @@ const tickStyle = (tick) =>
</div>
<div class="cockpit-altitude-rim-pointer">
<strong id="cockpit-altitude-rim-value">{{ hud.altitudeRim.value }}</strong>
<span class="material-symbols-outlined">arrow_left</span>
<UiIcon name="arrow_left" :size="null" />
</div>
</div>
<div class="cockpit-topline">
@@ -193,21 +195,21 @@ const tickStyle = (tick) =>
<span id="cockpit-aircraft-meta" v-class-toggle="{ emergency: hud.meta.emergency }" class="cockpit-aircraft-meta" :data-tone="generic ? hud.meta.tone : undefined">{{ hud.meta.text }}</span>
</div>
<div class="cockpit-vision-controls" role="group" :aria-label="t('Cockpit vision style')">
<button id="cockpit-vision-previous" class="cockpit-vision-nav" type="button" :aria-label="t('Previous cockpit vision style')" :title="t('Previous vision style')">
<span class="material-symbols-outlined" aria-hidden="true">chevron_left</span>
<UiButton id="cockpit-vision-previous" class="cockpit-vision-nav" :aria-label="t('Previous cockpit vision style')" :title="t('Previous vision style')">
<UiIcon name="chevron_left" :size="null" />
<small>{{ t('PREV') }}</small>
</button>
<button id="cockpit-vision-current" class="cockpit-vision-current" type="button" :data-cockpit-vision="v.mode" :aria-label="visionLabel" :title="visionTitle">
</UiButton>
<UiButton id="cockpit-vision-current" class="cockpit-vision-current" :data-cockpit-vision="v.mode" :aria-label="visionLabel" :title="visionTitle">
<small>{{ t('CURRENT') }}</small>
<strong id="cockpit-vision-current-label" aria-live="polite">{{ v.label }}</strong>
</button>
<button id="cockpit-vision-next" class="cockpit-vision-nav" type="button" :aria-label="t('Next cockpit vision style')" :title="t('Next vision style')">
</UiButton>
<UiButton id="cockpit-vision-next" class="cockpit-vision-nav" :aria-label="t('Next cockpit vision style')" :title="t('Next vision style')">
<small>{{ t('NEXT') }}</small>
<span class="material-symbols-outlined" aria-hidden="true">chevron_right</span>
</button>
<UiIcon name="chevron_right" :size="null" />
</UiButton>
</div>
</div>
<div v-if="!orbital && !generic" class="cockpit-reticle material-symbols-outlined" aria-hidden="true">my_location</div>
<UiIcon v-if="!orbital && !generic" name="my_location" class="cockpit-reticle" :size="null" />
<!-- A provider's banner: a status that names where the subject is. -->
<div v-if="generic && hud.banner" class="cockpit-banner" role="status" :data-tone="hud.banner.tone">
<strong>{{ hud.banner.title }}</strong>
@@ -216,9 +218,9 @@ const tickStyle = (tick) =>
<!-- A view turned off its rest says where it looks and offers the way back. -->
<div v-if="looks" class="cockpit-look" :hidden="!look.offset">
<span id="cockpit-look-readout" class="cockpit-look-readout" aria-live="polite">{{ look.readout }}</span>
<button id="cockpit-look-ahead" type="button" class="cockpit-look-ahead" :aria-label="aheadLabel" :title="t('Look ahead (Home or 0)')" aria-keyshortcuts="Home 0">
<UiButton id="cockpit-look-ahead" class="cockpit-look-ahead" :aria-label="aheadLabel" :title="t('Look ahead (Home or 0)')" aria-keyshortcuts="Home 0">
<span>{{ t('LOOK AHEAD') }}</span>
</button>
</UiButton>
</div>
<div v-if="!orbital" class="cockpit-compass" :aria-label="generic ? hudLabel : bridge ? t('Current vessel heading') : t('Current aircraft heading')">
<div class="cockpit-instrument-row">
@@ -241,7 +243,7 @@ const tickStyle = (tick) =>
<span class="cockpit-readout-unit">{{ t('FT') }}</span>
</div>
</div>
<span class="cockpit-heading-caret material-symbols-outlined" aria-hidden="true">arrow_drop_down</span>
<UiIcon name="arrow_drop_down" class="cockpit-heading-caret" :size="null" />
<div class="cockpit-compass-tape" id="cockpit-compass-tape" aria-hidden="true" :style="bridge ? { '--tape-shift': tapeShift } : undefined"><span v-for="division in hud.compass" :key="division.heading ?? division.slot" :class="(division.active ?? division.slot === 0) ? 'active' : ''" :style="{ '--slot': division.slot, '--depth': Math.abs(division.slot) }">{{ division.label }}</span><template v-if="bridge"><i v-if="hud.compassMarkers?.prograde != null" class="cockpit-compass-marker cockpit-compass-prograde" aria-hidden="true" :style="{ '--slot': hud.compassMarkers.prograde }"></i><i v-if="hud.compassMarkers?.retrograde != null" class="cockpit-compass-marker cockpit-compass-retrograde" aria-hidden="true" :style="{ '--slot': hud.compassMarkers.retrograde }"></i></template></div>
</div>
<div v-if="!orbital" class="cockpit-position-readout">
@@ -274,13 +276,13 @@ const tickStyle = (tick) =>
</section>
<nav id="view-switcher" :aria-label="t('View switcher')">
<button id="cockpit-reset-globe" type="button" :aria-label="resetBusy ? t('Resetting cockpit to full globe view') : t('Reset cockpit to full globe view')" :title="t('Exit cockpit and return to full globe view')" :hidden="!active" @click="globe.act('reset')">
<span class="material-symbols-outlined" aria-hidden="true">public</span>
<UiButton id="cockpit-reset-globe" :aria-label="resetBusy ? t('Resetting cockpit to full globe view') : t('Reset cockpit to full globe view')" :title="t('Exit cockpit and return to full globe view')" :hidden="!active" @click="globe.act('reset')">
<UiIcon name="public" :size="null" />
<span>{{ t('RESET') }}</span>
</button>
<button id="map-view-switch" type="button" :aria-label="exitLabel" aria-keyshortcuts="Escape" :title="exitLabel" :hidden="!active">
<span class="material-symbols-outlined" aria-hidden="true">close_fullscreen</span>
</UiButton>
<UiButton id="map-view-switch" :aria-label="exitLabel" aria-keyshortcuts="Escape" :title="exitLabel" :hidden="!active">
<UiIcon name="close_fullscreen" :size="null" />
<span>{{ exitText }}</span>
</button>
</UiButton>
</nav>
</template>
+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>
+12 -10
View File
@@ -5,6 +5,8 @@ import { t } from '../../../i18n/index.js';
import { useVoiceStore } from '../../stores/voice.js';
import { ASSISTANT_NAME } from '../../../voice/control.js';
import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSelect from '../../kit/UiSelect.js';
@@ -67,7 +69,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];
<div><strong>{{ t('GEV CHAT') }}</strong><p>{{ t('Ask about the map. Tell it where to go.') }}</p></div>
<div id="gev-chat-header-actions">
<PanelLayoutButtons :docked="props.view.layout.docked" :minimized="props.view.chat.minimized" @dock="emit('layout-dock')" @minimize="emit('chat-minimize')" />
<button v-if="props.view.panel" id="gev-voice-settings-button" class="gev-voice-settings-button" type="button" :aria-label="t('Settings')" :title="t('Settings')" aria-controls="gev-voice-panel" :aria-expanded="String(props.view.voicePanel.settingsExpanded)" @click="emit('settings-button')"><span class="material-symbols-outlined gev-voice-settings-icon" aria-hidden="true">settings</span></button>
<UiButton v-if="props.view.panel" id="gev-voice-settings-button" class="gev-voice-settings-button" :aria-label="t('Settings')" :title="t('Settings')" aria-controls="gev-voice-panel" :aria-expanded="String(props.view.voicePanel.settingsExpanded)" @click="emit('settings-button')"><UiIcon name="settings" class="gev-voice-settings-icon" :size="null" /></UiButton>
<UiCloseButton id="gev-chat-close" :label="t('Close chat')" @click="emit('chat-close')" />
</div>
</header>
@@ -76,7 +78,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];
<svg viewBox="0 0 24 24" width="32" height="32" fill="none" stroke="currentColor" stroke-width="1" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><ellipse cx="12" cy="12" rx="4" ry="10"></ellipse><path d="M2 12h20"></path></svg>
<h3>{{ t('Explore with a question') }}</h3>
<p>{{ t('Find a place, explore live data, or change your view.') }}</p>
<button v-for="prompt in quickPrompts()" :key="prompt" type="button" :hidden="!props.view.chat.quickChecked" @click="emit('chat-prompt', prompt)">{{ prompt }}</button>
<UiButton v-for="prompt in quickPrompts()" :key="prompt" :hidden="!props.view.chat.quickChecked" @click="emit('chat-prompt', prompt)">{{ prompt }}</UiButton>
</div>
<div v-for="message in messages" :key="message.id" class="gev-chat-message" :data-role="message.role">
<small>{{ message.role === 'user' ? t('YOU') : ASSISTANT_NAME }}</small><span>{{ message.text }}</span>
@@ -86,7 +88,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];
<!-- Stays under the status for the whole conversation. -->
<p v-if="props.view.chat.authNote" id="gev-chat-auth-note">{{ props.view.chat.authNote }}</p>
<div id="gev-chat-attachments" :aria-label="t('Attachments')" :hidden="!props.view.chat.attachments.length">
<button v-for="item in props.view.chat.attachments" :key="item.key" type="button" :disabled="props.view.chat.locked" :aria-label="`${t('Remove attachment')}: ${item.name}`" @click="emit('chat-attachment-remove', item.key)">{{ item.name }} ×</button>
<UiButton v-for="item in props.view.chat.attachments" :key="item.key" :disabled="props.view.chat.locked" :aria-label="`${t('Remove attachment')}: ${item.name}`" @click="emit('chat-attachment-remove', item.key)">{{ item.name }} ×</UiButton>
</div>
<div id="gev-chat-attach-menu" :hidden="!props.view.chat.attachMenuOpen" @keydown="emit('chat-attach-keydown', $event)">
<label for="gev-chat-layer">{{ t('Attach a map layer') }}</label>
@@ -95,27 +97,27 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];
<option value="">{{ t('Choose a layer…') }}</option>
<option v-for="layer in props.view.chat.layers" :key="layer.value" :value="layer.value">{{ layer.label }}</option>
</UiSelect>
<button id="gev-chat-layer-attach" type="button" :disabled="props.view.chat.locked || !layerChoice" @click="attachLayer()">{{ t('Attach layer') }}</button>
<UiButton id="gev-chat-layer-attach" :disabled="props.view.chat.locked || !layerChoice" @click="attachLayer()">{{ t('Attach layer') }}</UiButton>
</div>
<button id="gev-chat-file-button" type="button" :disabled="props.view.chat.locked" @click="emit('chat-file-button')">{{ t('Attach a file') }}</button>
<UiButton id="gev-chat-file-button" :disabled="props.view.chat.locked" @click="emit('chat-file-button')">{{ t('Attach a file') }}</UiButton>
<p>{{ t('TXT, Markdown, CSV, JSON or GeoJSON · up to 10 KB in total. Attachments are sent to your AI provider with your message.') }}</p>
<input id="gev-chat-file" type="file" accept=".txt,.md,.csv,.json,.geojson" multiple hidden @change="emit('chat-files', $event.target)" />
</div>
<aside id="gev-chat-mini-reply" :hidden="!props.view.chat.miniReply" :aria-label="t('Latest AI response')">
<header><span translate="no">{{ ASSISTANT_NAME }}</span><button id="gev-chat-expand-reply" type="button" :aria-label="t('Expand conversation')" :title="t('Expand conversation')" @click="emit('chat-restore')"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M14 4h6v6m0-6-7 7M10 20H4v-6m0 6 7-7"></path></svg></button></header>
<header><span translate="no">{{ ASSISTANT_NAME }}</span><UiButton id="gev-chat-expand-reply" :aria-label="t('Expand conversation')" :title="t('Expand conversation')" @click="emit('chat-restore')"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M14 4h6v6m0-6-7 7M10 20H4v-6m0 6 7-7"></path></svg></UiButton></header>
<p id="gev-chat-mini-text" aria-live="polite">{{ props.view.chat.miniReply }}</p>
</aside>
<div id="gev-chat-suggestions" :aria-label="t('Command suggestions')" :hidden="!props.view.chat.suggestions.length">
<div v-for="group in props.view.chat.suggestions" :key="group.label">
<small>{{ group.label }}</small>
<button v-for="command in group.items" :key="command" type="button" :title="command" @click="emit('chat-suggestion', command)">{{ command }}</button>
<UiButton v-for="command in group.items" :key="command" :title="command" @click="emit('chat-suggestion', command)">{{ command }}</UiButton>
</div>
</div>
<form id="gev-chat-form" @submit.prevent="emit('chat-submit')">
<button id="gev-chat-restore" type="button" :aria-label="t('Expand chat')" :title="t('Expand chat')" @click="emit('chat-restore')"><svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-6 4V6a2 2 0 0 1 2-2Z"></path></svg></button>
<button id="gev-chat-attach" type="button" :disabled="props.view.chat.busy" :aria-label="t('Add attachment')" :aria-expanded="String(props.view.chat.attachMenuOpen)" aria-controls="gev-chat-attach-menu" @click="emit('chat-attach-toggle')" @keydown="emit('chat-attach-keydown', $event)"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="m8 12 6-6a3 3 0 0 1 4 4l-8 8a5 5 0 0 1-7-7l9-9"></path></svg></button>
<UiButton id="gev-chat-restore" :aria-label="t('Expand chat')" :title="t('Expand chat')" @click="emit('chat-restore')"><svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-6 4V6a2 2 0 0 1 2-2Z"></path></svg></UiButton>
<UiButton id="gev-chat-attach" :disabled="props.view.chat.busy" :aria-label="t('Add attachment')" :aria-expanded="String(props.view.chat.attachMenuOpen)" aria-controls="gev-chat-attach-menu" @click="emit('chat-attach-toggle')" @keydown="emit('chat-attach-keydown', $event)"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="m8 12 6-6a3 3 0 0 1 4 4l-8 8a5 5 0 0 1-7-7l9-9"></path></svg></UiButton>
<textarea id="gev-chat-input" v-owned-draft="{ text: props.view.chat.draft, revision: props.view.chat.draftRevision }" :rows="props.view.chat.rows" maxlength="4000" :aria-label="t('Message GEV')" :placeholder="t('Ask GEV anything about the map…')" @input="emit('chat-input', $event.target.value)" @keydown="emit('chat-keydown', $event)"></textarea>
<button id="gev-chat-send" :type="props.view.chat.busy ? 'button' : 'submit'" :disabled="props.view.chat.sendDisabled" :data-busy="String(props.view.chat.busy)" :aria-label="props.view.chat.busy ? t('Stop reply') : t('Send message')" :title="props.view.chat.busy ? t('Stop reply') : t('Send message')" @click="props.view.chat.busy && emit('chat-stop')"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path class="gev-chat-enter-icon" d="M19 5v8H5m5-5-5 5 5 5"></path><rect class="gev-chat-stop-icon" x="6" y="6" width="12" height="12" rx="1.5" fill="currentColor" stroke="none"></rect></svg></button>
<UiButton id="gev-chat-send" :type="props.view.chat.busy ? 'button' : 'submit'" :disabled="props.view.chat.sendDisabled" :data-busy="String(props.view.chat.busy)" :aria-label="props.view.chat.busy ? t('Stop reply') : t('Send message')" :title="props.view.chat.busy ? t('Stop reply') : t('Send message')" @click="props.view.chat.busy && emit('chat-stop')"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path class="gev-chat-enter-icon" d="M19 5v8H5m5-5-5 5 5 5"></path><rect class="gev-chat-stop-icon" x="6" y="6" width="12" height="12" rx="1.5" fill="currentColor" stroke="none"></rect></svg></UiButton>
</form>
</section>
</template>
+13 -12
View File
@@ -7,6 +7,7 @@ import { useCockpitStore } from '../../stores/cockpit.js';
import CockpitRoute from './CockpitRoute.vue';
import CockpitSignalList from './CockpitSignalList.vue';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The Cockpit briefing card. The Cockpit controller presents its pages,
// cycle toggle, regional news and local conditions; until it does, the card
@@ -45,17 +46,17 @@ function leaveSignals() {
<strong id="cockpit-brief-subtitle">{{ b.subtitle }}</strong>
</div>
<nav class="cockpit-card-actions cockpit-brief-actions" :aria-label="t('Cockpit briefing controls')">
<button id="cockpit-brief-previous" type="button" :aria-label="t('Previous briefing page')" :title="t('Previous briefing page')">
<span class="material-symbols-outlined" aria-hidden="true">chevron_left</span>
</button>
<UiButton id="cockpit-brief-previous" :aria-label="t('Previous briefing page')" :title="t('Previous briefing page')">
<UiIcon name="chevron_left" :size="null" />
</UiButton>
<span id="cockpit-brief-position" aria-live="polite">{{ b.position }}</span>
<button id="cockpit-brief-next" type="button" :aria-label="t('Next briefing page')" :title="t('Next briefing page')">
<span class="material-symbols-outlined" aria-hidden="true">chevron_right</span>
</button>
<UiButton id="cockpit-brief-next" :aria-label="t('Next briefing page')" :title="t('Next briefing page')">
<UiIcon name="chevron_right" :size="null" />
</UiButton>
<UiButton id="cockpit-brief-auto" :aria-label="b.autoLabel" :pressed="Boolean(b.autoRotate)" :title="b.autoHelp">{{ b.autoLabel }}</UiButton>
<button id="cockpit-signal-toggle" type="button" :aria-label="collapsed ? t('Expand cockpit briefing panel') : t('Collapse cockpit briefing panel')" :aria-expanded="String(!collapsed)" :title="collapsed ? t('Expand briefing panel') : t('Collapse briefing panel')">
<span class="material-symbols-outlined" aria-hidden="true">{{ collapsed ? 'right_panel_open' : 'right_panel_close' }}</span>
</button>
<UiButton id="cockpit-signal-toggle" :aria-label="collapsed ? t('Expand cockpit briefing panel') : t('Collapse cockpit briefing panel')" :aria-expanded="String(!collapsed)" :title="collapsed ? t('Expand briefing panel') : t('Collapse briefing panel')">
<UiIcon :name="collapsed ? 'right_panel_open' : 'right_panel_close'" :size="null" />
</UiButton>
</nav>
</header>
<div class="cockpit-brief-stage">
@@ -83,9 +84,9 @@ function leaveSignals() {
<footer class="cockpit-signal-footer">
<span id="cockpit-brief-source">{{ b.source }}</span>
<nav class="cockpit-brief-tabs" :aria-label="t('Cockpit briefing pages')">
<button type="button" data-cockpit-brief-index="0" :aria-label="t('Show Live Signals')" :aria-current="String(b.pageIndex === 0)">{{ t('SIG') }}</button>
<button type="button" data-cockpit-brief-index="1" :aria-label="t('Show Regional News')" :aria-current="brief ? String(b.pageIndex === 1) : undefined">{{ t('NEWS') }}</button>
<button type="button" data-cockpit-brief-index="2" :aria-label="t('Show Local Info')" :aria-current="brief ? String(b.pageIndex === 2) : undefined">{{ t('LOCAL') }}</button>
<UiButton data-cockpit-brief-index="0" :aria-label="t('Show Live Signals')" :aria-current="String(b.pageIndex === 0)">{{ t('SIG') }}</UiButton>
<UiButton data-cockpit-brief-index="1" :aria-label="t('Show Regional News')" :aria-current="brief ? String(b.pageIndex === 1) : undefined">{{ t('NEWS') }}</UiButton>
<UiButton data-cockpit-brief-index="2" :aria-label="t('Show Local Info')" :aria-current="brief ? String(b.pageIndex === 2) : undefined">{{ t('LOCAL') }}</UiButton>
</nav>
</footer>
</aside>
+11 -10
View File
@@ -6,6 +6,7 @@ import { createContextState } from '../../cockpitContextState.js';
import { vClassToggle } from '../../rail/classToggle.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The Cockpit Contact card. The Cockpit controller presents its scope,
// navigation, cohort counts, nearest contact and weather toggle; until it
@@ -36,15 +37,15 @@ const weatherLabel = computed(() =>
<strong id="cockpit-context-subject">{{ c.subject }}</strong>
</div>
<nav class="cockpit-card-actions cockpit-context-actions" :aria-label="t('Contact navigation')">
<button id="cockpit-context-previous" type="button" :disabled="!c.canPrevious" :aria-label="t('Previous — prior visited contact in the 250 km window')" :title="t('Previous — prior visited contact in the 250 km window')">
<span class="material-symbols-outlined" aria-hidden="true">skip_previous</span>
</button>
<button id="cockpit-context-next" type="button" :disabled="!c.canNext" :aria-label="t('Next — nearest unvisited contact in the 250 km window')" :title="t('Next — nearest unvisited contact in the 250 km window')">
<span class="material-symbols-outlined" aria-hidden="true">skip_next</span>
</button>
<button id="cockpit-context-toggle" type="button" :aria-label="collapsed ? t('Expand Contact panel') : t('Collapse Contact panel')" :aria-expanded="String(!collapsed)" :title="collapsed ? t('Expand contact panel') : t('Collapse contact panel')">
<span class="material-symbols-outlined" aria-hidden="true">{{ collapsed ? 'chevron_right' : 'chevron_left' }}</span>
</button>
<UiButton id="cockpit-context-previous" :disabled="!c.canPrevious" :aria-label="t('Previous — prior visited contact in the 250 km window')" :title="t('Previous — prior visited contact in the 250 km window')">
<UiIcon name="skip_previous" :size="null" />
</UiButton>
<UiButton id="cockpit-context-next" :disabled="!c.canNext" :aria-label="t('Next — nearest unvisited contact in the 250 km window')" :title="t('Next — nearest unvisited contact in the 250 km window')">
<UiIcon name="skip_next" :size="null" />
</UiButton>
<UiButton id="cockpit-context-toggle" :aria-label="collapsed ? t('Expand Contact panel') : t('Collapse Contact panel')" :aria-expanded="String(!collapsed)" :title="collapsed ? t('Expand contact panel') : t('Collapse contact panel')">
<UiIcon :name="collapsed ? 'chevron_right' : 'chevron_left'" :size="null" />
</UiButton>
</nav>
<span class="cockpit-context-qualifier">{{ t('CONTEXT ONLY') }}</span>
</header>
@@ -55,7 +56,7 @@ const weatherLabel = computed(() =>
<div v-class-toggle="{ unknown: c.cohorts['military-installations'].unknown }" role="listitem" data-context-cohort="military-installations"><span>{{ t('SITE') }}</span><strong>{{ c.cohorts['military-installations'].count }}</strong><small translate="no" :title="c.cohorts['military-installations'].source">{{ c.cohorts['military-installations'].source }}</small></div>
</div>
<div class="cockpit-context-nearest">
<span id="cockpit-context-direction" v-class-toggle="{ unknown: c.direction.unknown }" class="material-symbols-outlined" :style="directionStyle" aria-hidden="true">navigation</span>
<UiIcon id="cockpit-context-direction" v-class-toggle="{ unknown: c.direction.unknown }" name="navigation" :size="null" :style="directionStyle" />
<div>
<small>{{ t('NEAREST OBSERVED / MAPPED') }}</small>
<strong id="cockpit-context-nearest-label" :aria-label="c.nearest.ariaLabel ?? undefined">{{ c.nearest.label }}</strong>
+9 -7
View File
@@ -14,6 +14,7 @@ import {
shownOwnerMark,
} from '../../ownerFlag.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import UiButton from '../../kit/UiButton.vue';
// The orbital view's HUD: a nadir reticle over the picture, the satellite's
// identity and orbit, and the optical zoom. The Cockpit controller presents
@@ -118,14 +119,15 @@ const sensorStepShown = computed(
// A focused control that turns off (a zoom button at the end of its range,
// SENSOR as the view tilts away) hands focus on instead of dropping it to the
// page. The watchers run before the re-render, while it still has focus.
// Each ref holds a UiButton, whose element is its `$el`.
const zoomInButton = ref(null);
const zoomOutButton = ref(null);
const sensorButton = ref(null);
const nadirButton = ref(null);
const handFocus = (from, to) => {
if (!from || document.activeElement !== from) return;
if (!from?.$el || document.activeElement !== from.$el) return;
nextTick(() =>
(to() ?? document.getElementById('map-view-switch'))?.focus({
(to()?.$el ?? document.getElementById('map-view-switch'))?.focus({
preventScroll: true,
}),
);
@@ -298,7 +300,7 @@ const lensStyle = computed(() => {
<div v-if="identText" class="cockpit-orbital-ident">
<!-- Wraps between parts, never inside a date. -->
<span class="cockpit-orbital-ident-text"><template v-for="(part, index) in identParts" :key="index"><template v-if="index"> · </template><span class="cockpit-orbital-ident-part">{{ part }}</span></template></span>
<button v-if="tleText" id="cockpit-orbital-tle-toggle" type="button" class="cockpit-orbital-tle-toggle" :aria-expanded="String(tleOpen)" aria-controls="cockpit-orbital-tle" :aria-label="tleOpen ? t('Hide the two-line element set') : t('Show the two-line element set')" :title="tleOpen ? t('Hide the two-line element set') : t('Show the two-line element set')" @click="tleOpen = !tleOpen">{{ t('TLE') }}</button>
<UiButton v-if="tleText" id="cockpit-orbital-tle-toggle" class="cockpit-orbital-tle-toggle" :aria-expanded="String(tleOpen)" aria-controls="cockpit-orbital-tle" :aria-label="tleOpen ? t('Hide the two-line element set') : t('Show the two-line element set')" :title="tleOpen ? t('Hide the two-line element set') : t('Show the two-line element set')" @click="tleOpen = !tleOpen">{{ t('TLE') }}</UiButton>
</div>
<pre v-if="tleText" v-show="tleOpen" id="cockpit-orbital-tle" class="cockpit-orbital-tle" :aria-label="t('Two-line element set')">{{ tleText }}</pre>
<dl class="cockpit-orbital-data">
@@ -319,17 +321,17 @@ const lensStyle = computed(() => {
<!-- Shown only while the view is tilted off nadir: where it looks and the way back. -->
<div v-if="look.offset" class="cockpit-orbital-look">
<span id="cockpit-orbital-look-readout" class="cockpit-orbital-look-readout" :aria-live="look.focus ? 'off' : 'polite'">{{ look.readout }}</span>
<button id="cockpit-orbital-nadir" ref="nadirButton" type="button" class="cockpit-orbital-nadir" :aria-label="t('Return the view to nadir')" :title="t('Return to nadir (Home or 0)')" aria-keyshortcuts="Home 0">{{ t('NADIR') }}</button>
<UiButton id="cockpit-orbital-nadir" ref="nadirButton" class="cockpit-orbital-nadir" :aria-label="t('Return the view to nadir')" :title="t('Return to nadir (Home or 0)')" aria-keyshortcuts="Home 0">{{ t('NADIR') }}</UiButton>
</div>
<p id="cockpit-orbital-focus" class="cockpit-orbital-focus" aria-live="polite">{{ focusText }}</p>
</div>
<div class="cockpit-orbital-optics">
<button id="cockpit-orbital-zoom-out" ref="zoomOutButton" type="button" class="cockpit-orbital-zoom-button" :disabled="atWidest" :aria-label="t('Zoom out')" :title="t('Zoom out (−)')" aria-keyshortcuts="- _">−</button>
<UiButton id="cockpit-orbital-zoom-out" ref="zoomOutButton" class="cockpit-orbital-zoom-button" :disabled="atWidest" :aria-label="t('Zoom out')" :title="t('Zoom out (−)')" aria-keyshortcuts="- _">−</UiButton>
<span class="cockpit-orbital-zoom" aria-live="polite">{{ zoomText }}</span>
<button id="cockpit-orbital-zoom-in" ref="zoomInButton" type="button" class="cockpit-orbital-zoom-button" :disabled="atTightest" :aria-label="t('Zoom in')" :title="t('Zoom in (+)')" aria-keyshortcuts="+ =">+</button>
<UiButton id="cockpit-orbital-zoom-in" ref="zoomInButton" class="cockpit-orbital-zoom-button" :disabled="atTightest" :aria-label="t('Zoom in')" :title="t('Zoom in (+)')" aria-keyshortcuts="+ =">+</UiButton>
<span v-if="swathText" class="cockpit-orbital-swath">{{ swathText }}</span>
<span v-if="sensorText" class="cockpit-orbital-swath cockpit-orbital-sensor-swath">{{ sensorText }}</span>
<button v-if="sensorStepShown" id="cockpit-orbital-sensor" ref="sensorButton" type="button" class="cockpit-orbital-sensor-step" :aria-label="t('Zoom to the imaging sensor swath')" :title="t('Zoom to the imaging sensor swath')">{{ t('SENSOR') }}</button>
<UiButton v-if="sensorStepShown" id="cockpit-orbital-sensor" ref="sensorButton" class="cockpit-orbital-sensor-step" :aria-label="t('Zoom to the imaging sensor swath')" :title="t('Zoom to the imaging sensor swath')">{{ t('SENSOR') }}</UiButton>
</div>
</template>
</section>
+2 -1
View File
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { computed, onBeforeUnmount, ref, watch } from 'vue';
import { formatNumber, t, tn } from '../../../i18n/index.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import UiButton from '../../kit/UiButton.vue';
// The bridge radar: a heading-up scope of nearby AIS vessels, with a line
// where the bridge view looks when it is turned off the bow. The Cockpit
@@ -158,7 +159,7 @@ const rangeAction = computed(() =>
</template>
</div>
<div class="cockpit-radar-readout">
<button id="cockpit-radar-range" type="button" class="cockpit-radar-range" :aria-label="rangeAction" :title="rangeAction">{{ rangeLabel }}</button>
<UiButton id="cockpit-radar-range" class="cockpit-radar-range" :aria-label="rangeAction" :title="rangeAction">{{ rangeLabel }}</UiButton>
<span class="cockpit-radar-rings">{{ ringLabel }}</span>
<span class="cockpit-radar-count">{{ countLabel }}</span>
</div>
+2 -1
View File
@@ -4,6 +4,7 @@ import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { createRouteState } from '../../cockpitInstrumentState.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import UiIcon from '../../kit/UiIcon.vue';
// The Cockpit flight plan card. The Cockpit controller presents the route's
// endpoints and whether a destination direction exists; until it does, the
@@ -39,7 +40,7 @@ const label = computed(() =>
<span>{{ t('FROM') }}</span>
<strong id="cockpit-route-from">{{ r.from }}</strong>
</div>
<span v-if="r.kind !== 'vessel'" class="cockpit-route-arrow material-symbols-outlined" aria-hidden="true">east</span>
<UiIcon v-if="r.kind !== 'vessel'" name="east" class="cockpit-route-arrow" :size="null" />
<div class="cockpit-route-airport">
<span>{{ t('TO') }}</span>
<strong id="cockpit-route-to">{{ r.to }}</strong>
+3 -1
View File
@@ -3,6 +3,8 @@ import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { vFocusSafeChildren } from '../../rail/focusSafeChildren.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The Cockpit's live signal rows. The Cockpit controller presents them;
// until it does, the list is empty. Rows reorder several times a second,
@@ -18,5 +20,5 @@ const rows = computed(() => signals.value ?? []);
</script>
<template>
<ol id="cockpit-signal-list" v-focus-safe-children="leave" class="cockpit-signal-list" aria-live="polite"><li v-for="row in rows" :key="row.key" :class="row.className" :data-signal-key="row.key"><time>{{ row.time }}</time><div><button v-if="row.target" type="button" class="cockpit-signal-target" :data-signal-layer="row.target.layerId" :data-signal-id="row.target.id" :aria-label="row.target.label"><span class="cockpit-signal-target-label">{{ row.title }}</span><span class="cockpit-signal-target-rule" aria-hidden="true"></span><span class="material-symbols-outlined cockpit-signal-target-chevron" aria-hidden="true">chevron_right</span></button><strong v-else>{{ row.title }}</strong><span>{{ row.detail }}</span></div></li></ol>
<ol id="cockpit-signal-list" v-focus-safe-children="leave" class="cockpit-signal-list" aria-live="polite"><li v-for="row in rows" :key="row.key" :class="row.className" :data-signal-key="row.key"><time>{{ row.time }}</time><div><UiButton v-if="row.target" class="cockpit-signal-target" :data-signal-layer="row.target.layerId" :data-signal-id="row.target.id" :aria-label="row.target.label"><span class="cockpit-signal-target-label">{{ row.title }}</span><span class="cockpit-signal-target-rule" aria-hidden="true"></span><UiIcon name="chevron_right" class="cockpit-signal-target-chevron" :size="null" /></UiButton><strong v-else>{{ row.title }}</strong><span>{{ row.detail }}</span></div></li></ol>
</template>
+11 -10
View File
@@ -8,6 +8,7 @@ import { useRadioStore } from '../../stores/radio.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import { useDisplayStore } from '../../stores/display.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The Cockpit's Display and Radio launchers and their popovers, and the
// desktop look's rail, whose icons stay at the edge and open one panel at a
@@ -54,8 +55,8 @@ const radioLabel = computed(() =>
<div class="cockpit-utility-launcher" data-cockpit-launcher="display">
<span>{{ t('DISPLAY') }}</span>
<span class="cockpit-utility-divider" aria-hidden="true"></span>
<button v-if="open.display" type="button" class="cockpit-utility-collapse" :aria-label="t('Collapse panel')" :title="t('Collapse panel')" @click="act('toggleCockpitUtility', 'display', { returnFocus: true })">−</button>
<button id="cockpit-display-toggle-btn" class="cockpit-utility-glyph" type="button" :aria-expanded="String(open.display)" aria-controls="cockpit-display-panel" :aria-label="displayLabel" :title="displayLabel">{{ open.display ? '▶' : '◀' }}</button>
<UiButton v-if="open.display" class="cockpit-utility-collapse" :aria-label="t('Collapse panel')" :title="t('Collapse panel')" @click="act('toggleCockpitUtility', 'display', { returnFocus: true })">−</UiButton>
<UiButton id="cockpit-display-toggle-btn" class="cockpit-utility-glyph" :aria-expanded="String(open.display)" aria-controls="cockpit-display-panel" :aria-label="displayLabel" :title="displayLabel">{{ open.display ? '▶' : '◀' }}</UiButton>
</div>
<div id="cockpit-display-panel" class="cockpit-utility-popover ui-scroll" v-class-toggle="{ 'uses-shared-display-controls': !!cockpitPortal }" role="group" :aria-label="t('Cockpit display options')" :hidden="!open.display">
<div class="cockpit-display-slot" data-cockpit-display-slot="hud"></div>
@@ -68,16 +69,16 @@ const radioLabel = computed(() =>
<div class="cockpit-utility-launcher" data-cockpit-launcher="radio">
<span>{{ t('RADIO') }}</span>
<span class="cockpit-utility-divider" aria-hidden="true"></span>
<button v-if="open.radio" type="button" class="cockpit-utility-collapse" :aria-label="t('Collapse panel')" :title="t('Collapse panel')" @click="act('toggleCockpitUtility', 'radio', { returnFocus: true })">−</button>
<button id="cockpit-radio-toggle-btn" @click="act('toggleCockpitRadio')" class="cockpit-utility-glyph" type="button" :aria-expanded="String(open.radio)" aria-controls="cockpit-radio-panel" :aria-label="radioLabel" :title="radioLabel">{{ open.radio ? '▶' : '◀' }}</button>
<UiButton v-if="open.radio" class="cockpit-utility-collapse" :aria-label="t('Collapse panel')" :title="t('Collapse panel')" @click="act('toggleCockpitUtility', 'radio', { returnFocus: true })">−</UiButton>
<UiButton id="cockpit-radio-toggle-btn" @click="act('toggleCockpitRadio')" class="cockpit-utility-glyph" :aria-expanded="String(open.radio)" aria-controls="cockpit-radio-panel" :aria-label="radioLabel" :title="radioLabel">{{ open.radio ? '▶' : '◀' }}</UiButton>
</div>
<div id="cockpit-radio-panel" class="cockpit-utility-popover cockpit-radio-compact" role="group" :aria-label="t('Cockpit compact Radio controls')" :hidden="!open.radio">
<strong id="cockpit-radio-station" class="cockpit-radio-station">{{ cockpit ? cockpit.station : t('READY') }}</strong>
<UiButton id="cockpit-radio-enable-btn" @click="act('toggleRadio', 'cockpit')" class="panel-layer-toggle" :pressed="cockpit?.enable.active ?? false" pressed-class="active" :aria-label="cockpit?.enable.label" :aria-disabled="cockpit ? String(cockpit.enable.busy) : undefined" :aria-busy="cockpit ? String(cockpit.enable.busy) : undefined">{{ cockpit ? cockpit.enable.text : t('ENABLE') }}</UiButton>
<UiButton id="cockpit-radio-enable-btn" @click="act('toggleRadio', 'cockpit')" class="panel-layer-toggle" :pressed="Boolean(cockpit?.enable.active)" pressed-class="active" :aria-label="cockpit?.enable.label" :aria-disabled="cockpit ? String(cockpit.enable.busy) : undefined" :aria-busy="cockpit ? String(cockpit.enable.busy) : undefined">{{ cockpit ? cockpit.enable.text : t('ENABLE') }}</UiButton>
<div class="cockpit-radio-transport">
<button id="cockpit-radio-prev-btn" @click="act('cycleRadio', -1, { rotate: false })" type="button" :aria-label="t('Previous filtered radio station')" :disabled="radio ? radio.transport.stepDisabled : true">◀◀</button>
<button id="cockpit-radio-play-btn" @click="act('toggleRadioPlayback')" type="button" v-class-toggle="{ active: radio?.transport.play.active }" :aria-label="radio ? radio.transport.play.label : t('Play selected radio station')" :title="cockpit?.play.title" :disabled="radio ? radio.transport.play.disabled : true">{{ cockpit ? cockpit.play.glyph : '▶' }}</button>
<button id="cockpit-radio-next-btn" @click="act('cycleRadio', 1, { rotate: false })" type="button" :aria-label="t('Next filtered radio station')" :disabled="radio ? radio.transport.stepDisabled : true">▶▶</button>
<UiButton id="cockpit-radio-prev-btn" @click="act('cycleRadio', -1, { rotate: false })" :aria-label="t('Previous filtered radio station')" :disabled="radio ? radio.transport.stepDisabled : true">◀◀</UiButton>
<UiButton id="cockpit-radio-play-btn" @click="act('toggleRadioPlayback')" v-class-toggle="{ active: radio?.transport.play.active }" :aria-label="radio ? radio.transport.play.label : t('Play selected radio station')" :title="cockpit?.play.title" :disabled="radio ? radio.transport.play.disabled : true">{{ cockpit ? cockpit.play.glyph : '▶' }}</UiButton>
<UiButton id="cockpit-radio-next-btn" @click="act('cycleRadio', 1, { rotate: false })" :aria-label="t('Next filtered radio station')" :disabled="radio ? radio.transport.stepDisabled : true">▶▶</UiButton>
</div>
<label class="cockpit-radio-volume" for="cockpit-radio-volume">
<span>{{ t('VOLUME') }}</span>
@@ -92,8 +93,8 @@ const radioLabel = computed(() =>
<span>{{ t('RADIO') }}</span>
</span>
<span class="cockpit-utility-rail__icons">
<button type="button" class="cockpit-utility-rail__item" data-cockpit-rail-item="display" :class="{ 'is-on': open.display }" :aria-expanded="String(open.display)" aria-controls="cockpit-display-panel" :aria-label="displayLabel" :title="displayLabel" @click="act('toggleCockpitUtility', 'display')"><span class="material-symbols-outlined" aria-hidden="true">tune</span></button>
<button type="button" class="cockpit-utility-rail__item" data-cockpit-rail-item="radio" :class="{ 'is-on': open.radio }" :aria-expanded="String(open.radio)" aria-controls="cockpit-radio-panel" :aria-label="radioLabel" :title="radioLabel" @click="act('toggleCockpitUtility', 'radio')"><span class="material-symbols-outlined" aria-hidden="true">radio</span></button>
<UiButton class="cockpit-utility-rail__item" data-cockpit-rail-item="display" :class="{ 'is-on': open.display }" :aria-expanded="String(open.display)" aria-controls="cockpit-display-panel" :aria-label="displayLabel" :title="displayLabel" @click="act('toggleCockpitUtility', 'display')"><UiIcon name="tune" :size="null" /></UiButton>
<UiButton class="cockpit-utility-rail__item" data-cockpit-rail-item="radio" :class="{ 'is-on': open.radio }" :aria-expanded="String(open.radio)" aria-controls="cockpit-radio-panel" :aria-label="radioLabel" :title="radioLabel" @click="act('toggleCockpitUtility', 'radio')"><UiIcon name="radio" :size="null" /></UiButton>
</span>
</div>
</aside>
+3 -2
View File
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSegmented from '../../kit/UiSegmented.vue';
import { useDisplayStore } from '../../stores/display.js';
import DrawMarkList from './DrawMarkList.vue';
@@ -27,7 +28,7 @@ const shapeOptions = computed(() => [
<template>
<div class="pp-toggle-group" id="draw-group">
<UiButton class="pp-toggle-btn" :pressed="draw?.active ?? false" pressed-class="active" id="draw-toggle" @click="act('toggleDraw')" :title="t('Draw on the world — click vertices, double-click or Enter to finish, Esc to cancel')">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">draw</span>
<UiIcon class="pp-icon" name="draw" :size="null" />
<span class="pp-label">{{ t('Draw') }}</span>
</UiButton>
<div class="pp-slider-row" :class="{ visible: draw?.active }" id="draw-mode-row">
@@ -36,7 +37,7 @@ const shapeOptions = computed(() => [
</div>
<div class="pp-slider-row" :class="{ visible: draw?.active }" id="draw-label-row">
<span class="draw-hint" id="draw-hint" aria-live="polite">{{ draw?.hint ?? '' }}</span>
<button class="pp-mode-btn draw-clear-btn" id="draw-clear" type="button" @click="act('clearDraw')" :title="t('Remove every mark from the board')">{{ t('Clear') }}</button>
<UiButton class="pp-mode-btn draw-clear-btn" id="draw-clear" @click="act('clearDraw')" :title="t('Remove every mark from the board')">{{ t('Clear') }}</UiButton>
</div>
<DrawMarkList />
</div>
+3 -1
View File
@@ -6,7 +6,9 @@ import { DRAW_COLOR_CSS } from '../../../annotations/drawMarks.js';
import { vFieldValue } from '../../rail/fieldValue.js';
import { vFocusSafeChildren } from '../../rail/focusSafeChildren.js';
import DrawSwatches from './DrawSwatches.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import { useDisplayStore } from '../../stores/display.js';
// UTILITIES ▸ Draw's shapes, one row each like Import's files: the colour
@@ -100,5 +102,5 @@ function leave() {
</script>
<template>
<ul class="geo-import-list draw-mark-list" :class="{ visible: listed }" id="draw-mark-list" v-focus-safe-children="leave" :aria-label="t('Drawn shapes')"><li v-for="row in rows" :key="row.id" class="geo-import-row draw-mark-row" :class="{ 'hidden-mark': row.hidden }" :data-mark-id="row.id" @keydown="onRowKey(row, $event)"><button type="button" class="geo-import-swatch draw-mark-swatch" data-control="swatch" :style="{ background: DRAW_COLOR_CSS[row.color] }" :title="row.labels.swatch" :aria-label="row.labels.swatch" :aria-expanded="String(picking === row.id)" :aria-controls="`draw-mark-colors-${row.id}`" @click="picking = picking === row.id ? null : row.id"></button><DrawSwatches v-if="picking === row.id" :id="`draw-mark-colors-${row.id}`" class="draw-mark-colors" data-control="picker" autofocus :label="row.labels.colors" :model-value="row.color" @update:model-value="recolor(row, $event)" @choose="closePicker(row.id)" /><input type="text" class="geo-import-name draw-mark-name" data-control="name" maxlength="120" autocomplete="off" spellcheck="false" v-field-value="row.name" :placeholder="row.placeholder" :aria-label="row.labels.name" @keydown="onNameKey(row, $event)" @focusout="commit(row, $event.currentTarget)"><button type="button" class="geo-import-action" data-control="toggle" :title="row.labels.toggle" :aria-label="row.labels.toggle" @click="display.act('toggleDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ row.hidden ? 'visibility_off' : 'visibility' }}</span></button><button v-for="action in row.actions" :key="action.id" type="button" class="geo-import-action draw-mark-action" :data-control="`action-${action.id}`" :data-action="action.id" :title="action.label" :aria-label="action.label" :aria-disabled="String(row.busy)" @click="display.act('runDrawMarkAction', row.id, action.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ action.icon }}</span></button><button type="button" class="geo-import-action" data-control="fly" :title="row.labels.fly" :aria-label="row.labels.fly" @click="display.act('flyToDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">my_location</span></button><UiCloseButton class="geo-import-action" glyph="icon" data-control="remove" :title="row.labels.remove" :label="row.labels.remove" @click="display.act('removeDrawMark', row.id)" /><span v-if="row.actions.length" class="draw-mark-note" role="status" :aria-busy="String(row.busy)">{{ row.busy ? '…' : row.note }}</span></li></ul>
<ul class="geo-import-list draw-mark-list" :class="{ visible: listed }" id="draw-mark-list" v-focus-safe-children="leave" :aria-label="t('Drawn shapes')"><li v-for="row in rows" :key="row.id" class="geo-import-row draw-mark-row" :class="{ 'hidden-mark': row.hidden }" :data-mark-id="row.id" @keydown="onRowKey(row, $event)"><UiButton class="geo-import-swatch draw-mark-swatch" data-control="swatch" :style="{ background: DRAW_COLOR_CSS[row.color] }" :label="row.labels.swatch" :aria-expanded="String(picking === row.id)" :aria-controls="`draw-mark-colors-${row.id}`" @click="picking = picking === row.id ? null : row.id" /><DrawSwatches v-if="picking === row.id" :id="`draw-mark-colors-${row.id}`" class="draw-mark-colors" data-control="picker" autofocus :label="row.labels.colors" :model-value="row.color" @update:model-value="recolor(row, $event)" @choose="closePicker(row.id)" /><input type="text" class="geo-import-name draw-mark-name" data-control="name" maxlength="120" autocomplete="off" spellcheck="false" v-field-value="row.name" :placeholder="row.placeholder" :aria-label="row.labels.name" @keydown="onNameKey(row, $event)" @focusout="commit(row, $event.currentTarget)"><UiButton class="geo-import-action" data-control="toggle" :label="row.labels.toggle" @click="display.act('toggleDrawMark', row.id)"><UiIcon :name="row.hidden ? 'visibility_off' : 'visibility'" :size="null" /></UiButton><UiButton v-for="action in row.actions" :key="action.id" class="geo-import-action draw-mark-action" :data-control="`action-${action.id}`" :data-action="action.id" :label="action.label" :aria-disabled="String(row.busy)" @click="display.act('runDrawMarkAction', row.id, action.id)"><UiIcon :name="action.icon" :size="null" /></UiButton><UiButton class="geo-import-action" data-control="fly" :label="row.labels.fly" @click="display.act('flyToDrawMark', row.id)"><UiIcon name="my_location" :size="null" /></UiButton><UiCloseButton class="geo-import-action" glyph="icon" data-control="remove" :title="row.labels.remove" :label="row.labels.remove" @click="display.act('removeDrawMark', row.id)" /><span v-if="row.actions.length" class="draw-mark-note" role="status" :aria-busy="String(row.busy)">{{ row.busy ? '…' : row.note }}</span></li></ul>
</template>
+5 -1
View File
@@ -6,11 +6,15 @@ import {
DRAW_COLOR_CSS,
DRAW_COLOR_NAMES,
} from '../../../annotations/drawMarks.js';
import UiButton from '../../kit/UiButton.vue';
// Draw's five colours as one radio group: the next shape's colour and a
// drawn shape's picker. Only the checked colour is a tab stop; the arrows,
// Home and End move to and choose another, as a radio group's do. Each swatch
// shows its colour from DRAW_COLOR_CSS, the same value the shape is drawn in.
// The swatches are ghost UiButtons with role="radio": they say they are
// chosen with aria-checked and their own `active` class, never aria-pressed,
// and `buttons` keeps their elements for the arrows.
// The template is one line: templates keep whitespace.
const props = defineProps({
modelValue: { type: String, default: 'primary' },
@@ -44,5 +48,5 @@ onMounted(() => {
</script>
<template>
<div class="draw-colors" role="radiogroup" :aria-label="props.label" @keydown="onKey"><button v-for="(color, index) in DRAW_COLORS" :key="color" :ref="(el) => (buttons[index] = el)" type="button" class="draw-color" :class="{ active: color === props.modelValue }" role="radio" :data-color="color" :data-control="`color-${color}`" :aria-checked="String(color === props.modelValue)" :tabindex="color === props.modelValue ? 0 : -1" :style="{ background: DRAW_COLOR_CSS[color] }" :title="t(DRAW_COLOR_NAMES[color])" :aria-label="t(DRAW_COLOR_NAMES[color])" @click="emit('update:modelValue', color), emit('choose', color)"></button></div>
<div class="draw-colors" role="radiogroup" :aria-label="props.label" @keydown="onKey"><UiButton v-for="(color, index) in DRAW_COLORS" :key="color" :ref="(swatch) => (buttons[index] = swatch?.$el)" class="draw-color" :class="{ active: color === props.modelValue }" role="radio" :data-color="color" :data-control="`color-${color}`" :aria-checked="String(color === props.modelValue)" :tabindex="color === props.modelValue ? 0 : -1" :style="{ background: DRAW_COLOR_CSS[color] }" :label="t(DRAW_COLOR_NAMES[color])" @click="emit('update:modelValue', color), emit('choose', color)" /></div>
</template>
+4 -4
View File
@@ -56,16 +56,16 @@ function leave() {
other.querySelector('button');
if (target) return target.focus();
}
importButton.value?.focus();
importButton.value?.$el.focus();
}
</script>
<template>
<div class="pp-toggle-group" id="geo-import-group">
<button ref="importButton" class="pp-toggle-btn" id="geo-import-button" type="button" @click="openPicker" :title="t('Show your own GeoJSON, KML, KMZ or GPX files on the globe (or drop them onto it). File bytes stay on this device; overlays can appear in map screenshots shared with voice.')">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">upload_file</span>
<UiButton ref="importButton" class="pp-toggle-btn" id="geo-import-button" @click="openPicker" :title="t('Show your own GeoJSON, KML, KMZ or GPX files on the globe (or drop them onto it). File bytes stay on this device; overlays can appear in map screenshots shared with voice.')">
<UiIcon class="pp-icon" name="upload_file" :size="null" />
<span class="pp-label">{{ t('Import') }}</span>
</button>
</UiButton>
<input ref="picker" type="file" id="geo-import-input" accept=".geojson,.json,.kml,.kmz,.gpx" multiple hidden @change="pick" :aria-label="t('Choose GeoJSON, KML, KMZ or GPX files')">
<ul class="geo-import-list" :class="{ visible: listed }" id="geo-import-list" v-focus-safe-children="leave" :aria-label="t('Imported files')"><li v-for="row in rows" :key="row.id" class="geo-import-row" :data-import-id="row.id"><span :class="['geo-import-swatch', { 'own-styles': row.ownStyles }]" :style="row.ownStyles ? null : { background: row.color }"></span><span class="geo-import-name" :title="row.title">{{ row.name }}</span><UiButton v-for="item in row.actions" :key="item.action" class="geo-import-action" :data-action="item.action" :label="item.label" :pressed="item.pressed" @click="display.act(ROW_ACTIONS[item.action], row.id)"><UiIcon :name="item.icon" :size="null" /></UiButton></li></ul>
<span class="draw-hint geo-import-hint" id="geo-import-hint" aria-live="polite">{{ geoImport?.hint ?? '' }}</span>
+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>
+7 -6
View File
@@ -11,6 +11,7 @@ import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSelect from '../../kit/UiSelect.js';
// The voice control in the command dock, as its presenter
@@ -79,7 +80,7 @@ const frameStyle = (panel) => ({
<span class="gev-mic-orbit"><img src="/mic.svg" alt="" /></span>
<span class="gev-mic-label">{{ view.mic.text }}</span>
</UiButton>
<button v-if="view.panel" id="gev-chat-button" type="button" :aria-label="t('Open AI chat')" aria-controls="gev-chat-panel" :aria-expanded="String(view.chat.open && !view.chat.minimized)" @click="emit('chat-button')"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-6 4V6a2 2 0 0 1 2-2Z"></path></svg><span class="gev-chat-label">{{ t('CHAT') }}</span></button>
<UiButton v-if="view.panel" id="gev-chat-button" :aria-label="t('Open AI chat')" aria-controls="gev-chat-panel" :aria-expanded="String(view.chat.open && !view.chat.minimized)" @click="emit('chat-button')"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-6 4V6a2 2 0 0 1 2-2Z"></path></svg><span class="gev-chat-label">{{ t('CHAT') }}</span></UiButton>
<ChatPanel v-if="view.panel" :view="view" />
<VoiceVisualizer />
<div class="gev-chat-thinking" aria-hidden="true"><span></span><span></span><span></span></div>
@@ -94,12 +95,12 @@ const frameStyle = (panel) => ({
</div>
<section v-if="view.panel" id="gev-voice-panel" class="gev-voice-panel" :hidden="view.voicePanel.hidden" :data-view="optional(view.voicePanel.view)" :data-minimized="view.voicePanel.minimized ? 'true' : undefined" :data-context="optional(view.voicePanel.context)" :style="frameStyle(view.voicePanel)" :aria-label="t('Voice Settings')" @keydown="emit('panel-keydown', $event)">
<div class="gev-voice-panel-header">
<button id="gev-chat-back" type="button" :hidden="!view.chat.backVisible" @click="emit('chat-back')"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M15 5l-7 7 7 7"></path></svg><span>{{ t('Back to chat') }}</span></button>
<button id="gev-voice-back" type="button" @click="emit('voice-back')"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M15 5l-7 7 7 7"></path></svg><span>{{ t('Back to voice') }}</span></button>
<UiButton id="gev-chat-back" :hidden="!view.chat.backVisible" @click="emit('chat-back')"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M15 5l-7 7 7 7"></path></svg><span>{{ t('Back to chat') }}</span></UiButton>
<UiButton id="gev-voice-back" @click="emit('voice-back')"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M15 5l-7 7 7 7"></path></svg><span>{{ t('Back to voice') }}</span></UiButton>
<span class="gev-voice-panel-title">{{ t('VOICE') }}</span>
<div class="gev-voice-panel-tabs" role="tablist" :aria-label="t('Voice Settings')">
<button id="gev-voice-preview-tab" class="gev-voice-panel-tab" type="button" role="tab" :aria-label="t('Preview')" :title="t('Preview')" :aria-selected="String(view.voicePanel.selected === 'preview')" :tabindex="view.voicePanel.selected === 'preview' ? 0 : -1" aria-controls="gev-voice-preview-panel" @click="emit('tab', 0)" @keydown="emit('tab-keydown', 0, $event)"><span class="material-symbols-outlined gev-voice-panel-tab-icon" aria-hidden="true">visibility</span></button>
<button id="gev-voice-settings-tab" class="gev-voice-panel-tab" type="button" role="tab" :aria-label="t('Settings')" :title="t('Settings')" :aria-selected="String(view.voicePanel.selected === 'settings')" :tabindex="view.voicePanel.selected === 'settings' ? 0 : -1" aria-controls="gev-voice-settings-panel" @click="emit('tab', 1)" @keydown="emit('tab-keydown', 1, $event)"><span class="material-symbols-outlined gev-voice-panel-tab-icon" aria-hidden="true">settings</span></button>
<UiButton id="gev-voice-preview-tab" class="gev-voice-panel-tab" role="tab" :aria-label="t('Preview')" :title="t('Preview')" :aria-selected="String(view.voicePanel.selected === 'preview')" :tabindex="view.voicePanel.selected === 'preview' ? 0 : -1" aria-controls="gev-voice-preview-panel" @click="emit('tab', 0)" @keydown="emit('tab-keydown', 0, $event)"><UiIcon name="visibility" class="gev-voice-panel-tab-icon" :size="null" /></UiButton>
<UiButton id="gev-voice-settings-tab" class="gev-voice-panel-tab" role="tab" :aria-label="t('Settings')" :title="t('Settings')" :aria-selected="String(view.voicePanel.selected === 'settings')" :tabindex="view.voicePanel.selected === 'settings' ? 0 : -1" aria-controls="gev-voice-settings-panel" @click="emit('tab', 1)" @keydown="emit('tab-keydown', 1, $event)"><UiIcon name="settings" class="gev-voice-panel-tab-icon" :size="null" /></UiButton>
</div>
<PanelLayoutButtons :docked="view.layout.docked" :minimized="view.voicePanel.minimized" @dock="emit('layout-dock')" @minimize="emit('voice-minimize')" />
<UiCloseButton id="gev-voice-settings-close" :label="t('Close voice panel')" @click="emit('settings-close')" />
@@ -158,7 +159,7 @@ const frameStyle = (panel) => ({
<div class="gev-voice-error-tray" role="alert" aria-live="assertive">
<div class="gev-voice-error-header">
<span>{{ view.error.typed ? `${t('Chat')} · ${t('ERROR', { context: 'voice' })}` : t('VOICE SYSTEM ERROR') }}</span>
<button class="gev-voice-error-dismiss" type="button" @click="controls?.dismissError()">{{ t('DISMISS') }}</button>
<UiButton class="gev-voice-error-dismiss" @click="controls?.dismissError()">{{ t('DISMISS') }}</UiButton>
</div>
<div id="gev-voice-error-detail">{{ view.error.text }}</div>
<div class="gev-voice-error-hint" :hidden="view.error.typed || view.error.hint === false">{{ t('Check microphone permission and network access, then try again.') }}</div>