mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 02:02:21 +00:00
The title logo goes back to live at the starting view
The logo in the title was only a picture. It is now a button, "Back to live at the starting view": the world clock goes live and the camera flies to the view the app started from, letting go of whatever it follows as Reset Globe does. The shell's returnToStart() does it. It flies to the `homeView` option of createApplicationControls, which is the start view unless given: an application that passes `startView` only to carry a view across a rebuild can keep the logo on its own first view. START_VIEW is exported from ./application/controls for that. The title heading keeps "GOD'S EYE VIEW" as its name beside the button.
This commit is contained in:
1 parent
4c90c065be
commit
f5d3521cda
25 files changed
+191
-32
No files matched your search
@@ -48,3 +48,35 @@ test('the FPS readout sits in the title bar, hidden until the backquote key', as
|
||||
await nextTick();
|
||||
assert.equal(readout(), null);
|
||||
});
|
||||
|
||||
test('the title logo is a button that asks for the way back to live at the start view', async (t) => {
|
||||
document.body.replaceChildren();
|
||||
const pinia = createPinia();
|
||||
const app = createApp(SceneChromeView).use(pinia);
|
||||
app.mount(document.body.appendChild(document.createElement('div')));
|
||||
t.after(() => app.unmount());
|
||||
const { useGlobeActionsStore } = await import('./stores/globeActions.js');
|
||||
const calls = [];
|
||||
useGlobeActionsStore(pinia).connect({ home: () => calls.push('home') });
|
||||
const logo = document.querySelector('#title-bar h1 > button.title-logo');
|
||||
assert.ok(logo, 'the logo is the title heading’s button');
|
||||
assert.equal(
|
||||
logo.getAttribute('aria-label'),
|
||||
'Back to live at the starting view',
|
||||
);
|
||||
assert.ok(logo.hasAttribute('data-logo-gaze'));
|
||||
logo.click();
|
||||
assert.deepEqual(calls, ['home']);
|
||||
});
|
||||
|
||||
test('the title heading keeps its own name beside the logo button', async (t) => {
|
||||
document.body.replaceChildren();
|
||||
const app = createApp(SceneChromeView).use(createPinia());
|
||||
app.mount(document.body.appendChild(document.createElement('div')));
|
||||
t.after(() => app.unmount());
|
||||
const heading = document.querySelector('#title-bar h1');
|
||||
const named = document.getElementById(
|
||||
heading.getAttribute('aria-labelledby'),
|
||||
);
|
||||
assert.equal(named.textContent.replace(/\s+/g, ' ').trim(), "GOD'S EYE VIEW");
|
||||
});
|
||||
Reference in new issue
Block a user