pablen / toasty Goto Github PK
View Code? Open in Web Editor NEWA notification package for Elm apps.
Home Page: http://package.elm-lang.org/packages/pablen/toasty/latest
License: BSD 3-Clause "New" or "Revised" License
A notification package for Elm apps.
Home Page: http://package.elm-lang.org/packages/pablen/toasty/latest
License: BSD 3-Clause "New" or "Revised" License
We're using toasty to notify the user whenever API requests are slower than a given threshold. Using the current version of toasty there isn't a way to figure out if a toast is visible or not. If multiple API's are slow and hit the threshold at or around the same time, multiple toasts (in our case with the same contents) are shown.
The most pressing issue we have is to figure out if a given toast is visible or not. If it's the case that one already is visible, we don't want to show another toast as we've already told the user that one or more of the API's are slow.
Currently we've forked Toasty and exposed the Stack constructors so we can poke around in the toasty internals and figure out if we should show a new toast or not. Simply exposing the constructors as we have, doesn't seem like a good idea for the library to do. I'm not sure what the best approach would be to solve this? I'm happy to submit a MR given I can wrap my head around what a good approach would be.
Further enhancements is to be able to prolong the duration of a given toast, as well as change the contents of the visible toast. Then we can make sure the relevant toast stays visible as new API requests hit the threshold. And we could update the message with the number of pending API requests. But these are enhancements, not strictly needed for us to use Toasty.
I know it's possible to pass a11y attributes in via the config, but I think they should be the default. I think Twitter Bootstrap's toasts are a good starting point. This would possibly also include giving it a tabindex and keyboard shortcuts for Enter and Escape to dismiss.
I wouldn't mind doing a PR for this.
I'm writing a component based on your component and I need that your component expose Msg
as Msg(..)
as is explained in this issue elm/error-message-catalog#215
Hello, could you bump the version to support elm 0.19?
I understand that it's not really what this library is trying to do, but, I have a use case. I want to show a toast for the user being offline and it's persistent until the user comes back online (or they choose to close it). There's no mechanism for removing this as Remove
msg isn't exposed and everything is related to add*
.
In your demo i am forced to hit a keyboard key to create the toasts.
But that is a hard thing to do on mobile.
Can the demo additionally get some buttons that spawn the toasts?
Cheers
Steps to reproduce:
Id
as the dismissed toast, and the dismissed toast's Process.sleep
was never killed.Possible solutions:
Process.spawn
to keep track of the Process.sleep
process ID. If the user manually dismisses a toast, kill the sleep process with Process.kill
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.