mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(cockpit): render the utility strip's measured layout from the store
The Cockpit layout pass publishes the utility strip's fit to the gev-cockpit store: the HUD's --cockpit-utility-* lengths, whether only the expanded control fits, and whether a collapsed control beside an expanded one is hidden from assistive technology. CockpitView renders the lengths on the HUD and CockpitUtilityControls the strip's class and each control's aria-hidden, which now also follows a popover opened between passes. Focus leaves a control before the strip hides it. Exit publishes no layout, which also clears the expanded height, class and aria-hidden the old exit left behind. The briefing and Contact cards' positions stay imperative: the same pass measures them straight after writing them.
This commit is contained in:
1 parent
c3c69a91cd
commit
4c92f517db
12 files changed
+236
-70
No files matched your search
@@ -301,7 +301,14 @@ test('re-renders keep the visibility and classes the controller publishes on the
|
||||
const hud = $('#cockpit-hud');
|
||||
store.publishPresence({ active: true, context: false });
|
||||
hud.classList.add('voice-highlight');
|
||||
hud.style.setProperty('--cockpit-utility-top', '120px');
|
||||
hud.style.setProperty('--voice-glow', '1');
|
||||
store.publishUtilityLayout({
|
||||
top: '120px',
|
||||
maxHeight: null,
|
||||
expandedMaxHeight: null,
|
||||
primaryOnly: false,
|
||||
hideCollapsed: false,
|
||||
});
|
||||
$('#cockpit-speed-rim').classList.add('external');
|
||||
updateHud.call(owner, INFO, 1000, true);
|
||||
await nextTick();
|
||||
@@ -310,7 +317,13 @@ test('re-renders keep the visibility and classes the controller publishes on the
|
||||
assert.equal(hud.hidden, false);
|
||||
assert.equal(hud.classList.contains('signals-active'), true);
|
||||
assert.equal(hud.classList.contains('voice-highlight'), true);
|
||||
assert.equal(hud.style.getPropertyValue('--voice-glow'), '1');
|
||||
// The utility strip's measured anchor renders from the store.
|
||||
assert.equal(hud.style.getPropertyValue('--cockpit-utility-top'), '120px');
|
||||
store.publishUtilityLayout(null);
|
||||
await nextTick();
|
||||
assert.equal(hud.style.getPropertyValue('--cockpit-utility-top'), '');
|
||||
assert.equal(hud.style.getPropertyValue('--voice-glow'), '1');
|
||||
assert.equal($('#cockpit-speed-rim').classList.contains('external'), true);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user