mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Merge remote-tracking branch 'origin/main' into samehkhamis/kit-sweep-bhote-koshi
# Conflicts: # scripts/format-scope.json
This commit is contained in:
commit
36ef856ca2
28 files changed
+834
-71
No files matched your search
@@ -92,6 +92,7 @@ out vec2 v_uv;
|
||||
out vec4 v_color;
|
||||
out vec4 v_pickColor;
|
||||
out float v_proxy;
|
||||
out float v_overDepth; // 1 for a row drawn over depth, on the near plane
|
||||
|
||||
// The row's anchor in clip space before screen offsets, for effects that wrap
|
||||
// main() (sonar) and must not change geometry or picks.
|
||||
@@ -125,6 +126,7 @@ void main() {
|
||||
v_uv = vec2(0.0);
|
||||
v_color = vec4(0.0);
|
||||
v_proxy = 0.0;
|
||||
v_overDepth = 0.0;
|
||||
gl_Position = vec4(0.0, 0.0, 2.0, 1.0); // outside the clip volume: not drawn
|
||||
|
||||
float flags = style1.z;
|
||||
@@ -260,14 +262,9 @@ void main() {
|
||||
distanceSq < style3.w * style3.w;
|
||||
if (overDepth && zclip >= -1.0 && zclip <= 1.0) {
|
||||
gl_Position.z = -gl_Position.w;
|
||||
#ifdef LOG_DEPTH
|
||||
// Just past the near plane, not on it: czm_writeLogDepth discards a
|
||||
// fragment at or below 0.9999999, and 1.0 interpolated across the quad
|
||||
// can arrive a rounding step or two under that, dropping the icon for a
|
||||
// frame as it moves (flicker). 1e-4 m past the near plane is still in
|
||||
// front of everything the scene draws.
|
||||
v_depthFromNearPlusOne = 1.0001;
|
||||
#endif
|
||||
// With a log depth buffer the fragment shader writes the near plane's
|
||||
// depth itself.
|
||||
v_overDepth = 1.0;
|
||||
}
|
||||
|
||||
v_uv = mix(rect.xy, rect.zw, vec2(corner.x * 0.5 + 0.5, 0.5 - corner.y * 0.5));
|
||||
@@ -282,6 +279,7 @@ in vec2 v_uv;
|
||||
in vec4 v_color;
|
||||
in vec4 v_pickColor;
|
||||
in float v_proxy;
|
||||
in float v_overDepth;
|
||||
|
||||
void main() {
|
||||
vec4 color = czm_gammaCorrect(texture(u_atlas, v_uv));
|
||||
@@ -296,7 +294,16 @@ void main() {
|
||||
#endif
|
||||
out_FragColor = color;
|
||||
#ifdef LOG_DEPTH
|
||||
czm_writeLogDepth(v_depthFromNearPlusOne);
|
||||
// Over depth: exactly the near plane's depth, written here and not through
|
||||
// czm_writeLogDepth. That function discards a fragment whose interpolated
|
||||
// depth arrives a rounding step under the near plane (the icon drops for a
|
||||
// frame as it moves), and any depth past the near plane is a surface to
|
||||
// Cesium's depth pick: the camera controller then sizes a zoom step from an
|
||||
// icon under the canvas centre, a near plane's distance away, and the wheel
|
||||
// stops zooming. The pick reads a depth of 0 as nothing drawn, and keeps
|
||||
// the depth of the ground under the icon.
|
||||
if (v_overDepth > 0.5) gl_FragDepth = 0.0;
|
||||
else czm_writeLogDepth(v_depthFromNearPlusOne);
|
||||
#endif
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import fs from 'node:fs';
|
||||
import * as Cesium from 'cesium';
|
||||
import { createIconSet } from '../../data/iconSet.js';
|
||||
import { IconSetPrimitive } from './iconSetPrimitive.js';
|
||||
@@ -58,3 +59,29 @@ test('by default the set draws an opaque pass and a translucent one, and draws n
|
||||
assert.equal(translucent.renderState.depthMask, false);
|
||||
assert.equal(primitive.drawsBlend('translucent'), false);
|
||||
});
|
||||
|
||||
test('an over-depth row writes a depth of exactly 0, which a depth pick ignores', () => {
|
||||
// Shaders do not compile under node: this reads the fragment shader's
|
||||
// source. A depth past the near plane (as 1.0001 through
|
||||
// czm_writeLogDepth was) is a surface to Cesium's depth pick, a near
|
||||
// plane's distance from the camera, and the wheel stops zooming with an
|
||||
// icon under the canvas centre (scripts/qa-zoom-under-icon.mjs).
|
||||
const source = fs.readFileSync(
|
||||
new URL('./iconSetPrimitive.js', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
const [vertex, fragment] = source
|
||||
.slice(source.indexOf('const VERTEX_SHADER'))
|
||||
.split('const FRAGMENT_SHADER')
|
||||
.map((shader) => shader.replace(/\/\/.*$/gm, '')); // comments out
|
||||
assert.match(
|
||||
fragment,
|
||||
/if \(v_overDepth > 0\.5\) gl_FragDepth = 0\.0;\s+else czm_writeLogDepth\(v_depthFromNearPlusOne\);/,
|
||||
);
|
||||
// The vertex shader flags the row and leaves its log depth alone.
|
||||
assert.match(
|
||||
vertex,
|
||||
/gl_Position\.z = -gl_Position\.w;[^}]*v_overDepth = 1\.0;/,
|
||||
);
|
||||
assert.doesNotMatch(vertex, /v_depthFromNearPlusOne\s*=/);
|
||||
});
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
@@ -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\(\)/,
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,142 @@
|
||||
// The space missions, Contacts, Radio and provider settings controls are the
|
||||
// kit's: none of their views hand-writes a <button>, a Material Symbols span,
|
||||
// a select or a checkbox. Radio's Enable, the RTL-SDR card's Connect and its
|
||||
// FM and ADS-B modes are pressed toggles with `active`; Radio's Play and the
|
||||
// card's Locate keep their own `active` class, since their words change
|
||||
// with their state rather than saying they are pressed. The RTL-SDR card's
|
||||
// FM frequency stays a native number field (the kit has none), and the radio
|
||||
// tuner's range stays native: its owner moves the handle back to the
|
||||
// selected station on a drag's first input without changing the slot.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
/** A view's template block: everything outside script, style and comments. */
|
||||
function template(file) {
|
||||
const source = readFileSync(
|
||||
new URL(`../views/${file}`, import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
return source
|
||||
.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
|
||||
.replace(/<!--[\s\S]*?-->/g, '');
|
||||
}
|
||||
// A tag's attributes, read past quoted values so a handler's `=>` does not
|
||||
// end the tag early.
|
||||
const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
|
||||
const tag = (pattern, flags = '') =>
|
||||
new RegExp(pattern.replaceAll('ATTRS', ATTRS), flags);
|
||||
const tags = (markup, name) =>
|
||||
markup.match(tag(String.raw`<${name}\bATTRS>`, 'g')) ?? [];
|
||||
const byId = (markup, name, id) => {
|
||||
const found = tags(markup, name).filter((t) =>
|
||||
new RegExp(String.raw`\sid="${id}"`).test(t),
|
||||
);
|
||||
assert.equal(found.length, 1, id);
|
||||
return found[0];
|
||||
};
|
||||
|
||||
// Each view's UiButtons, UiCloseButtons, UiIcons, UiSelects and UiSliders.
|
||||
const VIEWS = {
|
||||
// FOCUS, REPLAY ASCENT, the replay's pause, PREV, NEXT and SHOW ALL; the
|
||||
// header's deselect and the replay's Cancel close.
|
||||
'panels/MissionDetail.vue': [6, 2, 0, 0, 1],
|
||||
// A mission's row.
|
||||
'panels/MissionRoster.vue': [1, 0, 0, 0, 0],
|
||||
'panels/MissionReplayOverlay.vue': [0, 0, 0, 0, 0],
|
||||
'panels/SpaceMissionsPanel.vue': [0, 0, 0, 0, 0],
|
||||
// PREV, FOCUS, NEXT and a contact's row.
|
||||
'panels/AwarenessPanel.vue': [4, 0, 0, 0, 0],
|
||||
'panels/AwarenessDirection.vue': [0, 0, 0, 0, 0],
|
||||
'panels/AwarenessNames.vue': [0, 0, 0, 0, 0],
|
||||
// Connect, Locate, Change device, FM, ADS-B, Tune and the two seeks.
|
||||
'panels/SdrCard.vue': [8, 0, 0, 1, 1],
|
||||
// Enable, PREV, PLAY, NEXT and STOP.
|
||||
'panels/RadioPanel.vue': [5, 0, 0, 1, 1],
|
||||
'panels/RadioTuner.vue': [0, 0, 0, 0, 0],
|
||||
// The POWER UP chip and its bolt, a key's REMOVE, the voice auth toggle
|
||||
// and SAVE KEYS; the dialog's close.
|
||||
'ProviderSettingsView.vue': [4, 1, 1, 0, 0],
|
||||
};
|
||||
const views = Object.entries(VIEWS).map(([file, counts]) => ({
|
||||
file,
|
||||
markup: template(file),
|
||||
counts,
|
||||
}));
|
||||
|
||||
test('they hand-write no button; each is a UiButton or UiCloseButton', () => {
|
||||
for (const { file, markup, counts } of views) {
|
||||
assert.deepEqual(markup.match(/<button\b/gi) ?? [], [], file);
|
||||
assert.deepEqual(markup.match(/<component\b/gi) ?? [], [], file);
|
||||
assert.equal(tags(markup, 'UiButton').length, counts[0], file);
|
||||
assert.equal(tags(markup, 'UiCloseButton').length, counts[1], file);
|
||||
}
|
||||
});
|
||||
|
||||
test('they hand-write no Material glyph; each is a UiIcon sized by its site', () => {
|
||||
for (const { file, markup, counts } of views) {
|
||||
assert.deepEqual(
|
||||
markup.match(/material-symbols-outlined/g) ?? [],
|
||||
[],
|
||||
file,
|
||||
);
|
||||
const icons = tags(markup, 'UiIcon');
|
||||
assert.equal(icons.length, counts[2], file);
|
||||
// Without it the kit writes an 18px size that beats the site rules.
|
||||
for (const icon of icons) assert.match(icon, /\s:size="null"/, file);
|
||||
}
|
||||
});
|
||||
|
||||
test('their selects and ranges are the kit’s, apart from the tuner', () => {
|
||||
for (const { file, markup, counts } of views) {
|
||||
assert.deepEqual(markup.match(/<select\b/gi) ?? [], [], file);
|
||||
assert.doesNotMatch(markup, /type="checkbox"/, file);
|
||||
assert.equal(tags(markup, 'UiSelect').length, counts[3], file);
|
||||
assert.equal(tags(markup, 'UiSlider').length, counts[4], file);
|
||||
const ranges = tags(markup, 'input').filter((i) =>
|
||||
/\stype="range"/.test(i),
|
||||
);
|
||||
assert.equal(ranges.length, file === 'panels/RadioTuner.vue' ? 1 : 0, file);
|
||||
}
|
||||
});
|
||||
|
||||
test('no tag hand-writes aria-pressed; the pressed toggles take :pressed', () => {
|
||||
const pressed = {
|
||||
'panels/MissionDetail.vue': 1,
|
||||
'panels/SdrCard.vue': 3,
|
||||
'panels/RadioPanel.vue': 1,
|
||||
};
|
||||
for (const { file, markup } of views) {
|
||||
assert.doesNotMatch(
|
||||
markup,
|
||||
tag(String.raw`<\w+\bATTRS\s(?:v-bind)?:?aria-pressed`),
|
||||
file,
|
||||
);
|
||||
const toggles = tags(markup, 'UiButton').filter((b) =>
|
||||
/\s:pressed=/.test(b),
|
||||
);
|
||||
assert.equal(toggles.length, pressed[file] ?? 0, file);
|
||||
}
|
||||
const sdr = views.find((v) => v.file === 'panels/SdrCard.vue').markup;
|
||||
const radio = views.find((v) => v.file === 'panels/RadioPanel.vue').markup;
|
||||
for (const [markup, id] of [
|
||||
[sdr, 'sdr-connect-btn'],
|
||||
[sdr, 'sdr-mode-fm-btn'],
|
||||
[sdr, 'sdr-mode-adsb-btn'],
|
||||
[radio, 'radio-enable-btn'],
|
||||
])
|
||||
assert.match(byId(markup, 'UiButton', id), /\spressed-class="active"/, id);
|
||||
});
|
||||
|
||||
test('Play and Locate keep their own active class rather than pressed', () => {
|
||||
const sdr = views.find((v) => v.file === 'panels/SdrCard.vue').markup;
|
||||
const radio = views.find((v) => v.file === 'panels/RadioPanel.vue').markup;
|
||||
for (const [markup, id] of [
|
||||
[radio, 'radio-play-btn'],
|
||||
[sdr, 'sdr-locate-btn'],
|
||||
]) {
|
||||
const button = byId(markup, 'UiButton', id);
|
||||
assert.doesNotMatch(button, /\s:pressed=/, id);
|
||||
assert.match(button, /\sv-class-toggle="\{ active: /, id);
|
||||
}
|
||||
});
|
||||
@@ -68,7 +68,7 @@ test('before RadioControls renders, the panel shows its initial markup', (t) =>
|
||||
assert.equal($('radio-filter').options.length, 1);
|
||||
assert.equal($('radio-filter').options[0].value, 'all');
|
||||
assert.equal($('radio-filter').options[0].textContent, 'All');
|
||||
assert.equal($('radio-play-btn').getAttribute('class'), null);
|
||||
assert.equal(coreClasses($('radio-play-btn')), '');
|
||||
assert.equal($('radio-play-btn').disabled, true);
|
||||
assert.equal($('radio-volume').value, '80');
|
||||
assert.equal($('radio-volume-value').textContent, '80%');
|
||||
@@ -120,7 +120,7 @@ test('the panel renders the presented directory, station, transport and playback
|
||||
assert.equal($('radio-station-homepage').getAttribute('href'), 'https://example.org/');
|
||||
assert.equal($('radio-station-homepage').hidden, false);
|
||||
const play = $('radio-play-btn');
|
||||
assert.equal(play.className, 'active');
|
||||
assert.equal(coreClasses(play), 'active');
|
||||
assert.equal(play.textContent, 'PAUSE');
|
||||
assert.equal(play.getAttribute('aria-label'), 'Pause selected radio station');
|
||||
assert.equal($('radio-prev-btn').disabled, false);
|
||||
@@ -128,7 +128,7 @@ test('the panel renders the presented directory, station, transport and playback
|
||||
assert.equal($('radio-playback-state').textContent, 'Playing KJAZ');
|
||||
|
||||
await render({ audioState: 'error', filter: 'all' });
|
||||
assert.equal(play.className, '');
|
||||
assert.equal(coreClasses(play), '');
|
||||
assert.equal($('radio-playback-state').className, 'radio-playback-state error');
|
||||
assert.equal($('radio-station-homepage').hasAttribute('href'), false);
|
||||
assert.equal($('radio-station-homepage').hidden, true);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -8,7 +8,9 @@ import { vStatusText } from '../rail/statusText.js';
|
||||
import { useLocaleStore } from '../stores/locale.js';
|
||||
import { useProviderSettingsStore } from '../stores/providerSettings.js';
|
||||
import LocalePicker from './panels/LocalePicker.vue';
|
||||
import UiButton from '../kit/UiButton.vue';
|
||||
import UiCloseButton from '../kit/UiCloseButton.vue';
|
||||
import UiIcon from '../kit/UiIcon.vue';
|
||||
|
||||
const { picker } = storeToRefs(useLocaleStore());
|
||||
// The key setup owner (src/keySetup.js) presents the chip, the dialog and its
|
||||
@@ -39,10 +41,10 @@ const removeTitle = (title) =>
|
||||
<!-- Bottom-right HUD row: the POWER UP chip (while keys are missing) and
|
||||
the language picker, once the shell publishes it. -->
|
||||
<div id="corner-actions">
|
||||
<button v-if="available" id="key-setup-chip" type="button" :hidden="!chip || chip.hidden" aria-haspopup="dialog" aria-controls="key-setup" :title="chip?.title" :aria-label="chip?.title" @click="controls?.open()">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">bolt</span>
|
||||
<UiButton v-if="available" id="key-setup-chip" :hidden="!chip || chip.hidden" aria-haspopup="dialog" aria-controls="key-setup" :title="chip?.title" :aria-label="chip?.title" @click="controls?.open()">
|
||||
<UiIcon name="bolt" :size="null" />
|
||||
<span data-key-setup-chip-label>{{ chip ? chip.label : t('POWER UP') }}</span>
|
||||
</button>
|
||||
</UiButton>
|
||||
<LocalePicker v-if="picker" :key="picker.current" :current="picker.current" :on-select="picker.onSelect" :focus="picker.focus" />
|
||||
</div>
|
||||
<aside v-if="available" id="key-setup" role="dialog" aria-labelledby="key-setup-title" aria-describedby="key-setup-description" :hidden="dialog.hidden" v-class-toggle="{ visible: dialog.visible }" :data-ready="view?.ready ? 'true' : undefined" @transitionend="controls?.transitionEnd()">
|
||||
@@ -66,16 +68,16 @@ const removeTitle = (title) =>
|
||||
<p class="key-setup-unlocks">{{ key.unlocks }}</p>
|
||||
<div v-if="!key.external" class="key-setup-fields">
|
||||
<input v-for="envVar in key.envVars" :key="envVar" type="password" autocomplete="off" spellcheck="false" :data-env-var="envVar" :aria-label="envVar" :placeholder="key.set ? t('{envVar} saved — paste to replace', { envVar }) : t('paste {envVar}', { envVar })" v-field-value="view.fields[envVar] ?? ''" @input="controls?.setField(envVar, $event.target.value)" />
|
||||
<button v-if="key.managed === 'file'" type="button" class="key-setup-remove" :data-key-setup-remove="JSON.stringify(key.envVars)" :title="removeTitle(key.title)" @click="controls?.remove(key.envVars)">{{ t('REMOVE') }}</button>
|
||||
<UiButton v-if="key.managed === 'file'" class="key-setup-remove" :data-key-setup-remove="JSON.stringify(key.envVars)" :title="removeTitle(key.title)" @click="controls?.remove(key.envVars)">{{ t('REMOVE') }}</UiButton>
|
||||
</div>
|
||||
<div v-if="key.id === 'openai'" class="key-setup-cloud-auth">
|
||||
<span class="key-setup-cloud-auth-state">{{ view.auth.mode === 'oauth' ? t('VOICE AUTH · CHATGPT OAUTH') : t('VOICE AUTH · API KEY') }}</span>
|
||||
<button type="button" class="key-setup-cloud-auth-toggle" data-cloud-voice-auth-toggle="true" :title="view.auth.mode === 'oauth' ? t('Use OPENAI_API_KEY for the next cloud voice session') : t('Use the signed-in local ChatGPT/Codex OAuth session for the next cloud voice session')" :aria-disabled="String(view.auth.busy)" @click="controls?.toggleAuth()">{{ view.auth.mode === 'oauth' ? t('USE API KEY') : t('USE CHATGPT OAUTH') }}</button>
|
||||
<UiButton class="key-setup-cloud-auth-toggle" data-cloud-voice-auth-toggle="true" :title="view.auth.mode === 'oauth' ? t('Use OPENAI_API_KEY for the next cloud voice session') : t('Use the signed-in local ChatGPT/Codex OAuth session for the next cloud voice session')" :aria-disabled="String(view.auth.busy)" @click="controls?.toggleAuth()">{{ view.auth.mode === 'oauth' ? t('USE API KEY') : t('USE CHATGPT OAUTH') }}</UiButton>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="key-setup-footer">
|
||||
<button type="button" class="key-setup-apply" data-key-setup-apply :aria-disabled="view?.saving == null ? undefined : String(view.saving)" @click="controls?.apply()">{{ t('SAVE KEYS') }}</button>
|
||||
<UiButton class="key-setup-apply" data-key-setup-apply :aria-disabled="view?.saving == null ? undefined : String(view.saving)" @click="controls?.apply()">{{ t('SAVE KEYS') }}</UiButton>
|
||||
<span class="key-setup-hint">{{ t('ESC to close') }}</span>
|
||||
</div>
|
||||
<p class="key-setup-note" data-key-setup-status role="status" aria-live="polite" v-status-text="statusText"></p>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
|
||||
import { onBeforeUpdate, onUpdated, ref } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { useContextStore } from '../../stores/context.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
import AwarenessNames from './AwarenessNames.vue';
|
||||
|
||||
// The Contacts panel inside Context. The Contacts layer publishes its view
|
||||
@@ -66,16 +67,16 @@ onUpdated(() => {
|
||||
</a>
|
||||
<AwarenessNames v-if="view.subjectNames" :names="view.subjectNames" />
|
||||
<div class="military-awareness-controls" role="group" :aria-label="view.navigation.label">
|
||||
<button type="button" data-awareness-action="previous" :title="view.navigation.previous.title" :disabled="view.navigation.previous.disabled" @click="layer?.navigatePrevious(user)">{{ view.navigation.previous.text }}</button>
|
||||
<button type="button" data-awareness-action="focus" @click="layer?.focusCurrent(user)">{{ view.navigation.focus.text }}</button>
|
||||
<button type="button" data-awareness-action="next" :title="view.navigation.next.title" :disabled="view.navigation.next.disabled" @click="layer?.navigateNext(user)">{{ view.navigation.next.text }}</button>
|
||||
<UiButton data-awareness-action="previous" :title="view.navigation.previous.title" :disabled="view.navigation.previous.disabled" @click="layer?.navigatePrevious(user)">{{ view.navigation.previous.text }}</UiButton>
|
||||
<UiButton data-awareness-action="focus" @click="layer?.focusCurrent(user)">{{ view.navigation.focus.text }}</UiButton>
|
||||
<UiButton data-awareness-action="next" :title="view.navigation.next.title" :disabled="view.navigation.next.disabled" @click="layer?.navigateNext(user)">{{ view.navigation.next.text }}</UiButton>
|
||||
</div>
|
||||
<section v-for="row in view.rows" :key="row.id" :class="['military-awareness-row', row.relationship]">
|
||||
<div><strong>{{ row.label }}</strong><b aria-live="polite">{{ row.count }}</b></div>
|
||||
<small>{{ row.detail }}</small>
|
||||
<ul v-if="row.nearest.length">
|
||||
<li v-for="item in row.nearest" :key="item.key">
|
||||
<button v-if="item.targetId" type="button" class="military-awareness-target" :data-awareness-layer="item.layer" :data-awareness-id="item.targetId" :aria-label="item.ariaLabel" @click="layer?.focusTarget(item.layer, item.targetId, user)">{{ item.label }} <span>{{ item.distance }}</span></button>
|
||||
<UiButton v-if="item.targetId" class="military-awareness-target" :data-awareness-layer="item.layer" :data-awareness-id="item.targetId" :aria-label="item.ariaLabel" @click="layer?.focusTarget(item.layer, item.targetId, user)">{{ item.label }} <span>{{ item.distance }}</span></UiButton>
|
||||
<span v-else class="military-awareness-target unavailable" :aria-label="item.ariaLabel">{{ item.label }} <span>{{ item.distance }}</span></span>
|
||||
<AwarenessNames v-if="item.names" :names="item.names" />
|
||||
</li>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -68,18 +68,18 @@ watch(
|
||||
<div class="mission-replay-speed-scale" aria-hidden="true"><span>0.25×</span><span>1×</span><span>4×</span></div>
|
||||
</div>
|
||||
<div class="mission-action-row">
|
||||
<button type="button" class="mission-focus-button" data-mission-focus @click="layer?.focusSelectedLaunchSite()">{{ t('FOCUS') }}</button>
|
||||
<UiButton class="mission-focus-button" data-mission-focus @click="layer?.focusSelectedLaunchSite()">{{ t('FOCUS') }}</UiButton>
|
||||
<UiButton class="mission-replay-button" data-mission-replay :pressed="m?.replay.active ?? false" :title="t('Replay the estimated ascent with a following camera')" :hidden="m && (m.replay.active || !m.replay.available)" :disabled="m && !m.replay.available" @click="layer?.startSelectedReplay()">{{ t('REPLAY ASCENT') }}</UiButton>
|
||||
<div class="mission-replay-transport" :class="{ 'is-paused': m?.replay.paused }" data-mission-replay-transport :hidden="!m?.replay.active" :aria-label="m?.replay.transportLabel">
|
||||
<button type="button" data-mission-replay-toggle :title="m ? m.replay.toggleLabel : t('Pause replay')" :aria-label="m ? m.replay.toggleLabel : t('Pause replay')" :disabled="m && !m.replay.active" @click="layer?.toggleReplayPause()">{{ m ? m.replay.toggleText : 'Ⅱ' }}</button>
|
||||
<UiButton data-mission-replay-toggle :title="m ? m.replay.toggleLabel : t('Pause replay')" :aria-label="m ? m.replay.toggleLabel : t('Pause replay')" :disabled="m && !m.replay.active" @click="layer?.toggleReplayPause()">{{ m ? m.replay.toggleText : 'Ⅱ' }}</UiButton>
|
||||
<UiCloseButton class="cancel" data-mission-replay-cancel bare :title="t('Cancel replay')" :label="t('Cancel replay')" @click="layer?.cancelReplay()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-mission-nav">
|
||||
<button type="button" class="mission-nav-button" data-mission-prev :title="t('Previous mission')" :disabled="m?.previousDisabled" @click="layer?.selectPreviousMission()"><span aria-hidden="true">‹</span> {{ t('PREV') }}</button>
|
||||
<UiButton class="mission-nav-button" data-mission-prev :title="t('Previous mission')" :disabled="m?.previousDisabled" @click="layer?.selectPreviousMission()"><span aria-hidden="true">‹</span> {{ t('PREV') }}</UiButton>
|
||||
<span class="mission-nav-index" data-mission-index>{{ m ? m.index : '—' }}</span>
|
||||
<button type="button" class="mission-nav-button" data-mission-next :title="t('Next mission')" :disabled="m?.nextDisabled" @click="layer?.selectNextMission()">{{ t('NEXT') }} <span aria-hidden="true">›</span></button>
|
||||
<UiButton class="mission-nav-button" data-mission-next :title="t('Next mission')" :disabled="m?.nextDisabled" @click="layer?.selectNextMission()">{{ t('NEXT') }} <span aria-hidden="true">›</span></UiButton>
|
||||
</div>
|
||||
<button type="button" class="panel-layer-toggle" data-mission-show-all @click="layer?.deselectMission()">{{ t('SHOW ALL / DESELECT') }}</button>
|
||||
<UiButton class="panel-layer-toggle" data-mission-show-all @click="layer?.deselectMission()">{{ t('SHOW ALL / DESELECT') }}</UiButton>
|
||||
</aside>
|
||||
</template>
|
||||
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
|
||||
import { onBeforeUpdate, onUpdated, ref } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
import UiEmpty from '../../kit/UiEmpty.vue';
|
||||
|
||||
// The Space Missions roster. The launches layer presents it; until it does,
|
||||
@@ -72,7 +73,7 @@ onUpdated(() => {
|
||||
<div class="space-mission-roster-list ui-scroll" data-mission-roster-list>
|
||||
<UiEmpty v-if="!roster" class="space-mission-roster-empty" :title="t('LOADING 30-DAY MISSION INDEX')" />
|
||||
<UiEmpty v-else-if="!roster.entries.length" class="space-mission-roster-empty" :title="roster.empty" />
|
||||
<button v-for="entry in roster?.entries" v-else :key="entry.id" type="button" class="space-mission-roster-item" :data-mission-roster-index="entry.index" :data-mission-roster-id="entry.id" :aria-label="entry.ariaLabel" @click="layer?.selectMissionAt(entry.index)" @mouseenter="enter(entry.index)" @mousemove="move(entry.index)" @mouseleave="layer?.rosterPointerLeave()" @focus="layer?.rosterFocus(entry.index)" @blur="blur"><span class="space-mission-roster-marker" :style="{ '--mission-roster-color': entry.color }" aria-hidden="true"></span><span class="space-mission-roster-copy"><strong>{{ entry.label }}</strong><small>{{ entry.provider }} · {{ entry.date }}</small></span><span class="space-mission-roster-chevron" aria-hidden="true">›</span></button>
|
||||
<UiButton v-for="entry in roster?.entries" v-else :key="entry.id" class="space-mission-roster-item" :data-mission-roster-index="entry.index" :data-mission-roster-id="entry.id" :aria-label="entry.ariaLabel" @click="layer?.selectMissionAt(entry.index)" @mouseenter="enter(entry.index)" @mousemove="move(entry.index)" @mouseleave="layer?.rosterPointerLeave()" @focus="layer?.rosterFocus(entry.index)" @blur="blur"><span class="space-mission-roster-marker" :style="{ '--mission-roster-color': entry.color }" aria-hidden="true"></span><span class="space-mission-roster-copy"><strong>{{ entry.label }}</strong><small>{{ entry.provider }} · {{ entry.date }}</small></span><span class="space-mission-roster-chevron" aria-hidden="true">›</span></UiButton>
|
||||
</div>
|
||||
<p class="space-mission-roster-focus-continuation" tabindex="-1" data-mission-roster-focus-continuation>{{ t('TAB PREVIEWS · ENTER / SPACE SELECTS') }}</p>
|
||||
</div>
|
||||
|
||||
@@ -52,10 +52,10 @@ const radioWords = computed(() => ({
|
||||
</div>
|
||||
<RadioTuner />
|
||||
<div class="radio-transport" role="group" :aria-label="t('Radio playback')">
|
||||
<button id="radio-prev-btn" @click="act('cycleRadio', -1)" type="button" :aria-label="t('Previous filtered station')" :disabled="radio ? radio.transport.stepDisabled : true">{{ t('PREV') }}</button>
|
||||
<button id="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 station')" :disabled="radio ? radio.transport.play.disabled : true">{{ radio ? radio.transport.play.text : t('PLAY') }}</button>
|
||||
<button id="radio-next-btn" @click="act('cycleRadio', 1)" type="button" :aria-label="t('Next filtered station')" :disabled="radio ? radio.transport.stepDisabled : true">{{ t('NEXT') }}</button>
|
||||
<button id="radio-stop-btn" @click="act('stopRadio')" type="button" :aria-label="t('Stop radio playback')" :disabled="radio ? radio.transport.stopDisabled : true">{{ t('STOP') }}</button>
|
||||
<UiButton id="radio-prev-btn" @click="act('cycleRadio', -1)" :aria-label="t('Previous filtered station')" :disabled="radio ? radio.transport.stepDisabled : true">{{ t('PREV') }}</UiButton>
|
||||
<UiButton id="radio-play-btn" @click="act('toggleRadioPlayback')" v-class-toggle="{ active: radio?.transport.play.active }" :aria-label="radio ? radio.transport.play.label : t('Play selected station')" :disabled="radio ? radio.transport.play.disabled : true">{{ radio ? radio.transport.play.text : t('PLAY') }}</UiButton>
|
||||
<UiButton id="radio-next-btn" @click="act('cycleRadio', 1)" :aria-label="t('Next filtered station')" :disabled="radio ? radio.transport.stepDisabled : true">{{ t('NEXT') }}</UiButton>
|
||||
<UiButton id="radio-stop-btn" @click="act('stopRadio')" :aria-label="t('Stop radio playback')" :disabled="radio ? radio.transport.stopDisabled : true">{{ t('STOP') }}</UiButton>
|
||||
</div>
|
||||
<label class="radio-volume-row" for="radio-volume">
|
||||
<span>{{ t('VOLUME') }}</span>
|
||||
|
||||
@@ -32,8 +32,8 @@ const tune = () => act('tuneSdr', frequency.value.value);
|
||||
<p>{{ t('Chrome/Edge · WebUSB · one local tuner shared by FM and the Local ADS-B layer.') }}</p>
|
||||
<div class="sdr-radio-actions">
|
||||
<UiButton id="sdr-connect-btn" @click="act('toggleSdrConnection')" class="panel-layer-toggle" :pressed="sdr?.connectPressed ?? false" pressed-class="active" :disabled="sdr?.connectDisabled">{{ sdr ? sdr.connectLabel : t('CONNECT') }}</UiButton>
|
||||
<button id="sdr-locate-btn" type="button" @click="act('locateSdr')" v-class-toggle="{ active: sdr?.locateActive }" :title="t('Use your location for faster ADS-B position decoding')" :disabled="sdr?.locateDisabled">{{ sdr ? sdr.locateLabel : t('LOCATE') }}</button>
|
||||
<button id="sdr-change-device-btn" type="button" @click="act('changeSdrDevice')" :title="t('Choose a different RTL-SDR or receiver channel')" :disabled="sdr?.changeDeviceDisabled">{{ t('CHANGE DEVICE') }}</button>
|
||||
<UiButton id="sdr-locate-btn" @click="act('locateSdr')" v-class-toggle="{ active: sdr?.locateActive }" :title="t('Use your location for faster ADS-B position decoding')" :disabled="sdr?.locateDisabled">{{ sdr ? sdr.locateLabel : t('LOCATE') }}</UiButton>
|
||||
<UiButton id="sdr-change-device-btn" @click="act('changeSdrDevice')" :title="t('Choose a different RTL-SDR or receiver channel')" :disabled="sdr?.changeDeviceDisabled">{{ t('CHANGE DEVICE') }}</UiButton>
|
||||
</div>
|
||||
<div class="sdr-mode-row" role="group" :aria-label="t('RTL-SDR receiver mode')">
|
||||
<UiButton id="sdr-mode-fm-btn" @click="act('setSdrMode', 'fm')" :pressed="sdr ? sdr.fmActive : true" pressed-class="active" :disabled="sdr?.modeDisabled" translate="no">FM</UiButton>
|
||||
@@ -55,11 +55,11 @@ const tune = () => act('tuneSdr', frequency.value.value);
|
||||
<div class="sdr-frequency-row">
|
||||
<label for="sdr-frequency-input">{{ t('FM MHZ') }}</label>
|
||||
<input ref="frequency" class="gev-field" id="sdr-frequency-input" @keydown.enter.prevent="tune" type="number" min="87.5" max="108" step="0.1" value="98.5" inputmode="decimal" :disabled="sdr?.frequencyDisabled" v-field-value="sdr ? sdr.frequency : '98.5'" />
|
||||
<button id="sdr-tune-btn" type="button" @click="tune" :disabled="sdr?.tuneDisabled">{{ t('TUNE') }}</button>
|
||||
<UiButton id="sdr-tune-btn" @click="tune" :disabled="sdr?.tuneDisabled">{{ t('TUNE') }}</UiButton>
|
||||
</div>
|
||||
<div class="sdr-seek-row" role="group" :aria-label="t('Seek broadcast FM stations')">
|
||||
<button id="sdr-seek-back-btn" type="button" @click="act('seekSdr', -1)" :disabled="sdr ? sdr.seekDisabled : true">{{ t('◀ SEEK') }}</button>
|
||||
<button id="sdr-seek-forward-btn" type="button" @click="act('seekSdr', 1)" :disabled="sdr ? sdr.seekDisabled : true">{{ t('SEEK ▶') }}</button>
|
||||
<UiButton id="sdr-seek-back-btn" @click="act('seekSdr', -1)" :disabled="sdr ? sdr.seekDisabled : true">{{ t('◀ SEEK') }}</UiButton>
|
||||
<UiButton id="sdr-seek-forward-btn" @click="act('seekSdr', 1)" :disabled="sdr ? sdr.seekDisabled : true">{{ t('SEEK ▶') }}</UiButton>
|
||||
</div>
|
||||
<label class="radio-volume-row" for="sdr-volume">
|
||||
<span>{{ t('SDR VOL') }}</span>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user