11import { createEffect , createSignal , For , onCleanup } from "solid-js" ;
22import {
33 getNotifications ,
4+ mutedSources ,
45 type AppNotification ,
56 type NotificationSeverity ,
67} from "../../lib/errors" ;
@@ -50,10 +51,6 @@ export function severityConfig(severity: NotificationSeverity): SeverityConfig {
5051 }
5152}
5253
53- // Module-level muted sources — session only, resets on page reload
54- // Populated by NotificationDrawer's "Dismiss all" action
55- export const mutedSources = new Set < string > ( ) ;
56-
5754interface ToastItem {
5855 notification : AppNotification ;
5956 dismissing : boolean ;
@@ -72,8 +69,8 @@ export default function ToastContainer() {
7269 const dismissingTimeouts = new Map < string , ReturnType < typeof setTimeout > > ( ) ;
7370
7471 const COOLDOWN_MS = 60_000 ;
75- const animDelay = ( ) =>
76- window . matchMedia ( "(prefers-reduced-motion: reduce)" ) . matches ? 0 : 300 ;
72+ const reducedMotion = window . matchMedia ( "(prefers-reduced-motion: reduce)" ) . matches ;
73+ const animDelay = reducedMotion ? 0 : 300 ;
7774
7875 function removeToast ( id : string ) {
7976 setVisibleToasts ( ( prev ) => {
@@ -99,7 +96,7 @@ export default function ToastContainer() {
9996 const t = setTimeout ( ( ) => {
10097 dismissingTimeouts . delete ( id ) ;
10198 removeToast ( id ) ;
102- } , animDelay ( ) ) ;
99+ } , animDelay ) ;
103100 dismissingTimeouts . set ( id , t ) ;
104101 }
105102
@@ -178,7 +175,7 @@ export default function ToastContainer() {
178175 } ) ;
179176
180177 return (
181- < div class = "fixed bottom-4 right-4 z-[60] flex flex-col gap-2 w-96 " >
178+ < div class = "fixed bottom-4 right-4 z-[60] flex flex-col gap-2 w-[calc(100vw-2rem)] max-w-96" aria-live = "assertive" aria-atomic = "false ">
182179 < For each = { [ ...visibleToasts ( ) . values ( ) ] } >
183180 { ( item ) => {
184181 const cfg = severityConfig ( item . notification . severity ) ;
0 commit comments