mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix(mobile): never trap navigation; top-right button opens all layers
Tab switches no longer run inside a View Transition, which the globe and camera could stall so taps on the tab bar went unanswered, and a capture enter/leave failure can no longer abort a switch. Escape closes the topmost open sheet wherever focus is. The top-right globe button opens one Layers sheet with the visual looks and every layer family. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VVYRAqiQj9Y1V9ZfG1RcDH
This commit is contained in:
3 files changed
+70
-19
No files matched your search
+18
-17
@@ -159,13 +159,16 @@ function applyTab(tab) {
|
||||
else el.hidden = id !== tab && !(two && tab === 'capture' && id === prev);
|
||||
}
|
||||
tabbar.select(tab);
|
||||
if (tab === 'capture') {
|
||||
globe?.pause();
|
||||
capture?.enter();
|
||||
} else {
|
||||
if (prev === 'capture') capture?.leave();
|
||||
updateGlobeActivity();
|
||||
// A camera or sensor failure must never trap someone in Capture.
|
||||
try {
|
||||
if (tab === 'capture') {
|
||||
globe?.pause();
|
||||
capture?.enter();
|
||||
} else if (prev === 'capture') capture?.leave();
|
||||
} catch (err) {
|
||||
console.warn('capture', err);
|
||||
}
|
||||
if (tab !== 'capture') updateGlobeActivity();
|
||||
if (tab === 'you') you?.render?.();
|
||||
if (tab === 'rooms') threads?.refresh?.();
|
||||
if (tab === 'live' && two) chrome?.renderLeadView();
|
||||
@@ -180,16 +183,14 @@ function selectTab(tab) {
|
||||
if (player?.current) player.close();
|
||||
if (world?.current && !isTwoPane()) world.close();
|
||||
if (narrative?.active) narrative.stop();
|
||||
const vt = document.startViewTransition && !reducedMotion();
|
||||
if (vt) document.startViewTransition(() => applyTab(tab));
|
||||
else {
|
||||
applyTab(tab);
|
||||
const v = views[tab];
|
||||
if (v && !v.hidden) {
|
||||
v.classList.remove('view-enter');
|
||||
void v.offsetWidth;
|
||||
v.classList.add('view-enter');
|
||||
}
|
||||
// Switch synchronously. A View Transition waits on frames the globe and
|
||||
// the camera can hold up, which left taps on the tab bar unanswered.
|
||||
applyTab(tab);
|
||||
const v = views[tab];
|
||||
if (v && !v.hidden && !reducedMotion()) {
|
||||
v.classList.remove('view-enter');
|
||||
void v.offsetWidth;
|
||||
v.classList.add('view-enter');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1298,7 +1299,7 @@ function buildDirector(g) {
|
||||
|
||||
// Keyboard: Escape closes the topmost thing.
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key !== 'Escape') return;
|
||||
if (e.key !== 'Escape' || e.defaultPrevented) return;
|
||||
if (document.querySelector('.sheet-layer.is-modal:not([hidden])')) return;
|
||||
if (dossier?.isOpen) return dossier.close();
|
||||
if (player?.current) return;
|
||||
|
||||
Reference in new issue
Block a user