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.

fix platform table filter reset

rcourtman37dfdf95ad4d
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 7abac7612a..f8db087afb 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -3892,6 +3892,12 @@ inherit the same ownership through `PlatformTableToolbar`. Recovery is event-fir
and does not use equal workspace subtabs for protected rollups versus event
history; Storage subtabs (Pools / Physical Disks) sit above the bar as
navigation, not filters.
+`PlatformTableToolbar` must always expose contextual Clear filters for a
+non-empty search, including simple table-local search/status state that does
+not need a feature-owned reset. Route-owned or multi-facet platform surfaces
+may supply one composite reset, which the toolbar delegates exactly once;
+otherwise the shared `FilterBar` fallback clears its search and inline status
+catalog without forcing every platform table to repeat reset plumbing.
Primary filters with small, stable option sets should stay one-click controls
inside that same `FilterDef[]` catalog by setting `inline: true`; `FilterBar`
renders those as unlabeled compact segmented controls in the same second-row
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index bb56b05837..b25d325034 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,17 +1,15 @@
{
"version": 1,
- "base_sha": "2402858e3c80b29d898e551c82969566c6a649b8",
- "verified_at": "2026-08-03T11:15:05Z",
+ "base_sha": "e3fdfc98b413db1b29b18cb65bb18bd10bdd3e18",
+ "verified_at": "2026-08-03T13:09:09Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/features/alerts/AlertHistoryFiltersCard.tsx",
- "frontend-modern/src/features/alerts/useAlertHistoryState.ts"
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx"
],
"content_sha256": {
- "frontend-modern/src/features/alerts/AlertHistoryFiltersCard.tsx": "768d706dad29c92c8a205059e48f16bd4fc8f652ad093501759f7f50c72d849c",
- "frontend-modern/src/features/alerts/useAlertHistoryState.ts": "e190111f1b89a806b7bd07cf2b10a5ba4f8e5d204c0cebea871964252c5ccebd"
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx": "b94fdef76a18a9ef95f393f11445b8da613593064e03260c9349f804d39fb2fb"
},
- "routes": ["/alerts/history"],
+ "routes": ["/truenas/overview", "/kubernetes/overview", "/vmware/networks"],
"viewports": [
{
"width": 1280,
@@ -23,20 +21,18 @@
}
],
"states": [
- "Desktop default, search-only, combined period/severity/search, and chart-bucket states",
- "Desktop Saved views empty, named-view, restored-view, removed-view, and deep-linked states",
- "Phone-width filter shell collapsed and expanded with search-only and combined filter state",
- "Phone-width Saved views dialog bounded within the viewport with active filter state"
+ "Desktop TrueNAS alert toolbar with default, search-only, and combined search/status state",
+ "Phone-width TrueNAS alert toolbar with collapsed and expanded filter rails",
+ "Desktop Kubernetes overview with URL-owned combined search/status state",
+ "Desktop vSphere networks with table-local search state"
],
"interactions": [
- "Entered search text alone and confirmed Clear filters appeared, then cleared the URL and visible search state in one action",
- "Selected Last 30d and Critical with search text, confirmed all three query parameters, and cleared them atomically back to defaults",
- "Saved the combined slice as Alert reset audit, cleared it, reapplied it, and confirmed the exact query string and visible controls were restored",
- "Reloaded the explicit deep link and confirmed search, period, and severity remained selected",
- "Removed the temporary saved view and confirmed it no longer appeared",
- "Selected an alert-frequency bucket, added a toolbar filter, and confirmed Clear filters removed both the route-owned filters and transient chart selection",
- "Expanded the phone-width filter shell and confirmed Saved and Clear filters remained aligned without overflow",
- "Opened and dismissed the phone-width Saved dialog with Escape and confirmed it stayed viewport-bounded",
- "Read the browser console after the final responsive pass and confirmed no warnings or errors"
+ "Entered TrueNAS alert search text and confirmed contextual Clear filters appeared without requiring table-specific reset plumbing",
+ "Selected Warning with search active and confirmed one Clear filters action restored blank search and All status",
+ "Expanded the phone-width TrueNAS filter rail and confirmed Clear filters and the result count aligned without clipping or overflow",
+ "Cleared phone-width search state and confirmed the Clear action disappeared while the status default remained selected",
+ "Loaded Kubernetes overview with ?q=payments&status=degraded, confirmed both controls hydrated, and verified its feature-owned composite reset returned the exact default route",
+ "Entered and cleared vSphere network search text to confirm the shared fallback applies across another table-local platform consumer",
+ "Read the browser console after the final cross-platform pass and confirmed no warnings or errors"
]
}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 3bc6d57057..8b0c8aba1d 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -8251,6 +8251,10 @@ describe('shared primitive guardrails', () => {
expect(sharedPlatformPageSource).toContain('viewOptions={props.viewOptions}');
expect(sharedPlatformPageSource).toContain('trailingControls={');
expect(sharedPlatformPageSource).not.toContain('ViewOptionsMenu');
+ expect(sharedPlatformPageSource).toContain(
+ 'showClearAll={() => Boolean(props.hasActiveFilters) || props.search().trim().length > 0}',
+ );
+ expect(sharedPlatformPageSource).toContain('onClearAll={props.onResetFilters}');
expect(savedViewsMenuSource).toContain('class="relative shrink-0"');
expect(savedViewsMenuSource).toContain('class="h-3.5 w-3.5"');
expect(savedViewsMenuSource).toContain('aria-label="Saved views"');
diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
index 1efb17f178..da9548816b 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
@@ -281,6 +281,64 @@ describe('filterPlatformResources', () => {
});
describe('PlatformTableToolbar', () => {
+ it('shows and clears search-only state without requiring a custom reset owner', () => {
+ const [search, setSearch] = createSignal('archive');
+
+ render(() =>
+ PlatformTableToolbar({
+ search,
+ onSearchChange: setSearch,
+ searchPlaceholder: 'Search alerts',
+ status: 'all',
+ onStatusChange: () => undefined,
+ statusOptions: [{ value: 'all', label: 'All' }],
+ visible: 1,
+ total: 2,
+ rowNoun: 'alerts',
+ }),
+ );
+
+ fireEvent.click(screen.getByRole('button', { name: 'Clear filters' }));
+
+ expect(search()).toBe('');
+ expect(screen.queryByRole('button', { name: 'Clear filters' })).not.toBeInTheDocument();
+ });
+
+ it('delegates active platform state to one custom reset when the route owns it', () => {
+ const [search, setSearch] = createSignal('payments');
+ const [status, setStatus] = createSignal('degraded');
+ let resetCount = 0;
+
+ render(() =>
+ PlatformTableToolbar({
+ search,
+ onSearchChange: setSearch,
+ searchPlaceholder: 'Search rows',
+ status: status(),
+ onStatusChange: setStatus,
+ statusOptions: [
+ { value: 'all', label: 'All' },
+ { value: 'degraded', label: 'Degraded' },
+ ],
+ visible: 1,
+ total: 3,
+ rowNoun: 'rows',
+ hasActiveFilters: true,
+ onResetFilters: () => {
+ resetCount += 1;
+ setSearch('');
+ setStatus('all');
+ },
+ }),
+ );
+
+ fireEvent.click(screen.getByRole('button', { name: 'Clear filters' }));
+
+ expect(resetCount).toBe(1);
+ expect(search()).toBe('');
+ expect(status()).toBe('all');
+ });
+
it('owns the View popover while keeping the row counter permanently visible', () => {
render(() =>
PlatformTableToolbar({
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 6ff975396c..300efb0240 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -1067,7 +1067,7 @@ export function PlatformTableToolbar<T extends string | number>(props: {
rowNoun={props.rowNoun}
/>
}
- showClearAll={() => Boolean(props.hasActiveFilters && props.onResetFilters)}
+ showClearAll={() => Boolean(props.hasActiveFilters) || props.search().trim().length > 0}
onClearAll={props.onResetFilters}
/>
);