Skip to content

Notification log for triggered rule events#556

Merged
bracyw merged 10 commits intodevelopfrom
544-notification-log-for-triggered-rule-events
Apr 7, 2026
Merged

Notification log for triggered rule events#556
bracyw merged 10 commits intodevelopfrom
544-notification-log-for-triggered-rule-events

Conversation

@bracyw
Copy link
Copy Markdown
Collaborator

@bracyw bracyw commented Mar 29, 2026

Changes

Captures rule_notify socket events on the frontend and surfaces them across the nav, Rules page, and a dedicated log page — all backed by a single signal-based NotificationLogService (session-only, 500-entry cap).

  • NotificationLogService accumulates notifications with unread tracking, per-entry dismiss, and clear-all; public methods documented with JSDoc
  • Nav bar bell icon with popover dropdown showing the 10 most recent entries and an unread badge count
  • Collapsible notification stream rail on the Rules page (always expanded on mobile)
  • Red "View Log" button on the Rules page navigates to the full log
  • /notification-log page with a scrollable PrimeNG table (Rule ID, Topic, Values, Time, per-row dismiss, Clear All)
  • Shared NotificationListComponent renders both the nav popover and Rules page stream rail from one code path
  • Socket connection sends clientId query param (persisted in localStorage) for rule subscription identity
  • Removed accidentally committed .claude/settings.json symlink and added .claude/ to .gitignore

Notes

  • Includes the 535-rules-table branch merge for integration testing — those changes will land via their own PR
  • rule_notify payload arrives as a pre-parsed object from socketioxide, unlike data/faults/timers which arrive as JSON strings, so the handler accepts RuleNotification directly instead of calling JSON.parse
  • Signal updates from socket callbacks are wrapped in NgZone.run() to ensure change detection runs
  • No toast popup — notifications surface only via the bell badge, stream rail, and log page

Test Cases

  • Receiving a rule_notify socket event adds a notification to the nav popover, Rules stream rail, and log page
  • 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
  • Log is capped at 500 entries — oldest are dropped
  • View Log button on Rules page navigates to /notification-log
  • Stream rail toggles open/closed on desktop; always visible on mobile

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
@@ -0,0 +1 @@
/Users/wyattbracy/Desktop/ner/app_software/Argos/Argos-worktrees/.claude/settings.json No newline at end of file
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude folder should be ignored

additionalStyles="fontSize: 36px"
/>
<messages-per-second />
<div
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be made it's own component and abstracted to be able to be used again.

{
id: appRoutes.notificationLogRoute(),
label: 'Notification Log',
onClick: () => this.navigateTo(appRoutes.notificationLogRoute()),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create another ticket to generalize the Notification Center to have different sections and be customizable.

</div>
} @else {
@for (entry of notificationLogService.recentNotifications(); track entry.id) {
<div class="notification-item" [class.unread]="!entry.read">
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use a primeng component for this if possible. Oriented towards notifications or data of this type.

});
}

markAllRead(): void {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review if this is needed yet and add docs on how it is currently used

@bracyw bracyw requested a review from suryatho April 7, 2026 00:07
@bracyw bracyw merged commit f515ecf into develop Apr 7, 2026
4 checks passed
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

2 participants