mw.notify() should have "autoHideSeconds" option settable.
Closed, ResolvedPublic

Description

For now, mw.notify() function does not take "autoHideSeconds" parameter, but notification implements this value. We should add this as option in defaults.

Filip created this task.Jan 13 2017, 10:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 13 2017, 10:41 AM
Filip updated the task description. (Show Details)Jan 13 2017, 12:21 PM
Filip claimed this task.
Filip renamed this task from mw.notify() should have "autoHideSecounds" option settable. to mw.notify() should have "autoHideSeconds" option settable..Jan 13 2017, 4:45 PM
Filip updated the task description. (Show Details)

Change 331989 had a related patch set uploaded (by Filip):
Added "autoHideSeconds" setting in mw.notify()

https://gerrit.wikimedia.org/r/331989

Change 331989 merged by jenkins-bot:
Added "autoHideSeconds" setting in mw.notify()

https://gerrit.wikimedia.org/r/331989

matmarex closed this task as Resolved.Jan 15 2017, 2:18 AM
matmarex removed a project: Patch-For-Review.

Change 333161 had a related patch set uploaded (by Krinkle):
mw.notification: Re-implement autoHideSeconds as string preset option

https://gerrit.wikimedia.org/r/333161

Krinkle reopened this task as Open.Jan 20 2017, 3:26 AM
Krinkle added subscribers: MtDu, Krinkle.

The change now looks ok, but I don't think we should show it forever. See https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.notification. There is an option called autoHideSeconds, which defaults to 5. That is what is causing the problem. I think we should change it to 10.

I would recommend against individual uses of mw.notify arbitrarily overriding the duration for notification bubbles. While I recognise the need for an option besides only "stay indefinitely until clicked" and "hide after 5 seconds", I'd rather this be a built-in option to avoid user confusion and set better expectations. I do not expect development of individual features that happen to include notifications to spend adequate time evaluating how long is "appropiate" and consistent with other interfaces. As such, we should provide better defaults so that developers don't have to eyeball this (since we'd make indeterministic guesses).

Previously autoHideSeconds was configurable through defaults, but not overridable per notification. This is by design and I'd like to restore that. Perhaps we can strike a compromise by allowing one of N presets to be used as timeout? E.g. 'short' for 5 seconds (default), and 'long' as 10 seconds (or 30?).

Change 333161 merged by jenkins-bot:
mw.notification: Re-implement autoHideSeconds as string preset option

https://gerrit.wikimedia.org/r/333161

Krinkle closed this task as Resolved.Feb 23 2017, 2:35 AM