notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Add progress based notifications

Open keithamus opened this issue 11 years ago • 4 comments

Abstract

It would be useful to have progress based notifications, that allow you to indicate the current progress of a long running task.

Justification

Aside from the usefulness of telling a user that a task is in progress, Android devices in particular already have this feature natively:

Proposal

I propose having a read only property on the notification called "progress". It expects a floating point value between 0 and 1.

Creating a new notification with the same tag as a previous notification, but a different progress float gives the UA an opportunity to display a progress bar for this notification. Other UAs will not be effected, and will gracefully continue doing what they do.

Example

# Contrived progress example, but could be done with Streams based on current/total.
var progress = 0.1;
setTimeout(function updateProgress() {
    progress += 0.1;
    if (progress < 1) {
        new Notification('Downloading...', {
            body: 'Downloading file.zip',
            progress: 0.1,
            tag:'download/file.zip'
        });
        setTimeout(updateProgress, 500);
    }
}, 500);

keithamus avatar Jun 17 '14 14:06 keithamus

Thanks @keithamus. Might take a while before we get to this. Paging @sicking @hober @beverloo

annevk avatar Jun 17 '14 17:06 annevk

Yes, we definitely need this!

sicking avatar Jun 18 '14 08:06 sicking

I definitely agree that this is a good extension. I'm in favor of richer notifications in general, e.g. buttons and lists.

beverloo avatar Jun 18 '14 13:06 beverloo

We aimed for a different approach with regards to lists, but in the end I think doing a list might be simpler.

With regards to notifications that ask for input, through buttons or even text fields, this also seems like an interesting area, but feels more complex. Especially since I don't think the spec is good yet at handling sending back notifications to the opening page/app if the opening page/app has been closed since the notification was created.

/ Jonas

sicking avatar Jun 18 '14 14:06 sicking