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(arena): announce tab switches and leader changes to screen readers

nirholasfc75d5bac0e1
diff --git a/pages/arena.html b/pages/arena.html
index e1b8c57c4..78cde511c 100644
--- a/pages/arena.html
+++ b/pages/arena.html
@@ -4,7 +4,7 @@
<script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title data-i18n="arena.meta_title">Arena — live PvP trading tournaments · three.ws</title>
+ <title data-i18n="arena.meta_title">Arena: live PvP trading tournaments · three.ws</title>
<meta
name="description"
content="The Social Trading Arena: time-boxed PvP tournaments where AI agents compete on real, verified pump.fun P&L. Live rankings, on-chain attested standings, and $THREE prizes for the winners."
@@ -12,7 +12,7 @@
<meta property="og:type" content="website" />
<meta property="og:site_name" content="three.ws" />
<meta property="og:url" content="https://three.ws/arena" />
- <meta property="og:title" content="Arena — live PvP trading tournaments · three.ws" data-i18n-attr="content:arena.meta_og_title"/>
+ <meta property="og:title" content="Arena: live PvP trading tournaments · three.ws" data-i18n-attr="content:arena.meta_og_title"/>
<meta
property="og:description"
content="Watch AI agents go head-to-head on real, verified pump.fun P&L. Live rankings, on-chain attested results, $THREE prizes."
@@ -22,7 +22,7 @@
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@trythreews" />
- <meta name="twitter:title" content="Arena — live PvP trading tournaments · three.ws" data-i18n-attr="content:arena.meta_twitter_title"/>
+ <meta name="twitter:title" content="Arena: live PvP trading tournaments · three.ws" data-i18n-attr="content:arena.meta_twitter_title"/>
<meta
name="twitter:description"
content="AI agents go head-to-head on real, verified pump.fun P&L. Live rankings, on-chain attested results, $THREE prizes."
@@ -42,26 +42,33 @@
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
<meta property="og:locale" content="en_US">
- <meta property="og:image:alt" content="The Arena — live PvP trading tournaments — three.ws">
- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"The Arena — live PvP trading tournaments","description":"Time-boxed PvP tournaments where AI agents compete on real, verified pump.fun P&L. Live rankings, on-chain attested standings, and $THREE prizes for the winners.","url":"https://three.ws/arena","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=crypto&amp;t=The+Arena+%E2%80%94+live+PvP+trading+tournaments&amp;d=Time-boxed+PvP+tournaments+where+AI+agents+compete+on+real%2C+verified+pump.fun+P%26L.+Live+rankings%2C+on-chain+attested+standings%2C+and+%24THREE+prizes+for+the+winners&amp;p=%2Farena"}]}</script>
+ <meta property="og:image:alt" content="The Arena: live PvP trading tournaments - three.ws">
+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"The Arena: live PvP trading tournaments","description":"Time-boxed PvP tournaments where AI agents compete on real, verified pump.fun P&L. Live rankings, on-chain attested standings, and $THREE prizes for the winners.","url":"https://three.ws/arena","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=crypto&amp;t=The+Arena%3A+live+PvP+trading+tournaments&amp;d=Time-boxed+PvP+tournaments+where+AI+agents+compete+on+real%2C+verified+pump.fun+P%26L.+Live+rankings%2C+on-chain+attested+standings%2C+and+%24THREE+prizes+for+the&amp;p=%2Farena"}]}</script>
</head>
<body>
<header><div id="nav-container"></div></header>
<script src="/nav.js"></script>
- <main id="arena" class="arena" aria-live="polite">
+ <main id="arena" class="arena">
<!-- Rendered by /src/arena/arena.js. JS-disabled fallback below. -->
<noscript>
<section class="arena-noscript">
<h1>The Arena</h1>
<p>
- Time-boxed PvP trading tournaments where AI agents compete on real, verified pump.fun P&amp;L —
+ Time-boxed PvP trading tournaments where AI agents compete on real, verified pump.fun P&amp;L,
with on-chain attested standings and $THREE prizes. Enable JavaScript to watch live.
</p>
</section>
</noscript>
</main>
+ <!-- Screen-reader announcements (view changes, rank changes). Deliberately a
+ small dedicated region rather than aria-live on <main>: the live board
+ re-renders every few seconds off SSE, and announcing the whole page each
+ time makes the route unusable with a screen reader. Sits outside <main>
+ so a re-render never removes it. -->
+ <div id="arena-live" class="sr-only" role="status" aria-live="polite"></div>
+
<div id="footer-container"></div>
<script src="/footer.js"></script>
<script type="module" src="/src/arena/arena.js"></script>
diff --git a/src/arena/arena.css b/src/arena/arena.css
index 9430b1ff6..e93f57f56 100644
--- a/src/arena/arena.css
+++ b/src/arena/arena.css
@@ -1,6 +1,6 @@
-/* The Arena — Social Trading Arena. Tournament list, live competition, results.
+/* The Arena: Social Trading Arena. Tournament list, live competition, results.
*
- * Built entirely on the canonical design tokens (public/tokens.css via nav.css) —
+ * Built entirely on the canonical design tokens (public/tokens.css via nav.css),
* the same vocabulary as the neighbouring leaderboard.css. Glass-on-near-black,
* golden-ratio spacing, dark/light via tokens, mono numerics for the trading feel.
*
@@ -153,7 +153,9 @@
/* ── Tournament card grid ─────────────────────────────────────────────── */
.tourn-grid {
display: grid;
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+ /* min() keeps the track from forcing a 300px column (and a horizontally
+ scrolling page) inside a narrower container, e.g. a 320px phone. */
+ grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
gap: var(--space-md);
}
.tourn-card {
@@ -602,15 +604,24 @@
}
/* Expanded trade proof under a row */
+/* Sibling of its row, not a child: the pills are links, and a role="button" may
+ not contain focusable descendants. The negative margin cancels the board's
+ flex gap so the panel still reads as one card with the row above it. */
.row-proof {
- grid-column: 1 / -1;
- margin-top: 0.5rem;
- padding-top: 0.5rem;
+ margin-top: calc(-0.4rem - 1px);
+ padding: 0.55rem 0.8rem 0.6rem;
+ border: 1px solid var(--stroke);
border-top: 1px dashed var(--stroke);
+ border-radius: 0 0 var(--radius-md) var(--radius-md);
+ background: var(--surface-1);
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
}
+.row[aria-expanded='true'] {
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+}
.proof-pill {
font-family: var(--font-mono);
font-size: var(--text-2xs);
@@ -748,10 +759,15 @@
border-radius: var(--radius-lg);
color: var(--ink-dim);
}
+/* A state that IS the whole page (load failure, stale link) carries the route's
+ only <h1>, so it has to read identically to the in-page <h3> variants. */
+.state h1,
.state h3 {
margin: 0 0 0.4rem;
color: var(--ink-bright);
font-size: var(--text-lg);
+ line-height: 1.25;
+ letter-spacing: normal;
}
.state p {
margin: 0 auto 1rem;
@@ -1064,7 +1080,7 @@
padding: 1rem;
/* Above the site's fixed corner widgets (getting-started pill 2147482500,
feature-discovery card 2147483600) so a modal is always the top layer and
- its actions are never obscured — esp. the bottom sheet on mobile. */
+ its actions are never obscured, esp. the bottom sheet on mobile. */
z-index: 2147483640;
font-family: var(--font-body);
animation: arena-fade var(--duration-base) var(--ease-out);
@@ -1365,7 +1381,7 @@
min-width: 0; /* let the board/ticker shrink inside the grid track */
}
-/* Hero context stats on the list view — reuses .detail-stats layout. */
+/* Hero context stats on the list view: reuses the .detail-stats layout. */
.arena-hero-stats {
margin-top: var(--space-sm);
}
@@ -1442,7 +1458,7 @@
font-variant-numeric: tabular-nums;
}
-/* Aside panels — prize ladder + rules. */
+/* Aside panels: prize ladder + rules. */
.panel {
border: 1px solid var(--stroke);
background: var(--surface-1);
diff --git a/src/arena/arena.js b/src/arena/arena.js
index 21f06f8ef..ca91f7e73 100644
--- a/src/arena/arena.js
+++ b/src/arena/arena.js
@@ -1,5 +1,5 @@
/**
- * The Arena — Social Trading Arena front-end.
+ * The Arena: Social Trading Arena front-end.
*
* A single-page surface with two views, hash-routed:
* #/ → tournament list (Live / Upcoming / Finished tabs + create)
@@ -38,8 +38,10 @@ const h = (tag, attrs = {}, ...kids) => {
return node;
};
const esc = (s) => String(s ?? '');
-const fmtSol = (n) => (n == null ? '—' : `${n > 0 ? '+' : ''}${Number(n).toFixed(n && Math.abs(n) < 1 ? 3 : 2)} ◎`);
-const fmtPct = (n) => (n == null ? '—' : `${n > 0 ? '+' : ''}${Number(n).toFixed(1)}%`);
+/** Rendered in numeric slots that have no value yet (no trades, no pool, unranked). */
+const NO_VALUE = '-';
+const fmtSol = (n) => (n == null ? NO_VALUE : `${n > 0 ? '+' : ''}${Number(n).toFixed(n && Math.abs(n) < 1 ? 3 : 2)} ◎`);
+const fmtPct = (n) => (n == null ? NO_VALUE : `${n > 0 ? '+' : ''}${Number(n).toFixed(1)}%`);
const fmtThree = (n) => {
const v = Number(n || 0);
if (v >= 1_000_000) return `${(v / 1_000_000).toFixed(2)}M`;
@@ -71,6 +73,21 @@ async function fetchJSON(url, opts) {
return body;
}
+/**
+ * Speak a short update through the page's dedicated live region (#arena-live in
+ * pages/arena.html). Used for the changes a sighted visitor sees but a screen
+ * reader would otherwise miss: tab switches and the leader flipping mid-stream.
+ */
+function announce(msg) {
+ const region = document.getElementById('arena-live');
+ if (!region) return;
+ // Re-setting identical text does not re-fire the announcement; clear first.
+ region.textContent = '';
+ requestAnimationFrame(() => {
+ region.textContent = msg;
+ });
+}
+
function toast(msg, isErr = false) {
document.querySelectorAll('.arena-toast').forEach((t) => t.remove());
const t = h('div', { class: `arena-toast${isErr ? ' err' : ''}`, role: 'status' }, msg);
@@ -140,6 +157,8 @@ const scoringLabel = { score: 'TraderScore', realized_pnl: 'Realized P&L', roi_p
// ───────────────────────────────────────────────────────────────────────────
let listCache = null;
const listState = { tab: 'live' };
+const TAB_KEYS = ['live', 'upcoming', 'finished'];
+const TAB_LABELS = { live: 'Live', upcoming: 'Upcoming', finished: 'Finished' };
async function renderList() {
stopStream();
@@ -171,7 +190,7 @@ async function renderList() {
const tabsBar = h('div', { class: 'arena-tabs', role: 'tablist', 'aria-label': 'Tournament phase' });
root.append(tabsBar);
- const body = h('div', { id: 'list-body' });
+ const body = h('div', { id: 'list-body', role: 'tabpanel', tabindex: '-1' });
root.append(body);
// Loading skeletons.
@@ -206,7 +225,7 @@ async function renderList() {
finished: listCache.filter((t) => t.phase === 'finished'),
};
- // Hero context strip — real, live counts. Prize/competing only surface when > 0
+ // Hero context strip: real, live counts. Prize/competing only surface when > 0
// so an empty Arena never advertises a hollow "0 $THREE at stake".
const hs = document.getElementById('hero-stats');
if (hs) {
@@ -226,32 +245,57 @@ async function renderList() {
// If the preferred tab is empty, fall back to the first non-empty one.
if (!groups[listState.tab].length) {
- listState.tab = ['live', 'upcoming', 'finished'].find((k) => groups[k].length) || 'live';
+ listState.tab = TAB_KEYS.find((k) => groups[k].length) || 'live';
}
- for (const key of ['live', 'upcoming', 'finished']) {
- const label = key[0].toUpperCase() + key.slice(1);
+ // Tabs follow the WAI-ARIA tabs pattern: a roving tabindex (one stop for the
+ // whole set), arrow/Home/End to move between them, and each tab owning the
+ // panel it controls so a screen reader can jump straight to the results.
+ const selectTab = (key) => {
+ listState.tab = key;
+ paintGroup(body, groups);
+ for (const b of tabsBar.querySelectorAll('.arena-tab')) {
+ const on = b.dataset.tab === key;
+ b.setAttribute('aria-selected', on ? 'true' : 'false');
+ b.tabIndex = on ? 0 : -1;
+ if (on) body.setAttribute('aria-labelledby', b.id);
+ }
+ announce(`${TAB_LABELS[key]} tournaments: ${groups[key].length}`);
+ };
+
+ for (const key of TAB_KEYS) {
+ const on = key === listState.tab;
tabsBar.append(
h(
'button',
{
class: 'arena-tab',
+ id: `arena-tab-${key}`,
role: 'tab',
type: 'button',
- 'aria-selected': key === listState.tab ? 'true' : 'false',
- onclick: () => {
- listState.tab = key;
- paintGroup(body, groups);
- tabsBar.querySelectorAll('.arena-tab').forEach((b, i) => {
- b.setAttribute('aria-selected', ['live', 'upcoming', 'finished'][i] === key ? 'true' : 'false');
- });
+ 'aria-controls': 'list-body',
+ 'aria-selected': on ? 'true' : 'false',
+ tabindex: on ? '0' : '-1',
+ dataset: { tab: key },
+ onclick: () => selectTab(key),
+ onkeydown: (e) => {
+ const step = e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0;
+ let next = null;
+ if (step) next = TAB_KEYS[(TAB_KEYS.indexOf(key) + step + TAB_KEYS.length) % TAB_KEYS.length];
+ else if (e.key === 'Home') next = TAB_KEYS[0];
+ else if (e.key === 'End') next = TAB_KEYS[TAB_KEYS.length - 1];
+ if (!next) return;
+ e.preventDefault();
+ selectTab(next);
+ tabsBar.querySelector(`#arena-tab-${next}`)?.focus();
},
},
- label,
+ TAB_LABELS[key],
h('span', { class: 'count' }, String(groups[key].length)),
),
);
}
+ body.setAttribute('aria-labelledby', `arena-tab-${listState.tab}`);
paintGroup(body, groups);
startCountdowns();
@@ -269,7 +313,7 @@ function paintGroup(body, groups) {
function emptyForTab(tab) {
const copy = {
- live: ['No live tournaments right now', 'Create one, or check the upcoming bracket — the next competition could be yours.'],
+ live: ['No live tournaments right now', 'Create one, or check the upcoming bracket. The next competition could be yours.'],
upcoming: ['Nothing scheduled yet', 'Be the first to host a competition. Set a window, a prize pool in $THREE, and open the gates.'],
finished: ['No finished tournaments yet', 'Completed competitions and their on-chain attested results will appear here.'],
}[tab];
@@ -349,16 +393,18 @@ async function renderDetail(id) {
try {
data = await fetchJSON(`/api/tournaments/${id}`);
} catch (err) {
- // A 404 means the link is stale — retrying it will never succeed. Turn the
+ // A 404 means the link is stale, so retrying it will never succeed. Turn the
// dead end into a discovery moment instead of an inert Retry button.
if (err.status === 404) return renderNotFound();
+ // This state IS the page, so its heading is the route's <h1>, not an <h3>.
+ document.title = `Tournament unavailable · ${BASE_TITLE}`;
root.replaceChildren(
backButton(),
h(
'div',
{ class: 'state' },
h('div', { class: 'state-icon', 'aria-hidden': 'true' }, '⚠️'),
- h('h3', {}, 'Could not load this tournament'),
+ h('h1', {}, 'Could not load this tournament'),
h('p', {}, err.message || 'Something went wrong reaching the Arena. Check your connection and try again.'),
h(
'div',
@@ -398,7 +444,7 @@ async function renderNotFound() {
'div',
{ class: 'state' },
h('div', { class: 'state-icon', 'aria-hidden': 'true' }, '🏁'),
- h('h3', {}, 'This tournament isn’t here'),
+ h('h1', {}, 'This tournament isn’t here'),
h(
'p',
{},
@@ -425,7 +471,7 @@ async function renderNotFound() {
startCountdowns();
}
} catch {
- /* Suggestions are a bonus — the recovery state stands on its own without them. */
+ /* Suggestions are a bonus: the recovery state stands on its own without them. */
}
}
@@ -468,7 +514,7 @@ function paintDetail(data) {
{ class: 'title-row' },
statusBadge({ derived_status: data.derived_status }),
h('h1', {}, t.name),
- t.bracket === 'practice' ? h('span', { class: 'badge badge-practice' }, 'Practice — no prizes') : null,
+ t.bracket === 'practice' ? h('span', { class: 'badge badge-practice' }, 'Practice, no prizes') : null,
),
t.description ? h('p', { class: 'desc' }, t.description) : null,
detailStats(data, phase),
@@ -525,7 +571,7 @@ function paintDetail(data) {
function detailStats(data, phase) {
const t = data.tournament;
const stats = [];
- stats.push(stat('Prize pool', Number(t.prize_pool_three) > 0 ? `${fmtThree(t.prize_pool_three)} $THREE` : '—'));
+ stats.push(stat('Prize pool', Number(t.prize_pool_three) > 0 ? `${fmtThree(t.prize_pool_three)} $THREE` : 'None'));
stats.push(stat('Entrants', String(data.standings?.length || 0)));
stats.push(stat('Scoring', scoringLabel[t.scoring] || t.scoring));
if (phase === 'upcoming') {
@@ -589,7 +635,7 @@ function renderBoard(board, standings, t, phase) {
'p',
{},
phase === 'upcoming'
- ? 'Be the first to enter. Only trades opened during the window count — fair start for everyone.'
+ ? 'Be the first to enter. Only trades opened during the window count, so everyone gets a fair start.'
: 'Standings appear as soon as entrants open real, verifiable trades inside the window.',
),
phase !== 'finished'
@@ -599,7 +645,10 @@ function renderBoard(board, standings, t, phase) {
);
return;
}
- board.replaceChildren(...ranked.map((s) => boardRow(s, t)), ...dq.map((s) => boardRow(s, t)));
+ // boardRow yields the row plus, when expanded, its proof panel as a SIBLING:
+ // the panel holds links, and focusable descendants inside a role="button" are
+ // unreachable to assistive tech.
+ board.replaceChildren(...[...ranked, ...dq].flatMap((s) => boardRow(s, t)));
}
function boardRow(s, t) {
@@ -621,6 +670,8 @@ function boardRow(s, t) {
const scoreText =
t.scoring === 'realized_pnl' ? fmtSol(s.score_value) : t.scoring === 'roi_pct' ? fmtPct(s.score_value) : String(s.score_value);
+ const expanded = expandedAgent === s.agent_id;
+ const proofId = `proof-${s.agent_id}`;
const row = h(
'div',
{
@@ -628,7 +679,8 @@ function boardRow(s, t) {
role: 'button',
tabindex: '0',
dataset: { agent: s.agent_id },
- 'aria-expanded': expandedAgent === s.agent_id ? 'true' : 'false',
+ 'aria-expanded': expanded ? 'true' : 'false',
+ 'aria-controls': expanded ? proofId : null,
onclick: () => toggleProof(s),
onkeydown: (e) => {
if (e.key === 'Enter' || e.key === ' ') {
@@ -637,7 +689,7 @@ function boardRow(s, t) {
}
},
},
- h('span', { class: 'rank' }, s.rank == null ? '–' : `#${s.rank}`),
+ h('span', { class: 'rank' }, s.rank == null ? NO_VALUE : `#${s.rank}`),
h(
'div',
{ class: 'who' },
@@ -654,18 +706,17 @@ function boardRow(s, t) {
h('span', { class: 'prize num' }, Number(prizeShown) > 0 ? `${fmtThree(prizeShown)}` : ''),
);
- if (expandedAgent === s.agent_id) row.append(proofPanel(s));
- return row;
+ return expanded ? [row, proofPanel(s, proofId)] : [row];
}
-function proofPanel(s) {
+function proofPanel(s, id) {
const trades = s.sample_trades || [];
if (!trades.length) {
- return h('div', { class: 'row-proof' }, h('span', { class: 'proof-pill' }, 'No closed trades in the window yet'));
+ return h('div', { class: 'row-proof', id }, h('span', { class: 'proof-pill' }, 'No closed trades in the window yet'));
}
return h(
'div',
- { class: 'row-proof' },
+ { class: 'row-proof', id },
...trades.map((tr) =>
h(
tr.tx_url ? 'a' : 'span',
@@ -682,7 +733,12 @@ function toggleProof(s) {
expandedAgent = expandedAgent === s.agent_id ? null : s.agent_id;
// Re-render just the board against the cached standings without refetch.
const board = document.getElementById('board');
- if (board && currentStandings) renderBoard(board, currentStandings, currentTournament, phaseFromStatus(currentDerived));
+ if (!board || !currentStandings) return;
+ const hadFocus = document.activeElement?.dataset?.agent === s.agent_id;
+ renderBoard(board, currentStandings, currentTournament, phaseFromStatus(currentDerived));
+ // The clicked row is a fresh node after the re-render; keyboard users would
+ // otherwise be dumped back to the top of the document.
+ if (hadFocus) board.querySelector(`.row[data-agent="${s.agent_id}"]`)?.focus();
}
function tickerFromStandings(standings) {
@@ -709,7 +765,7 @@ function tickerFromStandings(standings) {
);
}
}
- return h('div', { class: 'ticker' }, h('h4', {}, 'Recent trades — every line traceable on-chain'), list);
+ return h('div', { class: 'ticker' }, h('h4', {}, 'Recent trades: every line traceable on-chain'), list);
}
function resultsBanner(data) {
@@ -720,7 +776,7 @@ function resultsBanner(data) {
if (att?.url) {
bits.push(h('a', { class: 'att-link', href: att.url, target: '_blank', rel: 'noopener' }, '⛓ Standings attested on-chain →'));
} else if (data.derived_status === 'ended') {
- bits.push(h('span', { class: 'settle-note' }, 'Final standings frozen — awaiting on-chain attestation by the host.'));
+ bits.push(h('span', { class: 'settle-note' }, 'Final standings frozen, awaiting on-chain attestation by the host.'));
}
if (Number(t.prize_pool_three) > 0) {
const reason = settle.block_reason;
@@ -731,13 +787,13 @@ function resultsBanner(data) {
{ class: 'settle-note' },
'Prizes computed but ',
h('b', {}, 'settlement BLOCKED'),
- ' — set ',
+ '. Set ',
h('code', {}, 'THREE_PRIZE_PAYOUT_KEY'),
' to fund payouts.',
),
);
} else if (reason === 'devnet_no_prizes') {
- bits.push(h('span', { class: 'settle-note' }, 'Devnet tournament — no real $THREE prizes are paid.'));
+ bits.push(h('span', { class: 'settle-note' }, 'Devnet tournament: no real $THREE prizes are paid.'));
} else {
const paid = (settle.winners || []).filter((w) => w.settlement_status === 'settled').length;
bits.push(h('span', { class: 'settle-note' }, `${paid}/${(settle.winners || []).length} prizes settled in $THREE.`));
@@ -748,9 +804,9 @@ function resultsBanner(data) {
// ── detail panels ────────────────────────────────────────────────────────────
const fmtWhen = (v) => {
- if (v == null) return '—';
+ if (v == null) return NO_VALUE;
const d = new Date(v);
- if (Number.isNaN(d.getTime())) return '—';
+ if (Number.isNaN(d.getTime())) return NO_VALUE;
return d.toLocaleString(undefined, { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' });
};
@@ -785,8 +841,8 @@ function windowTimeline(t, phase) {
phase === 'upcoming'
? h('span', {}, 'Opens in ', h('b', { dataset: { countdown: t.starts_at, doneLabel: 'now' } }, '…'))
: phase === 'live'
- ? h('span', {}, h('span', { class: 'wt-live' }, '● Live'), ' — closes in ', h('b', { dataset: { countdown: t.ends_at, doneLabel: 'now' } }, '…'))
- : h('span', {}, 'Window closed — final standings frozen');
+ ? h('span', {}, h('span', { class: 'wt-live' }, '● Live'), ', closes in ', h('b', { dataset: { countdown: t.ends_at, doneLabel: 'now' } }, '…'))
+ : h('span', {}, 'Window closed, final standings frozen');
return h(
'div',
{ class: `window-timeline wt-${phase}` },
@@ -823,7 +879,7 @@ function prizeLadder(data, phase) {
'p',
{ class: 'panel-note' },
t.bracket === 'practice'
- ? 'Practice bracket — paper trades, no prizes. Pure bragging rights and a verified spot on the board.'
+ ? 'Practice bracket: paper trades, no prizes. Pure bragging rights and a verified spot on the board.'
: 'No prize pool on this one. Top the board for bragging rights and a permanent, on-chain-attested record.',
),
);
@@ -852,8 +908,8 @@ function prizeLadder(data, phase) {
'p',
{ class: 'panel-note' },
phase === 'finished'
- ? 'Final split — paid in $THREE to the winners’ agent wallets.'
- : 'Live projection — the split locks when the window closes and standings attest on-chain.',
+ ? 'Final split, paid in $THREE to the winners’ agent wallets.'
+ : 'Live projection. The split locks when the window closes and standings attest on-chain.',
),
);
}
@@ -886,7 +942,7 @@ function rulesPanel(data) {
h('div', { class: 'gate-pills' }, ...gateBits.map((b) => h('span', { class: 'gate-pill' }, b))),
)
: null,
- h('p', { class: 'panel-note' }, 'Only trades opened inside the window count — existing history never carries in. Every ranked trade is verifiable on-chain.'),
+ h('p', { class: 'panel-note' }, 'Only trades opened inside the window count, so existing history never carries in. Every ranked trade is verifiable on-chain.'),
);
}
function ruleRow(k, v) {
@@ -972,6 +1028,7 @@ function applyLiveStandings(id, data) {
if (spot && leader && spot.dataset.leader !== leader.agent_id) {
spot.dataset.leader = leader.agent_id;
spot.replaceChildren(h('div', { class: 'crown' }, '🏆 Current leader'), leaderVisual(leader));
+ announce(`New leader: ${leader.agent_name || 'an agent'}, ${fmtSol(leader.metrics?.realized_pnl_sol)}`);
}
}
@@ -1070,7 +1127,7 @@ function openModal(node) {
function openCreateModal() {
const err = h('p', { class: 'form-error', role: 'alert' });
const nameI = h('input', { type: 'text', placeholder: 'Friday Night Snipe-Off', maxlength: '120', required: true });
- const descI = h('textarea', { rows: '2', placeholder: 'Optional — what makes this competition fun.' });
+ const descI = h('textarea', { rows: '2', placeholder: 'Optional: what makes this competition fun.' });
const scoringI = h(
'select',
{},
@@ -1167,7 +1224,7 @@ async function openJoinModal(t) {
body: JSON.stringify({ agent_id: selected }),
});
overlay.close();
- toast('Entered the arena — good luck');
+ toast('Entered the arena. Good luck.');
renderDetail(t.id);
} catch (ex) {
err.textContent = ex.message;
@@ -1180,7 +1237,7 @@ async function openJoinModal(t) {
h(
'p',
{ class: 'sub' },
- 'Pick one of your agents. Only trades it opens inside the window count — your existing history won’t carry in.',
+ 'Pick one of your agents. Only trades it opens inside the window count, so your existing history won’t carry in.',
),
body,
err,