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.

feat: enhance launch detail with live-state indicator and progress animation using ui-juice

qbdzb7fd3c3e329d
diff --git a/.smoke-juice.mjs b/.smoke-juice.mjs
new file mode 100644
index 000000000..fe9f328c5
--- /dev/null
+++ b/.smoke-juice.mjs
@@ -0,0 +1,57 @@
+import puppeteer from 'puppeteer';
+
+const BASE = process.env.BASE || 'http://localhost:3000';
+const PAGES = [
+ { name: 'agi', url: `${BASE}/agi`, waitMs: 6000 },
+ { name: 'alpha-copilot', url: `${BASE}/alpha-copilot`, waitMs: 9000 },
+ { name: 'reasoning-ledger', url: `${BASE}/reasoning-ledger`, waitMs: 5000 },
+];
+
+// Console messages we expect when /api is proxied to prod from a logged-out dev
+// session (auth-gated endpoints, missing favicons, etc). These are NOT defects in
+// the presentation work; real JS exceptions are what we hunt.
+const IGNORE = [
+ /Failed to load resource/i,
+ /the server responded with a status/i,
+ /net::ERR/i,
+ /401|403|404|429|500|502|503/,
+ /favicon|apple-touch|og-image|\.png|\.svg|\.webmanifest/i,
+ /Download the React|Lighthouse/i,
+ /agent-3d|element\.js|GLB|gltf|three\b/i, // 3D body is an enhancement, not in scope
+];
+const ignored = (t) => IGNORE.some((re) => re.test(t));
+
+const browser = await puppeteer.launch({ args: ['--no-sandbox'], headless: 'new' });
+let hardFail = 0;
+
+for (const p of PAGES) {
+ const page = await browser.newPage();
+ const errors = [];
+ page.on('console', (m) => { if (m.type() === 'error' && !ignored(m.text())) errors.push(`console: ${m.text()}`); });
+ page.on('pageerror', (e) => { if (!ignored(String(e))) errors.push(`pageerror: ${e.message || e}`); });
+ for (const motion of ['no-preference', 'reduce']) {
+ await page.emulateMediaFeatures([{ name: 'prefers-reduced-motion', value: motion }]);
+ await page.goto(p.url, { waitUntil: 'domcontentloaded' });
+ await new Promise((r) => setTimeout(r, p.waitMs));
+ }
+ // Report a few signals of the juice actually mounting against real data.
+ const probe = await page.evaluate(() => ({
+ juiceEnter: document.querySelectorAll('.juice-enter').length,
+ live: document.querySelector('.juice-live')?.dataset.state || null,
+ spark: document.querySelectorAll('.juice-spark').length,
+ thoughts: document.querySelectorAll('.agi-thought').length,
+ launches: document.querySelectorAll('.ac-launch').length,
+ entries: document.querySelectorAll('.rl-entry').length,
+ ring: document.querySelectorAll('.agi-ring-val, .rl-score-arc').length,
+ bodyLen: document.body.innerText.trim().length,
+ }));
+ console.log(`\n=== ${p.name} ===`);
+ console.log('probe:', JSON.stringify(probe));
+ if (errors.length) { hardFail++; console.log('ERRORS:'); errors.slice(0, 8).forEach((e) => console.log(' -', e)); }
+ else console.log('no JS errors');
+ await page.close();
+}
+
+await browser.close();
+console.log(`\n${hardFail ? 'FAIL' : 'PASS'}: ${hardFail} page(s) with JS errors`);
+process.exit(hardFail ? 1 : 0);
diff --git a/src/launch-copilot.js b/src/launch-copilot.js
index 795adf5b1..1f7416059 100644
--- a/src/launch-copilot.js
+++ b/src/launch-copilot.js
@@ -11,6 +11,7 @@
// this UI only edits the published policy and reads its honest action ledger.
import { apiFetch } from './api.js';
+import { enterRow, flashValue, rippleOnce, liveDot, setLiveDot } from './ui-juice.js';
import './launch-copilot.css';
const NETWORK_DEFAULT = 'mainnet';
@@ -116,13 +117,18 @@ export function mountLaunchCopilot(host, opts = {}) {
try { state.es?.close(); } catch {}
const es = new EventSource(`/api/launch/mm/${encodeURIComponent(state.mint)}?network=${state.network}&stream=1`);
state.es = es;
- es.addEventListener('open', () => { /* connected */ });
+ es.addEventListener('open', () => setLogLive('live'));
es.addEventListener('action', (ev) => {
try {
const a = JSON.parse(ev.data);
if (!state.data) return;
+ setLogLive('live');
state.data.actions = [a, ...(state.data.actions || [])].slice(0, 60);
renderActions();
+ // The freshest action slides in and tints in the direction money moved
+ // (a sell returns SOL → success, a buy spends it → danger).
+ const first = host.querySelector('#lc-actions .lc-act');
+ if (first) { enterRow(first); flashValue(first, a.side === 'sell' ? 'up' : 'down'); }
} catch { /* ignore frame */ }
});
es.addEventListener('state', (ev) => {
@@ -131,8 +137,14 @@ export function mountLaunchCopilot(host, opts = {}) {
if (state.data?.policy) { state.data.policy = p; renderStats(); renderHeader(); }
} catch { /* ignore */ }
});
- es.addEventListener('close', () => { es.close(); state.es = null; if (!state.destroyed) setTimeout(() => { if (state.data?.policy) connectStream(); }, 800); });
- es.onerror = () => { es.close(); state.es = null; if (!state.destroyed) setTimeout(() => { if (state.data?.policy) connectStream(); }, 2500); };
+ es.addEventListener('close', () => { es.close(); state.es = null; setLogLive('connecting'); if (!state.destroyed) setTimeout(() => { if (state.data?.policy) connectStream(); }, 800); });
+ es.onerror = () => { es.close(); state.es = null; setLogLive('connecting'); if (!state.destroyed) setTimeout(() => { if (state.data?.policy) connectStream(); }, 2500); };
+ }
+
+ // Drive the shared live-state dot in the action-log head (survives re-renders;
+ // no-ops when the log isn't mounted, e.g. the form/empty states).
+ function setLogLive(stateName) {
+ setLiveDot(host.querySelector('#lc-log-live'), stateName);
}
// ── owner actions ───────────────────────────────────────────────────────────
diff --git a/src/launch-detail.css b/src/launch-detail.css
index 2ba9a4104..e5f7bf219 100644
--- a/src/launch-detail.css
+++ b/src/launch-detail.css
@@ -5,6 +5,7 @@
panels, signal-tinted accents (good=success, warn, danger). Every panel owns
a designed empty/error state; reduced-motion calms all motion; light theme
remaps entirely through tokens. */
+@import './ui-juice.css';
body {
margin: 0;
@@ -582,6 +583,8 @@ body {
.ld-live-dot.ld-live-on { background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: ld-pulse 1.8s var(--ease-standard) infinite; }
@keyframes ld-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ld-live-dot.ld-live-on { animation: none; } }
+/* Shared live-state indicator in the trade-tape head (see ui-juice liveDot). */
+.ld-tape-live { display: inline-flex; align-items: center; margin-left: var(--space-2); }
.ld-tape-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.ld-trade {
display: flex; align-items: center; gap: var(--space-sm);
diff --git a/src/launch-detail.js b/src/launch-detail.js
index 454f52116..89c4c0ca4 100644
--- a/src/launch-detail.js
+++ b/src/launch-detail.js
@@ -1710,7 +1710,8 @@ async function renderTape() {
target.hidden = true;
return;
}
- const dot = el('span', { class: 'ld-live-dot', 'aria-hidden': 'true' });
+ // Shared live-state indicator (connecting → live) for the SSE trade tape.
+ const dot = el('span', { class: 'ld-tape-live', html: liveDot('connecting', { label: 'live' }) });
const list = el('div', { class: 'ld-tape-list' });
const head = el('div', { class: 'ld-sec-head' }, [
el('h2', { class: 'ld-sec-title' }, [el('span', { text: 'Live trades' }), dot]),
@@ -2119,10 +2120,22 @@ async function boot() {
// Refresh the live market every 30s so price / mcap / graduation stay fresh.
state.priceTimer = setInterval(async () => {
if (document.hidden) return;
+ const prev = state.coin;
const fresh = await loadCoin();
if (fresh) {
state.coin = fresh;
renderHero();
+ // Real-value deltas across the 30s poll drive the game-feel beats: tint the
+ // market-cap stat in the direction it moved, and fire a single ripple the
+ // moment a coin graduates — a genuine "it shipped" milestone, not a timer.
+ const prevMcap = Number(prev?.usd_market_cap);
+ const nextMcap = Number(fresh?.usd_market_cap);
+ if (Number.isFinite(prevMcap) && Number.isFinite(nextMcap) && nextMcap !== prevMcap) {
+ flashValue($('ld-hero')?.querySelector('.ld-stat-mcap dd'), nextMcap > prevMcap ? 'up' : 'down');
+ }
+ if (prev && prev.complete !== true && fresh.complete === true) {
+ rippleOnce($('ld-hero')?.querySelector('.ld-grad'));
+ }
}
}, 30_000);
}
diff --git a/src/three-gate.js b/src/three-gate.js
index fea5fee38..88433d85b 100644
--- a/src/three-gate.js
+++ b/src/three-gate.js
@@ -27,6 +27,7 @@
import gateStyles from './three-gate.css?inline';
import { getAccess } from './three-tier-pass.js';
import { log } from './shared/log.js';
+import { countUp } from './ui-juice.js';
// The one and only coin. Hardcoded (matching src/pump/three-token-data.js) so the
// acquire links work even before any access payload resolves.
@@ -279,8 +280,8 @@ class ThreeGate extends HTMLElement {
`<span class="tg-meta-v">${escapeHtml(required.label)} · ${fmtUsd(reqMin)}</span></div>` +
`</div>` +
`<div class="tg-prog">` +
- `<span class="tg-prog-track"><span class="tg-prog-fill" style="width:${pct}%"></span></span>` +
- `<span class="tg-prog-cap">${pct}% there</span>` +
+ `<span class="tg-prog-track"><span class="tg-prog-fill" style="width:0%"></span></span>` +
+ `<span class="tg-prog-cap"><span class="tg-prog-cap-n">0</span>% there</span>` +
`</div>` +
`<div class="tg-actions">` +
`<a class="tg-btn tg-btn--primary" data-tg-get href="${JUPITER_SWAP_URL}" target="_blank" rel="noopener">Get $THREE</a>` +
@@ -293,6 +294,14 @@ class ThreeGate extends HTMLElement {
`</div>`;
this._wireLocked();
+
+ // Drive the progress toward the required hold from real numbers: sweep the
+ // fill to its live percentage and count the cap up to match. Reduced motion
+ // is handled by the scoped transition reset + countUp's instant-final path.
+ const fill = this._veil.querySelector('.tg-prog-fill');
+ const capN = this._veil.querySelector('.tg-prog-cap-n');
+ if (fill) requestAnimationFrame(() => { fill.style.width = `${pct}%`; });
+ if (capN) countUp(capN, 0, pct, { format: (n) => String(Math.round(n)) });
}
_wireLocked() {