Skip to content

Bug: multiple notifications panel issues — dismiss on outside click, empty state, fade animation, inline styles, theme compliance #86

Description

@JoshuaRowePhantom

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.csIsOpen, Rows, ToggleOpen
  • Phantom.Workspaces.Gui.Styles/ — no notification styles currently exist here; they should be added

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingverifiedIssue has been verified

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions