Skip to content

[2.x] feat(realtime): make notification toast duration configurable#4497

Merged
imorland merged 1 commit into2.xfrom
im/realtime-configurable-toast-duration
Mar 22, 2026
Merged

[2.x] feat(realtime): make notification toast duration configurable#4497
imorland merged 1 commit into2.xfrom
im/realtime-configurable-toast-duration

Conversation

@imorland
Copy link
Copy Markdown
Member

Summary

  • Replaces the hardcoded 5s dismiss timeout with an admin setting flarum-realtime.notification-toast-dismiss-after, defaulting to 10 seconds
  • Setting the value to 0 disables toast notifications entirely (the push() call returns early, nothing is queued or rendered)
  • The value is registered as a PHP default, serialized to the forum payload, and picked up directly from app.data.settings in NotificationToastState
  • Admin setting registered in admin/extend.ts with min: 0

Test plan

  • Set duration to a custom value and confirm toasts dismiss after that many seconds
  • Set duration to 0 and confirm no toasts appear for incoming realtime notifications

Replaces the hardcoded 5s dismiss timeout with an admin setting
(flarum-realtime.notification-toast-dismiss-after), defaulting to 10s.
Setting the value to 0 disables toast notifications entirely.
@imorland imorland requested a review from a team as a code owner March 22, 2026 20:04
@imorland imorland changed the title feat(realtime): make notification toast duration configurable [2.x] feat(realtime): make notification toast duration configurable Mar 22, 2026
@imorland imorland added this to the 2.0.0-beta.8 milestone Mar 22, 2026
@imorland imorland merged commit 186629c into 2.x Mar 22, 2026
25 checks passed
@imorland imorland deleted the im/realtime-configurable-toast-duration branch March 22, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant