Skip to content

Notification queue cap (MaxNotifications)#130

Open
corradedied wants to merge 1 commit into
deividcomsono:mainfrom
corradedied:notification-cap
Open

Notification queue cap (MaxNotifications)#130
corradedied wants to merge 1 commit into
deividcomsono:mainfrom
corradedied:notification-cap

Conversation

@corradedied

Copy link
Copy Markdown
Contributor

Firing many notifications fast caused unbounded screen clutter with no way to remove old ones — Library.Notifications is an unordered dictionary, so "oldest" was unknowable.

What changed

  • Library.NotificationQueue — ordered array parallel to the existing dict, so oldest is always [1]
  • Library.MaxNotifications (default 10) — on each Notify insert, removes from the front of the queue until under cap. 0 = unlimited. Persist notifications are exempt and will remain untouched.
  • Data:Destroy() — removes the entry from the queue on natural expiry so dead references don't block future evictions
  • Templates.Window + CreateWindow — wires the setting into the window config so it can be set at the call site:
Library:CreateWindow({ MaxNotifications = 5 })

Unload path clears NotificationQueue alongside Notifications.
Recording 2026-06-28 213959

Added NotificationQueue and MaxNotifications. Updated notification handling to respect the maximum limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant