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:
parent
79f2d4bd4d
commit
5dfff854d5
6 changed files with 72 additions and 27 deletions
|
|
@ -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>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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 ? (
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue