The Service Health Pulse widget provides a compact visual indicator of overall platform status with an expandable per-service breakdown. It connects to the external dependencies monitoring system to display real-time health status across all monitored services.
src/components/ServiceHealthPulse.tsx— Main widget componentsrc/hooks/useServiceHealth.ts— Data fetching hook
- Compact Mode (default): Single pulse indicator with overall status and service count
- Detailed Mode: Expandable list showing individual service statuses
- Real-time Updates: Polls service health data every 60 seconds
- Theme Support: Full light and dark mode support via Tailwind CSS
- Accessibility: WCAG 2.1 AA compliant with screen reader support and color-independent status indicators
interface ServiceHealthPulseProps {
compact?: boolean; // Default: true - controls initial collapsed state
className?: string; // Additional CSS classes for custom styling
}| Prop | Type | Default | Description |
|---|---|---|---|
compact |
boolean |
true |
When true, the widget starts in collapsed mode. When false, service breakdown is initially visible. |
className |
string |
"" |
Additional CSS classes applied to the root container. |
Shows:
- Animated pulse indicator (color-coded by status)
- Overall status label
- Total service count
- Last updated timestamp
- Expand/collapse toggle button
Shows all compact mode content plus:
- Per-service breakdown list
- Individual service names
- Status indicator for each service
- Status label for each service
The widget displays one of five possible statuses:
| Status | Label | Color | Pulse Animation | Priority |
|---|---|---|---|---|
healthy |
"All systems operational" | Green | Yes | Lowest |
degraded |
"Degraded performance" | Yellow | Yes | Medium |
down |
"Service disruption" | Red | Yes | Highest |
maintenance |
"Scheduled maintenance" | Blue | No | Medium-High |
unknown |
"Status unknown" | Gray | No | Low |
The overall status is determined using worst-case aggregation:
- If any service is
down→ overall status isdown - Else if any service is
degraded→ overall status isdegraded - Else if any service is
maintenance→ overall status ismaintenance - Else if any service is
unknown→ overall status isunknown - Else → overall status is
healthy
The widget connects to the /api/v1/external-dependencies endpoint via the useServiceHealth hook. This endpoint provides:
- List of monitored external services
- Current status for each service
- Summary counts by status type
The hook polls this endpoint every 60 seconds by default and can be configured with custom refresh intervals.
import ServiceHealthPulse from './components/ServiceHealthPulse';
function Dashboard() {
return (
<div>
<ServiceHealthPulse />
</div>
);
}import ServiceHealthPulse from './components/ServiceHealthPulse';
function StatusPage() {
return (
<div>
<ServiceHealthPulse compact={false} />
</div>
);
}import ServiceHealthPulse from './components/ServiceHealthPulse';
function Sidebar() {
return (
<div>
<ServiceHealthPulse className="shadow-lg" />
</div>
);
}import { useServiceHealth } from './hooks/useServiceHealth';
function CustomHealthDisplay() {
const { data, isLoading, isError } = useServiceHealth();
if (isLoading) return <div>Loading...</div>;
if (isError) return <div>Error loading health data</div>;
return (
<div>
<h2>Overall Status: {data.overallStatus}</h2>
<p>Total Services: {data.totalServices}</p>
<p>Healthy: {data.healthyCount}</p>
<p>Degraded: {data.degradedCount}</p>
<p>Down: {data.downCount}</p>
</div>
);
}The widget uses the following Tailwind CSS classes and CSS variables:
--stellar-bg— Background color--stellar-card— Card background--stellar-border— Border color--stellar-text-primary— Primary text--stellar-text-secondary— Secondary text
- Green:
bg-green-500,text-green-400 - Yellow:
bg-yellow-500,text-yellow-400 - Red:
bg-red-500,text-red-400 - Blue:
bg-blue-500,text-blue-400 - Gray:
bg-gray-500,text-gray-400
All colors automatically adapt to light and dark themes via Tailwind's dark mode.
The widget follows WCAG 2.1 AA guidelines:
role="status"on overall pulse indicatoraria-live="polite"for status change announcementsrole="list"androle="listitem"for service breakdown- Descriptive
aria-labelattributes on all interactive elements
- Expand/collapse button is fully keyboard accessible
aria-expandedattribute indicates current statearia-controlslinks button to content region- Visible focus indicators on all interactive elements
- Every status indicator includes a text label
- Status dots are marked
aria-hidden="true"with adjacent text - No information conveyed by color alone
The widget includes comprehensive test coverage:
- Loading state rendering
- All status values (healthy, degraded, down, maintenance, unknown)
- Expand/collapse functionality
- Error state handling
- Empty service list handling
- Accessibility compliance (vitest-axe)
- Custom className application
- Data fetching and aggregation
- Status priority logic
- Error handling
- Empty data handling
Run tests with:
npm test ServiceHealthPulseExternalDependencyPanel— Detailed view of external dependencies with historyConnectionStatus— WebSocket connection status indicatorBridgeStatusCard— Individual bridge health status
Potential improvements for future iterations:
- Click-through to detailed dependency view
- Historical status timeline
- Configurable polling interval via props
- Status change notifications
- Export status data