From d2f739ece6aee26ba0efa341322da889232639ce Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 1 Mar 2026 06:38:14 -0600 Subject: [PATCH] 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. --- TODO.txt | 3 -- .../Components/PatchVisualizer/DomLabel.lua | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/TODO.txt b/TODO.txt index 0db1c29a..1bc4c5bd 100644 --- a/TODO.txt +++ b/TODO.txt @@ -339,9 +339,6 @@ We need to investigate Tree reconciliation, make sure it's parallel, etc. I'd really like to just reconcile specific paths that were modified - but i'm not sure if that just defeats the purpose.. need to explore this topic later. Worst case - we reconcile only on connect, but do so in mega-parallel -[change visualizer] -we should support right-click to unselect the bubble (atlas/studio/skip) - [auto select issue] when you commit changes on git, it's considered unchanged. we should send like the last git hash too, like prior to head, too. diff --git a/plugin/src/App/Components/PatchVisualizer/DomLabel.lua b/plugin/src/App/Components/PatchVisualizer/DomLabel.lua index 268e1c0d..b10c1fc7 100644 --- a/plugin/src/App/Components/PatchVisualizer/DomLabel.lua +++ b/plugin/src/App/Components/PatchVisualizer/DomLabel.lua @@ -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