feat(new_editor): wire project, inspector, and viewport runtime

This commit is contained in:
2026-04-19 00:03:25 +08:00
parent 8257403036
commit a57b322bc7
168 changed files with 14829 additions and 2507 deletions

View File

@@ -459,6 +459,7 @@ void CollectVisiblePanelsRecursive(
UIEditorWorkspaceValidationResult ValidateNodeRecursive(
const UIEditorWorkspaceNode& node,
std::unordered_set<std::string>& nodeIds,
std::unordered_set<std::string>& panelIds) {
if (node.nodeId.empty()) {
return MakeValidationError(
@@ -466,6 +467,13 @@ UIEditorWorkspaceValidationResult ValidateNodeRecursive(
"Workspace node id must not be empty.");
}
if (!nodeIds.insert(node.nodeId).second) {
return MakeValidationError(
UIEditorWorkspaceValidationCode::DuplicateNodeId,
"Workspace node id '" + node.nodeId +
"' is duplicated in the workspace tree.");
}
switch (node.kind) {
case UIEditorWorkspaceNodeKind::Panel:
if (!node.children.empty()) {
@@ -517,7 +525,7 @@ UIEditorWorkspaceValidationResult ValidateNodeRecursive(
}
if (UIEditorWorkspaceValidationResult result =
ValidateNodeRecursive(child, panelIds);
ValidateNodeRecursive(child, nodeIds, panelIds);
!result.IsValid()) {
return result;
}
@@ -542,7 +550,7 @@ UIEditorWorkspaceValidationResult ValidateNodeRecursive(
for (const UIEditorWorkspaceNode& child : node.children) {
if (UIEditorWorkspaceValidationResult result =
ValidateNodeRecursive(child, panelIds);
ValidateNodeRecursive(child, nodeIds, panelIds);
!result.IsValid()) {
return result;
}
@@ -591,8 +599,8 @@ bool AreUIEditorWorkspaceModelsEquivalent(
AreUIEditorWorkspaceNodesEquivalent(lhs.root, rhs.root);
}
UIEditorWorkspaceModel BuildDefaultEditorShellWorkspaceModel() {
const UIEditorPanelRegistry registry = BuildDefaultEditorShellPanelRegistry();
UIEditorWorkspaceModel BuildEditorFoundationWorkspaceModel() {
const UIEditorPanelRegistry registry = BuildEditorFoundationPanelRegistry();
const UIEditorPanelDescriptor& rootPanel =
Internal::RequirePanelDescriptor(registry, "editor-foundation-root");