Enhance right-click functionality in PatchVisualizer

- Added support for right-click events in the PatchVisualizer component, allowing users to unselect nodes and manage subtree selections more intuitively.
- Updated the TODO list to remove outdated tasks related to the change visualizer, streamlining focus on current issues.

These changes aim to improve user interaction and simplify task management within the application.
This commit is contained in:
Joe 2026-03-01 06:38:14 -06:00
parent 0ed0b40766
commit d2f739ece6
2 changed files with 41 additions and 3 deletions

View file

@ -243,6 +243,17 @@ function SelectionOption:render()
end
end
end,
[Roact.Event.MouseButton2Click] = function()
if isParentOnly or (isSelected and hasChildren) then
if props.onSubtreeRightClick then
props.onSubtreeRightClick()
end
else
if props.onRightClick then
props.onRightClick()
end
end
end,
}, {
Corner = e("UICorner", {
CornerRadius = UDim.new(0, 3),
@ -295,6 +306,16 @@ local function SelectionRadio(props)
props.onSubtreeSelectionChange(props.nodeId, "pull")
end
end,
onRightClick = function()
if props.onSelectionChange then
props.onSelectionChange(props.nodeId, nil)
end
end,
onSubtreeRightClick = function()
if props.onSubtreeSelectionChange then
props.onSubtreeSelectionChange(props.nodeId, nil)
end
end,
}),
Skip = e(SelectionOption, {
text = "Skip",
@ -316,6 +337,16 @@ local function SelectionRadio(props)
props.onSubtreeSelectionChange(props.nodeId, "ignore")
end
end,
onRightClick = function()
if props.onSelectionChange then
props.onSelectionChange(props.nodeId, nil)
end
end,
onSubtreeRightClick = function()
if props.onSubtreeSelectionChange then
props.onSubtreeSelectionChange(props.nodeId, nil)
end
end,
}),
Atlas = e(SelectionOption, {
text = "Atlas",
@ -337,6 +368,16 @@ local function SelectionRadio(props)
props.onSubtreeSelectionChange(props.nodeId, "push")
end
end,
onRightClick = function()
if props.onSelectionChange then
props.onSelectionChange(props.nodeId, nil)
end
end,
onSubtreeRightClick = function()
if props.onSubtreeSelectionChange then
props.onSubtreeSelectionChange(props.nodeId, nil)
end
end,
}),
})
end