fix: toast visibility — opaque backgrounds and flash scope matching with query strings

Two bugs in the toast redesign:

1. Variant backgrounds (success/warning/info/error) used rgba with 12-20%
   opacity, making toasts semi-transparent over page content. Fixed by
   layering the tint over a solid background via linear-gradient compositing.

2. Flash messages with scoped paths including query strings (e.g.
   edit pages with ?return=...) were not matched by Flash::peek(Request::path())
   since path() strips the query. Added fallback to pathWithQuery() matching.

Also moved flash partial before JS init scripts to ensure DOM is present
when the component runtime mounts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 19:58:15 +01:00
parent c89501bbed
commit 1ba6829a1c
5 changed files with 44 additions and 54 deletions

View File

@@ -6,7 +6,7 @@ import { resolveHost } from '../core/app-dom.js';
export function initFlashAutoDismiss(root = document, options = {}) {
const {
selector = '.app-toast-stack .notice[data-flash-timeout]',
selector = '.notice[data-flash-timeout]',
defaultTimeout = 0,
} = options;
const host = resolveHost(root);