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.

Hide no-op Patrol sort control

rcourtman04e08f69a8ee
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 505fa70bb2..1316fd21a0 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -191,6 +191,10 @@ than promotional. Inside the Patrol findings tab, the card header should use a
direct label such as `Patrol findings` and should not add extra product
restatement or marketing subtitles that compete with the page-level Patrol
header above.
+That same control bar should also stay proportional to the current findings
+set. Sort controls belong only when there are multiple Patrol findings to
+order; the empty state or single-finding state should not spend header space
+on a no-op sort selector.
When Patrol is currently running, that strip should still stay factual rather
than switching to another verdict label: the runtime may add an explicit
in-progress indicator, but the primary activity label remains recent activity
diff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsx
index c4b052196a..71a9c69995 100644
--- a/frontend-modern/src/components/AI/FindingsPanel.tsx
+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx
@@ -1035,14 +1035,16 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
}}
</For>
</div>
- <select
- value={sortBy()}
- onChange={(e) => setSortBy(e.currentTarget.value as 'severity' | 'time')}
- class="text-xs px-2 py-1 rounded border border-border bg-surface"
- >
- <option value="severity">By Severity</option>
- <option value="time">By Time</option>
- </select>
+ <Show when={patrolFindings().length > 1}>
+ <select
+ value={sortBy()}
+ onChange={(e) => setSortBy(e.currentTarget.value as 'severity' | 'time')}
+ class="text-xs px-2 py-1 rounded border border-border bg-surface"
+ >
+ <option value="severity">By Severity</option>
+ <option value="time">By Time</option>
+ </select>
+ </Show>
</div>
</Show>
diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
index 82fc2edab7..46f88e7c2b 100644
--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
@@ -171,6 +171,11 @@ describe('aiFindingPresentation', () => {
expect(findingsPanelSource).not.toContain('Pulse Patrol Findings');
expect(findingsPanelSource).not.toContain('AI-discovered insights');
});
+
+ it('only shows the sort control when there are multiple Patrol findings to sort', () => {
+ expect(findingsPanelSource).toContain('<Show when={patrolFindings().length > 1}>');
+ expect(findingsPanelSource).toContain('<option value="severity">By Severity</option>');
+ });
});
describe('sourceColors', () => {