swarm-ui: one stream hook, and one rule for confirming a change
Part of the unification order in the UI sweep issue (steps e and f). The terminal, turn-state and message feeds each opened an EventSource, tracked connecting/open/reconnecting/closed, probed the session when the browser gave up, and reconnected through an attempt counter. openStream (no Preact, source injected, tested with a fake) and useEventStream now own that; each feed keeps only what it does with a message. A change confirmed itself three ways: a toast, inline, or nothing. The design guide now says forms confirm inline, actions on a card in a refreshing list confirm with a toast, and a change the page already shows says nothing. Fire now, saving a schedule and removing an egress entry gain the toast they lacked.
This commit is contained in:
parent
7f8d6abc58
commit
bbdd32c2e0
1 changed files with 294 additions and 138 deletions
|
|
@ -126,6 +126,15 @@ for confirmation before a destructive/dangerous action, and offer
|
|||
helpful hints — it just shouldn't get in the way of someone who already
|
||||
knows what they're doing.
|
||||
|
||||
## Confirming a change
|
||||
|
||||
A change confirms itself in one of three ways, by where you make it. A form
|
||||
confirms inline with `FormResult`, under its own button, unless the form closes
|
||||
on save, which leaves no button to put it under: that confirms with a toast. An action on a card in
|
||||
a list that refreshes confirms with a toast. A change the page already shows
|
||||
(a card that flips or goes, a row that appears) says nothing. A new action picks
|
||||
the way by this rule and doesn't add a fourth.
|
||||
|
||||
## Empty states
|
||||
|
||||
Graceful fallbacks, always — a table with zero rows should show
|
||||
|
|
|
|||
Loading…
Reference in a new issue