For now, mw.notify() function does not take "autoHideSeconds" parameter, but notification implements this value. We should add this as option in defaults.
Description
Details
Related Objects
Event Timeline
Change 331989 had a related patch set uploaded (by Filip):
Added "autoHideSeconds" setting in mw.notify()
Change 333161 had a related patch set uploaded (by Krinkle):
mw.notification: Re-implement autoHideSeconds as string preset option
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
Change #1038896 had a related patch set uploaded (by Sportzpikachu; author: Sportzpikachu):
[mediawiki/core@master] mw.notification: Document autoHideSeconds property
Change #1038896 merged by jenkins-bot:
[mediawiki/core@master] mw.notification: Document autoHideSeconds property