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.

docs(changelog): publish the agora, arbitrage and bnb repairs to holders

nirholasf8f91b7f40b7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 403a36825..9302d311c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,10 +50,12 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **The Animation Gallery keeps its keyboard, its focus, and its promises about what will play**: The gallery of nearly 3,000 motion clips had a set of small breakages that added up. Roughly a third of the mocap catalogue has no picture made for it yet, and the page was asking the picture store for one anyway: every one of those requests came back empty, so a third of the cards spent a request to arrive at the same drawing they now show immediately. Opening a clip's details trapped nobody: pressing Tab walked out of the open window and into the page behind it, and closing the window dropped you back at the very top of the page instead of the card you came from. The playback controls were on show while a preview was still loading and stayed on show when it failed, so there were buttons that did nothing. Arrow keys jumped to the next clip even while you were dragging the speed slider, which moved the slider and changed the clip at the same time. Sharing a filtered view was misleading too: a link carrying the loops or one-shot filter applied it but left the buttons showing All, and a link with a filter the page does not recognise emptied the sort menu. All of it is fixed, along with the keyboard hint the window shows: Space really does play and pause now, from the moment the window opens. (`/animations`) `[fix, improvement]`
- **The arbitrage board says which price feeds it actually reached**: The x402 Arbitrage page compares what different providers charge for the same capability, and it builds that comparison from several facilitator catalogs at once. When one of those catalogs was unreachable, its listings simply vanished from every comparison and the page said nothing about it. A scan that had only seen half the market looked exactly like a market with fewer price gaps in it, which is the opposite of what the page is for. Each scan now names the facilitators it reached and how many listings each one contributed, and calls out any that dropped out along with the reason, so a short board is never mistaken for a quiet one. Separately, closing the payment window without paying used to leave the Pay cheapest button dead for four seconds before it would accept another click. Deciding not to pay now hands the button straight back. (`/arbitrage`) `[fix, improvement]`
- **The AWS page stops promising AWS invoicing three.ws does not do, and the GLB optimizer reads compressed avatars again**: Three corrections found by reading the docs pages against the code they describe. The AWS page told you a three.ws subscription would bill usage onto your AWS invoice, draw down AWS credits, and count toward Enterprise Discount Program commitments. None of that is the plan: the Marketplace subscription is free, and usage is paid per call in USDC over x402, exactly as it is for any other caller, so there is nothing to reconcile on your AWS bill at all. The page now says that, and describes the free subscription, the single key that opens every x402 endpoint, and the absence of any trial clock. Separately, the GLB optimization command documented on the 3D asset pipeline page failed on every compressed avatar, which is most of them, because it loaded the glTF extensions without the matching decoders; it now decodes meshopt and Draco and leaves the output as plain glTF the way its own contract promises. The NVIDIA models page also listed the tool-capable fallback model under the wrong vendor prefix. (`/aws`) `[fix, docs]`
+- **The background agent mint says out loud whether it ran**: Every avatar that finishes a scan or a prompt is given a draft on-chain identity in the background. That step is deliberately best-effort, so it can never cost you your avatar, but it was also completely silent: whether it minted, was skipped because the deployment holds no minting key, or was switched off entirely, the logs looked identical, which is how a run of avatars can go by without anyone noticing the identity was never created. Each finished avatar now records the outcome of both chains, including the reason a leg was skipped. The documentation for the feature also gained a way to prove the whole path on a machine that cannot reach the public test-network faucet, which is routinely exhausted on shared build machines: run your own node with the real Metaplex programs, and the proof reports which node served it rather than handing back an explorer link that leads nowhere. (`/docs/draft-agent-mint`) `[improvement, docs]`
- **The BNB Chain page now says how many demos are actually live**: The BNB Chain page checks each of its three demo tracks against the running deployment and reports the tally in its header. That line was stuck: it read "Checking which tracks are live" forever, even once all three cards beside it had finished and said Live. The page's own result was being written first and then overwritten by the translation pass that swaps the page into your language, so the finished count never survived. The header now holds its result and reads "3 of 3 demo tracks live now". The same checks were also leaving four cancelled requests in the browser's network log on every visit, which made a healthy page look like it was failing to anyone with developer tools open. They now close cleanly. (`/bnb`) `[fix]`
- **The creations gallery now counts every creation a creator has made, and pages all the way to the end**: The gallery ranked creators and paged the feed over only the newest 120 creations, however many the feed actually held. A creator's older work was invisible in their profile count, the top-creator board scored people on a fraction of their output, and scrolling the gallery dead-ended early with items still left to show. It now reads the full feed depth it always meant to, and does it in two database round trips instead of two per item, so the deeper read loads faster than the shallow one did. (`/creations`) `[fix, improvement]`
- **The Forge community board remembers what you liked**: The community showcase on /forge, and the same feed on the daily page and the model explorer, kept showing your own likes as un-liked. The board is held at the edge for a minute so it loads instantly for everyone, but the copy being held was the one built for a visitor who is not you, and it was handed to you as well. Your like button then started from the wrong state, and pressing it again fought with what the server already knew. The board now keeps a separate copy for a signed browser, so the hearts you filled in stay filled. Alongside it, a security fix on the Game-Ready export: when the export was paid for with $THREE rather than covered by holding, a badly formed payment reference made the server answer with the raw internals of its own database instead of a plain "that payment could not be verified". It now says only what a caller needs, and a database problem is no longer reported as a bad payment, so nobody is told to pay twice for an outage on our side. (`/forge`) `[fix, security]`
- **The KOL, Loom and marketplace MCP servers now tell you why a call failed, and ship runnable examples**: When a market-data provider was rate-limited, these servers passed back only a bare code like provider_unavailable and threw away the sentence explaining it. They now surface the full reason. The KOL portfolio tool used to answer a provider outage with an empty card that read as a quiet wallet with no trades; it now reports the outage as an outage, so nobody sizes up a trader from a blank. The KOL and Loom packages also gained runnable examples that talk to the live public API, and the naming SDK now answers an unregistered .eth name the same way it answers an unclaimed .sol one, with data instead of an exception. `[fix, sdk]`
+- **The model viewer tells you when a file will not open, and how to recover**: The viewer at /app had two dead ends. Drop a file that is not a glTF or GLB and nothing happened at all: the rejection went to the browser console, where no one would see it, so the page just sat there looking broken. It now says plainly that no model was found in the drop and offers a button to pick a different file. And when a model failed to download, the error card offered a Retry button only to signed-in members loading their own agent; everyone else got a dead card with no way forward. Retry now works for any load, including a file you dropped yourself. The page title and description in search results also went back to describing the viewer instead of the platform, the keyboard focus outline on the chat box and the animation and share fields is now actually visible rather than a barely-there glow, the scene search and chat boxes gained screen-reader labels, and the footer's GitHub links pointed at a repository that no longer exists and now reach the real one. (`/app`) `[fix, improvement]`
- **The public news feed can no longer be knocked out by a single post**: Everything that reads three.ws announcements, RSS readers and the HackerNoon importer alike, reads one feed at three.ws/rss/announcements.xml. That format has no partial failure: one illegal character anywhere in it makes the entire feed unreadable, so a single post could have taken every subscriber offline rather than costing one item. Three inputs could do that, and none of them can now. A code sample in an announcement that happened to contain the sequence that ends a raw-content block used to end it early and corrupt every item after it. Control characters the format forbids outright, which no amount of escaping can rescue, were passed straight through; they are now dropped, while emoji and other real characters are kept untouched. And a post whose wording happened to match a marker the feed builder uses internally while turning links into links stopped the feed building at all, returning an error to every reader instead. Separately, the feed takes an optional parameter for reading one of the archived accounts instead of the curated list, and misspelling it used to hand back the curated feed with no hint anything was wrong, so a subscriber could sit on the wrong feed indefinitely. It now says plainly that the source is unknown and lists the ones that exist. `[fix, infra]`
- **The public profile sitemap now lists people, not the seed crons**: The sitemap Google and Bing crawl is split into one file per kind of page, and the profiles file was handing search engines every account row with a username. That was 29,600 machine accounts minted by the avatar and forge seed crons against 42 real people, growing by about one a minute, so the profiles that belong to actual members were buried under auto-generated ones whose content (the avatars and agents they own) was already listed in its own sitemap. Machine accounts are now excluded from both the profiles sitemap and the last-updated stamp the sitemap index publishes for it, so that stamp changes when a person updates their profile rather than every time a cron runs. Separately, a handful of URLs under the sitemap API answered scanners with a server error instead of a plain not-found, which also filed a false internal alert each time; those now return a normal not-found listing the sitemap types that do exist. `[fix, infra]`
- **The sniper trade journal starts recording, and three sniper readouts stop reporting the wrong number**: The trade journal is the surface that answers why an agent bought and why it sold, and it had never recorded a single line. Two halves of the same mistake: the table expected a plain number where the platform stores an identifier, so every write failed and was silently discarded on purpose (a journal write must never be allowed to break a trade), and the page that reads it asked the database to compare the same two mismatched kinds of value, which failed outright and returned an error rather than an empty journal. Both are fixed and the surface now records and reads for real, across the 323 closed positions the fleet had already traded. Three readouts were also stating numbers that were not true. The Exit Lab corpus, asked without an explicit page size, answered with exactly one trade instead of the full 400, so the replay console looked like a fleet that had traded once; it now returns the whole window. The live pre-launch radar tape re-sent every precursor it had already shown, about forty times a minute, so the feed filled with copies of the same event; each precursor is now sent once. And the radar dashboard reported 100 watched wallets, the size of the table it was showing rather than the number it was watching, while the status line beside it reported the real figure; it now counts the wallets and the table says which slice of them it is showing. (`/radar`) `[fix, improvement]`
diff --git a/pages/capture.html b/pages/capture.html
index b7f8739f2..3a7616d13 100644
--- a/pages/capture.html
+++ b/pages/capture.html
@@ -4,7 +4,7 @@
<script>/* three.ws theme boot — no-flash */(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 http-equiv="X-UA-Compatible" content="IE=edge" />
- <title data-i18n="capture.meta_title">Scene Capture — Video to 3D Point Cloud · three.ws</title>
+ <title data-i18n="capture.meta_title">Scene Capture: Video to 3D Point Cloud · three.ws</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Turn a phone video of any space into an explorable 3D point cloud in the browser. Streaming feed-forward reconstruction (LingBot-Map) → coloured .ply, rendered live with WebGL." data-i18n-attr="content:capture.meta_description"/>
<meta name="theme-color" content="#000000" />
@@ -150,6 +150,11 @@
padding: 9px 11px; outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.pc-input:focus, .pc-select:focus { border-color: var(--text, #f6f6f6); }
+ /* `outline: none` above kills the ring a keyboard user needs, and a 1px
+ border tint is not enough to find on a dark panel. Restore a real
+ focus ring on keyboard focus, matching .pc-btn:focus-visible. */
+ .pc-input:focus-visible, .pc-select:focus-visible { outline: 2px solid var(--text, #fff); outline-offset: 2px; }
+ .pc-sample-btn:focus-visible { outline: 2px solid var(--text, #fff); outline-offset: 2px; }
.pc-input::placeholder { color: var(--text-4, #6e6e6e); }
.pc-btn {
display: inline-flex; align-items: center; justify-content: center; gap: 7px;
diff --git a/public/brain.css b/public/brain.css
index ce8c8b33d..ba0c4ef02 100644
--- a/public/brain.css
+++ b/public/brain.css
@@ -733,6 +733,11 @@ body {
color: #ff4444;
margin-left: 2px;
}
+/* Reachable but gated behind an account: dimmed, still clickable so the click
+ can explain itself and offer the sign-in link. */
+.br-pill.locked { opacity: 0.55; }
+.br-pill.locked .br-pill-dot { opacity: 0.3; }
+.br-pill-lock { font-size: 9px; margin-left: 2px; filter: grayscale(1); }
.br-pill-dot {
width: 7px;
height: 7px;
diff --git a/public/changelog.json b/public/changelog.json
index 4bf8918a0..29ae37275 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-16T19:44:10.604Z",
+ "generated_at": "2026-08-16T19:48:13.456Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -471,6 +471,17 @@
"docs"
]
},
+ {
+ "date": "2026-08-16",
+ "type": "update",
+ "title": "The background agent mint says out loud whether it ran",
+ "summary": "Every avatar that finishes a scan or a prompt is given a draft on-chain identity in the background. That step is deliberately best-effort, so it can never cost you your avatar, but it was also completely silent: whether it minted, was skipped because the deployment holds no minting key, or was switched off entirely, the logs looked identical, which is how a run of avatars can go by without anyone noticing the identity was never created. Each finished avatar now records the outcome of both chains, including the reason a leg was skipped. The documentation for the feature also gained a way to prove the whole path on a machine that cannot reach the public test-network faucet, which is routinely exhausted on shared build machines: run your own node with the real Metaplex programs, and the proof reports which node served it rather than handing back an explorer link that leads nowhere.",
+ "link": "/docs/draft-agent-mint",
+ "tags": [
+ "improvement",
+ "docs"
+ ]
+ },
{
"date": "2026-08-16",
"type": "update",
@@ -514,6 +525,17 @@
"sdk"
]
},
+ {
+ "date": "2026-08-16",
+ "type": "update",
+ "title": "The model viewer tells you when a file will not open, and how to recover",
+ "summary": "The viewer at /app had two dead ends. Drop a file that is not a glTF or GLB and nothing happened at all: the rejection went to the browser console, where no one would see it, so the page just sat there looking broken. It now says plainly that no model was found in the drop and offers a button to pick a different file. And when a model failed to download, the error card offered a Retry button only to signed-in members loading their own agent; everyone else got a dead card with no way forward. Retry now works for any load, including a file you dropped yourself. The page title and description in search results also went back to describing the viewer instead of the platform, the keyboard focus outline on the chat box and the animation and share fields is now actually visible rather than a barely-there glow, the scene search and chat boxes gained screen-reader labels, and the footer's GitHub links pointed at a repository that no longer exists and now reach the real one.",
+ "link": "/app",
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
{
"date": "2026-08-16",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 1f7414c2b..87b179e73 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -358,6 +358,14 @@
<category>fix</category>
<description>Three corrections found by reading the docs pages against the code they describe. The AWS page told you a three.ws subscription would bill usage onto your AWS invoice, draw down AWS credits, and count toward Enterprise Discount Program commitments. None of that is the plan: the Marketplace subscription is free, and usage is paid per call in USDC over x402, exactly as it is for any other caller, so there is nothing to reconcile on your AWS bill at all. The page now says that, and describes the free subscription, the single key that opens every x402 endpoint, and the absence of any trial clock. Separately, the GLB optimization command documented on the 3D asset pipeline page failed on every compressed avatar, which is most of them, because it loaded the glTF extensions without the matching decoders; it now decodes meshopt and Draco and leaves the output as plain glTF the way its own contract promises. The NVIDIA models page also listed the tool-capable fallback model under the wrong vendor prefix.</description>
</item>
+ <item>
+ <title>The background agent mint says out loud whether it ran</title>
+ <link>https://three.ws/docs/draft-agent-mint</link>
+ <guid isPermaLink="false">2026-08-16:The background agent mint says out loud whether it ran</guid>
+ <pubDate>Sun, 16 Aug 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Every avatar that finishes a scan or a prompt is given a draft on-chain identity in the background. That step is deliberately best-effort, so it can never cost you your avatar, but it was also completely silent: whether it minted, was skipped because the deployment holds no minting key, or was switched off entirely, the logs looked identical, which is how a run of avatars can go by without anyone noticing the identity was never created. Each finished avatar now records the outcome of both chains, including the reason a leg was skipped. The documentation for the feature also gained a way to prove the whole path on a machine that cannot reach the public test-network faucet, which is routinely exhausted on shared build machines: run your own node with the real Metaplex programs, and the proof reports which node served it rather than handing back an explorer link that leads nowhere.</description>
+ </item>
<item>
<title>The BNB Chain page now says how many demos are actually live</title>
<link>https://three.ws/bnb</link>
@@ -390,6 +398,14 @@
<category>fix</category>
<description>When a market-data provider was rate-limited, these servers passed back only a bare code like provider_unavailable and threw away the sentence explaining it. They now surface the full reason. The KOL portfolio tool used to answer a provider outage with an empty card that read as a quiet wallet with no trades; it now reports the outage as an outage, so nobody sizes up a trader from a blank. The KOL and Loom packages also gained runnable examples that talk to the live public API, and the naming SDK now answers an unregistered .eth name the same way it answers an unclaimed .sol one, with data instead of an exception.</description>
</item>
+ <item>
+ <title>The model viewer tells you when a file will not open, and how to recover</title>
+ <link>https://three.ws/app</link>
+ <guid isPermaLink="false">2026-08-16:The model viewer tells you when a file will not open, and how to recover</guid>
+ <pubDate>Sun, 16 Aug 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The viewer at /app had two dead ends. Drop a file that is not a glTF or GLB and nothing happened at all: the rejection went to the browser console, where no one would see it, so the page just sat there looking broken. It now says plainly that no model was found in the drop and offers a button to pick a different file. And when a model failed to download, the error card offered a Retry button only to signed-in members loading their own agent; everyone else got a dead card with no way forward. Retry now works for any load, including a file you dropped yourself. The page title and description in search results also went back to describing the viewer instead of the platform, the keyboard focus outline on the chat box and the animation and share fields is now actually visible rather than a barely-there glow, the scene search and chat boxes gained screen-reader labels, and the footer's GitHub links pointed at a repository that no longer exists and now reach the real one.</description>
+ </item>
<item>
<title>The public news feed can no longer be knocked out by a single post</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index aeb103e2f..7f3439060 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-16T19:44:10.312Z",
+ "generated_at": "2026-08-16T19:48:13.292Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/locales/en.json b/public/locales/en.json
index debd61e39..5756a240e 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -2282,11 +2282,11 @@
"all_coins": "All Coins",
"categories": "Categories",
"crypto_categories": "Crypto Categories",
- "every_sector_of_the_market_ranked_by": "Every sector of the market, ranked by market cap — Layer 1s, DeFi, memes, AI, RWAs and more. See which narratives are leading and lagging, then click through to the coins that make them up.",
+ "every_sector_of_the_market_ranked_by": "Every sector of the market, ranked by market cap: Layer 1s, DeFi, memes, AI, RWAs and more. See which narratives are leading and lagging, then click through to the coins that make them up.",
"heatmap": "Heatmap",
"markets": "Markets",
- "meta_description": "Every crypto sector ranked by market cap — Layer 1s, DeFi, memes, AI, RWAs and more. See which categories are leading and lagging with live 24h moves and volume.",
- "meta_og_description": "Every crypto sector ranked by market cap — Layer 1s, DeFi, memes, AI, RWAs and more, with live 24h moves and volume.",
+ "meta_description": "Every crypto sector ranked by market cap: Layer 1s, DeFi, memes, AI, RWAs and more. Search 700+ categories, sort by market cap, 24h change or volume, and see which narratives lead the market right now.",
+ "meta_og_description": "Every crypto sector ranked by market cap: Layer 1s, DeFi, memes, AI, RWAs and more, with live 24h moves and volume.",
"meta_og_title": "Crypto Categories · three.ws",
"meta_title": "Crypto Categories · three.ws",
"meta_twitter_description": "Every crypto sector ranked by market cap, with live 24h moves and volume.",
diff --git a/src/bnb-latency.js b/src/bnb-latency.js
index cf64503c3..4eedd1dc5 100644
--- a/src/bnb-latency.js
+++ b/src/bnb-latency.js
@@ -15,6 +15,7 @@ import {
laneState,
headlineState,
ageLabel,
+ measuredAtMs,
allLanesDown,
sparklineBars,
speedupRatio,
@@ -202,13 +203,13 @@ function applyPayload(payload) {
store.history.push(lane.avgBlockTimeMs);
if (store.history.length > MAX_HISTORY) store.history.shift();
store.last = lane;
- store.lastLiveAt = Date.parse(lane.measuredAt) || Date.now();
+ store.lastLiveAt = measuredAtMs(lane.measuredAt);
anyLive = true;
}
renderLane(lane);
}
lastLanes = payload.lanes;
- if (anyLive) lastSuccessAt = Date.now();
+ if (anyLive) lastSuccessAt = measuredAtMs(payload.measuredAt);
renderHeadline(payload.lanes.find((l) => l.id === 'bnb'));
renderUpdated();
// Every lane down is an outage the user can act on (retry), whether it
@@ -243,6 +244,12 @@ async function runPoll() {
try {
const res = await fetch('/api/bnb/latency', {
headers: { accept: 'application/json' },
+ // The endpoint ships stale-while-revalidate for crawlers and shared
+ // caches, which let the browser replay a body up to 15s old while
+ // this page claims a fresh measurement. A poll on a live race has to
+ // go to the network; the endpoint's own 4s cache is what protects
+ // the upstream RPCs from the traffic.
+ cache: 'no-store',
signal: AbortSignal.timeout(8000),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
diff --git a/src/brain.js b/src/brain.js
index 20dd0f923..0ba830e48 100644
--- a/src/brain.js
+++ b/src/brain.js
@@ -224,12 +224,22 @@ function toast(msg) {
toastTimer = setTimeout(() => el.classList.remove('show'), 2500);
}
-function showNotice(msg) {
+// A notice can carry one action, so "sign in to use this model" is a link the
+// user can follow instead of an instruction they have to go act on themselves.
+function showNotice(msg, action) {
const el = $('brNotice');
el.textContent = msg;
+ if (action) {
+ el.append(' ');
+ const a = document.createElement('a');
+ a.href = action.href;
+ a.textContent = action.label;
+ a.className = 'br-notice-action';
+ el.append(a);
+ }
el.style.display = 'block';
clearTimeout(el._t);
- el._t = setTimeout(() => { el.style.display = 'none'; }, 3500);
+ el._t = setTimeout(() => { el.style.display = 'none'; }, action ? 8000 : 3500);
}
// ── Markdown renderer ────────────────────────────────────────────────────────
@@ -710,7 +720,14 @@ async function fetchProviderRoster() {
updateSendAvailability();
try {
- const res = await fetch('/api/brain/chat', { headers: { accept: 'application/json' } });
+ // Both answers are needed before a line-up can be chosen: the roster says
+ // which models exist, the session says which of them this visitor may
+ // actually call. They run together so the bar still fills in one round
+ // trip.
+ const [res] = await Promise.all([
+ fetch('/api/brain/chat', { headers: { accept: 'application/json' } }),
+ hasSession().then(authed => { state.authed = authed; }),
+ ]);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
const providers = Array.isArray(data.providers) ? data.providers.filter(p => p?.key) : [];
@@ -1162,7 +1179,7 @@ function bindPlayControlEvents() {
const key = pill.dataset.key;
const spec = PMAP.get(key);
if (isLocked(spec)) {
- showNotice(`${spec.label} needs an account. Sign in to add it.`);
+ showNotice(`${spec.label} needs an account.`, { href: '/login?redirect=/brain', label: 'Sign in' });
return;
}
if (state.active.has(key)) {
@@ -1180,7 +1197,17 @@ function bindPlayControlEvents() {
});
} else {
const sel = document.getElementById('brFocusSel');
- if (sel) sel.addEventListener('change', () => { state.focusKey = sel.value; persistSelection(); renderCanvas(); });
+ if (sel) sel.addEventListener('change', () => {
+ const spec = PMAP.get(sel.value);
+ if (isLocked(spec)) {
+ showNotice(`${spec.label} needs an account.`, { href: '/login?redirect=/brain', label: 'Sign in' });
+ sel.value = state.focusKey;
+ return;
+ }
+ state.focusKey = sel.value;
+ persistSelection();
+ renderCanvas();
+ });
}
}
diff --git a/tests/bnb-latency-helpers.test.js b/tests/bnb-latency-helpers.test.js
index bc665a300..1b4b48ae4 100644
--- a/tests/bnb-latency-helpers.test.js
+++ b/tests/bnb-latency-helpers.test.js
@@ -12,6 +12,7 @@ import {
laneState,
headlineState,
ageLabel,
+ measuredAtMs,
allLanesDown,
sparklineBars,
speedupRatio,
@@ -98,6 +99,20 @@ describe('ageLabel', () => {
});
});
+describe('measuredAtMs', () => {
+ const now = Date.parse('2026-07-08T12:00:30.000Z');
+ it('uses the payload measurement time, not the moment bytes arrived', () => {
+ expect(measuredAtMs('2026-07-08T12:00:18.000Z', now)).toBe(Date.parse('2026-07-08T12:00:18.000Z'));
+ });
+ it('falls back to now for a missing or unparseable stamp', () => {
+ expect(measuredAtMs(null, now)).toBe(now);
+ expect(measuredAtMs('not-a-date', now)).toBe(now);
+ });
+ it('clamps a server clock running ahead of the client', () => {
+ expect(measuredAtMs('2026-07-08T12:05:00.000Z', now)).toBe(now);
+ });
+});
+
describe('allLanesDown', () => {
it('is false for an empty or missing list — nothing to race yet', () => {
expect(allLanesDown([])).toBe(false);