mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
Merge origin/main into fix/hal-722-radio-next-no-autoplay
main moved the Radio markup into Vue views and rebuilt the UI tests on
stores. Resolved:
- src/ui/templates/context.html: deleted in main; the new privacy note now
lives in src/ui/views/panels/RadioPanel.vue.
- src/ui/radioControls.test.mjs: main's store fixture; the Next/Previous
autoplay test drives store.act('cycleRadio').
- src/voice/gevRealtime.test.mjs: main's createTestVoiceUi; the stop and
select handoff cases stay one table-driven test.
- src/data/radioNextState.test.mjs reads the published gev-radio view.
- src/i18n/locales/ar.json: the new note translated for the Arabic locale.
This commit is contained in:
commit
a2be947aba
679 files changed
+45369
-19625
No files matched your search
@@ -21,28 +21,14 @@ const settle = () => new Promise((resolve) => setTimeout(resolve));
|
||||
|
||||
// What the Radio panel and the Cockpit player show for a state.
|
||||
function render(state) {
|
||||
const el = () => {
|
||||
const classes = new Set();
|
||||
return {
|
||||
textContent: '',
|
||||
disabled: false,
|
||||
title: '',
|
||||
setAttribute() {},
|
||||
getAttribute: () => null,
|
||||
classList: { toggle(name, on) { on ? classes.add(name) : classes.delete(name); }, contains: (name) => classes.has(name) },
|
||||
};
|
||||
};
|
||||
const previousDocument = globalThis.document;
|
||||
globalThis.document = { getElementById: () => null, activeElement: null };
|
||||
try {
|
||||
let view = null;
|
||||
const host = {
|
||||
destroyed: false,
|
||||
_radioPanel: el(),
|
||||
_radioPlaybackState: el(),
|
||||
_radioPlayBtn: el(),
|
||||
_radioStopBtn: el(),
|
||||
_cockpitRadioPlayBtn: el(),
|
||||
_syncContextRadioLauncherState() {},
|
||||
_radioPanel: {},
|
||||
store: { publish: (published) => (view = published), publishTuner() {} },
|
||||
actions: {
|
||||
getLifecycle: () => null,
|
||||
preservePanelStateDuringClear: () => false,
|
||||
@@ -52,11 +38,11 @@ function render(state) {
|
||||
};
|
||||
renderRadioState.call(host, state);
|
||||
return {
|
||||
status: host._radioPlaybackState.textContent,
|
||||
error: host._radioPlaybackState.classList.contains('error'),
|
||||
button: host._radioPlayBtn.textContent,
|
||||
stopDisabled: host._radioStopBtn.disabled,
|
||||
cockpit: host._cockpitRadioPlayBtn.textContent,
|
||||
status: view.playback.text,
|
||||
error: Boolean(view.playback.error),
|
||||
button: view.transport.play.text,
|
||||
stopDisabled: view.transport.stopDisabled,
|
||||
cockpit: view.cockpit.play.glyph,
|
||||
};
|
||||
} finally {
|
||||
if (previousDocument === undefined) delete globalThis.document;
|
||||
|
||||
Reference in new issue
Block a user