Select Instances from diff tree (#709)

This commit is contained in:
boatbomber
2023-07-08 18:45:25 -07:00
committed by GitHub
parent ccc52b69d2
commit 7ef4a1ff12
3 changed files with 51 additions and 16 deletions

View File

@@ -131,6 +131,7 @@ local function Tree()
id = ancestorId,
className = value.ClassName,
name = value.Name,
instance = if typeof(value) == "Instance" then value else nil,
})
previousId = ancestorId
end
@@ -236,6 +237,7 @@ function PatchVisualizer:buildTree(patch, instanceMap)
patchType = "Edit",
className = instance.ClassName,
name = instance.Name,
instance = instance,
hint = hint,
changeList = changeList,
})
@@ -271,10 +273,11 @@ function PatchVisualizer:buildTree(patch, instanceMap)
patchType = "Remove",
className = instance.ClassName,
name = instance.Name,
instance = instance,
})
end
for _, change in patch.added do
for id, change in patch.added do
-- Gather ancestors from existing DOM or future additions
local ancestry = {}
local parentId = change.Parent
@@ -344,6 +347,7 @@ function PatchVisualizer:buildTree(patch, instanceMap)
name = change.Name,
hint = hint,
changeList = changeList,
instance = instanceMap.fromIds[id],
})
end
@@ -370,6 +374,7 @@ function PatchVisualizer:render()
setElementHeight = setElementHeight,
patchType = node.patchType,
className = node.className,
instance = node.instance,
name = node.name,
hint = node.hint,
changeList = node.changeList,