From c3dcf31cc8012cb891534985a0d678d72d381baa Mon Sep 17 00:00:00 2001 From: Anso Date: Wed, 1 Jul 2026 14:31:54 -0400 Subject: [PATCH] fix: wrap auto-heal policy history in stack monitor sheet (#1538) * fix: wrap auto-heal policy history in stack monitor sheet Restructure PolicyRow history entries to stack vertically with break-words so long container names and reasons stay inside the sheet width. Fixes #1532 * fix: cap auto-heal policy history to a scrollable region Recent activity could grow the policy row unbounded, pushing the add-new-policy form far down the sheet when a policy accumulated many history entries. Wrap the list in a fixed-height ScrollArea so it scrolls internally instead. --- frontend/src/components/StackAlertSheet.tsx | 51 ++++++++++++--------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/StackAlertSheet.tsx b/frontend/src/components/StackAlertSheet.tsx index 6d3032a3..05950dcc 100644 --- a/frontend/src/components/StackAlertSheet.tsx +++ b/frontend/src/components/StackAlertSheet.tsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react'; import { SystemSheet, SheetSection } from '@/components/ui/system-sheet'; +import { ScrollArea } from '@/components/ui/scroll-area'; import { AlertDialog, AlertDialogAction, @@ -738,13 +739,13 @@ function PolicyRow({ policy, onDelete, onToggle, deleting, saving, isAdmin }: Po }; return ( -
-
-
- +
+
+
+ {policy.service_name ?? All services} - + Unhealthy for {policy.unhealthy_duration_mins} min • Cooldown: {policy.cooldown_mins} min • Max {policy.max_restarts_per_hour}/hr @@ -798,27 +799,35 @@ function PolicyRow({ policy, onDelete, onToggle, deleting, saving, isAdmin }: Po
{historyOpen && ( -
+

Recent activity

{history.length === 0 ? (

No history yet.

) : ( - history.map((entry) => ( -
- - {new Date(entry.timestamp).toLocaleString()} - - - {entry.container_name} - - - {actionLabel(entry.action)} - - - {entry.reason} - + +
+ {history.map((entry) => ( +
+
+ + {actionLabel(entry.action)} + + + {new Date(entry.timestamp).toLocaleString()} + +
+
+ {entry.container_name} +
+ {entry.reason ? ( +
+ {entry.reason} +
+ ) : null} +
+ ))}
- )) +
)}
)}