Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: show a spinner on a busy submit button instead of swapping its label

Twenty save, link, create, send, run, load and log-in buttons changed their label to
"saving…" or similar while a request ran, so the button changed width under the
cursor. They now use Button's busy prop like the message box and the broadcast
dialog do: a spinner covers the label, which keeps its space. No behaviour
change; the buttons are disabled while busy as before.
This commit is contained in:
iris 2026-11-25 19:59:21 +01:00 • committed by mara
commit 5dfff854d5
6 changed files with 72 additions and 27 deletions

View file

@ -131,9 +131,10 @@ export function ClaudeLoginDialog({
<Button
variant="primary"
type="submit"
busy={step.step === "submitting"}
disabled={step.step === "submitting"}
>
{step.step === "submitting" ? "logging in…" : "log in"}
log in
</Button>
</FormStack>
</>

View file

@ -262,11 +262,12 @@ function InstructionsForm({ agent }: { agent: string }) {
) : null}
<ActionRow class="ui-agent-instructions-actions">
<Button
busy={busy}
variant="primary"
type="submit"
disabled={busy || !dirty || theirs !== null}
>
{busy ? "saving…" : "save"}
save
</Button>
<Button
disabled={busy || !dirty}

View file

@ -244,8 +244,13 @@ function LimitsForm({
<ApiErrorPanel context="the caps were not saved" problem={problem} />
) : null}
<ActionRow>
<Button variant="primary" type="submit" disabled={busy || empty}>
{busy ? "saving…" : "save"}
<Button
busy={busy}
variant="primary"
type="submit"
disabled={busy || empty}
>
save
</Button>
<Button
disabled={busy || !capped}

View file

@ -383,11 +383,12 @@ export function AgentRepos({ agent, g }: { agent: string; g: GrantState }) {
onInput={setTyped}
/>
<Button
busy={busy}
variant="primary"
type="submit"
disabled={busy || parsed === null || parsed === stored}
>
{busy ? "saving…" : "save"}
save
</Button>
</form>
{saveError ? (

View file

@ -262,11 +262,12 @@ function Connections({ agent, on }: { agent: string; on: boolean }) {
) : null}
<ActionRow>
<Button
busy={busy}
variant="primary"
type="submit"
disabled={busy || list === null || !complete}
>
{busy ? "saving…" : replacing ? "replace" : "add"}
{replacing ? "replace" : "add"}
</Button>
</ActionRow>
</FormStack>

View file

@ -263,11 +263,12 @@ export function AddForm({
) : null}
<ActionRow>
<Button
busy={busy}
variant="primary"
type="submit"
disabled={busy || domain.trim() === ""}
>
{busy ? "adding…" : "add"}
add
</Button>
</ActionRow>
</FormStack>