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.

fix(characters): finish the discovery feed markup and studio page left mid-edit

nirholas029ef854990e
diff --git a/pages/avatar-studio.html b/pages/avatar-studio.html
index 7ef68fb69..0035f7222 100644
--- a/pages/avatar-studio.html
+++ b/pages/avatar-studio.html
@@ -410,6 +410,15 @@
padding: 24px 4px;
text-align: center;
}
+ /* While an accessory is loading onto the rig, the grid stops taking
+ input: a second click during the fetch queued a competing op that
+ landed after the first and undid it. */
+ .as-grid, .as-swatches { transition: opacity 0.15s; }
+ .as-panel[aria-busy='true'] .as-grid,
+ .as-panel[aria-busy='true'] .as-swatches {
+ opacity: 0.55;
+ pointer-events: none;
+ }
.as-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
diff --git a/src/avatar-studio.js b/src/avatar-studio.js
index 47fc7d6c2..441642a69 100644
--- a/src/avatar-studio.js
+++ b/src/avatar-studio.js
@@ -758,7 +758,7 @@ function renderActivePanel() {
if (tab.sculpt) {
if (!scene?.root) {
- panel.innerHTML = `<div class="as-empty">Waiting for avatar to load...</div>`;
+ panel.innerHTML = `<div class="as-empty">Waiting for avatar to load…</div>`;
return;
}
renderSculptPanel({
@@ -858,7 +858,7 @@ function tilePreviewMarkup(preset) {
function renderAnimatePanel(panel) {
if (!scene?.root) {
- panel.innerHTML = `<div class="as-empty">Waiting for avatar to load...</div>`;
+ panel.innerHTML = `<div class="as-empty">Waiting for avatar to load…</div>`;
return;
}
if (!emotesReady) {
diff --git a/src/characters.js b/src/characters.js
index c3bbe0a02..9d731e1ce 100644
--- a/src/characters.js
+++ b/src/characters.js
@@ -175,8 +175,15 @@ function showError(grid, appending) {
}
async function fetchCharacters(reset = false) {
- if (state.loading) return;
- state.loading = true;
+ // A reset (search or sort change) always supersedes whatever is in flight;
+ // only an append is dropped, and only to swallow a double-click on Load more.
+ // A blanket "already loading, ignore" guard meant that clicking Top while the
+ // first page was still arriving lit the button up and changed nothing else,
+ // so the page then showed New results under a Top label.
+ if (!reset && state.appending) return;
+ if (!reset) state.appending = true;
+ const gen = ++state.gen;
+ const superseded = () => gen !== state.gen;
const grid = document.getElementById('chs-grid');
const loadBtn = document.getElementById('chs-load-btn');
@@ -205,13 +212,19 @@ async function fetchCharacters(reset = false) {
if (!res.ok) throw new Error('characters feed responded ' + res.status);
data = await res.json();
} catch {
+ state.appending = false;
+ if (superseded()) return;
grid.setAttribute('aria-busy', 'false');
showError(grid, !reset);
if (loadBtn) loadBtn.disabled = false;
- state.loading = false;
return;
}
+ state.appending = false;
+ // A newer reset landed while this response was in flight; its render owns the
+ // grid now, so drop this one rather than painting stale results over it.
+ if (superseded()) return;
+
const chars = data.characters || [];
if (reset) {
@@ -219,7 +232,6 @@ async function fetchCharacters(reset = false) {
grid.setAttribute('aria-busy', 'false');
showEmpty(grid);
if (loadMore) loadMore.hidden = true;
- state.loading = false;
return;
}
grid.innerHTML = chars.map(cardHtml).join('');
@@ -244,7 +256,6 @@ async function fetchCharacters(reset = false) {
loadBtn.disabled = false;
loadBtn.textContent = 'Load more';
}
- state.loading = false;
}
function init() {