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.

Separate Patrol finding controls from disclosure

rcourtmanb2e437b1987b
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index d59ca96ccd..7c52e0d491 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -283,6 +283,11 @@ Patrol-specific presentation helpers.
The same panel also surfaces `investigation_record.confidence` as a
badge in the collapsed finding row (next to the investigation outcome
badge) so operators can scan trust without expanding every card.
+ Finding rows must keep their disclosure control separate from inline manual
+ controls: the row summary may be a keyboard-accessible expand/collapse
+ button, but acknowledge, snooze, dismiss, and other per-finding actions must
+ be sibling controls, not nested inside the disclosure button or a fake
+ role-button wrapper.
`FindingsPanel.tsx` also renders the
`previousResolvedFixSummary` operational-memory field directly on
the expanded finding card with emerald-accented styling, so
diff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsx
index 44e519f144..fba699144f 100644
--- a/frontend-modern/src/components/AI/FindingsPanel.tsx
+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx
@@ -841,28 +841,23 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
return (
<div
id={`finding-${finding.id}`}
- role="button"
- tabIndex={0}
- aria-expanded={expandedId() === finding.id}
- aria-controls={`finding-${finding.id}-details`}
- class={`p-3 cursor-pointer transition-colors ${
+ class={`p-3 transition-colors ${
finding.status === 'active'
? finding.acknowledgedAt
? 'opacity-60 hover:opacity-80 bg-surface-alt'
: 'hover:bg-surface-hover'
: 'opacity-60 bg-surface-alt hover:opacity-80'
}`}
- onClick={toggleExpanded}
- onKeyDown={(event) => {
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault();
- toggleExpanded();
- }
- }}
>
{/* Finding header */}
<div class="flex items-start justify-between gap-2">
- <div class="flex-1 min-w-0">
+ <button
+ type="button"
+ aria-expanded={expandedId() === finding.id}
+ aria-controls={`finding-${finding.id}-details`}
+ class="min-w-0 flex-1 cursor-pointer text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"
+ onClick={toggleExpanded}
+ >
<div class="flex items-center gap-2 flex-wrap">
{/* Status badge for non-active findings */}
<Show when={finding.status !== 'active'}>
@@ -1062,7 +1057,7 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
</span>
</Show>
</div>
- </div>
+ </button>
{/* Actions */}
<div class="flex items-center gap-1 shrink-0">
<Show when={finding.status === 'active'}>
diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.links.test.tsx b/frontend-modern/src/components/AI/__tests__/FindingsPanel.links.test.tsx
index a5c6737e8b..69918f0c29 100644
--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.links.test.tsx
+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.links.test.tsx
@@ -217,6 +217,25 @@ describe('FindingsPanel resource links', () => {
);
});
+ it('keeps finding disclosure separate from inline manual controls', async () => {
+ render(() => <FindingsPanel />);
+
+ await waitFor(() => expect(mockState.loadFindings).toHaveBeenCalled());
+
+ const disclosure = screen.getByRole('button', {
+ name: /Nextcloud failed readiness checks/,
+ });
+ const acknowledge = screen.getByRole('button', { name: 'Acknowledge' });
+
+ expect(disclosure).not.toContainElement(acknowledge);
+
+ fireEvent.click(disclosure);
+
+ expect(
+ screen.getByText('Nextcloud is unreachable for users until readiness recovers.'),
+ ).toBeInTheDocument();
+ });
+
it('can render Patrol findings from the direct Patrol source', async () => {
render(() => <FindingsPanel findingsSource="patrol" />);
diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
index 36290361b2..adfe9686f7 100644
--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
@@ -112,6 +112,16 @@ describe('FindingsPanel assistant handoff', () => {
expect(findingsPanelSource).toContain('confidence');
});
+ it('keeps collapsed finding disclosure separate from inline manual controls', () => {
+ // The collapsed finding row contains acknowledge/snooze/dismiss controls.
+ // Those controls must remain siblings of the disclosure button so the row
+ // does not expose one interactive control nested inside another.
+ expect(findingsPanelSource).not.toContain('role="button"');
+ expect(findingsPanelSource).toContain('aria-expanded={expandedId() === finding.id}');
+ expect(findingsPanelSource).toContain('onClick={toggleExpanded}');
+ expect(findingsPanelSource).toContain('</button>\n {/* Actions */}');
+ });
+
it('previews the will_fix_later remind-at deadline before the operator confirms dismiss', () => {
// The backend now treats will_fix_later as a real operational commitment
// (Finding.RemindAt, default 7 days), not a silent shut-up. The dismiss