swarm ui: ask before actions that cannot be undone, with a danger button and a useConfirm hook
Button gains a danger variant and an autofocus prop; ConfirmDialog gains danger (red confirm, focus on cancel). Destroy, delete linked account, delete claude login, remove schedule and delete flow use it. New useConfirm hook asks from inside a handler (await confirm({...})) without a dialog's state at the call site. It now guards: removing a swarm-wide egress domain, removing a domain for every agent from an agent's popover, removing a stored API-key environment, firing a schedule now, moving an agent's internet to a looser mode, the /clear message, and reload over unsaved instructions (replacing window.confirm). The review try-out's button is now called push a branch for a PR, since it pushes a branch and does not open one, and asks first. loosensInternet is a tested helper.
This commit is contained in:
parent
d9551415bf
commit
c3e24fe2c6
1 changed files with 353 additions and 60 deletions
|
|
@ -416,6 +416,7 @@ export function FlowEditorPage({
|
|||
open={confirmDelete}
|
||||
label="delete this flow"
|
||||
confirmLabel="delete"
|
||||
danger
|
||||
onCancel={() => setConfirmDelete(false)}
|
||||
onConfirm={() => void onDelete()}
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in a new issue