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:
German Khokhlov committed 2026-10-22 12:31:59 +04:00
1 parent 69a78710cc
commit c8a4f3ed98
10 files changed
+96 -7

No files matched your search

-1
View File
@@ -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,
+45
View File
@@ -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();
});