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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(composer,marketplace): stop late boxes shoving the page and load grid avatars on attention
nirholas94ae967ca57d
diff --git a/pages/forge.html b/pages/forge.htmlindex b3e1f1b21..b1aaf2073 100644--- a/pages/forge.html+++ b/pages/forge.html@@ -598,6 +598,15 @@row-gap: 2px;justify-content: flex-start;}+ /* The engine buttons arrive with the catalog. An empty pill is 6px tall+ and a filled one is 54px, so the row it sits in used to grow half a+ second into the load and push the example chips down with it. Reserve+ the filled height while it is empty; `:empty` stops matching the+ moment buildEngineButtons() writes, so a taller set is free to be+ taller. Keep in step with `.aspect button` padding + font size. */+ .engine-pill:empty {+ min-height: 50px;+ }/* Shown by buildEngineButtons() when no lane can serve the active tab —keeps the pill from collapsing to an empty box. */.engine-empty {@@ -3394,7 +3403,14 @@</button><!-- Hidden until the catalog reports a live sketch engine (TripoSGself-host) — no dead tab on deployments without the worker. -->- <button type="button" role="tab" id="tab-sketch" data-mode="sketch" aria-selected="false" aria-controls="sketch-pane" tabindex="-1" hidden data-i18n="forge.from_a_sketch">+ <!-- Not `hidden`. revealSketchMode() hides this tab when the catalog+ reports no sketch lane, which is the minority deployment; on a+ deployment that has one, waiting for the catalog meant the tab+ appeared ~400 ms in, wrapped the tab row onto a second line and+ dropped the whole composer 38 px. That single shift was 0.19 of+ this page's 0.23 CLS. Ship the state production is in and let+ the catalog take it away where it does not apply. -->+ <button type="button" role="tab" id="tab-sketch" data-mode="sketch" aria-selected="false" aria-controls="sketch-pane" tabindex="-1" data-i18n="forge.from_a_sketch">From a sketch</button></div>diff --git a/src/marketplace.js b/src/marketplace.jsindex 27ab3bdeb..d9b48700d 100644--- a/src/marketplace.js+++ b/src/marketplace.js@@ -1556,22 +1556,21 @@ function observeCardModelViewers() {for (const entry of entries) {const mv = entry.target;if (!entry.isIntersecting) continue;- // Lazy promote data-src → src on first intersect (fires the GLB download).- if (mv.dataset.src && !mv.getAttribute('src')) {- mv.setAttribute('src', mv.dataset.src);- delete mv.dataset.src;- }- // Rotation has exactly one owner from here: attendRotation, which- // turns the card when it arrives, settles it once it has turned far- // enough to read as 3D, and turns it again on hover or focus.- // Toggling the attribute here too meant two owners of one attribute:- // this observer re-added auto-rotate after the settle, attendRotation- // saw its own state already matching and never took it away again, and- // the cards rotated for the life of the tab anyway (27 s of scripting- // in a 40 s desktop run).+ // attendRotation owns both the model and its rotation from here. It+ // promotes data-src on the first hover, focus or tap, turns the card+ // while it is being looked at, and settles it once it has turned far+ // enough to read as 3D.+ //+ // Promoting on intersect instead, which is what this did, downloaded+ // and decoded a full avatar for every thumbnail-less card in view:+ // four of them were 8.7 s of the page's blocking time, and decoding a+ // GLB is one unbreakable main-thread task each. The card already+ // renders its designed placeholder underneath (placeholderHtml), so+ // nothing is blank in the meantime, and a card that carries a stored+ // thumbnail never had a viewer in the first place.if (mv.dataset.shouldRotate !== '0' && mv.dataset.attendedRotateBound !== '1') {mv.setAttribute('auto-rotate', '');- attendRotation(mv);+ attendRotation(mv, { attention: mv.closest('.market-card-avatar, .market-theme-pick') });}}},