Repository navigation
Plan viewer: minimap resize, double-click zoom and coloured edges (#4580) - #4603
Merged
Merged
Conversation
Ports PerformanceStudio's plan minimap core: a toggle button that opens a corner panel over the plan canvas, a scaled-down view of the whole plan (translucent per-root-child subtree backgrounds in an 8-color cycle, small per-node rectangles with the expensive-node tint and operator icon, elbow connectors), a viewport box that tracks the main scroll viewer's scroll/zoom, and click-to-center. The math (scale, node/subtree rectangles, viewport rectangle, click-to- offset) lives in a new pure PerformanceMonitor.PlanAnalysis.MinimapLayout, pinned in Darling.Tests.Viewer4580Tests. Resize/persist, double-click zoom+select, and accuracy-colored minimap edges are left for a follow-up; minimap edges use the neutral edge color for now.
# Conflicts: # Darling/Darling.Tests/Viewer4580Tests.cs # PerformanceMonitor.PlanAnalysis/MinimapLayout.cs # PerformanceMonitor.Ui/PlanViewerControl.Minimap.cs # PerformanceMonitor.Ui/PlanViewerControl.xaml
erikdarlingdata
marked this pull request as ready for review
September 28, 2026 16:25
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4580. Builds on #4596. Part of #4511.
Why
Part 1 (#4596) added the plan viewer's minimap panel but left three items for this pass, per PerformanceStudio's
PlanViewerControl.Minimap.cs: a resizable panel with its size remembered across plans, double-click on a minimap node to zoom and select it, and accuracy-ratio coloured minimap edges (using thePlanEdgeColourhelper from #4586, which is already ondev).What changes
PlanEdgeColourhelper and the same six-brush set the main canvas already defines — no new colours were introduced.MinimapLayout, alongside the geometry part 1 added. The WPF code-behind only wires these numbers to mouse events and the existing shapes.Test plan
Pins added to
Darling/Darling.Tests/Viewer4580Tests.cs(existing file from part 1; new members are new on this branch, so the RED for them is a compile failure on part 1'sb3317c250):ClampPanelSize: clamps to 160-500.ResizeFromDrag: subtracts the drag delta from the starting size (growing toward the pinned corner), clamped to bounds.GetZoomToNodeLevel: fits a node to about a third of the viewport, clamped to the zoom range, returns the minimum zoom when the viewport or node has no size.GetNodeCenterOffset: centers a node in the viewport, clamped to zero near the edges.FindNodeAt: returns the node whose minimap rectangle contains a point, or null.Runtime mutation (behavioural RED): flipped
ResizeFromDrag's subtraction to addition —ResizeFromDrag_SubtractsDeltaFromStartSize_ClampedToBoundsandResizeFromDrag_ClampsBelowMinAndAboveMaxboth failed (Darling.Tests Total: 26, Failed: 2); reverted, rebuilt, all 26 green again.Commands run (macOS, in-process xunit v3 runner,
Microsoft.WindowsDesktop.Appstripped from the runtimeconfig):Result:
Darling.Tests Total: 530, Errors: 0, Failed: 0, Skipped: 3.All four builds (Darling.Tests,
PerformanceMonitor.Ui, Lite, the Darling Viewer) are Release,-p:EnableWindowsTargeting=true, 0 warnings on every log.Not run (WPF-dependent, platform reasons): all
Viewer*classes that referencePresentationFrameworktypes fail to run on macOS for that reason alone; CI decides them.Screenshot plan (both hosts, since the control is shared): open a large multi-branch plan with some misestimated operators. Click "Minimap" — the panel appears with the same overview as part 1. Drag the resize grip in the panel's top-left corner and confirm it grows/shrinks between roughly 160px and 500px, re-rendering live; close and reopen the minimap (or load a different plan) and confirm the panel keeps the size you last set. Double-click a minimap node and confirm the main canvas zooms in on it, centers it, and selects it (its properties panel updates). Confirm minimap edges below a misestimated operator pick up the same orange/red (underestimated) or blue (overestimated) tint the main canvas shows for that same edge, instead of the plain neutral colour.
CHANGELOG
SECTION: Changed
ENTRY: - Plan viewer minimap: resize, double-click zoom, and accuracy-coloured edges ([#4603]) - The plan viewer's minimap panel can now be resized and remembers its size across plans, double-clicking a minimap node zooms to and selects it, and minimap edges pick up the same over/underestimate colouring as the main canvas.
REF: [#4603]: #4603