feat(activity): shared eventDisplay helper; kill raw source/severity leaks (Phase 1)#617
Merged
Merged
Conversation
…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.
8fce842 to
932e556
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsis the single source of truth —sourceLabel(
transaction→ "Compliance"),severityLabel,severityTone,relativeTime— adopted on every activity surface:
sourceLabel+severityLabel(was rawa.source/a.severity, e.g. "alert · info").{a.source}on each row (thecategory chip already labels the source);
severityTonenow from the helper.severityTone/activityRelativeTimecopies for the shared ones. This alsofixes a real drift (the drawer mapped
low→warn vs the widget'sinfo) andremoves 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-activityv1.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…) whennameOfcan't resolve the host —same "no UUIDs" goal, different (non-activity) widget.