Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72149

Improve js notification api to support alert timeouts, and de-duplication of messages

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Future Dev
    • Fix Version/s: None
    • Component/s: JavaScript, Usability

      Description

      Most notification api's in various places have various ways to make the notifications either go away after some time, or to replace a notification, and if there is a bunch of them if they automatically stack up and then after some threshold the oldest ones go away.

      JS notifications

      https://developer.mozilla.org/en-US/docs/Web/API/notification

      notify-send

      http://manpages.ubuntu.com/manpages/xenial/en/man1/notify-send.1.html

       

      So proposing to extend the JS notification api:

      1) An expiry timeout after which the notification fades away

      2) Allow an id to be set on the notification, if a new notification comes in with the same id as an existing on it deletes it and adds the new one to the top. (Even better might be an animation to move it to the top as its contents is replaced)

      3) There is also valid use cases for when a notification could be removed. Although if this is required it may be better to use the de-duplicating above to replace it with something else.

      4) The notification system could have some sort of maximum queue, eg 5 notifications, and if this is exceeded then the oldest one is automatically removed

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            brendanheywood Brendan Heywood
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Huong Nguyen, Barbara Ramiro, Bas Brands, Mathew May
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: