ui: Show nodes with more than 20 children initially collapsed (issue #509)
This commit is contained in:
@@ -631,7 +631,7 @@ void GraphController::autoExpandActiveNode(const std::vector<Id>& activeTokenIds
|
||||
node = getDummyGraphNodeById(activeTokenIds[0]);
|
||||
}
|
||||
|
||||
if (node)
|
||||
if (node && !node->hasMissingChildNodes())
|
||||
{
|
||||
node->expanded = true;
|
||||
node->autoExpanded = true;
|
||||
|
||||
@@ -925,8 +925,15 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeIds.push_back(elementId);
|
||||
m_hierarchyCache.addFirstChildIdsForNodeId(elementId, &nodeIds, &edgeIds);
|
||||
|
||||
// don't expand active node if it has more than 20 child nodes
|
||||
if (nodeIds.size() > 20)
|
||||
{
|
||||
nodeIds.clear();
|
||||
}
|
||||
|
||||
nodeIds.push_back(elementId);
|
||||
edgeIds.clear();
|
||||
|
||||
std::vector<StorageEdge> edges = m_sqliteIndexStorage.getEdgesBySourceOrTargetId(elementId);
|
||||
|
||||
Reference in New Issue
Block a user