mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
Fix Alerts bulk-edit dialog, slider focus/contrast, and destinations
Repair layout, keyboard focus, contrast, and semantic-token defects across
Alerts Thresholds and Notification Destinations surfaces:
- BulkEditDialog.tsx: remove the duplicate nested fixed inset-0 min-h-screen
overlay inside Dialog (which collapsed Dialog's role="dialog" shell to a 2px
ghost border strip and dropped horizontal padding at 360px phone widths),
link ariaLabelledBy to the heading, pass disabled={isOff()} to
ThresholdSlider so metrics toggled Off visibly dim and disable, raise
Unchanged/Clear dark-mode contrast with text-muted, and add min-h-11 mobile
touch targets and blue focus-visible rings to Clear, Cancel, and Apply.
- ThresholdSlider.tsx: add peer on the hidden range input and a visible blue
peer-focus-visible ring on the custom thumb pill so keyboard users can see
slider focus, and render thumb values in text-base-content (keeping metric
color borders via border-current) to fix ~2.2:1 light-mode contrast on green
and amber thresholds.
- ThresholdsTable.tsx: add blue focus-visible rings on the help-banner dismiss,
Expand all, and Collapse all buttons, and replace hover:text-muted with
text-muted hover:text-base-content.
- AlertDeliveryLogCard.tsx: migrate hardcoded gray-* neutral classes to
semantic tokens (text-base-content, text-muted, border-border,
hover:bg-surface-hover, divide-border, bg-surface-alt) and add a 44px mobile
touch target plus blue offset focus-visible ring on Refresh.
- WebhookConfigForm.tsx, EmailProviderSelect.tsx,
AlertAppriseDestinationsSection.tsx, and AlertDestinationOffSummary.tsx: add
aria-pressed and blue focus-visible rings to webhook service selector
buttons, add focus-visible rings to custom field/header/reapply/test/show-
settings buttons, and replace overflow-hidden with min-w-0 on
EmailProviderSelect so edge focus rings are not clipped at 360px.
- Add targeted Vitest regression assertions across all seven test files and
record paired desktop/narrow dark/light browser proof receipt
2d83a24486fa9fd6.json.
Contract-Neutral: Fixes dialog layout, slider focus/contrast, semantic tokens, and keyboard accessibility in existing Alerts Thresholds and Destinations UI components without changing API payloads, routes, or subsystem contracts.
Change-source: pulse-maintainer
This commit is contained in:
1 parent
0397f63650
commit
6334ff59b6
16 files changed
+360
-157
No files matched your search
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"version": 1,
|
||||
"base_sha": "0397f636509f77c8487d967c06baa665b9ed1989",
|
||||
"verified_at": "2026-11-29T04:58:58Z",
|
||||
"result": "passed",
|
||||
"changed_paths": [
|
||||
"frontend-modern/src/components/Alerts/BulkEditDialog.tsx",
|
||||
"frontend-modern/src/components/Alerts/EmailProviderSelect.tsx",
|
||||
"frontend-modern/src/components/Alerts/ThresholdsTable.tsx",
|
||||
"frontend-modern/src/components/Alerts/WebhookConfigForm.tsx",
|
||||
"frontend-modern/src/components/Workloads/ThresholdSlider.tsx",
|
||||
"frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx",
|
||||
"frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx",
|
||||
"frontend-modern/src/features/alerts/AlertDestinationOffSummary.tsx"
|
||||
],
|
||||
"content_sha256": {
|
||||
"frontend-modern/src/components/Alerts/BulkEditDialog.tsx": "15538117f470b8cc60808a234ec71d2b1d591466beee943c672eb8c1d696037f",
|
||||
"frontend-modern/src/components/Alerts/EmailProviderSelect.tsx": "a3047632fb8524bf3944381ef6c68f3044adb96b7eca7e87f522936e9c4ead43",
|
||||
"frontend-modern/src/components/Alerts/ThresholdsTable.tsx": "c9aa5b195714fcadababba721d39e4d5673cc0cc9ad2143a68907b5f2d6435d8",
|
||||
"frontend-modern/src/components/Alerts/WebhookConfigForm.tsx": "a8717cc9042bcb0078e2620becd3261311c0ad0fdcb9b8ec1efaa9a43243101a",
|
||||
"frontend-modern/src/components/Workloads/ThresholdSlider.tsx": "f0f5634e782fbd8994b3e3d089c2aa545add6ff56e529a073710af7b55c2c9d7",
|
||||
"frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx": "a6dcef4eb11235df4dd75c3c7d07d10d72a6c8e310b7daf6fa44d07babe4b15e",
|
||||
"frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx": "80de8708b266a03dda250c3e7267fd057c73fb06b28ba5ae1416a09e759cb9bf",
|
||||
"frontend-modern/src/features/alerts/AlertDestinationOffSummary.tsx": "3cd0418d674a2e7c027da1cc9a68ba65882897231a01b14e4439deeced8d0dcd"
|
||||
},
|
||||
"routes": [
|
||||
"/alerts/thresholds",
|
||||
"/alerts/destinations"
|
||||
],
|
||||
"viewports": [
|
||||
{
|
||||
"width": 1440,
|
||||
"height": 940
|
||||
},
|
||||
{
|
||||
"width": 360,
|
||||
"height": 820
|
||||
}
|
||||
],
|
||||
"states": [
|
||||
"Paired before (0397f63650) and after production builds on Chromium desktop 1440x940 dark/light and WebKit mobile 360x820 dark/light with reduced motion, 0px horizontal overflow, and zero console/page errors",
|
||||
"BulkEditDialog renders directly inside Dialog without a nested fixed overlay (eliminating the 2px ghost bar and full-bleed 0..360px phone layout), links aria-labelledby, disables ThresholdSlider when Memory % is toggled Off, raises Unchanged/Clear dark-mode contrast with text-muted, and sizes mobile Clear/Cancel/Apply controls to 44px with focus-visible rings",
|
||||
"ThresholdSlider exposes a visible blue peer-focus-visible ring around the focused CPU % thumb pill and renders thumb values in high-contrast text-base-content across dark and light modes",
|
||||
"ThresholdsTable Expand all, Collapse all, and help-banner dismiss controls render consistent blue focus-visible rings and text-muted hover:text-base-content contrast",
|
||||
"AlertDeliveryLogCard renders semantic neutral surface/border/text tokens and gives Refresh delivery status a 44px mobile touch target with a blue offset focus-visible ring",
|
||||
"WebhookConfigForm service selector grid buttons expose aria-pressed=true/false and blue focus-visible rings alongside Add/Remove header and custom field buttons",
|
||||
"EmailProviderSelect root wrapper removes overflow-hidden so Reapply defaults no longer clips its left focus-ring edge at 360px, and Reapply defaults, Send test email, Apprise Send test notification, and Show settings render crisp blue focus-visible rings"
|
||||
],
|
||||
"interactions": [
|
||||
"Keyboard-focused Expand all on /alerts/thresholds, expanded Virtualization Hosts, selected both nodes, and opened Bulk Edit Settings across desktop 1440x940 and narrow 360x820 dark/light profiles",
|
||||
"Toggled Memory % Off inside BulkEditDialog and verified its ThresholdSlider becomes disabled and dimmed while keyboard-focusing CPU % shows the peer-focus-visible ring",
|
||||
"Navigated to /alerts/destinations and keyboard-focused Refresh delivery status inside Recent delivery activity",
|
||||
"Clicked Edit on Ops Discord webhook, opened Service Type selector, and keyboard-focused Discord service option verifying aria-pressed=true and focus-visible ring",
|
||||
"Keyboard-focused Reapply defaults in Email notifications and Show settings in Apprise notifications across desktop and narrow viewports"
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Show, For, createSignal, createEffect } from 'solid-js';
|
||||
import { Show, For, createSignal, createEffect, createUniqueId } from 'solid-js';
|
||||
import { Dialog } from '../shared/Dialog';
|
||||
import { StatusBadge } from '../shared/StatusBadge';
|
||||
import { ThresholdSlider } from '../Workloads/ThresholdSlider';
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
ALERT_BULK_EDIT_UNCHANGED_LABEL,
|
||||
getAlertBulkEditApplyLabel,
|
||||
getAlertBulkEditDescription,
|
||||
getAlertBulkEditOpenLabel,
|
||||
} from '@/utils/alertBulkEditPresentation';
|
||||
|
||||
export interface BulkEditDialogProps {
|
||||
@@ -62,6 +61,7 @@ export function normalizeMetricKey(column: string): string {
|
||||
|
||||
export function BulkEditDialog(props: BulkEditDialogProps) {
|
||||
const [thresholds, setThresholds] = createSignal<Record<string, number | undefined>>({});
|
||||
const titleId = `bulk-edit-dialog-${createUniqueId()}-title`;
|
||||
|
||||
createEffect(() => {
|
||||
if (props.isOpen) {
|
||||
@@ -95,134 +95,132 @@ export function BulkEditDialog(props: BulkEditDialogProps) {
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog isOpen={props.isOpen} onClose={props.onClose} ariaLabel={getAlertBulkEditOpenLabel()}>
|
||||
<div class="fixed inset-0 min-h-screen z-100 flex items-center justify-center pointer-events-none">
|
||||
<div class="bg-surface rounded-xl shadow-2xl ring-1 ring-border max-w-lg w-full p-6 max-h-[90vh] flex flex-col pointer-events-auto">
|
||||
<h2 class="text-xl font-semibold text-base-content mb-2">
|
||||
{ALERT_BULK_EDIT_DIALOG_TITLE}
|
||||
</h2>
|
||||
<p class="text-sm text-muted mb-6">
|
||||
{getAlertBulkEditDescription(props.selectedIds.length)}
|
||||
</p>
|
||||
<Dialog
|
||||
isOpen={props.isOpen}
|
||||
onClose={props.onClose}
|
||||
ariaLabelledBy={titleId}
|
||||
panelClass="max-w-lg rounded-xl p-5 sm:p-6 shadow-2xl"
|
||||
>
|
||||
<h2 id={titleId} class="text-xl font-semibold text-base-content mb-2">
|
||||
{ALERT_BULK_EDIT_DIALOG_TITLE}
|
||||
</h2>
|
||||
<p class="text-sm text-muted mb-6">{getAlertBulkEditDescription(props.selectedIds.length)}</p>
|
||||
|
||||
<div class="space-y-6 overflow-y-auto px-1 flex-1 min-h-0">
|
||||
<For each={props.columns}>
|
||||
{(column) => {
|
||||
const metric = normalizeMetricKey(column);
|
||||
if (metric === 'backup' || metric === 'snapshot') return null;
|
||||
const bounds = getMetricBounds(metric);
|
||||
const val = () => thresholds()[metric];
|
||||
const isOff = () => isAlertResourceMetricOff(val());
|
||||
<div class="space-y-6 overflow-y-auto px-1 flex-1 min-h-0">
|
||||
<For each={props.columns}>
|
||||
{(column) => {
|
||||
const metric = normalizeMetricKey(column);
|
||||
if (metric === 'backup' || metric === 'snapshot') return null;
|
||||
const bounds = getMetricBounds(metric);
|
||||
const val = () => thresholds()[metric];
|
||||
const isOff = () => isAlertResourceMetricOff(val());
|
||||
|
||||
return (
|
||||
<div class="space-y-2 pb-4 border-b border-border-subtle last:border-0">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<span class="text-sm font-medium text-base-content">{column}</span>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs text-slate-500 font-mono">
|
||||
{isOff()
|
||||
? getAlertResourceTableMetricPlaceholder(true)
|
||||
: val() !== undefined
|
||||
? val()
|
||||
: ALERT_BULK_EDIT_UNCHANGED_LABEL}
|
||||
</span>
|
||||
<StatusBadge
|
||||
isEnabled={!isOff()}
|
||||
onToggle={() =>
|
||||
setThresholds((prev) => ({
|
||||
...prev,
|
||||
// Re-enabling has to stage a real threshold: an
|
||||
// undefined entry reads as "unchanged" on save, so
|
||||
// the selected resources would stay disabled.
|
||||
[metric]: isOff()
|
||||
? getAlertResourceEnabledDefault(metric)
|
||||
: ALERT_RESOURCE_METRIC_OFF_VALUE,
|
||||
}))
|
||||
}
|
||||
{...getAlertResourceTableMetricOffToggleProps()}
|
||||
return (
|
||||
<div class="space-y-2 pb-4 border-b border-border-subtle last:border-0">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<span class="text-sm font-medium text-base-content">{column}</span>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs text-muted font-mono">
|
||||
{isOff()
|
||||
? getAlertResourceTableMetricPlaceholder(true)
|
||||
: val() !== undefined
|
||||
? val()
|
||||
: ALERT_BULK_EDIT_UNCHANGED_LABEL}
|
||||
</span>
|
||||
<StatusBadge
|
||||
isEnabled={!isOff()}
|
||||
onToggle={() =>
|
||||
setThresholds((prev) => ({
|
||||
...prev,
|
||||
// Re-enabling has to stage a real threshold: an
|
||||
// undefined entry reads as "unchanged" on save, so
|
||||
// the selected resources would stay disabled.
|
||||
[metric]: isOff()
|
||||
? getAlertResourceEnabledDefault(metric)
|
||||
: ALERT_RESOURCE_METRIC_OFF_VALUE,
|
||||
}))
|
||||
}
|
||||
{...getAlertResourceTableMetricOffToggleProps()}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<div class="flex-1">
|
||||
{['cpu', 'memory', 'disk', 'temperature'].includes(metric) ? (
|
||||
<div class="py-1.5 px-1">
|
||||
<ThresholdSlider
|
||||
ariaLabel={`${column} threshold`}
|
||||
type={metric as 'cpu' | 'memory' | 'disk' | 'temperature'}
|
||||
min={bounds.min}
|
||||
max={bounds.max}
|
||||
value={val() !== undefined && !isOff() ? val()! : bounds.min}
|
||||
disabled={isOff()}
|
||||
onChange={(v) => {
|
||||
if (v < bounds.min || v > bounds.max) return;
|
||||
setThresholds((prev) => ({ ...prev, [metric]: v }));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<div class="flex-1">
|
||||
{['cpu', 'memory', 'disk', 'temperature'].includes(metric) ? (
|
||||
<div class="pt-2 px-1">
|
||||
<ThresholdSlider
|
||||
ariaLabel={`${column} threshold`}
|
||||
type={metric as 'cpu' | 'memory' | 'disk' | 'temperature'}
|
||||
min={bounds.min}
|
||||
max={bounds.max}
|
||||
value={val() !== undefined && !isOff() ? val()! : bounds.min}
|
||||
onChange={(v) => {
|
||||
if (v < bounds.min || v > bounds.max) return;
|
||||
setThresholds((prev) => ({ ...prev, [metric]: v }));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<input
|
||||
type="number"
|
||||
aria-label={`${column} threshold`}
|
||||
class="w-full h-9 rounded-md border border-border bg-surface px-3 py-1 text-sm shadow-xs transition-colors focus:border-sky-500 focus:outline-hidden focus:ring-1 focus:ring-sky-500"
|
||||
min={bounds.min}
|
||||
max={bounds.max}
|
||||
step={bounds.step}
|
||||
value={isOff() ? '' : (val() ?? '')}
|
||||
placeholder={
|
||||
isOff()
|
||||
? getAlertResourceTableMetricPlaceholder(true)
|
||||
: ALERT_BULK_EDIT_UNCHANGED_LABEL
|
||||
}
|
||||
onInput={(e) => {
|
||||
const v = parseFloat(e.currentTarget.value);
|
||||
if (!isNaN(v) && (v < bounds.min || v > bounds.max)) {
|
||||
return;
|
||||
}
|
||||
setThresholds((prev) => ({
|
||||
...prev,
|
||||
[metric]: isNaN(v) ? undefined : v,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div class="w-12 text-right">
|
||||
<Show when={val() !== undefined}>
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-slate-500 hover:text-red-500 transition-colors"
|
||||
onClick={() =>
|
||||
setThresholds((prev) => ({ ...prev, [metric]: undefined }))
|
||||
}
|
||||
>
|
||||
{ALERT_BULK_EDIT_CLEAR_LABEL}
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<input
|
||||
type="number"
|
||||
aria-label={`${column} threshold`}
|
||||
class="w-full h-9 rounded-md border border-border bg-surface px-3 py-1 text-sm shadow-xs transition-colors focus:border-sky-500 focus:outline-hidden focus:ring-2 focus:ring-sky-500/40"
|
||||
min={bounds.min}
|
||||
max={bounds.max}
|
||||
step={bounds.step}
|
||||
value={isOff() ? '' : (val() ?? '')}
|
||||
placeholder={
|
||||
isOff()
|
||||
? getAlertResourceTableMetricPlaceholder(true)
|
||||
: ALERT_BULK_EDIT_UNCHANGED_LABEL
|
||||
}
|
||||
onInput={(e) => {
|
||||
const v = parseFloat(e.currentTarget.value);
|
||||
if (!isNaN(v) && (v < bounds.min || v > bounds.max)) {
|
||||
return;
|
||||
}
|
||||
setThresholds((prev) => ({
|
||||
...prev,
|
||||
[metric]: isNaN(v) ? undefined : v,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
</div>
|
||||
<div class="w-12 text-right">
|
||||
<Show when={val() !== undefined}>
|
||||
<button
|
||||
type="button"
|
||||
class="min-h-11 rounded-sm px-1.5 text-xs text-muted hover:text-red-600 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 transition-colors sm:min-h-0 dark:hover:text-red-400"
|
||||
onClick={() => setThresholds((prev) => ({ ...prev, [metric]: undefined }))}
|
||||
>
|
||||
{ALERT_BULK_EDIT_CLEAR_LABEL}
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex justify-end gap-3 pt-4 border-t border-border shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
class="px-5 py-2 text-sm font-medium text-base-content bg-surface border border-border hover:bg-surface-hover rounded-md transition-colors shadow-xs"
|
||||
onClick={props.onClose}
|
||||
>
|
||||
{ALERT_BULK_EDIT_CANCEL_LABEL}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="px-5 py-2 text-sm font-medium text-white bg-sky-600 hover:bg-sky-500 rounded-md shadow-xs transition-colors"
|
||||
onClick={handleSave}
|
||||
>
|
||||
{getAlertBulkEditApplyLabel(props.selectedIds.length)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 flex flex-wrap justify-end gap-3 pt-4 border-t border-border shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
class="min-h-11 px-5 py-2 text-sm font-medium text-base-content bg-surface border border-border hover:bg-surface-hover rounded-md focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 transition-colors shadow-xs sm:min-h-0 dark:focus-visible:ring-offset-surface"
|
||||
onClick={props.onClose}
|
||||
>
|
||||
{ALERT_BULK_EDIT_CANCEL_LABEL}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="min-h-11 px-5 py-2 text-sm font-medium text-white bg-sky-600 hover:bg-sky-500 rounded-md focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 shadow-xs transition-colors sm:min-h-0 dark:focus-visible:ring-offset-surface"
|
||||
onClick={handleSave}
|
||||
>
|
||||
{getAlertBulkEditApplyLabel(props.selectedIds.length)}
|
||||
</button>
|
||||
</div>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
@@ -881,4 +881,27 @@ describe('EmailProviderSelect', () => {
|
||||
fireEvent.input(rateLimitInput, { target: { value: '25' } });
|
||||
expect(config().rateLimit).toBe(25);
|
||||
});
|
||||
|
||||
it('avoids clipping focus rings on root wrapper and gives Reapply defaults and Test focus rings', async () => {
|
||||
const { container } = render(() => (
|
||||
<EmailProviderSelect
|
||||
config={makeConfig({ enabled: true, provider: 'Gmail' })}
|
||||
onChange={onChangeMock}
|
||||
onTest={onTestMock}
|
||||
/>
|
||||
));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(getEmailProvidersMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
expect(container.firstElementChild?.className).not.toContain('overflow-hidden');
|
||||
expect(container.firstElementChild?.className).toContain('min-w-0');
|
||||
|
||||
const reapplyButton = screen.getByRole('button', { name: /reapply defaults/i });
|
||||
expect(reapplyButton.className).toContain('focus-visible:ring-2');
|
||||
|
||||
const testButton = screen.getByRole('button', { name: /send test email/i });
|
||||
expect(testButton.className).toContain('focus-visible:ring-2');
|
||||
});
|
||||
});
|
||||
@@ -79,7 +79,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="space-y-4 text-sm overflow-hidden">
|
||||
<div class="space-y-4 text-sm min-w-0">
|
||||
<div class={formField}>
|
||||
<div class="flex w-full flex-wrap items-end gap-2 sm:flex-nowrap">
|
||||
<FormSelect
|
||||
@@ -104,7 +104,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {
|
||||
const provider = state.currentProvider();
|
||||
if (provider) state.applyProviderDefaults(provider);
|
||||
}}
|
||||
class="min-h-11 text-xs font-medium text-blue-600 hover:underline sm:min-h-0 dark:text-blue-400"
|
||||
class="min-h-11 rounded-xs text-xs font-medium text-blue-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0 dark:text-blue-400"
|
||||
>
|
||||
{ALERT_EMAIL_REAPPLY_DEFAULTS_LABEL}
|
||||
</button>
|
||||
@@ -409,7 +409,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {
|
||||
type="button"
|
||||
onClick={props.onTest}
|
||||
disabled={props.testing || !props.config.enabled}
|
||||
class="min-h-11 rounded-sm border border-blue-500 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-50 disabled:opacity-50 disabled:cursor-not-allowed sm:min-h-0 dark:border-blue-400 dark:text-blue-300 dark:hover:bg-blue-900/25"
|
||||
class="min-h-11 rounded-sm border border-blue-500 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 disabled:opacity-50 disabled:cursor-not-allowed sm:min-h-0 dark:border-blue-400 dark:text-blue-300 dark:hover:bg-blue-900/25 dark:focus-visible:ring-offset-surface"
|
||||
>
|
||||
{getAlertEmailTestButtonLabel(Boolean(props.testing))}
|
||||
</button>
|
||||
|
||||
@@ -96,7 +96,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={state.dismissHelpBanner}
|
||||
class="absolute right-1 top-1 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md p-1 text-blue-600 transition-colors hover:bg-blue-100 hover:text-blue-800 dark:text-blue-300 dark:hover:bg-blue-900/40 dark:hover:text-blue-100 sm:right-2 sm:top-1.5 sm:min-h-0 sm:min-w-0"
|
||||
class="absolute right-1 top-1 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md p-1 text-blue-600 transition-colors hover:bg-blue-100 hover:text-blue-800 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 dark:text-blue-300 dark:hover:bg-blue-900/40 dark:hover:text-blue-100 sm:right-2 sm:top-1.5 sm:min-h-0 sm:min-w-0"
|
||||
title={state.getAlertThresholdsHelpDismissLabel()}
|
||||
aria-label={state.getAlertThresholdsHelpDismissLabel()}
|
||||
>
|
||||
@@ -181,7 +181,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={state.expandAll}
|
||||
class="min-h-11 rounded-sm px-2 py-1 text-xs transition-colors hover:bg-surface-hover hover:text-muted sm:min-h-0"
|
||||
class="min-h-11 rounded-sm px-2 py-1 text-xs text-muted transition-colors hover:bg-surface-hover hover:text-base-content focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0"
|
||||
>
|
||||
Expand all
|
||||
</button>
|
||||
@@ -191,7 +191,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={state.collapseAll}
|
||||
class="min-h-11 rounded-sm px-2 py-1 text-xs transition-colors hover:bg-surface-hover hover:text-muted sm:min-h-0"
|
||||
class="min-h-11 rounded-sm px-2 py-1 text-xs text-muted transition-colors hover:bg-surface-hover hover:text-base-content focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0"
|
||||
>
|
||||
Collapse all
|
||||
</button>
|
||||
|
||||
@@ -1611,6 +1611,38 @@ describe('WebhookConfig', () => {
|
||||
'button',
|
||||
);
|
||||
});
|
||||
|
||||
it('exposes aria-pressed and focus-visible rings on webhook service selector and field controls', async () => {
|
||||
render(() => (
|
||||
<WebhookConfig
|
||||
webhooks={[]}
|
||||
onAdd={onAddMock}
|
||||
onUpdate={onUpdateMock}
|
||||
onDelete={onDeleteMock}
|
||||
onTest={onTestMock}
|
||||
/>
|
||||
));
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: /add webhook/i }));
|
||||
|
||||
// Adding starts with the service picker already open.
|
||||
const serviceButtons = await waitFor(() => {
|
||||
const buttons = screen
|
||||
.getAllByRole('button')
|
||||
.filter((button) => button.hasAttribute('aria-pressed'));
|
||||
expect(buttons.length).toBeGreaterThan(0);
|
||||
return buttons;
|
||||
});
|
||||
expect(serviceButtons.some((button) => button.getAttribute('aria-pressed') === 'true')).toBe(
|
||||
true,
|
||||
);
|
||||
for (const button of serviceButtons) {
|
||||
expect(button.className).toContain('focus-visible:ring-2');
|
||||
}
|
||||
|
||||
const addHeaderButton = screen.getByRole('button', { name: /add header/i });
|
||||
expect(addHeaderButton.className).toContain('focus-visible:ring-2');
|
||||
});
|
||||
});
|
||||
|
||||
describe('webhook test/save parity', () => {
|
||||
|
||||
@@ -117,8 +117,9 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) {
|
||||
{(service) => (
|
||||
<button
|
||||
type="button"
|
||||
aria-pressed={props.formData().service === service.id}
|
||||
onClick={() => props.selectService(service.id)}
|
||||
class={`min-h-11 px-2 py-1.5 text-left border transition-colors text-xs sm:min-h-0 ${
|
||||
class={`min-h-11 rounded-sm px-2 py-1.5 text-left border transition-colors text-xs focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0 ${
|
||||
props.formData().service === service.id
|
||||
? 'border-blue-500 bg-blue-50 dark:bg-blue-900/25'
|
||||
: 'border-border hover:bg-surface-hover'
|
||||
@@ -348,7 +349,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => props.removeCustomFieldInput(index)}
|
||||
class="min-h-11 self-end px-2 py-1 text-xs text-red-600 hover:underline sm:min-h-0 dark:text-red-400"
|
||||
class="min-h-11 self-end rounded-sm px-2 py-1 text-xs text-red-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0 dark:text-red-400"
|
||||
>
|
||||
{ALERT_WEBHOOK_CUSTOM_FIELD_REMOVE_LABEL}
|
||||
</button>
|
||||
@@ -359,7 +360,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={props.addCustomFieldInput}
|
||||
class="min-h-11 w-full border border-dashed border-border px-2 py-1 text-xs hover:bg-surface-hover sm:min-h-0"
|
||||
class="min-h-11 w-full rounded-sm border border-dashed border-border px-2 py-1 text-xs hover:bg-surface-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0"
|
||||
>
|
||||
{ALERT_WEBHOOK_CUSTOM_FIELD_ADD_LABEL}
|
||||
</button>
|
||||
@@ -396,7 +397,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => props.removeHeaderInput(index)}
|
||||
class="min-h-11 self-end px-2 py-1 text-xs text-red-600 hover:underline sm:min-h-0 dark:text-red-400"
|
||||
class="min-h-11 self-end rounded-sm px-2 py-1 text-xs text-red-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0 dark:text-red-400"
|
||||
>
|
||||
{ALERT_WEBHOOK_HEADER_REMOVE_LABEL}
|
||||
</button>
|
||||
@@ -406,7 +407,7 @@ export function WebhookConfigForm(props: WebhookConfigFormProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={props.addHeaderInput}
|
||||
class="min-h-11 w-full border border-dashed border-border px-2 py-1 text-xs hover:bg-surface-hover sm:min-h-0"
|
||||
class="min-h-11 w-full rounded-sm border border-dashed border-border px-2 py-1 text-xs hover:bg-surface-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0"
|
||||
>
|
||||
{ALERT_WEBHOOK_HEADER_ADD_LABEL}
|
||||
</button>
|
||||
|
||||
@@ -11,6 +11,7 @@ vi.mock('../../Workloads/ThresholdSlider', () => ({
|
||||
min: number;
|
||||
max: number;
|
||||
value: number;
|
||||
disabled?: boolean;
|
||||
onChange: (v: number) => void;
|
||||
}) => (
|
||||
<input
|
||||
@@ -19,6 +20,7 @@ vi.mock('../../Workloads/ThresholdSlider', () => ({
|
||||
min={props.min}
|
||||
max={props.max}
|
||||
value={props.value}
|
||||
disabled={props.disabled}
|
||||
onInput={(e) => props.onChange(parseInt(e.currentTarget.value))}
|
||||
/>
|
||||
),
|
||||
@@ -433,4 +435,39 @@ describe('BulkEditDialog', () => {
|
||||
|
||||
expect(screen.getByText('Apply to 5 items')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders directly inside Dialog without a nested fixed overlay and links aria-labelledby', () => {
|
||||
const props = defaultProps();
|
||||
props.columns = ['CPU %', 'Memory %'];
|
||||
render(() => <BulkEditDialog {...props} />);
|
||||
|
||||
const dialog = screen.getByRole('dialog', { name: 'Bulk Edit Settings' });
|
||||
expect(dialog.querySelector('.fixed')).toBeNull();
|
||||
expect(dialog).toHaveAttribute('aria-labelledby');
|
||||
|
||||
const cancelButton = screen.getByRole('button', { name: 'Cancel' });
|
||||
const applyButton = screen.getByRole('button', { name: /Apply to 3 items/ });
|
||||
expect(cancelButton.className).toContain('min-h-11');
|
||||
expect(cancelButton.className).toContain('focus-visible:ring-2');
|
||||
expect(applyButton.className).toContain('min-h-11');
|
||||
expect(applyButton.className).toContain('focus-visible:ring-2');
|
||||
});
|
||||
|
||||
it('disables slider controls while a metric is toggled Off and re-enables them when toggled On', () => {
|
||||
const props = defaultProps();
|
||||
props.columns = ['CPU %'];
|
||||
render(() => <BulkEditDialog {...props} />);
|
||||
|
||||
const slider = screen.getByTestId('slider-cpu') as HTMLInputElement;
|
||||
expect(slider.disabled).toBe(false);
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'On' }));
|
||||
expect(slider.disabled).toBe(true);
|
||||
expect(screen.getByRole('button', { name: 'Clear' }).className).toContain(
|
||||
'focus-visible:ring-2',
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Off' }));
|
||||
expect(slider.disabled).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -1528,6 +1528,21 @@ describe('ThresholdsTable V6 ID compatibility', () => {
|
||||
render(() => <ThresholdsTable {...(baseProps() as any)} />);
|
||||
|
||||
const expandButton = screen.getByRole('button', { name: 'Expand all' });
|
||||
const collapseButton = screen.getByRole('button', { name: 'Collapse all' });
|
||||
expect(expandButton.parentElement).toHaveClass('items-center');
|
||||
expect(expandButton.className).toContain('focus-visible:ring-2');
|
||||
expect(expandButton.className).toContain('text-muted');
|
||||
expect(expandButton.className).toContain('hover:text-base-content');
|
||||
expect(collapseButton.className).toContain('focus-visible:ring-2');
|
||||
expect(collapseButton.className).toContain('text-muted');
|
||||
expect(collapseButton.className).toContain('hover:text-base-content');
|
||||
});
|
||||
|
||||
it('provides a visible keyboard focus ring on the help banner dismiss button', () => {
|
||||
localStorage.removeItem('pulse-thresholds-help-dismissed');
|
||||
render(() => <ThresholdsTable {...(baseProps() as any)} />);
|
||||
|
||||
const dismissButton = screen.getByRole('button', { name: /dismiss/i });
|
||||
expect(dismissButton.className).toContain('focus-visible:ring-2');
|
||||
});
|
||||
});
|
||||
@@ -161,4 +161,18 @@ describe('ThresholdSlider', () => {
|
||||
});
|
||||
expect(removeDocumentSpy).toHaveBeenCalledWith('mouseup', expect.any(Function));
|
||||
});
|
||||
|
||||
it('exposes peer-focus-visible thumb styling and high-contrast thumb label text', () => {
|
||||
render(() => <ThresholdSlider value={65} onChange={vi.fn()} type="memory" />);
|
||||
|
||||
const input = screen.getByTitle('MEMORY: 65%');
|
||||
expect(input.className).toContain('peer');
|
||||
|
||||
const label = screen.getByText('65%');
|
||||
expect(label.className).toContain('text-base-content');
|
||||
|
||||
const thumbWrapper = label.closest('.absolute.pointer-events-none')!;
|
||||
expect(thumbWrapper.className).toContain('peer-focus-visible:[&>div>div]:ring-2');
|
||||
expect(thumbWrapper.className).toContain('peer-focus-visible:[&>div>div]:ring-blue-500');
|
||||
});
|
||||
});
|
||||
@@ -33,14 +33,14 @@ export function ThresholdSlider(props: ThresholdSliderProps) {
|
||||
onInput={state.handleInput}
|
||||
onMouseDown={state.handleMouseDown}
|
||||
onWheel={state.handleInputWheel}
|
||||
class={`absolute inset-0 w-full h-3.5 opacity-0 ${props.disabled ? 'cursor-not-allowed' : 'cursor-pointer'} z-20 touch-none`}
|
||||
class={`peer absolute inset-0 w-full h-3.5 opacity-0 ${props.disabled ? 'cursor-not-allowed' : 'cursor-pointer'} z-20 touch-none`}
|
||||
disabled={props.disabled}
|
||||
title={state.sliderTitle()}
|
||||
/>
|
||||
|
||||
{/* Custom thumb with value */}
|
||||
<div
|
||||
class={`absolute top-1/2 pointer-events-none z-10 ${getThresholdSliderTextClass(props.type)}`}
|
||||
class={`absolute top-1/2 pointer-events-none z-10 peer-focus-visible:[&>div>div]:ring-2 peer-focus-visible:[&>div>div]:ring-blue-500 peer-focus-visible:[&>div>div]:ring-offset-1 peer-focus-visible:[&>div>div]:ring-offset-surface ${getThresholdSliderTextClass(props.type)}`}
|
||||
style={{
|
||||
left: `${state.thumbPosition()}%`,
|
||||
transform: state.thumbTransform(),
|
||||
@@ -48,7 +48,9 @@ export function ThresholdSlider(props: ThresholdSliderProps) {
|
||||
>
|
||||
<div class="relative">
|
||||
<div class="w-9 h-4 bg-surface rounded-full shadow-xs border-2 border-current flex items-center justify-center">
|
||||
<span class="text-[9px] font-semibold">{state.sliderLabel()}</span>
|
||||
<span class="text-[10px] font-semibold leading-none text-base-content">
|
||||
{state.sliderLabel()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -108,5 +108,13 @@ describe('AlertAppriseDestinationsSection', () => {
|
||||
const testButton = screen.getByRole('button', { name: /send test/i });
|
||||
expect(testButton).toBeInTheDocument();
|
||||
expect(testButton).toBeDisabled();
|
||||
expect(testButton.className).toContain('focus-visible:ring-2');
|
||||
});
|
||||
|
||||
it('gives the off-state Show settings button a visible keyboard focus ring', () => {
|
||||
renderSection(makeConfig({ enabled: false }));
|
||||
|
||||
const showSettings = screen.getByRole('button', { name: /show settings/i });
|
||||
expect(showSettings.className).toContain('focus-visible:ring-2');
|
||||
});
|
||||
});
|
||||
@@ -99,7 +99,7 @@ export function AlertAppriseDestinationsSection(props: AlertAppriseDestinationsS
|
||||
<Show when={props.config.enabled || showSettings()}>
|
||||
<button
|
||||
type="button"
|
||||
class="min-h-11 rounded-sm border border-blue-500 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-50 disabled:cursor-not-allowed disabled:opacity-50 sm:min-h-0 dark:border-blue-400 dark:text-blue-300 dark:hover:bg-blue-900/25"
|
||||
class="min-h-11 rounded-sm border border-blue-500 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 sm:min-h-0 dark:border-blue-400 dark:text-blue-300 dark:hover:bg-blue-900/25 dark:focus-visible:ring-offset-surface"
|
||||
disabled={!props.config.enabled || props.testing}
|
||||
onClick={props.onTest}
|
||||
>
|
||||
|
||||
@@ -571,4 +571,23 @@ describe('AlertDeliveryLogCard', () => {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
});
|
||||
|
||||
it('uses semantic neutral tokens and accessible touch/focus styling on the refresh control', () => {
|
||||
const { container } = render(() => (
|
||||
<AlertDeliveryLogCard
|
||||
log={log}
|
||||
unavailable={false}
|
||||
refreshing={false}
|
||||
onRefresh={vi.fn()}
|
||||
webhooks={webhooks}
|
||||
/>
|
||||
));
|
||||
|
||||
const refresh = screen.getByRole('button', { name: 'Refresh delivery status' });
|
||||
expect(refresh.className).toContain('min-h-11');
|
||||
expect(refresh.className).toContain('focus-visible:ring-2');
|
||||
expect(refresh.className).toContain('border-border');
|
||||
expect(refresh.className).toContain('text-base-content');
|
||||
expect(container.innerHTML).not.toMatch(/(?:text|bg|border|divide)-gray-/);
|
||||
});
|
||||
});
|
||||
@@ -73,7 +73,7 @@ const outcomeBadgeClasses: Record<NotificationDeliveryLogEntry['outcome'], strin
|
||||
retry: 'bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300',
|
||||
failed: 'bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300',
|
||||
dead_letter: 'bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300',
|
||||
cancelled: 'bg-gray-100 text-gray-600 dark:bg-gray-700/60 dark:text-gray-300',
|
||||
cancelled: 'bg-surface-alt text-muted',
|
||||
};
|
||||
|
||||
export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
@@ -146,10 +146,10 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
||||
<div class="min-w-0">
|
||||
<h3 id={titleId} class="text-sm font-semibold text-gray-900 dark:text-gray-100">
|
||||
<h3 id={titleId} class="text-sm font-semibold text-base-content">
|
||||
{getAlertDestinationsDeliveryLogTitle()}
|
||||
</h3>
|
||||
<p class="mt-1 text-sm leading-6 text-gray-600 dark:text-gray-400">
|
||||
<p class="mt-1 text-sm leading-6 text-muted">
|
||||
{getAlertDestinationsDeliveryLogDescription(
|
||||
completedRetentionDays(),
|
||||
deadLetterRetentionDays(),
|
||||
@@ -158,7 +158,7 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex shrink-0 items-center justify-center gap-2 rounded-md border border-gray-300 bg-transparent px-3 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-100 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700/40"
|
||||
class="inline-flex min-h-11 shrink-0 items-center justify-center gap-2 rounded-md border border-border bg-transparent px-3 py-1.5 text-sm font-medium text-base-content transition hover:bg-surface-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 sm:min-h-0 dark:focus-visible:ring-offset-surface"
|
||||
aria-disabled={props.refreshing}
|
||||
onClick={() => {
|
||||
if (!props.refreshing) props.onRefresh();
|
||||
@@ -180,12 +180,12 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
</p>
|
||||
</Show>
|
||||
<Show when={attemptsLoading() && entries().length === 0}>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400" role="status">
|
||||
<p class="text-sm text-muted" role="status">
|
||||
{getAlertDestinationsDeliveryLogLoading()}
|
||||
</p>
|
||||
</Show>
|
||||
<Show when={props.refreshingHeldEvents}>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400" role="status">
|
||||
<p class="text-sm text-muted" role="status">
|
||||
{getAlertDestinationsHeldEventsLoading()}
|
||||
</p>
|
||||
</Show>
|
||||
@@ -193,16 +193,14 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
when={rows().length > 0}
|
||||
fallback={
|
||||
<Show when={confirmedEmpty()}>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">
|
||||
{getAlertDestinationsDeliveryLogEmpty()}
|
||||
</p>
|
||||
<p class="text-sm text-muted">{getAlertDestinationsDeliveryLogEmpty()}</p>
|
||||
</Show>
|
||||
}
|
||||
>
|
||||
<ul
|
||||
tabIndex={0}
|
||||
aria-labelledby={titleId}
|
||||
class="max-h-80 divide-y divide-gray-200 overflow-y-auto rounded-sm focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:divide-gray-700"
|
||||
class="max-h-80 divide-y divide-border overflow-y-auto rounded-sm focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500"
|
||||
>
|
||||
<For each={rows()}>
|
||||
{(row) =>
|
||||
@@ -214,17 +212,17 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
>
|
||||
{getAlertDeliveryLogOutcomeLabel(row.entry.outcome)}
|
||||
</span>
|
||||
<span class="min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||
<span class="min-w-0 truncate text-sm font-medium text-base-content">
|
||||
{destinationLabel(row.entry)}
|
||||
</span>
|
||||
<span
|
||||
class="min-w-0 truncate text-sm text-gray-600 dark:text-gray-400"
|
||||
class="min-w-0 truncate text-sm text-muted"
|
||||
title={row.entry.alertIds.join(', ')}
|
||||
>
|
||||
{alertSummary(row.entry)}
|
||||
</span>
|
||||
<time
|
||||
class="ml-auto shrink-0 text-xs text-gray-500 dark:text-gray-400"
|
||||
class="ml-auto shrink-0 text-xs text-muted"
|
||||
dateTime={row.entry.timestamp}
|
||||
title={formatRelativeTime(row.entry.timestamp, { now: now() })}
|
||||
>
|
||||
@@ -256,19 +254,19 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
|
||||
class={`inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium ${
|
||||
row.event.type === 'notification_deferred'
|
||||
? 'bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300'
|
||||
: 'bg-gray-100 text-gray-600 dark:bg-gray-700/60 dark:text-gray-300'
|
||||
: 'bg-surface-alt text-muted'
|
||||
}`}
|
||||
>
|
||||
{row.event.type === 'notification_deferred' ? 'Deferred' : 'Held'}
|
||||
</span>
|
||||
<span class="min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||
<span class="min-w-0 truncate text-sm font-medium text-base-content">
|
||||
{heldResourceLabel(row.event)}
|
||||
</span>
|
||||
<span class="min-w-0 truncate text-sm text-gray-600 dark:text-gray-400">
|
||||
<span class="min-w-0 truncate text-sm text-muted">
|
||||
{describeAlertEventReason(row.event.reason)}
|
||||
</span>
|
||||
<time
|
||||
class="ml-auto shrink-0 text-xs text-gray-500 dark:text-gray-400"
|
||||
class="ml-auto shrink-0 text-xs text-muted"
|
||||
dateTime={row.event.occurredAt}
|
||||
title={formatRelativeTime(row.event.occurredAt, { now: now() })}
|
||||
>
|
||||
|
||||
@@ -16,7 +16,7 @@ export function AlertDestinationOffSummary(props: AlertDestinationOffSummaryProp
|
||||
<span>{props.message}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="min-h-11 text-sm font-medium text-blue-600 hover:underline sm:min-h-0 dark:text-blue-300"
|
||||
class="min-h-11 rounded-xs text-sm font-medium text-blue-600 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0 dark:text-blue-300"
|
||||
onClick={() => props.onShowSettings()}
|
||||
>
|
||||
{ALERT_DESTINATION_SHOW_SETTINGS_LABEL}
|
||||
|
||||
Reference in new issue
Block a user