mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
Merge main
This commit is contained in:
commit
a08cf7a2cd
7 files changed
+250
-9
No files matched your search
@@ -1157,6 +1157,15 @@ test('mobile Cockpit prioritizes flight instruments and collision-safe controls'
|
||||
mobileCockpit[1],
|
||||
/body\.cockpit-mode \.cockpit-utility-controls[\s\S]*?bottom:\s*152px;/,
|
||||
);
|
||||
assert.match(
|
||||
mobileCockpit[1],
|
||||
/body\.cockpit-mode\.mobile-shell[^{]*?\.cockpit-utility-controls \{[^}]*?top:[^;]*?var\(--cockpit-visor-top\)/,
|
||||
);
|
||||
assert.match(
|
||||
mobileCockpit[1],
|
||||
/@media \(min-width: 390px\) and \(min-height: 240px\),\s*\(min-height: 450px\) \{\s*body\.cockpit-mode\.mobile-shell/,
|
||||
);
|
||||
assert.match(css, /\.cockpit-visor-shell \{[^}]*?inset:\s*var\(--cockpit-visor-top\)/);
|
||||
assert.match(
|
||||
mobileCockpit[1],
|
||||
/body\.cockpit-mode \.cockpit-utility-control\.is-expanded[\s\S]*?top:\s*96px;/,
|
||||
@@ -1175,6 +1184,15 @@ test('mobile Cockpit prioritizes flight instruments and collision-safe controls'
|
||||
);
|
||||
});
|
||||
|
||||
test('the unread Stories announcement waits until Cockpit closes', () => {
|
||||
assert.match(css, /body\.cockpit-mode #gev-stories #hPop \{\s*display:\s*none;\s*\}/);
|
||||
const storiesView = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'views', 'StoriesView.vue'), 'utf8');
|
||||
assert.match(
|
||||
storiesView,
|
||||
/async function openExplore\(\) \{[^}]*?if \(await store\.controller\.open\(\)\) markPopSeen\(\);/,
|
||||
);
|
||||
});
|
||||
|
||||
test('cockpit route direction uses self-contained vector artwork, not a font ligature', () => {
|
||||
const match = html.match(/<div id="cockpit-route-direction"[\s\S]*?<\/div>/);
|
||||
assert.ok(match, 'cockpit route-direction markup is missing');
|
||||
|
||||
@@ -6,6 +6,33 @@ import { createPinia } from 'pinia';
|
||||
import { useStoriesStore } from './stores/stories.js';
|
||||
import { storyById } from '../stories/catalog.js';
|
||||
import StoryScreen from './views/stories/StoryScreen.vue';
|
||||
import StoriesView from './views/StoriesView.vue';
|
||||
|
||||
test('the announcement stays unread when a lazy Stories open resolves to false', async (t) => {
|
||||
const host = document.body.appendChild(document.createElement('div'));
|
||||
const pinia = createPinia();
|
||||
const store = useStoriesStore(pinia);
|
||||
let allowed = false;
|
||||
store.connect({ open: async () => allowed });
|
||||
const app = createApp(StoriesView).use(pinia);
|
||||
app.mount(host);
|
||||
t.after(() => {
|
||||
app.unmount();
|
||||
host.remove();
|
||||
localStorage.removeItem('gevStoriesPopSeen');
|
||||
});
|
||||
|
||||
const entry = host.querySelector('#hStories');
|
||||
entry.click();
|
||||
await nextTick();
|
||||
assert.equal(localStorage.getItem('gevStoriesPopSeen'), null);
|
||||
assert.ok(host.querySelector('#hPop'));
|
||||
|
||||
allowed = true;
|
||||
entry.click();
|
||||
await nextTick();
|
||||
assert.equal(localStorage.getItem('gevStoriesPopSeen'), '1');
|
||||
});
|
||||
|
||||
test('the story screen previews a drag and seeks once on release', async (t) => {
|
||||
const host = document.body.appendChild(document.createElement('div'));
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
--cockpit-side-panel-width: min(340px, 28vw);
|
||||
/* HUD bottom offset + tallest scaled telemetry block + 20px clear border. */
|
||||
--cockpit-bottom-rail-safe: calc(clamp(84px, 11vh, 118px) + 100px);
|
||||
/* The phone Display/Radio row shares the visor inset with the roll arc. */
|
||||
--cockpit-visor-top: clamp(62px, 9vh, 90px);
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 145;
|
||||
@@ -95,7 +97,7 @@
|
||||
}
|
||||
.cockpit-visor-shell {
|
||||
position: absolute;
|
||||
inset: clamp(62px, 9vh, 90px) clamp(18px, 3vw, 48px) clamp(38px, 5vh, 56px);
|
||||
inset: var(--cockpit-visor-top) clamp(18px, 3vw, 48px) clamp(38px, 5vh, 56px);
|
||||
transform-style: preserve-3d;
|
||||
perspective: 880px;
|
||||
}
|
||||
@@ -2026,6 +2028,11 @@ body.cockpit-mode
|
||||
) {
|
||||
display: none !important;
|
||||
}
|
||||
/* The first-visit Stories announcement waits, unread, until Cockpit closes:
|
||||
on a phone it would cover the Display/Radio row. */
|
||||
body.cockpit-mode #gev-stories #hPop {
|
||||
display: none;
|
||||
}
|
||||
body.cockpit-mode #left-panel-stack {
|
||||
z-index: 147;
|
||||
display: flex;
|
||||
@@ -2122,10 +2129,31 @@ body.cockpit-mode #intel-hud .hud-right-edge {
|
||||
top: auto;
|
||||
right: 12px;
|
||||
bottom: 152px;
|
||||
flex-direction: row;
|
||||
max-width: calc(100vw - 24px);
|
||||
}
|
||||
body.cockpit-mode .cockpit-utility-controls {
|
||||
flex-direction: row;
|
||||
/* Phone flight and bridge views: one row centred on the Reset/Exit axis,
|
||||
10px below the roll arc (.cockpit-roll-arc: 2px + 96px into the visor).
|
||||
Shorter screens reserve 36px around the 46% centre of .cockpit-reticle
|
||||
(about 25px tall on phones), plus an 8px gap below the 42px row.
|
||||
The row stops at 72px, below the vision controls. Windows under 240px
|
||||
tall, and narrow ones under 450px tall, keep the right-aligned row above
|
||||
Reset/Exit, clear of Reset, LOOK AHEAD and the Stories button, as do
|
||||
satellite and provider views. */
|
||||
@media (min-width: 390px) and (min-height: 240px), (min-height: 450px) {
|
||||
body.cockpit-mode.mobile-shell
|
||||
#cockpit-hud:not([data-generic]):not([data-subject='satellite'])
|
||||
.cockpit-utility-controls {
|
||||
top: clamp(
|
||||
72px,
|
||||
calc(46% - 68px),
|
||||
calc(var(--cockpit-visor-top) + 108px)
|
||||
);
|
||||
bottom: auto;
|
||||
left: 12px;
|
||||
width: max-content;
|
||||
margin-inline: auto;
|
||||
}
|
||||
}
|
||||
body.cockpit-mode .cockpit-utility-launcher {
|
||||
width: min(150px, calc((100vw - 31px) / 2));
|
||||
|
||||
@@ -152,9 +152,9 @@ function markPopSeen() {
|
||||
/* storage off: the popup comes back next visit */
|
||||
}
|
||||
}
|
||||
function openExplore() {
|
||||
markPopSeen();
|
||||
store.controller.open();
|
||||
async function openExplore() {
|
||||
// A refused open (Cockpit) leaves the announcement unread.
|
||||
if (await store.controller.open()) markPopSeen();
|
||||
}
|
||||
|
||||
// ── Opened in GEV: a toast that leads back to the story ──
|
||||
|
||||
Reference in new issue
Block a user