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 monitored-system banner when upgrade prompts are disabled

rcourtman28cf71387fb7
diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.json
index 7328960313..cf30b0e763 100644
--- a/docs/release-control/v6/internal/status.json
+++ b/docs/release-control/v6/internal/status.json
@@ -344,6 +344,7 @@
"src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx",
"src/components/Settings/__tests__/AgentProfilesPanel.test.tsx",
"src/components/shared/__tests__/HistoryChart.test.tsx",
+ "src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx",
"src/components/shared/__tests__/TrialBanner.test.tsx",
"src/pages/__tests__/AIIntelligence.test.tsx",
"src/features/patrol/__tests__/patrolCommercialBoundary.test.ts"
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 03a23fb241..ca65f414f7 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -808,6 +808,9 @@ infrastructure area uses `InfrastructurePanelStep` in-page state.
The shared monitored-system warning banner now uses a neutral policy-review
CTA and `reviewPolicyDestination` state, keeping the render shell pointed at
the usage-owned policy ledger instead of plan-selection or capacity wording.
+It also follows the resolved session-presentation upgrade policy, so ordinary
+self-hosted sessions with `presentationPolicy.hideUpgrade` do not render the
+banner, its plan-review link, or its upgrade-impression telemetry.
Shared alert presentation surfaces (`OverviewTab.tsx`, `HistoryTab.tsx`,
`AlertOverviewActiveAlertsSection.tsx`, `AlertHistoryTableSection.tsx`,
`AlertHistoryTableAlertRow.tsx`, `AlertOverviewAlertCard.tsx`) no longer accept
@@ -2600,12 +2603,13 @@ hooks stay on one canonical owner so suppression stays coherent across
customer-facing surfaces.
That same session-presentation boundary owns the non-promotional self-hosted
v6 app posture. Settings navigation, shared upgrade links, trial banners,
-history-lock overlays, and paid-feature gate primitives must honor resolved
-`presentationPolicy.hideUpgrade` by hiding prompts by default on ordinary
-self-hosted installs. Direct activation/recovery routes may still render their
-owned content, but sidebar discovery, trial CTAs, plan upsells, and feature
-upgrade links must not appear unless an explicit handoff, hosted-mode policy,
-or active entitlement says they should.
+monitored-system warning banners, history-lock overlays, and paid-feature gate
+primitives must honor resolved `presentationPolicy.hideUpgrade` by hiding
+prompts by default on ordinary self-hosted installs. Direct
+activation/recovery routes may still render their owned content, but sidebar
+discovery, trial CTAs, plan-review links, plan upsells, and feature upgrade
+links must not appear unless an explicit handoff, hosted-mode policy, or active
+entitlement says they should.
That same shared app-shell boundary now also owns assistant bootstrap silence
on non-AI routes. `frontend-modern/src/useAppRuntimeState.ts`,
`frontend-modern/src/App.tsx`,
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 2a56517e1b..97a0f64a46 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -666,6 +666,9 @@ describe('shared primitive guardrails', () => {
expect(monitoredSystemLimitWarningBannerStateSource).toContain(
'presentationPolicyHidesCommercialSurfaces',
);
+ expect(monitoredSystemLimitWarningBannerStateSource).toContain(
+ 'presentationPolicyHidesUpgradePrompts',
+ );
expect(monitoredSystemLimitWarningBannerStateSource).toContain('trackUpgradeMetricEvent');
expect(monitoredSystemLimitWarningBannerStateSource).toContain('hasMigrationGap');
expect(monitoredSystemLimitWarningBannerStateSource).not.toContain(
diff --git a/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx b/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx
index 33938d6c92..763538704c 100644
--- a/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/MonitoredSystemLimitWarningBanner.test.tsx
@@ -35,6 +35,7 @@ const mockTrackUpgradeMetricEvent = vi.hoisted(() => vi.fn());
const mockTrackUpgradeClicked = vi.hoisted(() => vi.fn());
const mockLoadRuntimeLicenseStatus = vi.hoisted(() => vi.fn());
const mockPresentationPolicyHidesCommercialSurfaces = vi.hoisted(() => vi.fn(() => false));
+const mockPresentationPolicyHidesUpgradePrompts = vi.hoisted(() => vi.fn(() => false));
const mockGetUpgradeActionDestination = vi.hoisted(() => vi.fn());
const mockGetUpgradeActionUrlOrFallback = vi.hoisted(() => vi.fn());
@@ -54,6 +55,7 @@ vi.mock('@/stores/licenseCommercial', () => ({
vi.mock('@/stores/sessionPresentationPolicy', () => ({
presentationPolicyHidesCommercialSurfaces: () => mockPresentationPolicyHidesCommercialSurfaces(),
+ presentationPolicyHidesUpgradePrompts: () => mockPresentationPolicyHidesUpgradePrompts(),
}));
vi.mock('@/utils/upgradeMetrics', () => ({
@@ -84,6 +86,8 @@ describe('MonitoredSystemLimitWarningBanner', () => {
});
mockPresentationPolicyHidesCommercialSurfaces.mockReset();
mockPresentationPolicyHidesCommercialSurfaces.mockReturnValue(false);
+ mockPresentationPolicyHidesUpgradePrompts.mockReset();
+ mockPresentationPolicyHidesUpgradePrompts.mockReturnValue(false);
mockLoadRuntimeLicenseStatus.mockReset();
mockLoadRuntimeLicenseStatus.mockResolvedValue(undefined);
mockGetUpgradeActionDestination.mockReset();
@@ -125,6 +129,9 @@ describe('MonitoredSystemLimitWarningBanner', () => {
expect(monitoredSystemLimitWarningBannerStateSource).toContain(
'presentationPolicyHidesCommercialSurfaces',
);
+ expect(monitoredSystemLimitWarningBannerStateSource).toContain(
+ 'presentationPolicyHidesUpgradePrompts',
+ );
expect(monitoredSystemLimitWarningBannerStateSource).toContain('trackUpgradeMetricEvent');
expect(monitoredSystemLimitWarningBannerStateSource).toContain('hasMigrationGap');
expect(monitoredSystemLimitWarningBannerStateSource).not.toContain(
@@ -286,4 +293,26 @@ describe('MonitoredSystemLimitWarningBanner', () => {
).not.toBeInTheDocument();
expect(mockTrackUpgradeMetricEvent).not.toHaveBeenCalled();
});
+
+ it('stays hidden when self-hosted upgrade prompts are suppressed', async () => {
+ mockPresentationPolicyHidesUpgradePrompts.mockReturnValue(true);
+ mockGetLimit.mockReturnValue({
+ key: 'max_monitored_systems',
+ limit: 6,
+ current: 5,
+ state: 'warning',
+ });
+
+ const mod = await import('../MonitoredSystemLimitWarningBanner');
+ render(() => (
+ <Router>
+ <Route path="/" component={mod.MonitoredSystemLimitWarningBanner} />
+ </Router>
+ ));
+
+ expect(
+ screen.queryByText('1 remaining. 5 monitored, 6 included.'),
+ ).not.toBeInTheDocument();
+ expect(mockTrackUpgradeMetricEvent).not.toHaveBeenCalled();
+ });
});
diff --git a/frontend-modern/src/components/shared/useMonitoredSystemLimitWarningBannerState.ts b/frontend-modern/src/components/shared/useMonitoredSystemLimitWarningBannerState.ts
index 734849a01b..3d07c62f25 100644
--- a/frontend-modern/src/components/shared/useMonitoredSystemLimitWarningBannerState.ts
+++ b/frontend-modern/src/components/shared/useMonitoredSystemLimitWarningBannerState.ts
@@ -1,5 +1,8 @@
import { createEffect, createMemo, onMount } from 'solid-js';
-import { presentationPolicyHidesCommercialSurfaces } from '@/stores/sessionPresentationPolicy';
+import {
+ presentationPolicyHidesCommercialSurfaces,
+ presentationPolicyHidesUpgradePrompts,
+} from '@/stores/sessionPresentationPolicy';
import {
getRuntimeMonitoredSystemCapacity,
getRuntimeLimit,
@@ -35,6 +38,7 @@ export function useMonitoredSystemLimitWarningBannerState() {
const showBanner = createMemo(
() =>
!presentationPolicyHidesCommercialSurfaces() &&
+ !presentationPolicyHidesUpgradePrompts() &&
shouldShowMonitoredSystemLimitBanner(monitoredSystemLimit(), monitoredSystemCapacity()),
);
const migrationGap = createMemo(() => hasMigrationGap());