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.

Improve mobile nav alert tab accessibility

rcourtmana2d798a56488
diff --git a/frontend-modern/src/components/shared/MobileNavBar.tsx b/frontend-modern/src/components/shared/MobileNavBar.tsx
index 29f25e3bc6..ef4c9828c5 100644
--- a/frontend-modern/src/components/shared/MobileNavBar.tsx
+++ b/frontend-modern/src/components/shared/MobileNavBar.tsx
@@ -1,6 +1,10 @@
import { For, Show } from 'solid-js';
import { type MobileNavBarProps, useMobileNavBarState } from './useMobileNavBarState';
-import { getMobileNavAlertBadgeCounts, getMobileNavTabButtonClass } from './mobileNavBarModel';
+import {
+ getMobileNavAlertBadgeCounts,
+ getMobileNavTabAriaLabel,
+ getMobileNavTabButtonClass,
+} from './mobileNavBarModel';
export type {
MobileNavBarPlatformTab,
@@ -67,6 +71,7 @@ export function MobileNavBar(props: MobileNavBarProps) {
data-tab-id={tab.id}
onClick={() => mobileNav.handleUtilityClick(tab)}
title={tab.tooltip}
+ aria-label={getMobileNavTabAriaLabel(tab)}
class={getMobileNavTabButtonClass({
active: props.activeTab() === tab.id,
})}
@@ -77,7 +82,7 @@ export function MobileNavBar(props: MobileNavBarProps) {
</span>
<Show when={alertBadges()}>
{(badges) => (
- <span class="absolute -right-2 -top-1 flex items-center gap-1">
+ <span aria-hidden="true" class="absolute -right-2 -top-1 flex items-center gap-1">
<Show when={badges().critical > 0}>
<span class="inline-flex h-4 min-w-[16px] items-center justify-center rounded-full bg-red-600 px-1 text-[10px] font-bold text-white">
{badges().critical}
diff --git a/frontend-modern/src/components/shared/mobileNavBarModel.ts b/frontend-modern/src/components/shared/mobileNavBarModel.ts
index 2b80e1b45c..7c61adb55f 100644
--- a/frontend-modern/src/components/shared/mobileNavBarModel.ts
+++ b/frontend-modern/src/components/shared/mobileNavBarModel.ts
@@ -87,6 +87,20 @@ export function getMobileNavAlertBadgeCounts(
};
}
+export function getMobileNavTabAriaLabel(tab: MobileNavBarUtilityTab): string {
+ const badges = getMobileNavAlertBadgeCounts(tab);
+ if (!badges) return tab.label;
+ const parts: string[] = [];
+ if (badges.critical > 0) {
+ parts.push(`${badges.critical} critical`);
+ }
+ if (badges.warning > 0) {
+ parts.push(`${badges.warning} warning`);
+ }
+ if (parts.length === 0) return tab.label;
+ return `${tab.label}: ${parts.join(', ')}`;
+}
+
export function getMobileNavTabButtonClass(options: {
active: boolean;
enabled?: boolean;