Summary
The notifications panel has several related issues that should be fixed together:
1. Panel does not dismiss when clicking outside
NotificationsViewModel.IsOpen is only toggled via ToggleOpenCommand (bound to the bell button). Clicking anywhere outside the panel does not close it. Expected: a click outside the panel (anywhere in the window not inside the panel) dismisses it, similar to a dropdown/flyout.
Suggested fix: subscribe to pointer-pressed events on the window (or use a transparent hit-test overlay behind the panel) and set IsOpen = false when a press is detected outside the panel bounds. Alternatively, host the panel in an Avalonia Popup or Flyout which handles outside-click dismissal natively.
2. No empty state message
When there are no notifications, the panel shows a blank scroll area. It should instead display a centred message: "There are no notifications."
Suggested fix: add an empty-state TextBlock in the panel (or a NotHasRows property on NotificationsViewModel) that is shown when Rows.Count == 0.
3. "Becoming transparent" animation does not cause the panel to disappear
There is currently no fade/transparency animation at all — IsVisible is bound directly to IsOpen with an instant show/hide. If a "becoming transparent" animation is introduced (e.g. an opacity transition), it must ultimately set IsVisible = false (or IsOpen = false) at the end so the panel is fully removed from the visual tree, not left as a transparent-but-present overlay that intercepts input.
Suggested fix: use an Avalonia Animation or Transition on Opacity triggered by IsOpen, combined with setting IsHitTestVisible="False" at opacity 0 and IsVisible="False" once the animation completes; or use a Popup/Flyout whose IsOpen drives both the animation and the visibility.
4. Notification panel styling is embedded directly in MainWindow.axaml
All visual properties of the panel — Background="#E0202020", CornerRadius, BoxShadow, hardcoded Width, MaxHeight, Padding, font weights and opacities — are inlined in MainWindow.axaml rather than defined in the shared style library. This bypasses the theming system and makes the panel invisible to theme changes.
Suggested fix:
- Extract the entire notifications panel into a dedicated
NotificationsControl (UserControl) in Phantom.Workspaces.
- Move all style properties into
Phantom.Workspaces.Gui.Styles (under a notifications-panel class or equivalent), using theme resource references (e.g. {DynamicResource ...}) for colours, opacities, and shadows rather than hardcoded hex values.
5. Styling does not obey the theme
Related to #4: Background="#E0202020" and Foreground="Gold" (on the unread count badge) are hardcoded colours that do not respond to light/dark theme switching or accent colour changes.
Suggested fix: replace all hardcoded colour values with {DynamicResource} references to the appropriate theme brush keys, consistent with how other panels in the app are styled.
Files
Phantom.Workspaces/MainWindow.axaml (lines 176–222) — notification panel markup
Phantom.Workspaces/ViewModels/NotificationsViewModel.cs — IsOpen, Rows, ToggleOpen
Phantom.Workspaces.Gui.Styles/ — no notification styles currently exist here; they should be added
Summary
The notifications panel has several related issues that should be fixed together:
1. Panel does not dismiss when clicking outside
NotificationsViewModel.IsOpenis only toggled viaToggleOpenCommand(bound to the bell button). Clicking anywhere outside the panel does not close it. Expected: a click outside the panel (anywhere in the window not inside the panel) dismisses it, similar to a dropdown/flyout.Suggested fix: subscribe to pointer-pressed events on the window (or use a transparent hit-test overlay behind the panel) and set
IsOpen = falsewhen a press is detected outside the panel bounds. Alternatively, host the panel in an AvaloniaPopuporFlyoutwhich handles outside-click dismissal natively.2. No empty state message
When there are no notifications, the panel shows a blank scroll area. It should instead display a centred message: "There are no notifications."
Suggested fix: add an empty-state
TextBlockin the panel (or aNotHasRowsproperty onNotificationsViewModel) that is shown whenRows.Count == 0.3. "Becoming transparent" animation does not cause the panel to disappear
There is currently no fade/transparency animation at all —
IsVisibleis bound directly toIsOpenwith an instant show/hide. If a "becoming transparent" animation is introduced (e.g. an opacity transition), it must ultimately setIsVisible = false(orIsOpen = false) at the end so the panel is fully removed from the visual tree, not left as a transparent-but-present overlay that intercepts input.Suggested fix: use an Avalonia
AnimationorTransitiononOpacitytriggered byIsOpen, combined with settingIsHitTestVisible="False"at opacity 0 andIsVisible="False"once the animation completes; or use aPopup/FlyoutwhoseIsOpendrives both the animation and the visibility.4. Notification panel styling is embedded directly in
MainWindow.axamlAll visual properties of the panel —
Background="#E0202020",CornerRadius,BoxShadow, hardcodedWidth,MaxHeight,Padding, font weights and opacities — are inlined inMainWindow.axamlrather than defined in the shared style library. This bypasses the theming system and makes the panel invisible to theme changes.Suggested fix:
NotificationsControl(UserControl) inPhantom.Workspaces.Phantom.Workspaces.Gui.Styles(under anotifications-panelclass or equivalent), using theme resource references (e.g.{DynamicResource ...}) for colours, opacities, and shadows rather than hardcoded hex values.5. Styling does not obey the theme
Related to #4:
Background="#E0202020"andForeground="Gold"(on the unread count badge) are hardcoded colours that do not respond to light/dark theme switching or accent colour changes.Suggested fix: replace all hardcoded colour values with
{DynamicResource}references to the appropriate theme brush keys, consistent with how other panels in the app are styled.Files
Phantom.Workspaces/MainWindow.axaml(lines 176–222) — notification panel markupPhantom.Workspaces/ViewModels/NotificationsViewModel.cs—IsOpen,Rows,ToggleOpenPhantom.Workspaces.Gui.Styles/— no notification styles currently exist here; they should be added