Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

refactor(recovery): compact events activity strip

rcourtmanf54ae46b1fa8
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 9ee3c81813..250d6f72c3 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -816,9 +816,10 @@ history surface itself, while current page and other table bookkeeping remain
in the table footer instead of competing with the scan path above the filters.
That same activity panel should stay compact and analytical rather than
becoming a second dashboard header. `RecoveryActivitySection.tsx` should keep a
-single slim telemetry header, compact active-filter chips, and a shorter chart
-frame so the events workspace hands off quickly from activity context to the
-history table.
+single slim telemetry header, compact active-filter chips, a shorter chart
+frame, reduced vertical insets, and a smaller legend footprint so the events
+workspace hands off quickly from activity context to the history table instead
+of spending a disproportionate slice of the screen on chart chrome.
That same events-table contract should also keep the default column set on a
monitoring-style scan path rather than a report-export path. Recovery events
should default to the concise columns operators need to triage quickly, while
diff --git a/frontend-modern/src/components/Recovery/RecoveryActivitySection.tsx b/frontend-modern/src/components/Recovery/RecoveryActivitySection.tsx
index f483a7abc3..90fed131e5 100644
--- a/frontend-modern/src/components/Recovery/RecoveryActivitySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryActivitySection.tsx
@@ -84,8 +84,8 @@ const rangeOptions: Array<7 | 30 | 90 | 365> = [7, 30, 90, 365];
function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JSX.Element {
return (
<>
- <div class="mb-2.5 flex flex-col gap-2.5">
- <div class="flex flex-col gap-2 lg:flex-row lg:items-center lg:justify-between">
+ <div class="mb-2 flex flex-col gap-2">
+ <div class="flex flex-col gap-1.5 lg:flex-row lg:items-center lg:justify-between">
<div class="flex min-w-0 flex-col gap-1.5">
<div class="flex flex-wrap items-baseline gap-x-2 gap-y-1">
<div class="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted">
@@ -110,7 +110,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
</div>
<div class="flex flex-wrap items-center gap-2">
<Show when={props.selectedHistoryItemLabel()}>
- <div class="inline-flex items-center gap-2 rounded-md border border-border-subtle bg-surface/70 px-2.5 py-1.5 text-xs">
+ <div class="inline-flex items-center gap-2 rounded-md border border-border-subtle bg-surface/70 px-2.5 py-1 text-xs">
<span class="font-semibold uppercase tracking-[0.14em] text-muted">Focused Item</span>
<span class="max-w-[18rem] truncate font-medium text-base-content">
{props.selectedHistoryItemLabel()}
@@ -138,7 +138,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
props.activeNamespaceLabel()
}
>
- <div class="mb-2 flex flex-wrap items-center gap-1.5">
+ <div class="mb-1.5 flex flex-wrap items-center gap-1.5">
<Show when={props.selectedDateKey()}>
{(() => {
const chip = getRecoveryFilterChipPresentation('day');
@@ -230,8 +230,8 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
</div>
</Show>
- <div class="rounded-lg border border-border-subtle bg-surface-alt/25 p-2.5">
- <div class={`mb-2.5 flex flex-wrap items-center justify-between gap-3 ${RECOVERY_TIMELINE_RANGE_GROUP_CLASS}`}>
+ <div class="rounded-lg border border-border-subtle bg-surface-alt/25 p-2">
+ <div class={`mb-2 flex flex-wrap items-center justify-between gap-3 ${RECOVERY_TIMELINE_RANGE_GROUP_CLASS}`}>
<div class="text-[11px] text-muted">Range</div>
<div class={RECOVERY_TIMELINE_RANGE_GROUP_CLASS}>
<For each={rangeOptions}>
@@ -251,7 +251,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
<Show
when={!props.loading() && props.timeline().points.length > 0}
fallback={
- <div class="flex h-40 items-center justify-center text-sm text-muted">
+ <div class="flex h-32 items-center justify-center text-sm text-muted">
{props.loading()
? getRecoveryActivityLoadingState().text
: getRecoveryActivityEmptyState().text}
@@ -259,7 +259,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
}
>
<div class="relative">
- <div class="mb-2 flex flex-wrap items-center justify-end gap-3 text-[10px] text-muted">
+ <div class="mb-1.5 flex flex-wrap items-center justify-end gap-2 text-[9px] text-muted">
<div class={RECOVERY_TIMELINE_LEGEND_ITEM_CLASS}>
<span class={`h-2.5 w-2.5 rounded ${getRecoveryArtifactModePresentation('snapshot').segmentClassName}`} />
{getRecoveryArtifactModePresentation('snapshot').aggregateLabel}
@@ -275,7 +275,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
</div>
<div class="grid grid-cols-[auto_minmax(0,1fr)] gap-3">
- <div class="flex h-24 flex-col justify-between text-[10px] text-muted">
+ <div class="flex h-20 flex-col justify-between text-[10px] text-muted">
<For each={[0, 1, 2, 3, 4]}>
{(step) => {
const value = Math.round((props.timeline().axisMax * (4 - step)) / 4);
@@ -284,7 +284,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
</For>
</div>
- <div class="relative h-28">
+ <div class="relative h-24">
<div
data-testid="recovery-activity-bars"
class="absolute inset-x-0 bottom-4 top-0 flex items-stretch gap-[3px]"
@@ -423,7 +423,7 @@ function RecoveryActivitySectionContent(props: RecoveryActivitySectionProps): JS
export const RecoveryActivitySection: Component<RecoveryActivitySectionProps> = (props) =>
props.embedded ? (
- <div class="px-4 py-4 sm:px-5">
+ <div class="px-4 py-3 sm:px-5">
<RecoveryActivitySectionContent {...props} />
</div>
) : (
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index bcdec219be..d00dd80b2d 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -285,6 +285,7 @@ describe('Recovery', () => {
const historyTable = screen.getAllByRole('table')[0];
const historyControls = screen.getByRole('group', { name: /recovery events controls/i });
const historyTablist = screen.getByRole('tablist', { name: /recovery data view/i });
+ const activityBars = screen.getByTestId('recovery-activity-bars');
const eventsWorkspaceCard = historyTablist.closest('.overflow-hidden');
expect(eventsWorkspaceCard).not.toBeNull();
expect(eventsWorkspaceCard).toContainElement(historyTablist);
@@ -292,6 +293,7 @@ describe('Recovery', () => {
historyTablist.compareDocumentPosition(historyControls) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);
const activityHeading = screen.getByText('Recovery Activity');
+ expect(activityBars.parentElement?.className).toContain('h-24');
expect(eventsWorkspaceCard).toContainElement(activityHeading);
expect(eventsWorkspaceCard).toContainElement(historyControls);
expect(eventsWorkspaceCard).toContainElement(historyTable);
diff --git a/frontend-modern/src/components/Recovery/__tests__/RecoveryActivitySection.test.tsx b/frontend-modern/src/components/Recovery/__tests__/RecoveryActivitySection.test.tsx
index 4af4b8b58e..a3871f69a2 100644
--- a/frontend-modern/src/components/Recovery/__tests__/RecoveryActivitySection.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/RecoveryActivitySection.test.tsx
@@ -43,6 +43,7 @@ describe('RecoveryActivitySection', () => {
const bars = screen.getByTestId('recovery-activity-bars');
expect(bars.className).toContain('items-stretch');
+ expect(bars.parentElement?.className).toContain('h-24');
expect(screen.getAllByRole('button', { name: /recovery points/i })).toHaveLength(2);
});
});