Feedback sweep: spinners on every async button, toasts for action outcomes, top activity bar, loading states on every page, terminal connecting overlay, dashboard save indicator, task pane pinned above the package list with auto-scroll and completion toast
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
d08b246b5f
commit
724f30c02b
+4
-4
@@ -1,5 +1,6 @@
|
||||
import { FormEvent, useState } from 'react'
|
||||
import { api } from './api'
|
||||
import { Spinner } from './ui'
|
||||
|
||||
export default function Login({ onLogin }: { onLogin: () => void }) {
|
||||
const [pw, setPw] = useState('')
|
||||
@@ -10,8 +11,7 @@ export default function Login({ onLogin }: { onLogin: () => void }) {
|
||||
e.preventDefault()
|
||||
setBusy(true); setErr('')
|
||||
try { await api.login(pw); onLogin() }
|
||||
catch (e) { setErr(e instanceof Error ? e.message : 'login failed') }
|
||||
finally { setBusy(false) }
|
||||
catch (e) { setErr(e instanceof Error ? e.message : 'login failed'); setBusy(false) }
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -20,8 +20,8 @@ export default function Login({ onLogin }: { onLogin: () => void }) {
|
||||
<img className="login-logo" src="/icons/logo.png" alt="" width={160} height={160} />
|
||||
<h1>Ham Lab</h1>
|
||||
<input type="password" autoFocus autoComplete="current-password" placeholder="password"
|
||||
value={pw} onChange={(e) => setPw(e.target.value)} />
|
||||
<button disabled={busy || !pw}>{busy ? '…' : 'Sign in'}</button>
|
||||
value={pw} onChange={(e) => setPw(e.target.value)} disabled={busy} />
|
||||
<button disabled={busy || !pw}>{busy && <Spinner />}{busy ? 'Signing in…' : 'Sign in'}</button>
|
||||
{err && <div className="error">{err}</div>}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user