Bump scene document version and update entity comparison

This commit is contained in:
2026-04-03 01:02:53 +02:00
parent 23ffb186e6
commit 1b66de906e
3 changed files with 7 additions and 2 deletions

View File

@@ -517,7 +517,7 @@ export function cloneEntityRegistry(entities: Record<string, EntityInstance>): R
}
export function areEntityInstancesEqual(left: EntityInstance, right: EntityInstance): boolean {
if (left.kind !== right.kind || left.id !== right.id || !areVec3Equal(left.position, right.position)) {
if (left.kind !== right.kind || left.id !== right.id || left.name !== right.name || !areVec3Equal(left.position, right.position)) {
return false;
}

View File

@@ -30,6 +30,10 @@ export function getEntityDisplayLabel(
entities: Record<string, EntityInstance>,
assets?: Record<string, ProjectAssetRecord>
): string {
if (entity.name !== undefined) {
return entity.name;
}
const typedEntities = getSortedEntitiesByKind(entities, entity.kind);
const entityIndex = typedEntities.findIndex((candidate) => candidate.id === entity.id);
const baseLabel = getEntityKindLabel(entity.kind);