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.

Centralize patrol dismissal labels

rcourtmance39c04e725b
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index e2751482c3..939184402f 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -352,3 +352,7 @@ The frontend Patrol intelligence page now also consumes that canonical
summary payload directly through the shared AI client and store, so the
visible summary card stays aligned with the same recent-change slice that the
runtime and API contracts expose.
+AI chat tool-name labels, pending-tool headers, and assistant status copy now
+also route through the shared frontend identifier-label helper, so the chat
+surfaces do not keep their own underscore-stripping behavior separate from
+the rest of the governed presentation helpers.
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 85367455d9..84ae7d233c 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -176,3 +176,7 @@ prefix rules instead of rebuilding that section locally.
The canonical shared AI resource context now also surfaces policy routing and
redaction hints from unified resources, so the Patrol page and resource drawer
see the same governance posture that the runtime uses for export boundaries.
+Patrol finding dismissal reasons and Patrol status labels now also route
+through the shared frontend identifier-label helper, so the Patrol surfaces
+do not keep their own underscore-stripping behavior separate from the rest
+of the governed presentation helpers.
diff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsx
index 21e6e6ee4d..bba96dcea4 100644
--- a/frontend-modern/src/components/AI/FindingsPanel.tsx
+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx
@@ -23,6 +23,7 @@ import { formatRelativeTime } from '@/utils/format';
import { getFindingAlertIdentifier, hasTriggeringAlert } from '@/utils/findingAlertIdentity';
import { logger } from '@/utils/logger';
import { segmentedButtonClass } from '@/utils/segmentedButton';
+import { formatIdentifierLabel } from '@/utils/textPresentation';
import {
buildFindingFilterOptions,
formatFindingLifecycleType,
@@ -527,7 +528,9 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
</span>
</Show>
<Show when={finding.dismissedReason}>
- <span class="ml-2 text-muted">({finding.dismissedReason?.replace(/_/g, ' ')})</span>
+ <span class="ml-2 text-muted">
+ ({formatIdentifierLabel(finding.dismissedReason)})
+ </span>
</Show>
<Show when={finding.status === 'snoozed' && finding.snoozedUntil}>
<span class="ml-2 text-blue-500 dark:text-blue-400">
@@ -846,7 +849,7 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
<div class="mt-2 p-2 rounded border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900">
<div class="flex items-center gap-2 mb-1.5">
<span class="text-xs font-medium text-red-700 dark:text-red-300">
- Dismiss as: {dismissReason().replace(/_/g, ' ')}
+ Dismiss as: {formatIdentifierLabel(dismissReason())}
</span>
</div>
<textarea
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 7efc5d60bd..79bd216142 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -1877,11 +1877,13 @@ describe('frontend resource type boundaries', () => {
expect(toolExecutionBlockSource).toContain('formatIdentifierLabel');
expect(aiChatSource).toContain('formatIdentifierLabel');
expect(patrolStatusBarSource).toContain('formatTriggerReason');
+ expect(findingsPanelSource).toContain('formatIdentifierLabel');
expect(patrolFormatSource).toContain('formatIdentifierLabel');
expect(aiFindingPresentationSource).toContain('formatIdentifierLabel');
expect(messageItemSource).not.toContain("replace(/^pulse_/, '').replace(/_/g, ' ')");
expect(toolExecutionBlockSource).not.toContain("replace(/^pulse_/, '').replace(/_/g, ' ')");
expect(aiChatSource).not.toContain("replace(/^pulse_/, '').replace(/_/g, ' ')");
+ expect(findingsPanelSource).not.toContain("replace(/_/g, ' ')");
expect(patrolStatusBarSource).not.toContain("replace(/_/g, ' ') : ''");
expect(patrolFormatSource).not.toContain("replace(/_/g, ' ') : 'Unknown'");
expect(aiFindingPresentationSource).not.toContain("replace(/_/g, ' ')");