Add project name validation and default value in document migration

This commit is contained in:
2026-04-11 13:25:22 +02:00
parent 88047649f9
commit b3ff49d38c
2 changed files with 44 additions and 7 deletions

View File

@@ -2518,6 +2518,17 @@ export function validateProjectDocument(
): SceneDocumentValidationResult {
const diagnostics: SceneDiagnostic[] = [];
if (document.name.trim().length === 0) {
diagnostics.push(
createDiagnostic(
"error",
"invalid-project-name",
"Project names must be non-empty.",
"name"
)
);
}
if (Object.keys(document.scenes).length === 0) {
diagnostics.push(
createDiagnostic(