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(ux): explain trading-hub vitals in plain language and unbury the marketplace sidebar toggle
nirholasceb47d0a857b
diff --git a/public/marketplace-v2.css b/public/marketplace-v2.cssindex 55928c95c..2d5a97de0 100644--- a/public/marketplace-v2.css+++ b/public/marketplace-v2.css@@ -841,7 +841,11 @@ body.market-page > #footer-container {.market-sidebar-toggle {display: none;position: fixed;- top: max(14px, env(safe-area-inset-top, 14px));+ /* Clear the sticky site header. The toggle only ever shows under the 880px+ breakpoint, where public/nav.css makes the nav 65px tall: anchoring it to+ the viewport top put it entirely behind the nav, so on a phone the only+ way into the sidebar was invisible and unclickable. */+ top: calc(65px + max(10px, env(safe-area-inset-top, 0px)));left: max(14px, env(safe-area-inset-left, 14px));z-index: 50;background: #111;diff --git a/src/trading-hub-data.js b/src/trading-hub-data.jsindex d4f743952..a56c3d8df 100644--- a/src/trading-hub-data.js+++ b/src/trading-hub-data.js@@ -19,6 +19,12 @@ export const SURFACES = [body: 'The live floor. Every agent, every open position, and every entry and exit as it lands.',href: '/play/arena',},+ {+ kicker: 'Replay',+ title: 'Exit Lab',+ body: 'Re-run every real closed trade under different exit rules and see what the SOL already spent would have returned.',+ href: '/exit-lab',+ },{kicker: 'Compare',title: 'Sniper Experiments',@@ -101,6 +107,12 @@ export const LEARN = [body: 'Step by step, from an empty wallet to an armed strategy with conservative caps.',href: '/tutorials/arm-an-agent-sniper',},+ {+ kicker: 'Tutorial',+ title: 'Find a better exit policy',+ body: 'Why tightening an exit is measurable, loosening one is only a hypothesis, and how to tell a real finding from two lucky coins.',+ href: '/tutorials/find-a-better-exit-policy',+ },{kicker: 'Method',title: 'The 10 SOL experiment',diff --git a/src/trading-hub.css b/src/trading-hub.cssindex c0441c342..b3c0ddf6a 100644--- a/src/trading-hub.css+++ b/src/trading-hub.css@@ -201,11 +201,27 @@}.th-vital {+ position: relative;padding: var(--space-4);border: 1px solid var(--color-hairline);border-radius: var(--radius-card);background: var(--surface-2);min-height: 6.5rem;+ transition: border-color var(--duration-fast) var(--ease-standard);+}++.th-vital[tabindex] {+ cursor: help;+}++.th-vital[tabindex]:hover,+.th-vital[tabindex]:focus-visible {+ border-color: var(--color-border-strong);+}++.th-vital[tabindex]:focus-visible {+ outline: var(--focus-ring-width) solid var(--focus-ring-color);+ outline-offset: var(--focus-ring-offset);}.th-vital-label {@@ -216,6 +232,69 @@color: var(--color-text-faint);}+/* The label carries a dotted underline so the tile reads as explainable before+ anyone hovers it. Without the cue, a tooltip nobody knows exists is no help. */+.th-vital[tabindex] .th-vital-label {+ border-bottom: 1px dotted var(--color-border-strong);+ display: inline-block;+ padding-bottom: 1px;+}++/* Pointer and keyboard both reveal it; a screen reader already has it through+ aria-describedby and never needs the visual state at all. */+.th-vital-help {+ position: absolute;+ left: var(--space-3);+ right: var(--space-3);+ bottom: calc(100% - var(--space-2));+ z-index: 5;+ padding: var(--space-3);+ border-radius: var(--radius-md);+ border: 1px solid var(--color-border-strong);+ background: var(--bg-1);+ box-shadow: var(--shadow-2);+ color: var(--color-text);+ font-size: var(--text-sm);+ line-height: var(--leading-normal);+ opacity: 0;+ visibility: hidden;+ transform: translateY(var(--space-1));+ transition:+ opacity var(--duration-fast) var(--ease-standard),+ transform var(--duration-fast) var(--ease-standard),+ visibility var(--duration-fast) var(--ease-standard);+ pointer-events: none;+}++.th-vital:hover .th-vital-help,+.th-vital:focus-visible .th-vital-help,+.th-vital:focus-within .th-vital-help {+ opacity: 1;+ visibility: visible;+ transform: translateY(0);+}++/* The first row of tiles has no space above it, so their tooltips open downward+ instead of off the top of the section. */+.th-vitals > .th-vital:nth-child(-n + 3) .th-vital-help {+ bottom: auto;+ top: calc(100% - var(--space-2));+ transform: translateY(calc(var(--space-1) * -1));+}++.th-vitals > .th-vital:nth-child(-n + 3):hover .th-vital-help,+.th-vitals > .th-vital:nth-child(-n + 3):focus-visible .th-vital-help,+.th-vitals > .th-vital:nth-child(-n + 3):focus-within .th-vital-help {+ transform: translateY(0);+}++@media (prefers-reduced-motion: reduce) {+ .th-vital,+ .th-vital-help {+ transition: none;+ }+}+.th-vital-value {font-family: var(--font-display);font-size: var(--text-lg);diff --git a/src/trading-hub.js b/src/trading-hub.jsindex 0e9567520..1d8b6f095 100644--- a/src/trading-hub.js+++ b/src/trading-hub.js@@ -50,11 +50,20 @@ function renderPillError() {// ── vitals ──────────────────────────────────────────────────────────────────-function vitalTile({ label, value, sub, tone }) {- return `<div class="th-vital${tone ? ` th-vital-${tone}` : ''}">+// A vital is a number with no context unless you already know the system, which+// is exactly the reader this page exists for. Each tile therefore carries a+// plain-language explanation, reachable three ways so nobody is left out: hover+// (pointer), focus (keyboard, the tile is tabbable), and aria-describedby (screen+// reader, which gets it without any interaction at all).+function vitalTile({ label, value, sub, tone, help }, i) {+ const helpId = `th-vital-help-${i}`;+ return `<div class="th-vital${tone ? ` th-vital-${tone}` : ''}" tabindex="0"${+ help ? ` aria-describedby="${helpId}"` : ''+ }><div class="th-vital-label">${esc(label)}</div><div class="th-vital-value">${esc(value)}</div><div class="th-vital-sub">${esc(sub)}</div>+ ${help ? `<span class="th-vital-help" id="${helpId}" role="tooltip">${esc(help)}</span>` : ''}</div>`;}@@ -70,32 +79,38 @@ function renderVitals(status) {value: status?.mode === 'live' ? 'Live' : status?.mode === 'simulate' ? 'Simulate' : 'Unknown',sub: status?.mode === 'live' ? 'Real funds, real fills' : 'Real quotes, no broadcast',tone: status?.mode === 'live' ? 'live' : 'muted',+ help: "Live means the worker signs and broadcasts real transactions from the agents' own wallets. Simulate means it does everything except broadcast: real launches, real quotes, real decisions, no money moved.",},{label: 'Strategies armed',value: String(status?.strategies ?? 0),sub: 'Independent agents, each with its own rules',+ help: 'How many strategies are currently enabled with their kill switch off. Each one has its own filters, position size and exit rules, and they compete on the same launches.',},{label: 'Open positions',value: String(status?.openPositions ?? 0),sub: 'Held right now, not yet realized',+ help: 'Coins the fleet is holding right now. An open position is not profit: it is worth whatever it re-quotes at, and that number moves until it closes.',},{label: 'Launch feed',value: d.feedLabel,sub: d.feedDetail,tone: d.feedTone,+ help: 'The live stream of new launches. This is the failure that hides best: the worker can be up, healthy and beating steadily while its feed has gone silent, in which case it sees nothing and takes no trades.',},{label: 'Funded to date',value: formatSol(funding.fundedTotalSol, { signed: false }),sub: `Last top-up ${formatAgo(funding.lastFundAt)}`,+ help: 'Total SOL moved into agent trading wallets from the treasury. This is capital deployed, not profit or loss. A stale last top-up while strategies are armed usually means the funding wallet is dry.',},{label: 'Uptime',value: d.uptimeLabel,sub: 'Since the worker last booted',+ help: 'How long the current worker process has been running. A long uptime is not automatically good: it also means the process predates any fix deployed since it booted.',},];el.innerHTML = tiles.map(vitalTile).join('');