Fade out success message automatically

Bug #1144820 reported by Lin Hua Cheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Lin Hua Cheng

Bug Description

Success messages usually confirms that requested operation succeeded, it would be nice to automatically fadeout the success message after 3 seconds to make the screen less cluttered.

Changed in horizon:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Changed in horizon:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23767

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
Matthias Runge (mrunge) wrote :

I'd think, this fade out should be made configurable. In the past, I have seen people argument in both directions

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

What I implemented right now is still basic.

In settings.py, the delay for auto-dismiss message and the duration of the fadeout are configured.

HORIZON_CONFIG = {
    ..
    'data_dismiss_delay': 3000,
    'data_dismiss_fade_duration': 1500,
    .}

In _messages.html, define what messages you want to auto-fade by adding the attribute data-dismiss-auto="true"

<div class="alert alert-block alert-success fade in" data-dismiss-auto="true">
      <a class="close" data-dismiss="alert" href="#">&times;</a>
      <p><strong>{% trans "Success: " %}</strong>{{ message }}</p>
</div>

Another alternative configuration I could this of is:

HORIZON_CONFIG = {
    ..
    'auto_fade_message': {
     'delay': 3000,
            'fade_duration': 1500,
     'alerts' : ['success', 'info']
    },
 ..
}

The alerts takes a list of alert type where the auto-fade will be applied. By default the alerts can be an empty list to fallback to default behavior of no auto-fade.

Revision history for this message
Kieran Spear (kspear) wrote :

Hi Lin-Hua. I don't have any strong thoughts about how this should work, but it would be good to keep things simple. I think what you have in the review is fine, really. I don't imagine this being very controversial for people, beyond wanting it either turned on or off. Would be good to hear others' thoughts though.

Revision history for this message
Julie Pichon (jpichon) wrote :

I like the idea in comment #3 of defining which type of alert should disappear -- IMO, it's ok to have success and probably info message auto-fade, but I'd prefer to have error alerts stick around to make sure the user has a chance to notice and read them.

Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

Also +1 on #3

Changed in horizon:
milestone: none → havana-1
importance: Undecided → Medium
Revision history for this message
Victoria Martinez de la Cruz (vkmc) wrote :

I also think that #3 is great. It's true that having to close the messages every time is quite bothering, but fading error messages can negatively affect the user experience. So, letting the user choose and configure this sounds good.

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Awesome, thanks everyone for the feedback! :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/23767
Committed: http://github.com/openstack/horizon/commit/b87398d90b490103e11912243bb8b413c79f4ac1
Submitter: Jenkins
Branch: master

commit b87398d90b490103e11912243bb8b413c79f4ac1
Author: Lin Hua Cheng <email address hidden>
Date: Wed Mar 6 16:21:12 2013 -0800

    Implement configurable auto-fade for alerts messages.

    The configuration takes what alert types would fade, the delay before
    it fades and the fade out duration.

    Fixes bug 1144820

    Change-Id: I421ee52308613da72118a507ed8b8b574c176f68

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.