feat(npcs): drop binding; select NPCs on storyline export

Remove storyline/scene NPC binding and export chosen NPCs with relations/groups. Harden export modal so a missing npcs payload no longer blacks out the editor.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-30 10:05:09 +08:00
parent 04c75cd725
commit e08f5ef550
17 changed files with 418 additions and 522 deletions
@@ -8,6 +8,7 @@ const here = path.dirname(fileURLToPath(import.meta.url));
const rendererRoot = path.resolve(here, '../..');
const SECONDARY_WINDOW_MAINS = [
'editor/main.tsx',
'npcs/npcsEditorMain.tsx',
'npcs/npcsMain.tsx',
'materials/main.tsx',
@@ -45,6 +46,24 @@ void test('NpcsEditorApp: no undefined controlStyles (inspector crash)', () => {
assert.doesNotMatch(src, /controlStyles/);
});
void test('NPC binding removed from editor UI', () => {
const editor = fs.readFileSync(path.join(rendererRoot, 'npcs/NpcsEditorApp.tsx'), 'utf8');
const modal = fs.readFileSync(path.join(rendererRoot, 'npcs/NpcEditModal.tsx'), 'utf8');
assert.doesNotMatch(editor, /NpcBindingFields|binding/);
assert.doesNotMatch(modal, /NpcBindingFields|binding|noneBinding/);
assert.ok(!fs.existsSync(path.join(rendererRoot, 'npcs/NpcBindingFields.tsx')));
assert.ok(!fs.existsSync(path.join(rendererRoot, '../shared/npcs/npcBinding.ts')));
});
void test('storyline export modal: NPC selection step', () => {
const src = fs.readFileSync(path.join(rendererRoot, 'editor/StorylineTransferModals.tsx'), 'utf8');
assert.match(src, /step === 'npcs'/);
assert.match(src, /export\.selectAllNpcs/);
assert.match(src, /npcIds/);
assert.match(src, /Array\.isArray\(res\?\.npcs\)/);
assert.doesNotMatch(src, /filterNpcsForStorylineExport/);
});
void test('WindowErrorBoundary component exists and catches errors', () => {
const src = fs.readFileSync(path.join(here, 'WindowErrorBoundary.tsx'), 'utf8');
assert.ok(src.includes('getDerivedStateFromError'));