Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a toaster for messages #1982

Closed
jokd opened this issue Mar 22, 2024 · 7 comments · Fixed by #1990
Closed

Create a toaster for messages #1982

jokd opened this issue Mar 22, 2024 · 7 comments · Fixed by #1990

Comments

@jokd
Copy link
Contributor

jokd commented Mar 22, 2024

Is your feature request related to a problem? Please describe.
We should have a simple way to show messages for the user, eg when a request fails or something is saved.

Describe the solution you'd like
We have a toaster for the infowindow exporthandler that could be moved to utils and be used by other functions. Perhas it also needs some kind of overhaul to be useful in a more general way.

@asemoller
Copy link
Contributor

@jokd You just took my "soon-to-submit-issue"! 😸

I agree and we have a plugin in progress that needs this function.

@jokd
Copy link
Contributor Author

jokd commented Mar 22, 2024

@jokd You just took my "soon-to-submit-issue"! 😸

I agree and we have a plugin in progress that needs this function.

Cool. Any input on how to design it or what features it should have?
The current one slides in from top right corner of the window and is shown for five seconds and then disappear and you can feed it with either a success or failmessage. I would like it a bit more configurable.

@tonnyandersson
Copy link
Collaborator

Mentioning #662 for the record.

@asemoller
Copy link
Contributor

Cool. Any input on how to design it or what features it should have?
The current one slides in from top right corner of the window and is shown for five seconds and then disappear and you can feed it with either a success or failmessage. I would like it a bit more configurable.

Yes, a little more configurable is a good one! Duration for example.

Then we have the discussion about whether a toaster or a modal is the best way forward for messages (for the user). I guess there are pros and cons to both. Whatever choice is made, it should be consistent in Origo.

@jokd
Copy link
Contributor Author

jokd commented Mar 22, 2024

Then we have the discussion about whether a toaster or a modal is the best way forward for messages (for the user). I guess there are pros and cons to both. Whatever choice is made, it should be consistent in Origo.

I guess that should be configurable as well. A modal can eg be a bit verbose for some situations.

@steff-o
Copy link
Contributor

steff-o commented Mar 27, 2024

I actually opted out of toasters in MultiSelect-plugin a couple of weeks ago as I didn't have time to implement a general toaster i the core. Instead I choose a clean Modal, which is already exposed instead of creating a one off implementation of a toaster in Multiselect.

That said, I'm all for it. I think the toaster should be exposed in the api as a function , e.g. showToaster(), which takes some arguments:

  • Duration
  • Title
  • Message
  • Severity (error, warning, OK, info)
  • Possibly an icon

Everything except "message" should have sensible defaults.

Whether to use toaster or modal I think is up to each control and add its own configuration if anything needs to be configured. Possibly a global duration setting and default icons for each severity could be useful.

@jokd
Copy link
Contributor Author

jokd commented Mar 27, 2024

I actually opted out of toasters in MultiSelect-plugin a couple of weeks ago as I didn't have time to implement a general toaster i the core. Instead I choose a clean Modal, which is already exposed instead of creating a one off implementation of a toaster in Multiselect.

That said, I'm all for it. I think the toaster should be exposed in the api as a function , e.g. showToaster(), which takes some arguments:

  • Duration
  • Title
  • Message
  • Severity (error, warning, OK, info)
  • Possibly an icon

Everything except "message" should have sensible defaults.

Whether to use toaster or modal I think is up to each control and add its own configuration if anything needs to be configured. Possibly a global duration setting and default icons for each severity could be useful.

Great input. I'll start cooking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants