Show associated event detail in the decisions review expander #126

Merged
hannah-vernon merged 1 commit from feature/decision-rationale-events into dev 2026-09-22 12:04:59 -05:00
Owner

What does this PR do?

Enriches the expandable Rationale section on the /decisions list page so a reviewer can approve or reject a decision without opening the underlying incident.

For a decision whose classification subject is an incident, the expander now shows, below the rationale text:

  • An aggregate line: number of associated events found, distinct source addresses, and the time span they cover.
  • Each associated event, newest first by occurrence and capped at 20, with a link to /events/{id}, a meta line (timestamp, payload type, source), and a full payload field table rendered through the existing AdminText.PayloadFields helper.
  • A "showing X of N events" note with a link to the incident when the list is capped.

Rows without an incident keep the rationale-only view. The expander now also opens for review rows that carry events even when the rationale text is empty.

No related issue.

How was this tested?

  • dotnet build - 0 errors, 0 warnings (Viegard.AdminApi)
  • dotnet test - all pass (Viegard.AdminApi.Tests: 194/194)
  • Manually tested on a local, disposable in-memory instance

End-to-end render check against a disposable in-memory instance (no real installation or database touched): a synthetic Require-approval decision backed by a multi-event incident (mixed payload types, two distinct source addresses, varied timestamps) was seeded directly into the running process's in-memory stores through a temporary env-gated hook, the real login flow was driven, and /decisions was fetched.

  • App started with no startup exception.
  • Authenticated GET /decisions returned HTTP 200.
  • Rendered HTML contained the new markup (aggregate line, rationale-events blocks, per-event /events/{id} links, payload field rows).
  • No exceptions in the server log during rendering.
  • The temporary seeding code was removed afterward; the working tree is clean and only the intended feature files are committed.

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (AGENT-README.md Changes entry, TODO.md done entry)
  • New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md (no new dependencies)
  • No secrets, credentials, or real infrastructure identifiers in the diff
  • No commented-out code or debug leftovers
## What does this PR do? Enriches the expandable **Rationale** section on the `/decisions` list page so a reviewer can approve or reject a decision without opening the underlying incident. For a decision whose classification subject is an incident, the expander now shows, below the rationale text: - An aggregate line: number of associated events found, distinct source addresses, and the time span they cover. - Each associated event, newest first by occurrence and capped at 20, with a link to `/events/{id}`, a meta line (timestamp, payload type, source), and a full payload field table rendered through the existing `AdminText.PayloadFields` helper. - A "showing X of N events" note with a link to the incident when the list is capped. Rows without an incident keep the rationale-only view. The expander now also opens for review rows that carry events even when the rationale text is empty. No related issue. ## How was this tested? - [x] `dotnet build` - 0 errors, 0 warnings (`Viegard.AdminApi`) - [x] `dotnet test` - all pass (`Viegard.AdminApi.Tests`: 194/194) - [x] Manually tested on a local, disposable in-memory instance End-to-end render check against a disposable in-memory instance (no real installation or database touched): a synthetic Require-approval decision backed by a multi-event incident (mixed payload types, two distinct source addresses, varied timestamps) was seeded directly into the running process's in-memory stores through a temporary env-gated hook, the real login flow was driven, and `/decisions` was fetched. - App started with no startup exception. - Authenticated `GET /decisions` returned HTTP 200. - Rendered HTML contained the new markup (aggregate line, `rationale-events` blocks, per-event `/events/{id}` links, payload field rows). - No exceptions in the server log during rendering. - The temporary seeding code was removed afterward; the working tree is clean and only the intended feature files are committed. ## Checklist - [x] I have read the [Contributing Guide](../CONTRIBUTING.md) - [x] Changes are focused - one logical change per PR - [x] Documentation updated (AGENT-README.md Changes entry, TODO.md done entry) - [x] New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md (no new dependencies) - [x] No secrets, credentials, or real infrastructure identifiers in the diff - [x] No commented-out code or debug leftovers
The /decisions rationale expander now lists the resolved incident's
events below the rationale so a reviewer can approve or reject without
opening the incident.  Events are newest first by occurrence, capped at
20 with a link to the incident for the full set, and each event shows
full payload field detail (via AdminText.PayloadFields), a link to
/events/{id}, and an aggregate line (event count, distinct source
addresses, time span).  Rows without an incident keep the rationale-only
view, and the expander now opens for review rows that carry events even
when the rationale text is empty.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hannah-vernon/viegard-sentinel!126
No description provided.