mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
feat(ui): render the status chips and their split-flap labels from a store
ShellFeedback publishes the loading status and the road network chip, and CctvControls the camera grid chip, to the gev-status store; the scene chrome renders them. SplitFlapText plays the departure-board cascade that splitFlap.js plans, writing only the label's one text node, and rests when its owner is destroyed. setSplitFlapText and disposeSplitFlap are gone.
This commit is contained in:
1 parent
492b719f19
commit
3c391482f6
21 files changed
+838
-428
No files matched your search
@@ -54,8 +54,6 @@ function fixture() {
|
||||
'right-context-rail',
|
||||
'pp-toggles',
|
||||
'toast',
|
||||
'global-loading-status',
|
||||
'global-loading-detail',
|
||||
'safe-frame-overlay',
|
||||
'safe-frame-box',
|
||||
'hud-toggle',
|
||||
@@ -176,11 +174,20 @@ test('panel layout coalesces each rail and cannot rearm after destruction', () =
|
||||
test('feedback disposal clears toast and polling work and rejects retained notices', () => {
|
||||
const f = fixture();
|
||||
try {
|
||||
const owner = new ShellFeedback({ readLayers: () => [] });
|
||||
const loading = [];
|
||||
const owner = new ShellFeedback({
|
||||
readLayers: () => [],
|
||||
store: {
|
||||
publishLoading: (view) => loading.push(view),
|
||||
publishTraffic() {},
|
||||
},
|
||||
});
|
||||
owner.observeVisibility();
|
||||
owner._startTrafficChipTicker();
|
||||
owner._showToast('Saved');
|
||||
assert.equal(f.timers.size, 2);
|
||||
owner._showGlobalStatusNotice('Saving');
|
||||
assert.equal(loading.at(-1).hidden, false);
|
||||
owner.destroy();
|
||||
owner._showToast('Late');
|
||||
owner._showGlobalStatusNotice('Late');
|
||||
@@ -189,7 +196,8 @@ test('feedback disposal clears toast and polling work and rejects retained notic
|
||||
assert.equal(f.timers.size, 0);
|
||||
assert.equal(f.nodes.get('toast').textContent, 'Saved');
|
||||
assert.equal(f.nodes.get('toast').classList.contains('visible'), false);
|
||||
assert.equal(f.nodes.get('global-loading-status').hidden, true);
|
||||
assert.equal(loading.at(-1).hidden, true);
|
||||
assert.equal(loading.at(-1).label, 'Saving', 'the hidden label stays');
|
||||
} finally {
|
||||
f.restore();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user