Repository navigation
Bug: multiple notifications panel issues — dismiss on outside click, empty state, fade animation, inline styles, theme compliance #86
Description
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) inPhantom.Workspaces. - Move all style properties into
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" 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 markupPhantom.Workspaces/ViewModels/NotificationsViewModel.cs—IsOpen,Rows,ToggleOpenPhantom.Workspaces.Gui.Styles/— no notification styles currently exist here; they should be added
Activity
JoshuaRowePhantom commentedon Jun 26, 2026
Additional issue: panel is obscured by DockControl despite ZIndex=100
Screenshot: The notification panel is partially or fully obscured by the workspace dock content even though the panel has
ZIndex="100"set.Root cause: The notification
Borderis declared as a sibling ofdock:DockControlinside<Grid Grid.Row="1" ColumnDefinitions="*,Auto,2*">(MainWindow.axamlline 176). Both occupyGrid.Column="2". Avalonia Grid ZIndex only governs draw order among siblings in the same visual layer, but Dock.Avalonia manages its own internal layering — dock tabs, overlays, and drag-handles render in their own sub-tree — so they paint on top of a ZIndex-elevated sibling in the parent Grid.Correct fix: Host the notifications panel in an Avalonia
Popupcontrol (which renders in its own top-level window layer, always above all other controls) rather than as a ZIndex-elevatedBorder. This also resolves issue #1 in this bug (outside-click dismissal) natively, becausePopuphas built-inLightDismissOverlayMode.Concretely:
LightDismissOverlayMode="OnTop"closes the popup on any outside click and keeps it above the dock layer. ThePlacementTargetmust reference the bellButton(give itx:Name="NotificationBellButton").This change should be done alongside the extract-to-
NotificationsControlrefactor (issue #4 above) so the popup content and its light-dismiss behaviour are encapsulated together.JoshuaRowePhantom commentedon Jun 26, 2026
Design
Root causes
Approach
Extract to control + Popup hosting:
Empty state:
Theme-compliant styles:
Files to change
No design doc updates needed (this is a UI implementation fix, not an architecture change).
Design decisions
JoshuaRowePhantom commentedon Jun 26, 2026
Tests
Unit Tests (Phantom.Workspaces.Tests\NotificationsViewModelTests.cs)
HasRows_WithNoRows_ReturnsFalse
HasRows_WithRows_ReturnsTrue
HasRows_RaisesPropertyChanged_WhenRowsChange
Integration Tests (not required for this issue)
All tests follow the Method_Condition_ExpectedResult naming convention and test the ViewModel logic in isolation.
Fix #86: notifications panel — Popup hosting, empty state, theme styl…
JoshuaRowePhantom commentedon Jun 30, 2026
Verification passed
Checked: commit
bed3ef4(Fix #86) on thefeaturesbranch. Files inspected:Phantom.Workspaces/ViewModels/NotificationsViewModel.csPhantom.Workspaces/Controls/NotificationsControl.axaml+.axaml.csPhantom.Workspaces/MainWindow.axamlPhantom.Workspaces.Gui.Shared/Styles/NotificationsStyles.axamlPhantom.Workspaces.Tests/NotificationsViewModelTests.csPhantom.Workspaces.Gui.Shared.Tests/NotificationsStylesTests.csResult: Implementation found, all verification criteria satisfied, tests present.
Features verified: