Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

dashboard(errors): show a sentence the user can act on instead of 'Failed to fetch'

nirholasc259baa45e7f
diff --git a/src/dashboard-next/pages/home.js b/src/dashboard-next/pages/home.js
index fa8642c8c..df09cdcf2 100644
--- a/src/dashboard-next/pages/home.js
+++ b/src/dashboard-next/pages/home.js
@@ -229,12 +229,22 @@ function renderSkeletons(main) {
// ── Hero strip ────────────────────────────────────────────────────────────
+/** Body copy for a failed load. An ApiError carries a real server message worth
+ * showing; a dropped connection surfaces as the browser's bare "Failed to
+ * fetch", which tells the user nothing they can act on, so it gets the
+ * caller's sentence instead. */
+function loadErrorBody(err, fallback) {
+ const msg = err && typeof err.message === 'string' ? err.message.trim() : '';
+ if (!msg || /^(failed to fetch|network ?error|load failed)$/i.test(msg)) return fallback;
+ return msg;
+}
+
function renderHero(host, avatars, err) {
if (err && !(err instanceof ApiError && err.status === 401)) {
ensureStateKitStyles();
host.innerHTML = `<div class="dn-panel" style="grid-column:1/-1;padding:0">${errorStateHTML({
title: "Couldn't load your avatars",
- body: esc(err.message || "The avatars service didn't respond. Check your connection and try again."),
+ body: esc(loadErrorBody(err, "The avatars service didn't respond. Check your connection and try again.")),
scope: 'avatars',
})}</div>`;
attachRetry(host, async () => {
@@ -542,7 +552,7 @@ function renderAgentHealth(host, agents, widgets, loadErrors = {}) {
ensureStateKitStyles();
host.innerHTML = `<div class="dn-panel dnx-health-panel" style="padding:0">${errorStateHTML({
title: "Couldn't load agent health",
- body: esc(loadErrors.agents.message || "The agents service didn't respond. Check your connection and try again."),
+ body: esc(loadErrorBody(loadErrors.agents, "The agents service didn't respond. Check your connection and try again.")),
scope: 'agent-health',
})}</div>`;
attachRetry(host, () => location.reload());
@@ -607,7 +617,7 @@ async function refreshActivity(host, ctx) {
<div class="dn-panel-title">Recent activity</div>
${errorStateHTML({
title: "Couldn't load activity",
- body: esc(ctx.loadErrors.widgets.message || "Your widgets didn't load, so there's nothing to read activity from."),
+ body: esc(loadErrorBody(ctx.loadErrors.widgets, "Your widgets didn't load, so there's nothing to read activity from. Check your connection and try again.")),
scope: 'activity',
})}
</div>
diff --git a/src/dashboard-next/pages/settings.js b/src/dashboard-next/pages/settings.js
index fca2d432d..07bc0bec4 100644
--- a/src/dashboard-next/pages/settings.js
+++ b/src/dashboard-next/pages/settings.js
@@ -53,8 +53,8 @@ function injectStyles() {
width:18px;height:18px;border-radius:50%;background:var(--nxt-ink);
transition:transform .2s cubic-bezier(.4,0,.2,1),background .18s ease}
.set-switch[aria-checked="true"]::after{transform:translateY(-50%) translateX(16px);background:#000}
- .set-switch:focus-visible{outline:none;box-shadow:0 0 0 3px var(--nxt-accent-soft)}
- .set-theme-btn:focus-visible,.set-net-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--nxt-accent-soft)}
+ .set-switch:focus-visible{box-shadow:0 0 0 3px var(--nxt-accent-soft)}
+ .set-theme-btn:focus-visible,.set-net-btn:focus-visible{box-shadow:0 0 0 3px var(--nxt-accent-soft)}
.set-store-row{display:flex;align-items:center;gap:12px;padding:12px 0;flex-wrap:wrap;
border-bottom:1px solid var(--nxt-stroke)}
.set-store-row:last-child{border-bottom:0}
@@ -73,7 +73,7 @@ function injectStyles() {
.set-seg-btn:hover:not([disabled]){background:rgba(255,255,255,.06);color:var(--nxt-ink)}
.set-seg-btn[aria-pressed="true"]{background:var(--nxt-accent);color:#000}
.set-seg-btn[disabled]{opacity:.4;cursor:not-allowed}
- .set-seg-btn:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--nxt-accent-soft)}
+ .set-seg-btn:focus-visible{box-shadow:inset 0 0 0 2px var(--nxt-accent-soft)}
@media (prefers-reduced-motion:reduce){.set-switch,.set-switch::after{transition:none}}
`;
document.head.appendChild(s);