Skip to content

Fix capture grid dismissed by map popup light-dismiss - #43

Merged
emosaru merged 1 commit into
avaloniafrom
claude/hungry-jones
Apr 13, 2026
Merged

Fix capture grid dismissed by map popup light-dismiss#43
emosaru merged 1 commit into
avaloniafrom
claude/hungry-jones

Conversation

@emosaru

@emosaru emosaru commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Capturing items no longer work, cancels out of menu #42 — clicking items in the capture grid popup was closing the location details popup before the capture could register
  • The tunneling PointerPressed handler now detects clicks inside child popups (capture grid, etc.) by checking whether the visual root is the TopLevel window; popup overlays have a different root and are left alone

Root cause

Popup content in Avalonia renders on an overlay layer with a disconnected visual tree. The light-dismiss handler walked up from e.Source looking for LocationDetailsContent, but for nested popups (capture grid inside location details), the walk terminates at the overlay host without ever reaching LocationDetailsContent. The handler incorrectly treated this as an "outside" click.

Test plan

  • Open a map location popup, click a section's capture icon → capture grid opens
  • Click an item in the capture grid → item should be captured, popup closes normally
  • Click "Clear" in the capture grid → captured item should be cleared
  • Click outside both popups (on a tracker item, empty space, etc.) → location details popup should close
  • Double-click a map location → should still pin correctly

🤖 Generated with Claude Code

The tunneling PointerPressed handler that closes the location details popup
on outside clicks was also closing it when clicking inside child popups
(e.g. the capture grid). Popup content renders on an overlay layer with a
disconnected visual tree, so the walk from e.Source never reached
LocationDetailsContent for nested popups.

Fix: detect clicks inside popup overlays by checking whether the visual root
of e.Source is the TopLevel window. If not, the click is inside a popup
overlay and should not dismiss the location details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@emosaru
emosaru requested a review from a team April 13, 2026 08:32
@emosaru
emosaru merged commit a9920e2 into avalonia Apr 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant