Request the addition of a toast notification API to allow plugin developers to notify users of completed actions in a non-intrusive manner.
Motivation
Toast notifications provide timely and unobtrusive feedback. For example, my plugin summarizes notes using LLMs, and it would be useful to show a toast message like "Summary completed" upon task completion.
Proposed Solution
Add an API method for plugins to trigger toast notifications with customizable options for message content, duration, and position.
Benefits
User Experience: Provides immediate, non-disruptive feedback.
Plugin Functionality: Enhances interactivity and responsiveness.
Consistent UI/UX: Ensures uniform notification design across the app.
Adding toast notifications will improve Joplin's usability and interactivity. This feature will be valuable for enhancing user experiences through plugins.
But after I tried the latest dev framework (npm list -g generator-joplin = v3.2.1), there still says,
"Property 'showToast' does not exist on type 'JoplinViewsDialogs'."
It should work, but a temporary workaround would be await (joplin.views.dialogs as any).showToast(.... to disable type-checking. I will check why it hasn't been exported properly
Thank you. Your "temporary workaround" worked well.
In addition, another bug (maybe?) is here:
If all parameters ('message', 'duration', and 'type') remain unchanged, subsequent toast notifications will not be displayed. A new toast will only appear if at least one of these parameters is modified.
I found an unconventional solution:
await (joplin.views.dialogs as any).showToast({message:'Finished', duration:3000+(Date.now()%500), type:'success'});
Also, the issue with the notification not reappearing hasn't been fixed for me by using the timestamp. I still only see the notification once. Do you also still experience this issue?