fix(border-color): keep ComboBox popup clicks inside LeftPanel (TASK 63)
This commit is contained in:
@@ -2275,6 +2275,36 @@ sizes to its **content**, not to the ComboBox — measured 142.7px of popup for
|
||||
whose rows read "swatch + hex + name". A long row is never clipped, and the popup may be wider
|
||||
than the closed box. Measure with `ActualWidth` in a throwaway test; do not guess widths.
|
||||
|
||||
**2026-10-22 follow-up — `PopupRoot` IS a `Visual`, yet its `VisualTreeHelper.GetParent` is `null`:**
|
||||
Switching from a code-built `ContextMenu` (which is not in `MainWindow`'s routed-event path) to a
|
||||
`ComboBox` (`PART_Popup`) exposed a latent bug in `LeftPanel.IsDescendantOf`:
|
||||
```csharp
|
||||
child = child is Visual or System.Windows.Media.Media3D.Visual3D
|
||||
? VisualTreeHelper.GetParent(child)
|
||||
: LogicalTreeHelper.GetParent(child);
|
||||
```
|
||||
When the user clicked a colour row inside the open `ComboBox` popup, `PreviewMouseLeftButtonDown`
|
||||
tunnelled through `MainWindow.Window_PreviewMouseLeftButtonDown` first. `IsDescendantOf` walked up
|
||||
`VisualTreeHelper.GetParent` to `PopupRoot` (the root `Visual` of the popup's separate Win32
|
||||
`HwndSource`). Because `PopupRoot` IS a `Visual`, the ternary took the `VisualTreeHelper.GetParent`
|
||||
branch and got `null` — never crossing `PopupRoot`'s **logical** parent
|
||||
(`LogicalTreeHelper.GetParent(popupRoot) == PART_Popup`). `LeftPanel.IsClickInside` returned
|
||||
`false`, and `MainWindow` set `SelectedElement = null` (exiting the properties listing before the
|
||||
`ComboBoxItem` click could register). Fix: always coalesce
|
||||
`VisualTreeHelper.GetParent(child) ?? LogicalTreeHelper.GetParent(child) ?? (child as FrameworkElement)?.TemplatedParent`.
|
||||
|
||||
## 2026-10-22 — WINDOWS GIT IDENTITY + PRE-TASK GIT STATUS (RECIPE)
|
||||
|
||||
- **Windows `git` vs WSL `~/.gitconfig`:** the creator's `user.name` / `user.email` lived only in
|
||||
WSL's `~/.gitconfig`, so running `git commit` from the Windows PowerShell host failed with
|
||||
`Author identity unknown`. Fixed permanently in `.git/config` (`[user] name = gramps`,
|
||||
`email = gramps@llamachile.shop`). If you ever need the repo's commit author without running a
|
||||
shell command, read `.git/logs/HEAD` directly with `read_file`.
|
||||
- **Check `git status` BEFORE starting a task** (and never run multiline/compound shell commands
|
||||
when a single simple command or `read_file`/`edit_file` works): `verify.sh` runs `scope-check.sh`
|
||||
over `git diff HEAD`, so any pre-existing uncommitted files in the worktree will fail step 3 at
|
||||
the end of a 2-minute build+test run unless spotted up front.
|
||||
|
||||
## 2026-10-22 — SCANNING A GIT HISTORY FOR SECRETS WITHOUT EVER PRINTING ONE (RECIPE)
|
||||
|
||||
A release gate ("the repo goes public — check the history first"). The rule from
|
||||
|
||||
Reference in New Issue
Block a user