feat: notification improvements, tray balloon fallback, and debug tools#329
Merged
feat: notification improvements, tray balloon fallback, and debug tools#329
Conversation
…order When a weather alert (e.g. Dense Fog Advisory) is active, the PriorityEngine reorders metrics so the relevant category appears first. The fallback_text builder was hard-coding 'Temperature:' as the label for metrics[0] regardless of what it was after reordering, producing output like 'Temperature: ESE at 6.9 mph' instead of 'Wind: ESE at 6.9 mph'. Fix: iterate all metrics using their actual labels. Also adds a regression test covering the fog-alert reorder scenario.
Covers the full toast + sound path to diagnose 'sound plays but toast doesn't show when app is minimized': - toast_notifier.py: [toast] prefix logs on worker health, future result, desktop-notifier availability, thread name, sound path - alert_notification_system.py: [notify] prefix logs on alert count, queued notifications, sound candidates - alert_manager.py: [alertmgr] prefix logs on skip reasons, per-alert and global cooldown remaining time; upgrade key messages to INFO - main_window.py: [events] prefix logs on discussion-update path, notifier source, event count, per-event send result
…tion testing - Add 'Test: Discussion Updated' — fires real NWS discussion update notification - Add 'Test: Alert Notification...' — opens DebugAlertDialog with 12 preset alert types (Tornado Warning, Severe Thunderstorm, Flash Flood, Hurricane, Winter Storm, Fog, Frost, Heat, SWS, Air Quality, etc.) - Dialog shows sound event candidates in priority order so soundpacks can be auditioned for each alert type - Rename existing test to 'Run Notification Diagnostics' (still in submenu) - Debug submenu only visible when app.debug_mode is True
… menu - Tray right-click Debug submenu matches main window Help → Debug - Discussion and alert test items delegate to main window handlers - Alert dialog falls back gracefully if main window not open - Diagnostics item still runs pass/fail test
- Tray alert test creates DebugAlertDialog directly (parent=None if needed) - Dialog centres on screen when no parent window is available - Notifications and sound never required the main window; dialog now doesn't either
…hidden) When the main window is minimized to the system tray, Windows silently drops WinRT toast notifications from the app. Sound still played (via sound_player), but no visual notification appeared. Fix: add optional balloon_fn callback to SafeDesktopNotifier. When _send_in_worker returns False, call balloon_fn(title, message) if set. After tray icon init, wire balloon_fn to tray_icon.ShowBalloon() so users get a tray balloon notification when the window is hidden.
Calls balloon_fn directly to verify the tray fallback is wired before testing the full WinRT → balloon code path. Shows the message in the balloon if balloon_fn is set, or falls back to ShowBalloon directly. Available in both Help → Debug and tray right-click → Debug.
Without an AUMID, Windows labels balloon tips and toast notifications as 'notification from Python' (the process name). Setting the AUMID to 'Orinks.AccessiWeather' makes the source label read 'AccessiWeather' across all notification types. No-ops silently on non-Windows.
…oundpack plays instead
…lloon Direct balloon test was missing the _play_sound call that the real send_notification path makes after balloon_fn. Now mirrors the full fallback path: show balloon (silent) + play custom soundpack sound.
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.
What changed
Notifications now appear when the app is in the system tray
When the main window is minimized to the notification area, Windows was silently dropping toast notifications. A tray balloon fallback now fires automatically so you never miss an alert or discussion update, even when AccessiWeather is running in the background.
Notifications correctly labeled as AccessiWeather
Toast notifications and balloon tips now show "AccessiWeather" as the source instead of "notification from Python".
Debug menu: separate notification test items
The single "Test Notifications" item has been replaced with a full Debug submenu (visible in debug mode):
The same submenu is available from the system tray right-click menu.
Bug fix: metric labels after alert priority reorder
When a weather alert (e.g. Dense Fog Advisory) triggered a metric reorder, the fallback text hard-coded
Temperature:as the label for the first metric regardless of what it actually was — producing output like "Temperature: ESE at 6.9 mph". All metrics now use their real labels. Regression test added.Notification pipeline debug logging
Added structured
[toast],[notify],[alertmgr], and[events]debug logging across the notification stack to help diagnose notification delivery issues.Testing