Download web/src/ui/Busy.tsx from fsanyoto/loopable: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/ui/Busy.tsx
- Command line
-
hf download hf://spaces/fsanyoto/loopable/web/src/ui/Busy.tsx
-
curl -L -o Busy.tsx https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/ui/Busy.tsx
2.01 kB
| // --------------------------------------------------------------------------- | |
| // ui/Busy.tsx — WAVE 37 · T05. The in-flight label for a write control. | |
| // | |
| // ⛔ THE DEFECT THIS EXISTS FOR IS NOT "there was no feedback". It is that the | |
| // feedback was INDISTINGUISHABLE FROM NOTHING TO DO. Every write control in | |
| // `settings/` carried `disabled={busy}` and nothing else — and the same controls | |
| // also carry `disabled={!dirty}`, `disabled={!accountDirty}`, `disabled={!canCopy}`, | |
| // `disabled={pw.length === 0}`. So a greyed button mid-save looks exactly like a | |
| // greyed button with nothing to save. The owner's words for that: "left on the | |
| // same pane wondering". | |
| // | |
| // ⭐ THE PATTERN IS NOT NEW, WHICH IS THE POINT. `account/FeedbackPage.tsx` has | |
| // swapped its icon for `<span className="lp-spin" role="status">` while sending | |
| // since wave 35, and `settings/SettingsModal.tsx`'s own connector card already | |
| // renders `{form.busy ? "Saving…" : "Save key"}`. Two correct precedents, in two | |
| // files, and neither reached the account controls beside them. This is the third | |
| // copy — so it is the one that becomes a component instead. | |
| // | |
| // ⚠ SPINNER *AND* LABEL, not either alone. A spinner says "something is | |
| // happening"; the label says WHICH something, which is what a person who clicked | |
| // two controls in five seconds actually needs. | |
| // | |
| // ⚠ `role="status"` on the spinner and `aria-label={doing}` — a screen reader | |
| // announces the state change rather than hearing a button silently become | |
| // disabled. The visible label carries the same word, so the two agree. | |
| // --------------------------------------------------------------------------- | |
| /** `<Busy busy={busy} idle="Save access" doing="Saving" />` inside a `<button>`. */ | |
| export function Busy({ busy, idle, doing }: { busy: boolean; idle: string; doing: string }) { | |
| return busy ? ( | |
| <> | |
| <span className="lp-spin set-btn-spin" role="status" aria-label={doing} /> | |
| {doing} | |
| </> | |
| ) : ( | |
| <>{idle}</> | |
| ); | |
| } | |