fix(border-color): keep ComboBox popup clicks inside LeftPanel (TASK 63)

This commit is contained in:
2026-10-22 12:02:05 -07:00
parent daac7689fd
commit c768a8ee49
8 changed files with 241 additions and 87 deletions
@@ -31,6 +31,17 @@ not *"is this control type themed?"*.
matches `SelectedValue` ordinally (case-sensitively) and the palette mixes `#FFFFFF` and
`#e94560`; the model matches by VALUE, so the hex the creator typed in any case still lands
on the right row.
- **Clicking a popup row stays inside `LeftPanel` (2026-10-22 fix):** a `ComboBox`'s open
`PART_Popup` lives in its own `PopupRoot` visual tree (`VisualTreeHelper.GetParent(popupRoot)`
is `null`), connected back to the `Popup` and `ComboBox` only via `PopupRoot`'s **logical**
parent (`LogicalTreeHelper.GetParent(popupRoot)`). `LeftPanel.IsDescendantOf` previously used
`child is Visual ? VisualTreeHelper.GetParent(child) : LogicalTreeHelper.GetParent(child)`,
which returned `null` at `PopupRoot` because `PopupRoot` is a `Visual`. That caused
`MainWindow.Window_PreviewMouseLeftButtonDown` to see `IsClickInside == false` on any click
inside the open dropdown and clear `SelectedElement = null` — exiting the properties panel
before the `ComboBoxItem` click could select the colour. `IsDescendantOf` now falls back to
`LogicalTreeHelper.GetParent` and `TemplatedParent` whenever `VisualTreeHelper.GetParent`
returns `null`.
- **The closed box shows the swatch + the colour's NAME; the rows show swatch + hex + name**
(the rows the creator approved in TASK 60). A ComboBox cannot do that with one
`ItemTemplate` — WPF copies it into the read-only `SelectionBoxItemTemplate` — so