Skip to content

Notification log for triggered rule events#556

Open
bracyw wants to merge 4 commits intodevelopfrom
544-notification-log-for-triggered-rule-events
Open

Notification log for triggered rule events#556
bracyw wants to merge 4 commits intodevelopfrom
544-notification-log-for-triggered-rule-events

Conversation

@bracyw
Copy link
Copy Markdown
Collaborator

@bracyw bracyw commented Mar 29, 2026

Changes

Wires up the frontend to capture rule_notify socket events and display them across three surfaces, all backed by a single signal-based NotificationLogService (session-only, capped at 500 entries).

  • NotificationLogService accumulates rule_notify events with unread tracking, dismiss, and clear-all
  • Nav bar bell icon with popover dropdown showing the 10 most recent notifications and an unread badge count
  • Dedicated /notification-log page with a full scrollable table (Rule ID, Topic, Values, Time, dismiss per row)
  • NotificationLogPanelComponent ready to embed in the Notification Rules page
  • rule_notify socket handler parses the event as a JSON object (not string — backend emits via socketioxide serialize, not serde_json::to_string) and also fires a PrimeNG toast
  • Socket connection now sends clientId query param (persisted in localStorage) for rule subscription identity
  • Merged 535-rules-table branch to test notifications alongside the rules page end-to-end

Notes

  • This branch includes the 535 merge for integration testing — the 535 changes will land via their own PR
  • The rule_notify payload arrives as a pre-parsed object from socketioxide, unlike data/faults/timers which arrive as JSON strings — the handler accepts RuleNotification directly instead of calling JSON.parse
  • Signal updates from socket callbacks are wrapped in NgZone.run() to avoid ExpressionChangedAfterItHasBeenChecked errors

Test Cases

  • Receiving a rule_notify socket event adds a notification to all three surfaces
  • Badge count increments per event and clears when the dropdown opens
  • Individual dismiss removes only that entry; Clear All empties everything
  • Empty state renders correctly when no notifications exist
  • Navigation between pages preserves the log within a session
  • After 500+ events the oldest entries are dropped
  • Toast popup appears on each rule trigger with rule ID, topic, and values

Screenshots

screenshot pending

Checklist

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Assign the PR to yourself
  • PR is linked to the ticket
  • Screenshots of UI changes (see Screenshots section)
  • Request reviewers & ping on Slack

Closes #544

@bracyw bracyw self-assigned this Mar 29, 2026
@bracyw bracyw marked this pull request as draft March 29, 2026 18:34
@bracyw bracyw changed the base branch from develop to 535-rules-table-with-selection-and-row-actions March 29, 2026 23:20
@bracyw bracyw marked this pull request as ready for review March 29, 2026 23:23
@bracyw bracyw changed the base branch from 535-rules-table-with-selection-and-row-actions to develop March 29, 2026 23:26
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.

Notification log for triggered rule events

1 participant