mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
fix(vessels): upload Navara chevrons and restore click focus
Fix delayed and growing mover bank commits, reject stale hidden model picks, and route world-focus through the engine. Strengthen vessel parity and performance checks without changing thresholds.
This commit is contained in:
1 parent
69a78710cc
commit
c8a4f3ed98
10 files changed
+96
-7
No files matched your search
@@ -83,7 +83,6 @@ export function createMoverBank(engine, { options, write, onCommit }) {
|
||||
capacity = wanted;
|
||||
handles.forEach((handle, index) => write(handle, set, index));
|
||||
set.setCount(visible ? handles.length : 0);
|
||||
dirty = true;
|
||||
};
|
||||
const bank = {
|
||||
handles,
|
||||
|
||||
@@ -286,3 +286,48 @@ test('vessels on the Navara renderer: one always-on-top chevron bank, MMSI picks
|
||||
globalThis.document = previousDocument;
|
||||
}
|
||||
});
|
||||
|
||||
test('a vessel bank commits rows arriving after its empty visibility commit and after growth', async () => {
|
||||
const { createMoverBank } = await import('../aircraft/render/navara.js');
|
||||
let commits = 0;
|
||||
let pending = null;
|
||||
const bank = createMoverBank(
|
||||
{
|
||||
movers: {
|
||||
createSet: () => ({
|
||||
set() {},
|
||||
setCount() {},
|
||||
destroy() {},
|
||||
commit() {
|
||||
commits++;
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
{
|
||||
options: (capacity) => ({ capacity }),
|
||||
write() {},
|
||||
onCommit: (next) => {
|
||||
pending = next;
|
||||
},
|
||||
},
|
||||
);
|
||||
const flush = () => {
|
||||
const next = pending;
|
||||
pending = null;
|
||||
next?.commit();
|
||||
};
|
||||
bank.setVisible(true);
|
||||
flush();
|
||||
bank.add({});
|
||||
assert.equal(pending, bank, 'first rows schedule their GPU upload');
|
||||
flush();
|
||||
assert.equal(commits, 1);
|
||||
for (let i = 1; i < 1024; i++) bank.add({});
|
||||
flush();
|
||||
bank.add({});
|
||||
assert.equal(pending, bank, 'capacity growth schedules its GPU upload');
|
||||
flush();
|
||||
assert.equal(commits, 3);
|
||||
bank.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user