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.

Announce platform filter result counts

pulse-triage[bot]8334ce57a582
diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
index 20a2f81dc4..bb6cc2dc8c 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
@@ -1,6 +1,6 @@
import { cleanup, fireEvent, render, screen, within } from '@solidjs/testing-library';
import { afterEach, describe, expect, it } from 'vitest';
-import { createRoot, createSignal } from 'solid-js';
+import { createComponent, createRoot, createSignal } from 'solid-js';
import type { Resource } from '@/types/resource';
import {
PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT,
@@ -13,6 +13,7 @@ import {
PlatformTableRelativeTimeValue,
PlatformTableTemperatureValue,
PlatformTableToolbar,
+ PlatformResourceCounter,
createPlatformTableFilterState,
formatPlatformTableBytesValue,
formatPlatformTableCountRatioValue,
@@ -414,6 +415,28 @@ describe('PlatformTableToolbar', () => {
expect(screen.queryByRole('button', { name: 'Clear filters' })).not.toBeInTheDocument();
});
+ it('exposes changing filter counts as one polite status message', () => {
+ const [visible, setVisible] = createSignal(3);
+
+ render(() =>
+ createComponent(PlatformResourceCounter, {
+ get visible() {
+ return visible();
+ },
+ total: 3,
+ rowNoun: 'rows',
+ }),
+ );
+
+ const resultStatus = screen.getByRole('status');
+ expect(resultStatus).toHaveAttribute('aria-live', 'polite');
+ expect(resultStatus).toHaveAttribute('aria-atomic', 'true');
+ expect(resultStatus).toHaveTextContent('3 rows');
+
+ setVisible(0);
+ expect(resultStatus).toHaveTextContent('0 of 3 rows');
+ });
+
it('delegates active platform state to one custom reset when the route owns it', () => {
const [search, setSearch] = createSignal('payments');
const [status, setStatus] = createSignal('degraded');
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 4d0bbc0ebf..f36aa0a2e0 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -1285,7 +1285,12 @@ export const PlatformResourceCounter: Component<{
}> = (props) => {
const totalNoun = () => getPlatformResourceCountNoun(props.rowNoun, props.total);
return (
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <span
+ class="ml-auto whitespace-nowrap text-xs font-medium text-muted"
+ role="status"
+ aria-live="polite"
+ aria-atomic="true"
+ >
<Show
when={props.visible !== props.total}
fallback={