Skip to content

Fix #916 — chart tooltips break after tab switch (real root cause)#937

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/916-tooltip-disposal-fix
May 6, 2026
Merged

Fix #916 — chart tooltips break after tab switch (real root cause)#937
erikdarlingdata merged 1 commit into
devfrom
feature/916-tooltip-disposal-fix

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Changes

  • MemoryContent / ResourceMetricsContent / QueryPerformanceContent: drop DisposeChartHelpers() and ThemeManager unsubscribe from the tab-switch Unloaded handler. Move the ThemeManager unsubscribe into DisposeChartHelpers() so it runs only on real cleanup.
  • SystemEventsContent: same family of bug. Add a DisposeChartHelpers() method that disposes the 19 hover helpers, unsubscribes filter-popup events, and unsubscribes ThemeManager. Empty out OnUnloaded.
  • ServerTab.CleanupOnClose: add SystemEventsContent.DisposeChartHelpers() to the cleanup chain — those 19 hovers were leaking on tab close before this.

Final disposal still happens correctly via ServerTab.CleanupOnClose, which only fires when a server tab is actually removed from MainTabControl. Lite is unaffected — its Unloaded handler only unsubscribes ThemeManager and never disposed chart hovers.

Test plan

  • Build Dashboard
  • Open Dashboard → Overview → Resource Overview → confirm tooltip appears
  • Switch to Memory → Memory Overview → confirm tooltip appears
  • Switch back to Overview → tooltip still works
  • Switch back to Memory → tooltip still works (the original [BUG] Tooltip in Memory-charts stops working after a while #916 repro)
  • Repeat across all five Memory sub-tabs (Memory Overview, Memory Grants, Memory Clerks, Plan Cache, Memory Pressure Events)
  • Repeat for Resource Metrics tab (the Apply #916 popup-wedge fix to CorrelatedCrosshairManager #922 follow-up scenario)
  • Repeat for Query Performance tab
  • Repeat for System Events tab
  • Switch theme (light/dark) after a tab switch — chart colors should still update
  • Close the server tab — no exceptions, no leaked subscriptions

Fixes #916

🤖 Generated with Claude Code

PR #919 / #921 / #922 addressed the WPF Popup wedge but missed the
underlying bug: MemoryContent, ResourceMetricsContent, and
QueryPerformanceContent all called DisposeChartHelpers() from their
per-control Unloaded event handler. WPF fires Unloaded on every
TabControl tab switch, not just on destruction, so switching away from
the Memory tab unsubscribed every chart's MouseMove handlers — which
were never re-registered when the user came back. The popup-wedge fixes
were running inside helpers that had already torn themselves down.

ServerTab_Unloaded had the same comment warning future maintainers,
but the inner UserControls didn't follow that rule.

Changes:
- MemoryContent / ResourceMetricsContent / QueryPerformanceContent:
  drop DisposeChartHelpers() (and ThemeManager unsubscribe) from the
  tab-switch Unloaded handler. Move the ThemeManager unsubscribe into
  DisposeChartHelpers() so it runs only on real cleanup.
- SystemEventsContent: same pattern — add a DisposeChartHelpers()
  method that disposes the 19 hover helpers, unsubscribes filter-popup
  events, and unsubscribes ThemeManager. Empty out OnUnloaded.
- ServerTab.CleanupOnClose: add SystemEventsContent.DisposeChartHelpers()
  to the cleanup chain (its hovers leaked on tab close before this).

Final disposal still happens correctly via ServerTab.CleanupOnClose,
which only fires when a server tab is actually removed. Lite is
unaffected — its Unloaded handler never disposed hovers.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@erikdarlingdata erikdarlingdata merged commit 659eedd into dev May 6, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/916-tooltip-disposal-fix branch May 6, 2026 09:33
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