masmerise / livewire-toaster

Beautiful toast notifications for Laravel / Livewire.
MIT License
342 stars 22 forks source link

Toast messages are not global #28

Closed marttheis closed 8 months ago

marttheis commented 8 months ago

Hi,

Good toast notifications!

However, the messages are not global so their usability is restricted. Toastmessages need to be global otherwise crucial information might be hidden from the user.

Any plans to make them global in the future?

best regards Martin

mabdullahsari commented 8 months ago

Hi, I don't really understand your point. Can you expound on it?

marttheis commented 8 months ago

Send from mobile

Hi Muhammed,

Toaster messages disappear when I switch to another view/page. Imagine I do something on one view which triggers the Toast notification but my action also forwards me to another page. In that case I won’t see the notification. It is a major flaw of many Toast note packages.

Critical toast messages should be visible always and should persist when I switch to another view of the app.

Best regards Martin

On Thu 2. Nov 2023 at 09:05, Muhammed Sari @.***> wrote:

Hi, I don't really understand your point. Can you expound on it?

— Reply to this email directly, view it on GitHub https://github.com/masmerise/livewire-toaster/issues/28#issuecomment-1790246952, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3LB42SHN6J7ZU5RYTJ4RDDYCNH3FAVCNFSM6AAAAAA62NJPESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQGI2DMOJVGI . You are receiving this because you authored the thread.Message ID: @.***>

mabdullahsari commented 8 months ago

Send from mobile Hi Muhammed, Toaster messages disappear when I switch to another view/page. Imagine I do something on one view which triggers the Toast notification but my action also forwards me to another page. In that case I won’t see the notification. It is a major flaw of many Toast note packages. Critical toast messages should be visible always and should persist when I switch to another view of the app. Best regards Martin On Thu 2. Nov 2023 at 09:05, Muhammed Sari @.> wrote: Hi, I don't really understand your point. Can you expound on it? — Reply to this email directly, view it on GitHub <#28 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3LB42SHN6J7ZU5RYTJ4RDDYCNH3FAVCNFSM6AAAAAA62NJPESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQGI2DMOJVGI . You are receiving this because you authored the thread.Message ID: @.>

I'm not sure if this is even possible with Livewire?

mabdullahsari commented 8 months ago

It seems that it is possible, thought it's your responsibility to opt in.

marttheis commented 8 months ago

Hi,

What do you mean with opt in?

Best regards Martin

Send from mobile

On Fri 10. Nov 2023 at 18:30, Muhammed Sari @.***> wrote:

It seems that it is possible https://livewire.laravel.com/docs/navigate#persisting-elements-across-page-visits, thought it's your responsibility to opt in.

— Reply to this email directly, view it on GitHub https://github.com/masmerise/livewire-toaster/issues/28#issuecomment-1806141396, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3LB42UG7JTGCFAGP72P6DTYDZQCZAVCNFSM6AAAAAA62NJPESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGE2DCMZZGY . You are receiving this because you authored the thread.Message ID: @.***>

boptom commented 2 months ago

This can be done by wrapping @persist around <x-toaster-hub />


@persist('toaster')
<x-toaster-hub />
@endpersist

This will persist the toaster component through `wire:navigate`, but not when redirecting from the backend.