perf: cut ControlApp re-renders and lazy-load VFX packs

Move audio scrub/volume and brush drafts off root React ticks, coalesce overlay layout IPC, cache machine fingerprint and asset URLs, share one scene overlay host, and stop idle Pixi ticker. Also harden console against EPIPE on window load failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-23 11:58:16 +08:00
parent 32a5479086
commit d9fbecf5a7
29 changed files with 1825 additions and 585 deletions
@@ -0,0 +1,24 @@
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import test from 'node:test';
import { fileURLToPath } from 'node:url';
const here = path.dirname(fileURLToPath(import.meta.url));
/** Регресс: списки сцен/материалов не должны дёргать assetFileUrl на каждый mount одного id. */
void test('useAssetUrl: module cache + invalidate при смене проекта', () => {
const src = fs.readFileSync(path.join(here, 'useAssetImageUrl.ts'), 'utf8');
const projectState = fs.readFileSync(path.join(here, '../editor/state/projectState.ts'), 'utf8');
assert.ok(src.includes('urlCache'));
assert.ok(src.includes('invalidateAssetUrlCache'));
assert.ok(src.includes('peekAssetUrlCache'));
assert.ok(src.includes('session.stateChanged'));
assert.match(src, /urlCache\.set\(id,\s*r\.url\)/);
assert.match(src, /peekAssetUrlCache\(id\)/);
assert.ok(projectState.includes('invalidateAssetUrlCache'));
assert.match(projectState, /openProject[\s\S]*?invalidateAssetUrlCache\(\)/);
assert.match(projectState, /closeProject[\s\S]*?invalidateAssetUrlCache\(\)/);
});