Ticket #2822 (closed enhancement: fixed)

Opened 13 months ago

Last modified 6 weeks ago

Alert bar control specification

Reported by: Eben Owned by: erikos
Priority: high Milestone:
Component: sugar Version:
Keywords: Cc: marco, morgs, Eben, tomeu
Action Needed: Verified: no
Blocked By: Blocking:

Description

We want to add a standard control for providing in-activity alerts.

The design is going to be a black bar that runs the full width of its container, with the guiding assumption that this control will generally be placed at the top (or perhaps bottom?) of the activity content area, and be the full width of the screen.

We'll support 2 sizes: 75px and 45px tall. Their appearance and API will be similar to primary rollovers, and having the following parameters:

Size: a constant which identifies the alert as LARGE (75px) or SMALL (45px). Could be a boolean, too, I don't care.

Icon: An icon to be embedded in the left of the alert (just like a primary rollover) We should have some alert icons that they can choose from easily, but could also specify their own. The icon will be 55px or 30px (with appropriate padding) depending on alert size. It's optional.

Title text: a string identifying the title of the alert (eg. "Import error") The alert text should be limited to one line, cropped off with an ellipsis or something if it overflows. Only large alerts will display a title; it will be ignored if it is small. This too, could be optional (see message text below.)

Message text: a string describing the alert (eg. "The file appears to be corrupt") If the message text is too long, I suppose we'll have to extend the alert vertically, though we'll note in the guidelines that we strongly urge single lines of text. Obviously, the number and size of the buttons may also affect this. We could also support a large alert that leaves the title blank, thus using 2 lines for the message text instead of one.

Buttons: an array of buttons with some API for hooking them up to the appropriate handlers. The API should also support declaration of "default" and "cancel" buttons, which will automatically receive the check and cancel icons, and the default button will also have the special rendering with the bold ring around it. The buttons will be right aligned within the alert. The default button should always go at the far right, and the cancel button should be the leftmost one. They should be adjacent to the title/message text, but should be bottom aligned (15px from bottom and from right) when the alert expands vertically.

Timeout: a number of seconds to display the alert for before it goes away on its own. The timeout should only work when a default button is specified, such that the default option is the one that is "selected" when the timer runs out. The guidelines will recommend that timeouts only be used when there is a single "OK" or "dismiss" option, and never when a choice is offered. We could make that a hard requirement, if we want. This is of course an optional parameter.

Modal: a boolean parameter that determines if the alert is modal or not. I mention this as an option, really, so that we could implement both types of dialogs with one API, but use a completely different design (probably fullscreen) for modal dialogs. We should leave the door open for this but start with non-modal only for now, probably not exposing the option in the API at this point.

I'll attach some mockups when I get around to it. Let me know if anything here isn't clear.

Change History

Changed 13 months ago by morgs

  • cc morgs added

Changed 13 months ago by jg

  • milestone changed from Untriaged to Trial-3

Changed 12 months ago by marco

  • owner changed from edsiper to Eben
  • component changed from sugar to interface-design
  • milestone changed from Trial-3 to Untriaged

Specs should go on the wiki...

Changed 12 months ago by jg

  • type changed from task to enhancement
  • milestone changed from Untriaged to First Deployment, V1.0

Changed 11 months ago by Eben

  • owner changed from Eben to marco
  • priority changed from normal to blocker
  • type changed from enhancement to task

I'm bumping this up to blocker; More and more "insufficient feedback bugs" are requiring this API. For instance, #3653, #3552, #542, and I'm sure others in the near future. Since this is now a blocker, I'll be sure to get the Spec into the wiki sometime later this afternoon.

Marco, I'm passing this to you since the API is so close to that for palettes (primary ones, anyway). If you want to pass it off, that's fine.

Spec: http://wiki.laptop.org/go/Specifications/Dialogs

Changed 11 months ago by tomeu

  • cc Eben added

Eben, could we use an alert like this for fixing #2630?

Changed 11 months ago by Eben

Absolutely. I think that could work well. I'm thinking it might also have a place in #2910. Perhaps we can provide an alert when a popup is initiated, and even provide an option or two for how to handle it: "block", "view", "view in new session" or something, with block being the default on timeout.

I see lots of valuable use cases, which is why I think this deserves blocker status.

Changed 11 months ago by tomeu

  • cc tomeu added

Changed 11 months ago by marco

  • type changed from task to enhancement
  • component changed from interface-design to sugar
  • milestone changed from First Deployment, V1.0 to Untriaged

Of the tickets cited here only #3552 is targeted for 1.0 and still need modal alert.

If that's the only real use case for 1.0, I don't think we should be adding this API. We can just use a standard modal dialog as a stop gap.

Changed 11 months ago by Eben

Actually, it seems that #3552 and #542 are both 1.0 targets. Also, while the particular issue addressed by the subject of #3653 might be an edge case, I mention several other instances of "missing feedback" in the Journal which this alert could solve, some of which will indeed occur more regularly.

If we can't get it done, that's OK, but it is a general purpose control that will certainly be taken advantage of by many, now and down the road. I'd be quite happy to rid sugar of the need for ugly floating dialog boxes.

Changed 11 months ago by marco

Heh #542 is really up in the air... It's not clear what we want to do, nor if the mozilla API allows us to do it.

Changed 11 months ago by erikos

  • owner changed from marco to erikos

Changed 11 months ago by walter

  • priority changed from blocker to high
  • milestone changed from Untriaged to V1.1

Changed 10 months ago by erikos

  • status changed from new to closed
  • resolution set to fixed

I think I implemented the spec described above. Added a timed alert two days ago and made refinements to the layout. If something is not working like you expect just feel free to open a specific ticket. Btw: Best can be tested in the browser with downloads.

Changed 6 weeks ago by gregorio

  • milestone deleted

Milestone FutureFeatures deleted

Note: See TracTickets for help on using tickets.