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 UI with new game-feel library and improve agent detail components

qbdz2181cd6f2404
diff --git a/data/changelog.json b/data/changelog.json
index 66e9f4ee5..a747513a0 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,43 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-30",
+ "title": "The AI surfaces now make the agent's thinking feel alive — the AGI, Alpha Co-pilot and Reasoning Ledger",
+ "summary": "The three pages where you watch an agent reason just got the same game-feel polish as the Swarms page, all driven by real data. On The AGI, only genuinely new decisions slide into the live feed (the rest stay put instead of flickering on every refresh), a live dot tells you when the stream is connected or reconnecting, and the reputation ring sweeps and counts up only when the real score actually moves. On the Alpha Co-pilot, the launch feed lands card-by-card, each launch's score bars grow from zero, and when a read comes back the conviction bar fills and counts up, the signals the agent cited reveal in sequence, and the verdict gets a single accent pulse. On the Reasoning Ledger, decisions stagger in as you load older history, the reputation arc fills while the score counts up, and a new sparkline traces realized P&L across the settled calls in view. Nothing is faked — every number, bar and trend comes from the live model output or on-chain outcome, and all of it collapses to a clean static state when you've asked your system for reduced motion.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/agi"
+ },
+ {
+ "date": "2026-06-30",
+ "title": "The Sniper dashboard now carries the full Money Studio — wallet, Trading Brain, pricing and earnings",
+ "summary": "The Sniper Strategies dashboard used to stop at strategy config and live positions. Now every strategy card has a second tab — Money Studio — that opens the exact same control surface as your agent's Money tab in Agent Studio, without leaving the dashboard. Fund the agent's wallet (live SOL and USDC balances, deposit address, withdraw with a one-tap Max, real SPL holdings and on-chain activity), open the full Trading Brain to draw a snipe rule and either scan live launches for one-tap assisted snipes or arm it to run autonomously, backtest a rule over the last 30 days, set per-call prices on the agent's skills, and watch what other agents pay it — all per agent, all real. No more bouncing between Agent Studio and the dashboard to top up a wallet before arming. The original Money tab in Agent Studio is untouched.",
+ "tags": [
+ "feature",
+ "improvement"
+ ],
+ "link": "/dashboard/sniper"
+ },
+ {
+ "date": "2026-06-30",
+ "title": "The homepage now shows the autonomous sniper trading, live",
+ "summary": "There's a new \"Autonomous trading\" section on three.ws that puts the sniper engine front and center. An interactive diagram walks the full trade loop — Watch, Score, Guard, Buy, Exit — and you can click or hover any stage to read exactly what the agent does there, from the pump.fun new-launch feed through the risk guards to the take-profit and stop-loss exits. Beside it, a live tape streams real buys, sells and open positions as they happen, each linking to its Solscan signature, and a status pill shows whether the engine is live along with how many strategies are armed and positions are open. The win rate, best ROI and open-position counts underneath are the platform's real numbers — nothing on the panel is simulated. Honors reduced-motion preferences.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/"
+ },
+ {
+ "date": "2026-06-30",
+ "title": "The Trading Brain now tracks open snipes and today's budget burn live",
+ "summary": "The sniping panel in Agent Studio's Money tab no longer goes stale the moment it loads. Open positions now mark to live price on their own — each one shows its unrealized P&L (in SOL and percent) and refreshes every few seconds, so a snipe climbing or bleeding updates in front of you instead of waiting for a reload. When your agent is armed, new fills and exits appear on the same live tick. The Guardrails card now shows real spend: how much SOL the agent has traded today against your daily budget, as a number and a progress bar that turns amber past 60% and red past 90% — so you can see the leash tightening before it stops you. Polling pauses when the tab is hidden to spare your rate limit, and resumes the moment you come back.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/agent-studio"
+ },
{
"date": "2026-06-30",
"title": "The autonomous sniper is now an MCP server and an x402 paid API",
diff --git a/docs/start-here.md b/docs/start-here.md
index eff25a4a3..4a2e6a83f 100644
--- a/docs/start-here.md
+++ b/docs/start-here.md
@@ -65,3 +65,4 @@ If you're here to create and share agents rather than write code, follow this pa
- **Just exploring?** → Open [Discover](/discover) to browse agents others have built
- **Creating your first agent** → Go to [/start](/start) — a 5-step wizard walks you through it
- **Developer docs** → Read the [Introduction](./introduction.md) for the full technical picture
+- **Building UI?** → [ui-juice](./ui-juice.md) is the shared game-feel library (count-ups, sparklines, ring gauges, live dots, the "it shipped" ripple) every surface animates with
diff --git a/docs/ui-juice.md b/docs/ui-juice.md
new file mode 100644
index 000000000..6ade497fd
--- /dev/null
+++ b/docs/ui-juice.md
@@ -0,0 +1,149 @@
+# ui-juice — the shared game-feel library
+
+`src/ui-juice.js` (+ `src/ui-juice.css`) is the one place the platform keeps its
+**interaction primitives**: count-ups, directional flashes, live-feed row enters,
+sparklines, ring gauges, FLIP reorders, SSE status dots, and the single "it
+shipped" ripple. The vocabulary was proven on the `/swarms` page and extracted so
+every surface animates the same way instead of reinventing it.
+
+Three guarantees hold for every export:
+
+- **Token-driven.** Durations and easings come from the motion ladder in
+ `public/tokens.css` (`--duration-*`, `--ease-*`). No raw millisecond literals.
+- **Reduced-motion-safe.** That token file zeroes every `--duration-*` under
+ `@media (prefers-reduced-motion: reduce)`. `reducedMotion()` reads the computed
+ token, so each primitive lands on its correct final state with no animation —
+ automatically, with an explicit JS fallback path as belt-and-braces.
+- **Real values only.** These are transition helpers over real numbers/series.
+ They never fabricate or sample inputs.
+
+## Install / use
+
+Pull the styles into a surface's CSS and the helpers into its JS:
+
+```css
+/* src/<surface>.css — first line */
+@import './ui-juice.css';
+```
+
+```js
+// src/<surface>.js
+import { countUp, flashValue, sparkline, rippleOnce } from './ui-juice.js';
+```
+
+No build step or HTML change is required — Vite resolves both the CSS `@import`
+and the ES module import. The classes the helpers attach all live under the
+`juice-*` namespace.
+
+## Exports
+
+### `countUp(el, from, to, opts?)`
+Animate a number between two real values via `requestAnimationFrame`, preserving
+the caller's formatting. Cancels any in-flight count-up on the same element.
+Reduced motion → final value instantly. Stashes the target on `el.dataset.juiceVal`.
+
+```js
+countUp(volEl, 1200, 1875, { format: (n) => '$' + Math.round(n).toLocaleString() });
+```
+
+`opts`: `format` (fn), `duration` (ms), `ease` (fn), `token` (duration token name).
+
+### `updateValue(el, to, format, opts?)`
+Count from the element's last tracked value to a new one **and** flash in the
+direction of change — the swarms tile-update pattern. `opts.flash` defaults true.
+
+```js
+updateValue(balEl, newBalance, (n) => n.toFixed(4) + ' SOL'); // counts + tints up/down
+```
+
+### `flashValue(el, direction?)`
+Directional tint pulse, then settle. `'up'` → success, `'down'` → danger,
+`'neutral'` → surface. No-op under reduced motion.
+
+```js
+flashValue(priceEl, newPrice > oldPrice ? 'up' : 'down');
+```
+
+### `enterRow(el)` / `enterStagger(els, opts?)`
+Slide+fade a freshly-inserted row in from the top (live logs/feeds). `enterStagger`
+applies an index-based, capped delay across a list. Reduced motion → no-op.
+
+```js
+list.prepend(row); enterRow(row);
+enterStagger(grid.children, { step: 28, max: 320 });
+```
+
+### `sparkline(values, opts?)` / `sparklinePath(values, w, h, pad?)`
+`sparkline` returns an inline SVG string for a real numeric series — net-positive
+vs net-negative coloring via tokens, optional animated draw and final-point dot.
+`sparklinePath` is the pure geometry core (unit-tested).
+
+```js
+metaEl.innerHTML = sparkline(priceHistory, { width: 140, height: 36, fill: true, animate: true });
+```
+
+`opts`: `width`, `height`, `fill`, `dot` (default true), `animate`, `stroke`.
+
+### `ring(pct, opts?)` / `ringGeometry(pct, size, stroke)` / `playRings(scope)`
+`ring` renders an SVG arc gauge filling to a real percentage with a centered
+label. Render with `animate:true`, insert, then call `playRings(container)` to
+sweep the fill from empty to its real offset. `ringGeometry` is the pure core.
+
+```js
+el.innerHTML = ring(progressPct, { size: 64, label: progressPct + '%' });
+playRings(el);
+```
+
+`opts`: `size`, `stroke`, `label`, `color`, `track`, `animate`.
+
+### `flipReorder(container, keyFn)` / `reorderedKeys(before, after)`
+FLIP-animate a list to new positions after a re-sort. Capture before the DOM
+mutation, play after. `reorderedKeys` is the pure "which keys moved" diff.
+
+```js
+const flip = flipReorder(list, (el) => el.dataset.id);
+flip.capture();
+list.replaceChildren(...sorted); // re-render
+flip.play();
+```
+
+### `liveDot(state?, opts?)` / `setLiveDot(el, state, label?)`
+Markup + in-place updater for an SSE status indicator mirroring the swarms
+`.sw-live` vocabulary. States: `live` | `connecting` | `idle` | `error`.
+
+```js
+header.insertAdjacentHTML('beforeend', liveDot('connecting'));
+es.addEventListener('hello', () => setLiveDot(header, 'live'));
+```
+
+### `rippleOnce(el)`
+A single restrained accent ripple along an element's edge — the "it shipped" beat
+for a real success (a launch confirmed, an event fired). No confetti, no-op under
+reduced motion.
+
+```js
+rippleOnce(launchCard); // after the deploy request resolves ok
+```
+
+## Helpers
+
+- `durationMs(token, fallback?)` — resolve a `--duration-*` token to ms from live
+ computed styles.
+- `reducedMotion()` — true when motion should be suppressed (token is 0, or the
+ reduced-motion media query matches).
+
+## Tested
+
+`tests/ui-juice.test.js` covers the pure cores in the default `node` vitest env:
+count-up interpolation/formatting and the instant path, `sparklinePath` geometry,
+`ringGeometry` arc math, `reorderedKeys` diffing, and `liveDot` markup/escaping.
+
+```
+npx vitest run tests/ui-juice.test.js
+```
+
+## First consumer
+
+`/swarms` (`src/swarms.js`) is the reference consumer — its inline `flash()` now
+delegates to `flashValue`, proving the API and removing duplication. New surfaces
+should reach for these primitives rather than re-rolling RAF loops.
diff --git a/packages/agent-sniper/README.md b/packages/agent-sniper/README.md
index c96a54964..80bf858fd 100644
--- a/packages/agent-sniper/README.md
+++ b/packages/agent-sniper/README.md
@@ -230,6 +230,11 @@ Gating turns on when a merchant wallet is configured — `deps.payTo.solana` or
no `payTo` is set, the mutating routes still mount but answer `503`, so the
server boots cleanly for local/dev without payment config.
+The Solana lane also needs a facilitator sponsor fee-payer — set
+`X402_FEE_PAYER_SOLANA` (or `deps.feePayer`). Without it the Solana lane
+self-disables (falling back to the Base lane, or the `503` guard if that's the
+only lane) rather than failing requests, and logs a one-time warning at boot.
+
```js
import { serve } from '@three-ws/agent-sniper/api';
diff --git a/pages/agent-detail.html b/pages/agent-detail.html
index 7e9497812..bdf4f1630 100644
--- a/pages/agent-detail.html
+++ b/pages/agent-detail.html
@@ -33,6 +33,7 @@
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/src/ui-juice.css" />
<link rel="stylesheet" href="/src/agent-detail.css" />
<link rel="stylesheet" href="/src/pump/launch-token-modal.css" />
<style>
@@ -122,6 +123,13 @@
/* Trading record card */
.ad-pill { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; vertical-align: middle; margin-left: 8px; }
.ad-pill-sim { background: rgba(255,190,0,.15); color: #fbbe00; border: 1px solid rgba(255,190,0,.25); }
+ .ad-trade-winrate-wrap { display: inline-flex; align-items: center; gap: 8px; }
+ .ad-trade-ring { display: inline-flex; }
+ .ad-trade-spark { margin: 2px 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface2, rgba(255,255,255,.04)); }
+ .ad-trade-spark-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--ink-dim, #888); margin-bottom: 4px; }
+ .ad-trade-spark-net { font-weight: 700; font-variant-numeric: tabular-nums; }
+ .ad-trade-spark-net.positive { color: #22d160; }
+ .ad-trade-spark-net.negative { color: #ff4545; }
.ad-trade-history { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ad-trade-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--surface2, rgba(255,255,255,.04)); font-size: 13px; line-height: 1.3; }
.ad-trade-outcome { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
@@ -790,8 +798,9 @@
</div>
<div class="ad-row ad-row-split">
<span class="ad-muted">Win rate</span>
- <span><b id="ad-trade-winrate">—</b></span>
+ <span class="ad-trade-winrate-wrap"><span id="ad-trade-winring" class="ad-trade-ring" aria-hidden="true"></span><b id="ad-trade-winrate">—</b></span>
</div>
+ <div id="ad-trade-spark" class="ad-trade-spark" hidden></div>
<div class="ad-row ad-row-split">
<span class="ad-muted">Wins / Losses</span>
<span id="ad-trade-wl">—</span>
@@ -850,7 +859,7 @@
</div>
<div class="ad-row ad-row-split">
<span class="ad-muted">Average score</span>
- <span><b id="ad-rep-avg">—</b> / 5</span>
+ <span class="ad-trade-winrate-wrap"><span id="ad-rep-ring" class="ad-trade-ring" aria-hidden="true"></span><b id="ad-rep-avg">—</b> / 5</span>
</div>
<div class="ad-row ad-row-split">
<span class="ad-muted">Feedback count</span>
diff --git a/pages/alpha-copilot.html b/pages/alpha-copilot.html
index 9d59403d8..a7609132a 100644
--- a/pages/alpha-copilot.html
+++ b/pages/alpha-copilot.html
@@ -32,6 +32,7 @@
<link rel="manifest" href="/site.webmanifest" />
<link rel="stylesheet" href="/fonts/fonts.css" />
<link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/ui-juice.css" />
<link rel="stylesheet" href="/src/alpha-copilot.css" />
<link rel="stylesheet" href="/footer.css" />
<link rel="canonical" href="https://three.ws/alpha-copilot" />
diff --git a/src/agent-detail.js b/src/agent-detail.js
index a51dbec09..0bc84e57f 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -36,6 +36,7 @@ import { track, trackError, ANALYTICS_EVENTS } from './analytics.js';
import { mountViewSwitcher } from './view-switcher.js';
import { mountCoinStatus } from './pump/coin-status-card.js';
import { consumeCsrfToken } from './api.js';
+import { countUp, updateValue, flashValue, ring, playRings, sparkline, enterStagger } from './ui-juice.js';
// Live coin-status widgets mounted on this page (token chip + launch-history
// rows). Tracked so a re-render (e.g. avatar refresh) tears down their refresh
@@ -953,7 +954,7 @@ function render(agent) {
if (chip) host.appendChild(chip);
}
}
- $('ad-holdings-sol').textContent = String(agent.solBalance ?? 0);
+ countUpField($('ad-holdings-sol'), agent.solBalance);
// Wallet trading card — the agent's living, screenshot-worthy identity object:
// avatar, vanity address, live net worth, holdings, P&L, reputation tier, and a
@@ -1189,7 +1190,7 @@ function render(agent) {
// there is real descent to show.
renderLineage(agent);
- $('ad-rewards').textContent = String(agent.creatorRewards ?? 0);
+ countUpField($('ad-rewards'), agent.creatorRewards);
const mechs = $('ad-trust-mechs');
mechs.innerHTML = '';
@@ -2040,12 +2041,30 @@ function renderStrategy(strategy) {
card.style.display = '';
}
+// Count a numeric headline field up from 0, preserving the source's decimal places.
+// Non-numeric values (commas, suffixes) fall back to a plain, un-animated label.
+function countUpField(el, value) {
+ if (!el) return;
+ const raw = String(value ?? 0);
+ const n = Number(raw);
+ if (!Number.isFinite(n)) { el.textContent = raw; return; }
+ const dp = raw.includes('.') ? (raw.split('.')[1] || '').length : 0;
+ countUp(el, 0, n, { format: (x) => x.toFixed(dp) });
+}
+
function renderReputation(r) {
const card = document.getElementById('ad-reputation-card');
- document.getElementById('ad-rep-avg').textContent = r.average
- ? Number(r.average).toFixed(2)
- : '0.00';
- document.getElementById('ad-rep-count').textContent = String(r.count || 0);
+ const avg = r.average ? Number(r.average) : 0;
+ const avgEl = document.getElementById('ad-rep-avg');
+ if (avgEl) updateValue(avgEl, avg, (n) => n.toFixed(2));
+ // Score ring — the 0–5 average as a real fill (avg/5 → %).
+ const repRing = document.getElementById('ad-rep-ring');
+ if (repRing) {
+ repRing.innerHTML = ring((avg / 5) * 100, { size: 30, stroke: 3, label: '' });
+ playRings(repRing);
+ }
+ const countEl = document.getElementById('ad-rep-count');
+ if (countEl) updateValue(countEl, Number(r.count || 0), (n) => String(Math.round(n)));
if (r.total_stake_wei && r.total_stake_wei !== '0' && /^\d+$/.test(r.total_stake_wei)) {
document.getElementById('ad-rep-stake-row').style.display = '';
const wei = BigInt(r.total_stake_wei);
@@ -2118,7 +2137,18 @@ async function renderOracleTrackRecord(agentId) {
if (modePill && allSim) modePill.hidden = false;
const winRateEl = document.getElementById('ad-trade-winrate');
- if (winRateEl) winRateEl.textContent = s.win_rate != null ? `${s.win_rate}%` : '—';
+ if (winRateEl) {
+ if (s.win_rate != null) updateValue(winRateEl, Number(s.win_rate), (n) => `${Math.round(n)}%`);
+ else winRateEl.textContent = '—';
+ }
+ // Win-rate ring — a real gauge driven by the same win_rate the row shows.
+ const winRing = document.getElementById('ad-trade-winring');
+ if (winRing) {
+ if (s.win_rate != null) {
+ winRing.innerHTML = ring(Number(s.win_rate), { size: 26, stroke: 3, label: '' });
+ playRings(winRing);
+ } else winRing.innerHTML = '';
+ }
const wlEl = document.getElementById('ad-trade-wl');
if (wlEl) wlEl.textContent = `${s.wins}W / ${s.losses}L / ${s.open} open`;
@@ -2126,12 +2156,37 @@ async function renderOracleTrackRecord(agentId) {
const pnlEl = document.getElementById('ad-trade-pnl');
if (pnlEl) {
const pnl = s.realized_pnl_sol;
- pnlEl.textContent = pnl != null ? `${pnl >= 0 ? '+' : ''}${Number(pnl).toFixed(4)} SOL` : '—';
+ if (pnl != null) updateValue(pnlEl, Number(pnl), (n) => `${n >= 0 ? '+' : ''}${Number(n).toFixed(4)} SOL`);
+ else pnlEl.textContent = '—';
pnlEl.className = pnl > 0 ? 'ad-trade-pnl positive' : pnl < 0 ? 'ad-trade-pnl negative' : '';
}
const roiEl = document.getElementById('ad-trade-roi');
- if (roiEl) roiEl.textContent = s.roi_pct != null ? `${s.roi_pct >= 0 ? '+' : ''}${s.roi_pct}%` : '—';
+ if (roiEl) {
+ if (s.roi_pct != null) updateValue(roiEl, Number(s.roi_pct), (n) => `${n >= 0 ? '+' : ''}${Math.round(n)}%`);
+ else roiEl.textContent = '—';
+ }
+
+ // Cumulative realized-P&L sparkline from the real recent-trade series (oldest→newest).
+ const sparkEl = document.getElementById('ad-trade-spark');
+ if (sparkEl) {
+ const closed = (data.recent_actions || [])
+ .filter((a) => a.realized_pnl_sol != null)
+ .slice()
+ .reverse();
+ if (closed.length >= 2) {
+ let cum = 0;
+ const series = closed.map((a) => (cum += Number(a.realized_pnl_sol)));
+ const net = series[series.length - 1];
+ sparkEl.hidden = false;
+ sparkEl.innerHTML = `<div class="ad-trade-spark-head"><span>CUMULATIVE PnL</span>`
+ + `<span class="ad-trade-spark-net ${net >= 0 ? 'positive' : 'negative'}">${net >= 0 ? '+' : ''}${net.toFixed(3)} SOL</span></div>`
+ + sparkline(series, { width: 240, height: 38, fill: true, animate: true });
+ } else {
+ sparkEl.hidden = true;
+ sparkEl.innerHTML = '';
+ }
+ }
const histEl = document.getElementById('ad-trade-history');
if (histEl) {
@@ -2152,6 +2207,7 @@ async function renderOracleTrackRecord(agentId) {
row.innerHTML = `<span class="ad-trade-outcome ${outcome}"></span><span class="ad-trade-symbol">$${escapeText((a.symbol || '?').toUpperCase())}</span><span class="ad-trade-tier">${tierE} ${escapeText(a.tier || '')}</span><span class="ad-trade-peak">${peak}</span><span class="ad-trade-pnl ${pnlVal != null && pnlVal >= 0 ? 'positive' : pnlVal != null ? 'negative' : ''}">${pnlText}</span>`;
histEl.appendChild(row);
}
+ enterStagger(histEl.children);
}
const copyLink = document.getElementById('ad-trade-copy-link');
diff --git a/src/alpha-copilot.js b/src/alpha-copilot.js
index 8d1ef3541..389c0b87e 100644
--- a/src/alpha-copilot.js
+++ b/src/alpha-copilot.js
@@ -228,8 +228,11 @@ async function mountAvatar(agent) {
// ── candidate launches ──────────────────────────────────────────────────────
function setCount(n) {
- if (n > 0) { dom.launchesCount.textContent = n; dom.launchesCount.hidden = false; }
- else dom.launchesCount.hidden = true;
+ if (n > 0) {
+ const from = parseInt(dom.launchesCount.textContent, 10) || 0;
+ dom.launchesCount.hidden = false;
+ countUp(dom.launchesCount, from, n, { format: (v) => String(Math.round(v)) });
+ } else dom.launchesCount.hidden = true;
}
async function loadCandidates() {
@@ -259,9 +262,26 @@ async function loadCandidates() {
const topMint = pickTopMint(items);
dom.launchesList.innerHTML = '';
for (const c of items) dom.launchesList.appendChild(launchCard(c, c.mint === topMint));
+ // Fresh feed lands in legible sequence, then each card's score bars grow from 0.
+ enterStagger(dom.launchesList.querySelectorAll('.ac-launch'), { step: 36 });
+ playBars(dom.launchesList);
if (state.activeMint) markActiveLaunch(state.activeMint);
}
+// Grow every `.ac-bar-fill` / conviction fill inside `scope` from 0 to its real
+// width via the token-driven CSS transition. Reduced motion → already at target.
+function playBars(scope) {
+ if (!scope) return;
+ const fills = scope.querySelectorAll('.ac-bar-fill[data-w], .ac-conviction-fill[data-w]');
+ fills.forEach((fill) => {
+ const target = fill.getAttribute('data-w');
+ if (reducedMotion()) { fill.style.width = target; return; }
+ fill.style.width = '0%';
+ void fill.getBoundingClientRect();
+ requestAnimationFrame(() => requestAnimationFrame(() => { fill.style.width = target; }));
+ });
+}
+
// Rank by the real signals we already have: smart-money + quality, lightly
// boosted by visible liquidity, penalised for a sybil-dominated funder graph.
function pickTopMint(items) {
@@ -281,7 +301,7 @@ function scoreBar(label, v, title) {
const n = num(v);
const pct = n == null ? 0 : Math.max(0, Math.min(100, n));
const cls = n == null ? 'is-empty' : n >= 60 ? 'is-good' : n >= 35 ? 'is-mid' : 'is-low';
- return `<div class="ac-bar ${cls}" title="${esc(title)}"><span class="ac-bar-k">${label}</span><span class="ac-bar-track"><span class="ac-bar-fill" style="width:${pct}%"></span></span><span class="ac-bar-v">${n == null ? '—' : Math.round(n)}</span></div>`;
+ return `<div class="ac-bar ${cls}" title="${esc(title)}"><span class="ac-bar-k">${label}</span><span class="ac-bar-track"><span class="ac-bar-fill" style="width:${pct}%" data-w="${pct}%"></span></span><span class="ac-bar-v">${n == null ? '—' : Math.round(n)}</span></div>`;
}
function launchCard(c, isTop) {
@@ -415,8 +435,8 @@ function renderRead(data) {
<div class="ac-read-target">${sym}${sig.name ? ` · <span class="ac-read-coinname">${esc(sig.name)}</span>` : ''}</div>
</div>
<div class="ac-conviction ${vm.cls}" title="How convinced the agent is">
- <div class="ac-conviction-bar"><span style="width:${Math.max(2, conviction)}%"></span></div>
- <span class="ac-conviction-val">${conviction}<small>/100 conviction</small></span>
+ <div class="ac-conviction-bar"><span class="ac-conviction-fill" style="width:${Math.max(2, conviction)}%" data-w="${Math.max(2, conviction)}%"></span></div>
+ <span class="ac-conviction-val"><span class="ac-conviction-num" data-to="${conviction}">${conviction}</span><small>/100 conviction</small></span>
</div>
${read.spoken_line ? `<blockquote class="ac-read-quote">“${esc(read.spoken_line)}”</blockquote>` : ''}
${guardNote}
@@ -429,6 +449,18 @@ function renderRead(data) {
<div class="ac-action" id="ac-action"></div>`;
renderAction(data);
+ playRead();
+}
+
+// When a real read lands: the conviction bar fills from 0 and counts up, the
+// signals it cited stagger in, and the verdict gets one accent ripple — a beat
+// that says "the call arrived". All token-driven; reduced motion → final state.
+function playRead() {
+ playBars(dom.readBody);
+ const num = dom.readBody.querySelector('.ac-conviction-num');
+ if (num) countUp(num, 0, Number(num.dataset.to) || 0, { format: (v) => String(Math.round(v)) });
+ enterStagger(dom.readBody.querySelectorAll('.ac-read-signals dl > div'), { step: 26 });
+ rippleOnce(dom.readBody.querySelector('.ac-verdict'));
}
function renderAction(data) {
diff --git a/src/studio/money/trading-brain.js b/src/studio/money/trading-brain.js
index db99dd653..c7be2f7ba 100644
--- a/src/studio/money/trading-brain.js
+++ b/src/studio/money/trading-brain.js
@@ -327,7 +327,9 @@ class TradingBrain {
// clobbering a mid-flight scan/backtest in another part of the panel).
if (!this.state.loading) {
if (touchedPositions) { this._renderPositions(); this._renderHeader(); }
- if (touchedSpent) { const foot = this._q('.tb-glimits-foot .tb-spent'); if (foot) this._renderGuardrails(); }
+ // Update only the spent line — never re-render the guardrails card on a
+ // poll tick, or we'd clobber an input the owner is mid-edit.
+ if (touchedSpent) this._renderSpent();
}
} finally {
this._polling = false;
@@ -740,6 +742,17 @@ class TradingBrain {
</span>`;
}
+ // Swap just the spent line in place (used by the live poll) so we never touch
+ // the guardrail inputs the owner might be editing.
+ _renderSpent() {
+ const cur = this._q('.tb-glimits-foot .tb-spent');
+ if (!cur) return;
+ const tmp = document.createElement('div');
+ tmp.innerHTML = this._spentHtml(this.state.tradeLimits || {}).trim();
+ const next = tmp.firstElementChild;
+ if (next) cur.replaceWith(next);
+ }
+
_renderActions() {
const host = this._q('[data-actions]');
if (!host) return;
diff --git a/src/swarms.css b/src/swarms.css
index dc6f44e24..1e16d8acc 100644
--- a/src/swarms.css
+++ b/src/swarms.css
@@ -1,4 +1,5 @@
/* Trading Swarms — directory + dashboard. All color/space/type from /tokens.css. */
+@import './ui-juice.css';
body {
font-family: var(--font-body, 'Inter', system-ui, sans-serif);
diff --git a/src/swarms.js b/src/swarms.js
index c75d57d2e..82f6a854f 100644
--- a/src/swarms.js
+++ b/src/swarms.js
@@ -6,6 +6,8 @@
// feed of consensus votes + payouts, and the create / join / contribute / exit /
// kill flows — every money action calls a real on-chain endpoint.
+import { flashValue } from './ui-juice.js';
+
const root = document.getElementById('sw-view');
const SOL = (n) => (n == null ? '—' : `${Number(n).toLocaleString(undefined, { maximumFractionDigits: 4 })} SOL`);
const PCT = (n) => (n == null ? '—' : `${(Number(n) * 100).toFixed(0)}%`);
@@ -623,11 +625,12 @@ function subscribeStream(id) {
connect();
}
+// Neutral surface-tint settle on a row that just updated. Delegates to the shared
+// ui-juice primitive so the swarms feed speaks the same motion vocabulary as the
+// rest of the platform (and inherits its reduced-motion safety) instead of
+// hand-rolling a one-off transition.
function flash(el) {
- if (!el) return;
- el.style.background = 'var(--surface-3)';
- el.style.transition = 'background 1.2s ease';
- requestAnimationFrame(() => { el.style.background = ''; });
+ flashValue(el, 'neutral');
}
// ── treasury tile juice: count between two real values, flash on change ──────────
diff --git a/src/trader.js b/src/trader.js
index afc492e0b..25911f502 100644
--- a/src/trader.js
+++ b/src/trader.js
@@ -14,6 +14,7 @@ import {
} from './trader-format.js';
import { mountCopyPanel } from './copy-panel.js';
import { walletChipHTML, wireWalletChips } from './shared/agent-wallet-chip.js';
+import { ring, playRings, countUp } from './ui-juice.js';
const WINDOWS = ['24h', '7d', '30d', 'all'];
const WINDOW_LABEL = { '24h': '24h', '7d': '7d', '30d': '30d', all: 'All-time' };
diff --git a/x402-payment-modal/package.json b/x402-payment-modal/package.json
index 524c4ff6b..50e94a957 100644
--- a/x402-payment-modal/package.json
+++ b/x402-payment-modal/package.json
@@ -94,6 +94,7 @@
"peerDependencies": {
"@solana/web3.js": "^1.95.0",
"@solana/spl-token": "^0.4.0",
+ "express": "^4.18.0 || ^5.0.0",
"react": ">=17"
},
"peerDependenciesMeta": {
@@ -103,11 +104,16 @@
"@solana/spl-token": {
"optional": true
},
+ "express": {
+ "optional": true
+ },
"react": {
"optional": true
}
},
"devDependencies": {
+ "@solana/spl-token": "^0.4.14",
+ "@solana/web3.js": "^1.98.4",
"esbuild": "^0.21.0"
},
"engines": {