mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 02:02:21 +00:00
Merge pull request #1864 from bilawalsidhu/samehkhamis/kit-sweep-missions-radio
Vue kit: missions', Contacts', Radio's and key setup's buttons and glyphs are kit controls
This commit is contained in:
11 files changed
+199
-28
No files matched your search
@@ -0,0 +1,2 @@
|
||||
- Space Missions', Contacts', Radio's, the RTL-SDR card's and key setup's
|
||||
buttons and glyphs are now kit controls (manjunath22466, samehkhamis, #1864).
|
||||
@@ -93,6 +93,13 @@ button, whose state the event layer writes into the attributes its panel
|
||||
renders, and Explore's story cards, which are `role="button"` elements,
|
||||
not buttons (`src/ui/kit/viewControls.test.mjs` pins it). Where the
|
||||
converted buttons draw Material symbols (the tilt-map button, the Context
|
||||
header's search and expand, the imported files' row actions and the rail
|
||||
chips' icons), the glyphs are `UiIcon`s with `:size="null"`, so the site
|
||||
rules still size them. Core's pressable chips and pills (the rail cards'
|
||||
chips and action chips, Recent Imagery's day chips, SWAP and ZOOM IN, map
|
||||
sources, cities and places, the view context's place and layer chips and
|
||||
the key setup chip) are `UiButton`s too. `UiChip` is a non-interactive
|
||||
label chip, used by the voice card.
|
||||
header's search and expand, Draw, Import, the imported files' and drawn
|
||||
shapes' row actions and the rail chips' icons), the glyphs are `UiIcon`s
|
||||
with `:size="null"`, so the site rules still size them. Core's pressable
|
||||
@@ -193,6 +200,21 @@ while a query is typed. The Filter button opens a disclosure and carries
|
||||
a `UiIcon` with `:size="null"`, so `layer-finder.css` still sizes them
|
||||
(`src/ui/kit/layerFinderControls.test.mjs` pins it); the search field's
|
||||
magnifier is `UiSearchField`'s own span.
|
||||
The Space Missions panel's buttons (a mission's roster row, FOCUS,
|
||||
REPLAY ASCENT, the replay's pause, PREV, NEXT and SHOW ALL / DESELECT),
|
||||
the Contacts panel's (PREV, FOCUS, NEXT and a contact's row), the Radio
|
||||
panel's (Enable, PREV, PLAY, NEXT and STOP), the RTL-SDR card's (Connect,
|
||||
Locate, Change device, FM, ADS-B, Tune and the two seeks) and the key
|
||||
setup's (the POWER UP chip, a key's REMOVE, the voice auth toggle and
|
||||
SAVE KEYS) are ghost `UiButton`s. Radio's Enable and the card's Connect,
|
||||
FM and ADS-B are pressed toggles with `active`; PLAY and Locate keep
|
||||
their own `active` class without `aria-pressed`, since their words say
|
||||
what they will do or have done. The chip's bolt is a `UiIcon` with
|
||||
`:size="null"`, so provider-settings.css still sizes it
|
||||
(`src/ui/kit/missionsRadioControls.test.mjs` pins it). The card's FM
|
||||
frequency stays a native number field, which the kit has no control for,
|
||||
and the replay's pause, the roster's chevron and the compass arrows are
|
||||
text characters, not Material symbols.
|
||||
Utilities' Draw and Import are on the kit. Draw (a pressed toggle with
|
||||
`active`), Clear and Import are ghost `UiButton`s, their glyphs `UiIcon`s
|
||||
with `pp-icon` and `:size="null"`. Draw's five colour swatches, in the
|
||||
|
||||
@@ -1355,6 +1355,7 @@
|
||||
"src/ui/kit/cockpitControls.test.mjs",
|
||||
"src/ui/kit/smallSurfacesControls.test.mjs",
|
||||
"src/ui/kit/commandDockControls.test.mjs",
|
||||
"src/ui/kit/missionsRadioControls.test.mjs",
|
||||
"src/ui/kit/drawControls.test.mjs",
|
||||
"src/ui/styles/chip.css",
|
||||
"src/ui/styles/empty-state.css",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user