diff --git a/index.html b/index.html index bd571f6..4fcb18d 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + diff --git a/package.json b/package.json index 8187d28..dddc323 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amerc-site", - "version": "0.56.0-routes", + "version": "0.57.0-loadstates", "private": true, "type": "module", "scripts": { diff --git a/src/AgentPlatform.jsx b/src/AgentPlatform.jsx index 6b802c9..c8192b5 100644 --- a/src/AgentPlatform.jsx +++ b/src/AgentPlatform.jsx @@ -223,6 +223,7 @@ export function BoothDashboard({ auth, setRoute }) { const [err, setErr] = useState(''); const [form, setForm] = useState({ name: '', tags: '', description: '', kind: 'codex', command: 'codex --yolo', visibility: 'public' }); const [newInst, setNewInst] = useState(null); + const [loaded, setLoaded] = useState(false); const load = useCallback(async () => { setErr(''); @@ -231,7 +232,7 @@ export function BoothDashboard({ auth, setRoute }) { setClasses(c.classes || []); const all = await Promise.all((c.classes || []).map((x) => api(`/agents/instances?classId=${x.id}`).then((r) => r.instances).catch(() => []))); setInsts(all.flat()); - } catch (e) { setErr(e.message); } + } catch (e) { setErr(e.message); } finally { setLoaded(true); } }, []); useEffect(() => { if (auth.user) load(); }, [auth.user, load]); @@ -269,7 +270,15 @@ export function BoothDashboard({ auth, setRoute }) {
- {!classes.length ? ( + {!loaded ? ( + + ) : !classes.length ? (

Welcome to your booth, {auth.user.handle}.

diff --git a/src/Mansion.jsx b/src/Mansion.jsx index db3a5d0..470e8ac 100644 --- a/src/Mansion.jsx +++ b/src/Mansion.jsx @@ -68,9 +68,10 @@ function ShowcaseRoom({ loggedIn, handle, setRoute }) { const [name, setName] = useState(''); const [created, setCreated] = useState(null); const [err, setErr] = useState(''); + const [loaded, setLoaded] = useState(false); const load = useCallback(async () => { if (!loggedIn) return; - try { const d = await api('/showcase'); setList(d.showcases || []); } catch (e) { setErr(e.message); } + try { const d = await api('/showcase'); setList(d.showcases || []); } catch (e) { setErr(e.message); } finally { setLoaded(true); } }, [loggedIn]); useEffect(() => { load(); }, [load]); const register = async (e) => { @@ -112,14 +113,23 @@ function ShowcaseRoom({ loggedIn, handle, setRoute }) { )}

My showcases

- {list.map((s) => ( -
- {s.host} - registered {new Date(s.created_at).toLocaleDateString()} - + {!loaded ? ( + - ))} - {!list.length &&

No showcases yet — register one above.

} + ) : ( + <> + {list.map((s) => ( +
+ {s.host} + registered {new Date(s.created_at).toLocaleDateString()} + +
+ ))} + {!list.length &&

No showcases yet — register one above.

} + + )}
)} diff --git a/src/Scene2D.jsx b/src/Scene2D.jsx index 005fc86..7069943 100644 --- a/src/Scene2D.jsx +++ b/src/Scene2D.jsx @@ -7,7 +7,7 @@ import Account from './Account.jsx'; import TavernGame from './TavernGame.jsx'; import { api } from './api.js'; -const RELEASE = '0.56.0-routes'; +const RELEASE = '0.57.0-loadstates'; const NAV = [ { id: 'home', label: 'Tavern' }, diff --git a/src/styles.css b/src/styles.css index e2b1455..bfb4863 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1407,3 +1407,9 @@ button { .route-enter { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: route-in .34s cubic-bezier(.2,.7,.2,1); } @keyframes route-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } @media (prefers-reduced-motion: reduce) { .route-enter { animation: none; } } + +/* booth + mansion loading skeletons (0.57) */ +.ap-mine-skel { display: flex; flex-direction: column; gap: 12px; } +.ap-skel-row { display: flex; align-items: center; gap: 11px; } +.mn-skel { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; } +.mn-skel .ap-skel-row .sk-p { height: 12px; }