#pragma once #include #include #include #include #include #include #include namespace XCEngine::UI::Editor::App::Project { class ProductProjectBrowserModel { public: struct BreadcrumbSegment { std::string label = {}; std::string targetFolderId = {}; bool current = false; }; struct FolderEntry { std::string itemId = {}; std::filesystem::path absolutePath = {}; std::string label = {}; }; struct AssetEntry { std::string itemId = {}; std::filesystem::path absolutePath = {}; std::string displayName = {}; bool directory = false; }; void Initialize(const std::filesystem::path& repoRoot); void SetFolderIcon(const ::XCEngine::UI::UITextureHandle& icon); void Refresh(); bool Empty() const; const std::filesystem::path& GetAssetsRootPath() const; const std::vector& GetFolderEntries() const; const std::vector& GetTreeItems() const; const std::vector& GetAssetEntries() const; const std::string& GetCurrentFolderId() const; const FolderEntry* FindFolderEntry(std::string_view itemId) const; const AssetEntry* FindAssetEntry(std::string_view itemId) const; bool NavigateToFolder(std::string_view itemId); std::vector BuildBreadcrumbSegments() const; std::vector CollectCurrentFolderAncestorIds() const; std::vector BuildAncestorFolderIds(std::string_view itemId) const; private: void RefreshFolderTree(); void RefreshAssetList(); void EnsureValidCurrentFolder(); std::filesystem::path m_assetsRootPath = {}; std::vector m_folderEntries = {}; std::vector m_treeItems = {}; std::vector m_assetEntries = {}; ::XCEngine::UI::UITextureHandle m_folderIcon = {}; std::string m_currentFolderId = {}; }; } // namespace XCEngine::UI::Editor::App::Project