Skip to content

feat(activity): shared eventDisplay helper; kill raw source/severity leaks (Phase 1)#617

Merged
remyluslosius merged 1 commit into
mainfrom
feat/activity-shared-display
Jun 20, 2026
Merged

feat(activity): shared eventDisplay helper; kill raw source/severity leaks (Phase 1)#617
remyluslosius merged 1 commit into
mainfrom
feat/activity-shared-display

Conversation

@remyluslosius

Copy link
Copy Markdown
Contributor

Phase 1 of the activity readability initiative (docs/engineering/activity_readability_plan.md).

Phase 0 made the row title/summary human on the backend. Phase 1 fixes the
surrounding chrome: there was no shared formatter, so each surface rolled
its own source/severity/time rendering and leaked raw enums differently.

New src/api/eventDisplay.ts is the single source of truth — sourceLabel
(transaction → "Compliance"), severityLabel, severityTone, relativeTime
— adopted on every activity surface:

  • Dashboard Recent-activity widget (worst former leak): sourceLabel +
    severityLabel (was raw a.source / a.severity, e.g. "alert · info").
  • ActivityPage: dropped the redundant bare {a.source} on each row (the
    category chip already labels the source); severityTone now from the helper.
  • ActivityDrawer + HostDetailPage: deleted their private
    severityTone / activityRelativeTime copies for the shared ones. This also
    fixes a real drift (the drawer mapped low→warn vs the widget's info) and
    removes an em-dash from the invalid-date fallback.

Verified live on the dashboard: "Monitoring · just now / High",
"Audit · 1m ago / Info" — no raw enums.

Spec frontend-activity v1.1.0 (C-06, AC-06 behavioral + source-inspection).
Full frontend suite (320) + specter (111) green.

Follow-up (out of scope, noted): the dashboard "Top failing hosts" widget
still shows a host UUID (019eccd8…) when nameOf can't resolve the host —
same "no UUIDs" goal, different (non-activity) widget.

…leaks (Phase 1)

frontend-activity v1.1.0 (C-06, AC-06). Phase 1 of the activity readability
initiative (docs/engineering/activity_readability_plan.md).

There was no shared event-formatting layer: each surface rolled its own
source/severity/time rendering, so the same raw enum leaked differently in
each place (the dashboard widget was worst, printing 'alert · info').

New src/api/eventDisplay.ts is the single source of truth: sourceLabel
(transaction -> 'Compliance'), severityLabel, severityTone, relativeTime.
Adopted on every activity surface:
- Dashboard Recent-activity widget: now sourceLabel + severityLabel (was raw
  a.source / a.severity).
- ActivityPage: dropped the redundant bare {a.source} on the row (the
  category chip already labels it); severityTone now imported from the helper.
- ActivityDrawer + HostDetailPage: deleted their private severityTone /
  activityRelativeTime copies in favour of the shared ones (this also fixes a
  drift where the drawer mapped 'low' to warn vs widgets' info, and removes an
  em-dash from the invalid-date fallback).

Backend already makes the title/summary human (Phase 0); this makes the
surrounding chrome consistent and enum-free. Verified live on the dashboard.

Full frontend suite (320) + specter (111) green.
@remyluslosius remyluslosius force-pushed the feat/activity-shared-display branch from 8fce842 to 932e556 Compare June 20, 2026 19:56
@remyluslosius remyluslosius merged commit 022de24 into main Jun 20, 2026
13 checks passed
@remyluslosius remyluslosius deleted the feat/activity-shared-display branch June 20, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant