fix: scene clear race, path editor anchors, avatar cover, team color crash
Clear scene now patches traps/tokens/npcTokens atomically and updateScene merges against a fresh scene snapshot. Align NPC path-editor previews on token center, default new paths to fixed facing, size avatars by natural aspect for cover, and read team color synchronously from the picker. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -85,6 +85,18 @@ void test('zipStore: NPC parse defaults externalUrl', () => {
|
||||
assert.match(src, /externalUrl: normalizeNpcExternalUrl/);
|
||||
});
|
||||
|
||||
void test('zipStore: updateScene merges patch inside updateProject mutator (no stale base race)', () => {
|
||||
const src = fs.readFileSync(path.join(here, 'zipStore.ts'), 'utf8');
|
||||
const i = src.indexOf('async updateScene(sceneId: SceneId, patch: ScenePatch)');
|
||||
assert.ok(i >= 0);
|
||||
const j = src.indexOf('async updateConnections(', i);
|
||||
assert.ok(j > i);
|
||||
const block = src.slice(i, j);
|
||||
assert.match(block, /await this\.updateProject\(\(p\) => \{/);
|
||||
assert.match(block, /const existing = p\.scenes\[sceneId\]/);
|
||||
assert.doesNotMatch(block, /const existing = open\.project\.scenes\[sceneId\]/);
|
||||
});
|
||||
|
||||
void test('zipStore: listProjects skips unreadable archives', () => {
|
||||
const src = fs.readFileSync(path.join(here, 'zipStore.ts'), 'utf8');
|
||||
assert.match(
|
||||
|
||||
Reference in New Issue
Block a user