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
|
|
@ -22,6 +22,7 @@ import {
|
|||
useDeniedDomains,
|
||||
} from "../../agent/detail/useAllowedDomains.js";
|
||||
import { Button } from "../../ui/button/Button.js";
|
||||
import { showToast } from "../../ui/toast/toasts.js";
|
||||
import { useConfirm } from "../../ui/confirm-dialog/useConfirm.js";
|
||||
import { LazyDisclosure } from "../../ui/disclosure/LazyDisclosure.js";
|
||||
import { Dialog } from "../../ui/dialog/Dialog.js";
|
||||
|
|
@ -66,7 +67,7 @@ function DomainSection({
|
|||
) {
|
||||
return;
|
||||
}
|
||||
void remove(e);
|
||||
if (await remove(e)) showToast(`removed ${e.domain}`, "ok");
|
||||
}
|
||||
|
||||
// A list already loaded stays under a failed refetch, so a change that
|
||||
|
|
|
|||
Loading…
Reference in a new issue