From e685338fbcee36e10b2db07c098a18fa28694763 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 30 Mar 2026 22:27:55 +0100 Subject: [PATCH] Keep security banner out of the app chrome --- .../src/components/SecurityWarning.tsx | 243 +++++++++--------- .../__tests__/SecurityWarning.test.tsx | 2 + 2 files changed, 121 insertions(+), 124 deletions(-) diff --git a/frontend-modern/src/components/SecurityWarning.tsx b/frontend-modern/src/components/SecurityWarning.tsx index b2d679874..b7b20f972 100644 --- a/frontend-modern/src/components/SecurityWarning.tsx +++ b/frontend-modern/src/components/SecurityWarning.tsx @@ -1,5 +1,4 @@ import { Component, createSignal, Show, onMount } from 'solid-js'; -import { Portal } from 'solid-js/web'; import { SectionHeader } from '@/components/shared/SectionHeader'; import { isPulseHttps } from '@/utils/url'; import { logger } from '@/utils/logger'; @@ -120,141 +119,137 @@ export const SecurityWarning: Component = () => { return ( - -
-
-
-
- - {getSecurityScoreSymbol(scorePercentage())} - -
-
- - Security score:{' '} - - {status()!.score}/{status()!.maxScore} - - - } - size="sm" - class="flex-1" - titleClass="text-base-content" - /> +
+
+
+ + {getSecurityScoreSymbol(scorePercentage())} + +
+
+ + Security score:{' '} + + {status()!.score}/{status()!.maxScore} + + + } + size="sm" + class="flex-1 min-w-[12rem]" + titleClass="text-base-content" + /> + +
+ +

+ {warningPresentation().message} +

+ + +
+
+
+ + {getSecurityFeatureStatePresentation(status()!.credentialsEncrypted).label} + + Credentials encrypted at rest +
+
+ + {getSecurityFeatureStatePresentation(status()!.exportProtected).label} + + Export requires authentication +
+
+ + {getSecurityFeatureStatePresentation(status()!.hasAuthentication).label} + + Authentication enabled +
+
+ + {getSecurityFeatureStatePresentation(status()!.hasHTTPS).label} + + HTTPS connection +
+
+ + {getSecurityFeatureStatePresentation(status()!.hasAuditLogging).label} + + Audit logging enabled +
+
+
+
+ +
+ + Enable Security → + + + Learn More + +
+ +
-
- -

- - {warningPresentation().message} - -

- - -
-
-
- - {getSecurityFeatureStatePresentation(status()!.credentialsEncrypted).label} - - Credentials encrypted at rest -
-
- - {getSecurityFeatureStatePresentation(status()!.exportProtected).label} - - Export requires authentication -
-
- - {getSecurityFeatureStatePresentation(status()!.hasAuthentication).label} - - Authentication enabled -
-
- - {getSecurityFeatureStatePresentation(status()!.hasHTTPS).label} - - HTTPS connection -
-
- - {getSecurityFeatureStatePresentation(status()!.hasAuditLogging).label} - - Audit logging enabled -
-
-
-
- -
- handleDismiss('week')} + class="block w-full text-left px-3 py-1.5 text-sm hover:bg-surface-hover" > - Enable Security → - - + -
- - - -
-
+ Forever +
- +
); }; diff --git a/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx b/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx index e51aec3a6..01d8dbee7 100644 --- a/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx +++ b/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx @@ -62,6 +62,8 @@ describe('SecurityWarning', () => { expect( screen.queryByText(/accessible without authentication/i), ).not.toBeInTheDocument(); + const banner = screen.getByRole('status'); + expect(banner).not.toHaveClass('fixed'); expect(screen.getByRole('link', { name: 'Learn More' })).toHaveAttribute( 'href', '/docs/SECURITY.md',