Skip to content

Activity Feed: Add severity filtering and scheduler event integration #519

@lbedner

Description

@lbedner

Problem

The activity feed currently has two limitations:

  1. No filtering - All events display with no way to filter by severity. As the system grows (more components, more events), the feed becomes noisy. Users need to quickly isolate warnings/errors.

  2. Only health checks emit events - activity.add_event() exists as a clean utility (app/services/system/activity.py:87) but is only called from health.py for startup and status change events. Other meaningful system events (scheduler job execution, job failures, etc.) are silent.

Requirements

1. Segmented filter button on activity feed

Add a single-select segmented button bar above the feed table: All | Info | Warning | Error

  • All shows everything (default)
  • Info shows info + warning + error (severity >= 1)
  • Warning shows warning + error (severity >= 2)
  • Error shows error/unhealthy only (severity >= 3)
  • Filter applies to _STATUS_SEVERITY mapping already in activity_feed.py
  • Filter should persist across refreshes (store selected filter as instance state)
  • Grouping logic should still work on the filtered set

2. Wire up scheduler job events

Add activity.add_event() calls in the scheduler component so job executions appear in the feed:

  • Job started: status="info"
  • Job completed successfully: status="success"
  • Job failed: status="error" with exception details

Files to modify

  • app/components/frontend/dashboard/activity_feed.py - Add segmented filter UI + filtering logic
  • app/components/scheduler/main.py - Add activity events for job execution
  • Template counterparts in aegis/templates/copier-aegis-project/{{ project_slug }}/

Current State

Activity service (app/services/system/activity.py):

  • add_event(component, event_type, message, status, details) - already a clean, importable utility
  • ActivityEvent dataclass with: component, event_type, message, status, timestamp, details
  • InMemoryEventStore with bounded deque (100 events)
  • Protocol-based design ready for Redis/DB backends

Activity feed UI (app/components/frontend/dashboard/activity_feed.py):

  • Already has _STATUS_SEVERITY mapping (success=0, healthy=0, info=1, warning=2, error=3, unhealthy=3)
  • Groups consecutive same-component events
  • No filter controls - always shows all events

Event sources - only health.py:

  • activity.add_event(...) on first health check (startup)
  • activity.add_event(...) on status change
  • No other file in the codebase calls activity.add_event()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions