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): restore full-width search rows

rcourtman3a01b39c93e2
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 2efba21a5b..729d63145a 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -773,6 +773,11 @@ storage surface does.
That same canonical-row rule also means the subtabs row should stand on its own
full-width shell instead of sharing a flex line with recovery-only chips or
adjacent badges that break the storage-style border and spacing treatment.
+That same shared page-controls contract applies to recovery search width too.
+The protected-items and recovery-events workspaces should keep the search field
+on the standard full-width shared search row, and any counts or utility cues
+should live in the toolbar actions instead of narrowing the search row through
+recovery-local grid overrides or width hacks.
That same handoff should keep recovery on the standard Pulse summary density.
`RecoverySummary.tsx` should use the shared default `SummaryPanel` /
`SummaryMetricCard` rhythm that infrastructure and workloads use, instead of
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
index 5baa678432..093fe01be8 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
@@ -134,16 +134,6 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
<PageControls
role="group"
aria-label="Recovery events controls"
- searchLeading={
- props.groupedByDay().length > 0 ? (
- <div class="flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted">
- <span>
- {props.groupedByDay().length} day group
- {props.groupedByDay().length === 1 ? '' : 's'}
- </span>
- </div>
- ) : undefined
- }
search={
<SearchInput
value={props.queryFilter}
@@ -152,7 +142,6 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
props.setCurrentPage(1);
}}
placeholder={getRecoveryHistorySearchPlaceholder()}
- class="min-w-[16rem] flex-1 !w-auto"
inputClass="py-2 text-sm"
clearOnEscape
history={{
@@ -168,6 +157,14 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
}}
utilityActions={
<div class="ml-auto flex items-center gap-2">
+ <Show when={props.groupedByDay().length > 0}>
+ <div class="flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted">
+ <span>
+ {props.groupedByDay().length} day group
+ {props.groupedByDay().length === 1 ? '' : 's'}
+ </span>
+ </div>
+ </Show>
<div class="relative">
<FilterActionButton
ref={advancedFiltersButtonRef}
@@ -354,7 +351,6 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
label: 'Reset all',
}}
showFilters={!props.isMobile || historyFiltersOpen()}
- searchRowClass="flex w-full flex-wrap items-center gap-3 sm:grid sm:grid-cols-[auto,minmax(16rem,1fr)] sm:items-center"
toolbarClass="lg:flex-nowrap"
>
<LabeledFilterSelect
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index f5d83771e7..c9d99e646d 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -207,7 +207,6 @@ export const RecoveryProtectedInventorySection: Component<
value={props.queryFilter}
onChange={(value) => props.setQueryFilter(value)}
placeholder={getRecoveryProtectedSearchPlaceholder()}
- class="min-w-[16rem] flex-1 !w-auto"
inputClass="py-1.5 text-sm"
clearOnEscape
history={{
@@ -222,7 +221,6 @@ export const RecoveryProtectedInventorySection: Component<
count: protectedActiveFilterCount(),
}}
showFilters={!props.isMobile || protectedFiltersOpen()}
- searchRowClass="flex w-full flex-wrap items-center gap-3 sm:grid sm:grid-cols-[auto,minmax(16rem,1fr)] sm:items-center"
toolbarClass="gap-3 lg:flex-nowrap"
>
<LabeledFilterSelect
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 342a2fb6ee..ebc7aece79 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -209,9 +209,9 @@ describe('Recovery', () => {
expect(screen.queryByText('Focused drill-in')).not.toBeInTheDocument();
await screen.findByText('VM 123');
const inventoryControls = screen.getByRole('group', { name: /protected items controls/i });
- expect(
- within(inventoryControls).getByPlaceholderText('Search protected items...'),
- ).toBeInTheDocument();
+ const protectedSearch = within(inventoryControls).getByPlaceholderText('Search protected items...');
+ expect(protectedSearch).toBeInTheDocument();
+ expect(protectedSearch.closest('div.relative')?.className).toContain('w-full');
expect(within(inventoryControls).queryByText(/^\d+ stale$/i)).not.toBeInTheDocument();
expect(within(inventoryControls).queryByText(/never succeeded/i)).not.toBeInTheDocument();
expect(
@@ -284,9 +284,9 @@ describe('Recovery', () => {
expect(
historyControls.compareDocumentPosition(historyTable) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);
- expect(
- within(historyControls).getByPlaceholderText('Search recovery history...'),
- ).toBeInTheDocument();
+ const historySearch = within(historyControls).getByPlaceholderText('Search recovery history...');
+ expect(historySearch).toBeInTheDocument();
+ expect(historySearch.closest('div.relative')?.className).toContain('w-full');
expect(within(historyTablist).getByRole('tab', { name: /protected items 2/i })).toBeInTheDocument();
expect(within(historyTablist).getByRole('tab', { name: /recovery events 1/i })).toBeInTheDocument();
expect(within(historyControls).getByText(/^1 day group$/i)).toBeInTheDocument();
diff --git a/frontend-modern/src/components/shared/PageControls.guardrails.test.ts b/frontend-modern/src/components/shared/PageControls.guardrails.test.ts
index 374db0c80f..62bbd0e09a 100644
--- a/frontend-modern/src/components/shared/PageControls.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/PageControls.guardrails.test.ts
@@ -100,6 +100,10 @@ describe('page controls guardrails', () => {
expect(pageControlsSource).toContain('{...divProps}');
expect(recoveryProtectedInventorySectionSource).not.toContain('<FilterHeader');
expect(recoveryHistorySectionSource).not.toContain('<FilterHeader');
+ expect(recoveryProtectedInventorySectionSource).not.toContain('searchRowClass=');
+ expect(recoveryHistorySectionSource).not.toContain('searchRowClass=');
+ expect(recoveryProtectedInventorySectionSource).not.toContain('!w-auto');
+ expect(recoveryHistorySectionSource).not.toContain('!w-auto');
});
it('keeps embedded workspace tabs on the canonical shared subtabs class pattern', () => {