We need a way to tell Scratchers when their hardware extension device loses connection.
This design is for an alert message which directs users to the device modal.
The alert appears when an extension device loses connection.
Clicking "x" dismisses the alert.

Clicking "reconnect" triggers the device modal. The original alert should disappear.

The alert can also appear in full screen stage mode.
Clicking "reconnect" takes you back to the editor page w/ device modal.

More than one alert can appear at once. Multiple alerts should stack.

Stacking behavior persists in full screen stage.

Although multiple alerts case is probably rare... the stacking solution isn't ideal. We might revisit a solution that doesn't dominate the entire workspace.
Alerts could also be useful in other use cases:


(Success alert should disappear on a timer.)

There are a couple situations where we should communicate that hardware is not connected, with or without alerts.
Sizing + Colors
Minimum width is 448px. For the smaller size, min width is 200px.
Ideally, text shouldn't be longer than one line. If it needs to, it can wrap to a 2nd line.

Positioning
Alerts are centered within the code stage.
First alert is 64px from the top of the page.
Multiple alerts have 8px of spacing between them.

When the code stage stage shrinks, the alert is centered within the entire window instead, so that it doesn't lose width.

R1 Animation: https://codepen.io/kathymakes/pen/BPXxWB
R1 Mockups: https://projects.invisionapp.com/d/main#/projects/prototypes/15193635
@kathymakes - Looks great! Thanks for speccing this out!
One more thing we should add to future considerations is the UX on the Project page view. Both when you first open a project that uses a hardware extension, but also once you have connected a device in the Editor view and then switch back to the Project page view (by clicking the "See Community" button).
Other warnings:
How about a red color, as well as orange/yellow and green.
Also, a "X" on success alerts, to close the alert before it times out.
Reupdated spec & images.
Progress is being made via PR https://github.com/LLK/scratch-gui/pull/3143.
Still to do in further PR's:
Progress continued via PRs https://github.com/LLK/scratch-gui/pull/3209 and https://github.com/LLK/scratch-vm/pull/1607.
Still to do in further PR's:
formatMessage compatible)this._runtime.emitPeripheralError(this._extensionId))Some styling notes from @kathymakes:
Thanks @evhan55 !
Here's the "X" icon, which is the same svg "X" we use for modals.
Thanks very much @kathymakes !
@kathymakes do you know if the orange close icon appears elsewhere in the GUI already?
Also, does this border work for you (ignore the styling and 'Tutorials' 馃槃 ):

@evhan55 Yeah, border looks good! :)
The "X" svg I sent you is the same one we use for modals, but we dont have any orange ones elsewhere. It might be more extensible for more alerts in the future.
Here's the white "X" in all of our modal windows...
It's contained in a circle like this:

@evhan55
I'm thinking it might also be good to style the "X"s same as the modal, for consistency.
Do you think we could try it with the circle?
These sketches have a 28x28 circle with orange at 20% opacity.

@kathymakes Sure thing! Circle for consistency sounds good.
@rschamp , is it cool for me to make changes to CloseButton and it's CSS to add an orange mode?
@kathymakes How is this? When you hover over the x button, it grows the same way it grows on other close buttons:

@evhan55 Ah so sorry I never saw your message, it got lost in my notifications! Yeah, that sounds good for consistency - and it's looking really nice
Unassigned myself as @benjiwheeler is taking over the generalized alerts system now
Closing because these are implemented in code; next, they need to have their CSS brought into line with this spec. Tracking that in https://github.com/LLK/scratch-gui/issues/3686
Most helpful comment
Some styling notes from @kathymakes: