Advance new editor hosted panels and state flow

This commit is contained in:
2026-04-12 11:12:27 +08:00
parent 7ad4bfbb1c
commit b7ce8618d2
23 changed files with 2059 additions and 381 deletions

View File

@@ -344,6 +344,39 @@ std::string DescribeProjectPanelEvent(const App::ProductProjectPanel::Event& eve
return stream.str();
}
std::string DescribeHierarchyPanelEvent(const App::ProductHierarchyPanel::Event& event) {
std::ostringstream stream = {};
switch (event.kind) {
case App::ProductHierarchyPanel::EventKind::SelectionChanged:
stream << "SelectionChanged";
break;
case App::ProductHierarchyPanel::EventKind::Reparented:
stream << "Reparented";
break;
case App::ProductHierarchyPanel::EventKind::MovedToRoot:
stream << "MovedToRoot";
break;
case App::ProductHierarchyPanel::EventKind::RenameRequested:
stream << "RenameRequested";
break;
case App::ProductHierarchyPanel::EventKind::None:
default:
stream << "None";
break;
}
if (!event.itemId.empty()) {
stream << " item=" << event.itemId;
}
if (!event.targetItemId.empty()) {
stream << " target=" << event.targetItemId;
}
if (!event.label.empty()) {
stream << " label=" << event.label;
}
return stream.str();
}
} // namespace
int Application::Run(HINSTANCE hInstance, int nCmdShow) {
@@ -534,9 +567,8 @@ void Application::RenderFrame() {
frameTrace.str());
}
ApplyHostCaptureRequests(shellFrame.result);
for (const App::ProductProjectPanel::Event& event : m_editorWorkspace.GetProjectPanelEvents()) {
LogRuntimeTrace("project", DescribeProjectPanelEvent(event));
m_editorContext.SetStatus("Project", DescribeProjectPanelEvent(event));
for (const App::ProductEditorWorkspaceTraceEntry& entry : m_editorWorkspace.GetTraceEntries()) {
LogRuntimeTrace(entry.channel, entry.message);
}
ApplyHostedContentCaptureRequests();
ApplyCurrentCursor();