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.

Keep modal failure notifications above their dialogs

pulse-triage[bot]4b74dbd5f9da
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 94909b2f6e..96a1fcf474 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -29,18 +29,25 @@ existing inline result. They do not rely on the intentionally inert background
notification portal. Copy confirms success only after clipboard completion and
otherwise offers manual copying. The full callback URL wraps at narrow widths.
Save/Cancel stay reachable, and a pending save neither repeats nor dismisses.
-Retained background toasts lower below the modal backdrop while any blocking
-dialog is open, then regain their ordinary layer on close; they are not
-unmounted or made interactive through the modal. Shared modal focus trapping,
-inertness and restoration remain unchanged.
+Only success-confirmation-only toast stacks lower below the modal backdrop while
+a blocking dialog is open. Any error, warning or info toast keeps the whole stack
+at its ordinary foreground layer, including when added alongside a retained
+success: existing delete, assignment and role dialogs still depend on those
+notifications while remaining open. Toasts are not unmounted or made interactive
+through the modal. Shared modal focus trapping, inertness and restoration remain
+unchanged. The SSO header and footer are non-scrolling flex siblings of the
+scrollable fields; the header needs no sticky positioning.
Allowed Groups are comma- or newline-separated exact IdP group names, preserving
spaces through details → edit → no-op/mapping-only save for OIDC and SAML. This
replaces the former whitespace split for that field only. Scopes, domains and
emails keep their existing parsing; explicit empty restriction lists still clear
them. Payload shape, secret omission and server-owned authorisation are unchanged.
-`SSOProvidersPanel.test.tsx`, `ssoProvidersModel.test.ts` and the settings
-architecture suite cover this boundary. Browser evidence uses the production
+`SSOProvidersPanel.test.tsx`, `ssoProvidersModel.test.ts`, `Toast.test.tsx`, the
+consuming `SSOProviderNotifications.test.tsx` and the settings architecture suite
+cover this boundary, including an actual refused DELETE while its confirmation
+stays open and a successful save/reopen with the previous confirmation retained.
+Browser evidence uses the production
panel, state hook, API client, Dialog, Toast and CSS with synthetic HTTP at desktop
and 320px widths; it is not native IdP, encrypted persistence or restart proof.
diff --git a/frontend-modern/browser-verification/5bdf00026ba6b130.json b/frontend-modern/browser-verification/5bdf00026ba6b130.json
new file mode 100644
index 0000000000..cad7c1f160
--- /dev/null
+++ b/frontend-modern/browser-verification/5bdf00026ba6b130.json
@@ -0,0 +1,39 @@
+{
+ "version": 1,
+ "base_sha": "518fda75b3581951868935e861c5c90c1b5c16cb",
+ "verified_at": "2026-10-24T02:25:40.484534Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Settings/SSOProvidersPanel.tsx",
+ "frontend-modern/src/components/Toast/Toast.tsx"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Settings/SSOProvidersPanel.tsx": "6fa2023f853a5a6080158459e0fb30593aa3a3853c3be43dfe35986b49ef946e",
+ "frontend-modern/src/components/Toast/Toast.tsx": "7c6236ffa6215a6bb4d52dc7932e24d3dee19fb361a02103b118597e6a3d84f1"
+ },
+ "routes": [
+ "/settings/security/sso (production panel consumed in a safe synthetic HTTP fixture at /candidate/)"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 320,
+ "height": 812
+ }
+ ],
+ "states": [
+ "Production SSO panel/state/API/Dialog/Toast/CSS; baseline is the retained candidate composed with current main. No native IdP, encryption, restart or installed recovery proof.",
+ "Actual modal-only DELETE refusal remains visible in the foreground while Delete provider stays open, even alongside the retained successful-save notification. Error, warning and info stacks keep their original foreground behaviour; only success-only stacks lower.",
+ "Successful mapping save and immediate reopen preserve the exact Server Access group, scopes, domain and omitted secret; the retained success does not obscure editor actions. Existing modal inertness stays intact.",
+ "Non-scrolling flex header is visible in initial, connection-failure, metadata-failure and scrolled-reopen narrow pixels. Earlier archived missing-title pixels were inspected; the current baseline also paints its heading, so no universal WebKit cause or fix is inferred.",
+ "All twelve retained captures were opened with the native image viewer, including modal-only failure controls and desktop/320px candidate states."
+ ],
+ "interactions": [
+ "Real production HTTP adapter GET/detail/PUT/DELETE/test/metadata-preview producers, with fixed synthetic responses; no automatic DELETE retry and no inline delete error substituted for the existing toast.",
+ "Keyboard save and consuming reopen, exact access restrictions and visible unobscured recovery controls. Removing the non-success feedback restores normal background isolation after close.",
+ "Playwright 1.56.1; desktop Chromium and narrow WebKit. Fourteen cases pass. No page errors or external requests; only deliberate HTTP400/409 and their existing error logs. Contexts, browsers and preview server closed."
+ ]
+}
diff --git a/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx b/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx
index c6af5ff4e9..2016479c2e 100644
--- a/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx
+++ b/frontend-modern/src/components/Settings/SSOProvidersPanel.tsx
@@ -280,7 +280,7 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
ariaLabel={`${editingProvider() ? 'Edit' : 'Add'} ${getSSOProviderTypeLabel(form.type)} provider`}
>
<form class="flex max-h-[calc(100dvh-2rem-2px)] min-h-0 flex-col" onSubmit={handleSave}>
- <div class="sticky top-0 z-10 shrink-0 border-b border-border bg-surface px-4 py-4 sm:px-6">
+ <div class="shrink-0 border-b border-border bg-surface px-4 py-4 sm:px-6">
<h3 class="text-lg font-semibold text-base-content">
{getSSOProviderModalTitle(Boolean(editingProvider()), form.type)}
</h3>
diff --git a/frontend-modern/src/components/Settings/__tests__/SSOProviderNotifications.test.tsx b/frontend-modern/src/components/Settings/__tests__/SSOProviderNotifications.test.tsx
new file mode 100644
index 0000000000..e3f8a7a5fe
--- /dev/null
+++ b/frontend-modern/src/components/Settings/__tests__/SSOProviderNotifications.test.tsx
@@ -0,0 +1,78 @@
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
+import { SSOProvidersPanel } from '../SSOProvidersPanel';
+import { ToastContainer } from '@/components/Toast/Toast';
+
+const provider = {
+ id: 'corp-oidc',
+ name: 'Corporate OIDC',
+ type: 'oidc',
+ enabled: true,
+ priority: 0,
+ oidc: { issuerUrl: 'https://idp.example.test', clientId: 'pulse' },
+};
+
+describe('SSO provider consuming notification layers', () => {
+ afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+ });
+
+ it('reveals a modal-only delete failure without losing the retained-success reopen behaviour', async () => {
+ const fetchMock = vi.fn((url: string, options?: RequestInit) => {
+ const method = options?.method ?? 'GET';
+ let body: unknown;
+ let status = 200;
+ if (url === '/api/security/status') body = { publicUrl: 'https://pulse.example.test' };
+ else if (method === 'DELETE') {
+ body = { error: 'Synthetic provider deletion refused' };
+ status = 409;
+ } else if (url === '/api/security/sso/providers' && method === 'GET')
+ body = { providers: [provider] };
+ else body = provider;
+ return Promise.resolve(
+ new Response(JSON.stringify(body), {
+ status,
+ headers: { 'Content-Type': 'application/json' },
+ }),
+ );
+ });
+ vi.stubGlobal('fetch', fetchMock);
+ document.cookie = 'pulse_csrf=synthetic-csrf';
+ render(() => (
+ <>
+ <SSOProvidersPanel />
+ <ToastContainer />
+ </>
+ ));
+ fireEvent.click(await screen.findByRole('button', { name: 'Edit provider' }));
+ let editor = await screen.findByRole('dialog', { name: 'Edit OIDC provider' });
+ fireEvent.submit(within(editor).getByRole('button', { name: 'Save Changes' }).closest('form')!);
+ await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
+ const notifications = screen.getByRole('region', { name: 'Notifications' });
+ expect(notifications).toHaveTextContent('SSO provider has been updated.');
+
+ fireEvent.click(await screen.findByRole('button', { name: 'Edit provider' }));
+ editor = await screen.findByRole('dialog', { name: 'Edit OIDC provider' });
+ expect(notifications).toHaveClass('z-50');
+ expect(notifications.closest('[inert]')).not.toBeNull();
+ fireEvent.click(within(editor).getByRole('button', { name: 'Cancel' }));
+
+ fireEvent.click(screen.getByRole('button', { name: 'Delete provider' }));
+ const confirmation = screen.getByRole('dialog', { name: 'Delete provider' });
+ fireEvent.click(within(confirmation).getByRole('button', { name: 'Delete Provider' }));
+ await waitFor(() =>
+ expect(notifications).toHaveTextContent('Unable to remove the SSO provider.'),
+ );
+ expect(confirmation).toBeInTheDocument();
+ expect(notifications).toHaveClass('z-9999');
+ expect(notifications).not.toHaveClass('z-50');
+ expect(notifications.closest('[inert]')).not.toBeNull();
+ expect(fetchMock.mock.calls.filter(([, options]) => options?.method === 'DELETE')).toHaveLength(
+ 1,
+ );
+ fireEvent.click(within(confirmation).getByRole('button', { name: 'Cancel' }));
+ expect(notifications.closest('[inert]')).toBeNull();
+ expect(notifications).toHaveTextContent('Unable to remove the SSO provider.');
+ });
+});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 366ce3724a..1e01d3f89b 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -1161,6 +1161,17 @@ describe('settings architecture guardrails', () => {
expect(ssoProvidersPanelSource).not.toContain('Add SAML (Pro)');
});
+ it('keeps the SSO editor header outside its independently scrolling fields', () => {
+ const editor = ssoProvidersPanelSource.slice(
+ ssoProvidersPanelSource.indexOf('{/* Add/Edit Modal */}'),
+ ssoProvidersPanelSource.indexOf('{/* Delete confirmation modal */}'),
+ );
+ expect(editor).toContain('min-h-0 flex-col');
+ expect(editor).toContain('shrink-0 border-b border-border bg-surface');
+ expect(editor).toContain('min-h-0 flex-1 space-y-4 overflow-y-auto');
+ expect(editor).not.toContain('sticky');
+ });
+
it('keeps SAML SSO available without a self-hosted Pro upsell boundary', () => {
expect(ssoProvidersPanelSource).toContain('@/components/shared/Button');
expect(ssoProvidersPanelSource).toContain('ActionIconButton');
diff --git a/frontend-modern/src/components/Toast/Toast.tsx b/frontend-modern/src/components/Toast/Toast.tsx
index 8ea2238672..9dbc8f8ced 100644
--- a/frontend-modern/src/components/Toast/Toast.tsx
+++ b/frontend-modern/src/components/Toast/Toast.tsx
@@ -193,6 +193,11 @@ declare global {
export const ToastContainer: Component = () => {
const [toasts, setToasts] = createSignal<ToastMessage[]>([]);
+ // Only confirmation-only stacks may sit behind a dialog. Existing editors
+ // still rely on error, warning and info toasts while they remain open.
+ const lowerSuccessConfirmations = () =>
+ dialogStackHasBlockingDialog() && toasts().every((toast) => toast.type === 'success');
+
const removeToast = (id: string) => {
setToasts((prev) => prev.filter((t) => t.id !== id));
};
@@ -219,7 +224,7 @@ export const ToastContainer: Component = () => {
role="region"
aria-label="Notifications"
class={`fixed inset-x-3 bottom-3 space-y-2 sm:left-auto sm:right-4 sm:bottom-4 sm:w-full sm:max-w-[500px] ${
- dialogStackHasBlockingDialog() ? 'z-50' : 'z-9999'
+ lowerSuccessConfirmations() ? 'z-50' : 'z-9999'
}`}
>
<For each={toasts()}>{(toast) => <Toast toast={toast} onRemove={removeToast} />}</For>
diff --git a/frontend-modern/src/components/Toast/__tests__/Toast.test.tsx b/frontend-modern/src/components/Toast/__tests__/Toast.test.tsx
index a51e745aa2..a70844555a 100644
--- a/frontend-modern/src/components/Toast/__tests__/Toast.test.tsx
+++ b/frontend-modern/src/components/Toast/__tests__/Toast.test.tsx
@@ -38,7 +38,7 @@ describe('Toast', () => {
expect(screen.queryByRole(role === 'alert' ? 'status' : 'alert')).not.toBeInTheDocument();
});
- it('keeps a retained notification below blocking dialogs, restoring it after close', () => {
+ it('keeps a retained success below blocking dialogs, restoring it after close', () => {
const [open, setOpen] = createSignal(false);
render(() => (
<>
@@ -62,6 +62,41 @@ describe('Toast', () => {
expect(screen.getByText('Previous operation completed')).toBeInTheDocument();
});
+ it.each(['error', 'warning', 'info'] as const)(
+ 'keeps %s feedback above an open dialog even beside a retained success',
+ (type) => {
+ const [open, setOpen] = createSignal(false);
+ render(() => (
+ <>
+ <ToastContainer />
+ <Dialog isOpen={open()} onClose={() => setOpen(false)} ariaLabel="Editor">
+ <button onClick={() => window.showToast(type, 'Operation needs attention')}>
+ Try operation
+ </button>
+ <button onClick={() => setOpen(false)}>Close editor</button>
+ </Dialog>
+ </>
+ ));
+ window.showToast('success', 'Previous operation completed');
+ const notifications = screen.getByRole('region', { name: 'Notifications' });
+ setOpen(true);
+ expect(notifications).toHaveClass('z-50');
+
+ fireEvent.click(screen.getByRole('button', { name: 'Try operation' }));
+
+ expect(notifications).toHaveClass('z-9999');
+ expect(notifications).not.toHaveClass('z-50');
+ expect(screen.getByText('Operation needs attention')).toBeInTheDocument();
+ expect(screen.getByRole('dialog')).toBeInTheDocument();
+ // Layering must not weaken the existing modal background isolation.
+ expect(notifications.closest('[inert]')).not.toBeNull();
+ fireEvent.click(screen.getByRole('button', { name: 'Close editor' }));
+ expect(notifications.closest('[inert]')).toBeNull();
+ expect(notifications).toHaveClass('z-9999');
+ expect(screen.getByText('Previous operation completed')).toBeInTheDocument();
+ },
+ );
+
it('keeps all toasts created within a batch', () => {
render(() => <ToastContainer />);