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.

Enhance UI/UX for Deploy Button and Register UI

nirholasa59d1fa7ac67
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 43fc9221b..36248879f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,12 +18,15 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Cleaner pages: sitemap header fits, stray glow clipped, quieter console** — A site-wide polish pass on cosmetic issues found in a full-site sweep. The /sitemap page now uses the standard site header instead of a cramped custom top bar that pushed the navigation past the right edge of the screen. The walk companion's caption bubble and the decorative glow on /x402-revenue are both capped so they can never spill outside the viewport or cause sideways scrolling. The companion's expected avatar fallback (a non-humanoid model handing off to the robot) no longer prints a warning on every page view, and the live demo frames on /labs and /integrations no longer trigger a browser sandbox warning. (`/sitemap`) `[fix]`
- **Coin Clash, coin worlds, and the sign-in page fail gracefully** — When the community battle service is offline, /clash and the /temporary world picker used to keep retrying and logging failed requests in the background. Both now recognize the outage on the first response, stop polling, and show a clear notice with live places to go instead (launches, markets, or walking the default world solo). The sign-in page also no longer throws a background error if its 3D greeter can't load; the form works exactly the same without him. (`/clash`) `[fix]`
- **IRL placement grows up: true AR anchoring leads the dock, and you can pinch-resize your agent** — Placing an avatar in the real world through /irl now feels like a native AR app. On phones with a real AR surface the new Place in AR button leads the dock: a floor-finding reticle, a tap to anchor the agent to the actual detected surface, and now a two-finger pinch to resize it live, from a 25% desk figurine to a 400% statue. The size you choose saves with the pin, so everyone who walks up sees your agent exactly where and how big you left it. iPhones open the same placement in ARKit Quick Look. The compass-and-GPS pin path is unchanged and remains the fallback everywhere else. (`/irl`) `[feature, improvement]`
+- **Launching a coin is clearer at every step** — The coin launch page now guides you properly: signed-out and no-agents states have one obvious button instead of buried links, the agent picker supports arrow keys and never shows a broken thumbnail, and the form has live character counters against pump.fun's real limits, auto-uppercased tickers, and inline validation. While a launch runs you see each stage progress, and success now links the actual transaction on Solscan next to your coin page. A subtle bug is also gone: retrying a launch after swapping the image no longer reuses the old image's metadata. (`/launch`) `[improvement, fix]`
+- **Launchpad Studio: loading, saving, and publishing you can trust** — The studio now shows a real loading state while it fetches a saved launchpad and a clear recovery screen if that fetch fails, instead of silently dropping you into a blank draft. Publishing validates your slug and wallet address inline before any network call, success puts your live URL front and center with a copy button, and a failure keeps your last live URL and offers retry. Edits to a published page warn before you navigate away, the editor finally works on phones with a stacked layout, and the Publish button is no longer white text on a white background. (`/launchpad`) `[improvement, fix]`
- **New doc: IRL, agents in the real world** — The IRL layer finally has a front door in the docs: one page that explains the whole vision and how the shipped pieces fit together. It covers placing an agent at a real GPS spot from your phone, walk-up discovery with proof of presence, paying agents in person via x402, Money Drops (real SOL, USDC, or $THREE escrowed at a place and claimable only by walking up), World Lines (agent-signed proofs that you were really there), and the privacy model that makes it all safe. The docs sidebar now also links the hands-on IRL tutorial, which was previously unreachable from the navigation. (`/docs/irl`) `[docs]`
- **Shared 3D viewer links load again** — Opening a shared model link at /viewer could hang on the loading spinner forever even though the model file itself was fine. The viewer now reveals the model as soon as it finishes rendering, and if a model genuinely cannot display, you get a clear message and a working download button instead of an endless spinner. (`/viewer`) `[fix]`
- **The 3D viewer now funnels every model into a next step** — Every generated model's share page grew a "Do more with this model" panel: pose and animate it in Pose Studio (rigged models are detected automatically), restyle the material, drop it into Scene Studio or Parts Studio, place it in your room in AR, copy a paste-anywhere embed iframe, or launch it as a pump.fun coin with a rendered snapshot pre-filled as the token image. The viewer can now also be embedded on any site. (`/viewer`) `[feature, improvement]`
- **The Agora and City worlds survive OpenStreetMap outages** — The 3D city on /agora and /city is built from live OpenStreetMap data, and a single overloaded map server used to mean an empty world with no buildings. Map data now fails over across three independent OpenStreetMap mirrors, and if every mirror is down the world rebuilds from the last map snapshot saved in your browser, so Manhattan stays standing even when the map providers do not. (`/agora`) `[fix, improvement]`
- **The AR placement button is visible again on /irl** — On phones, the strip of actions under the camera view had quietly scrolled itself past its own first button, so "Place in AR" (the one-tap way to stand your agent on a real floor) sat just off the left edge of the screen, where almost nobody would swipe back to find it. The strip now opens on its true first action, so AR placement leads the row as intended. Every other control on the page was re-checked for overlap at phone, small-phone, and landscape sizes: nothing is covering anything else. (`/irl`) `[fix]`
- **The best community models now go to Sketchfab** — The best forge models are now published to the official three.ws account on Sketchfab, the largest public 3D model site: weekly Forge-Off winners first, then top-voted board models, then creations their makers explicitly accepted. It is a curated showcase, not a firehose: a few validated models a week, each clearly tagged as AI-generated, with its generation prompt and a link back to the creation on three.ws so anyone who finds it can remix it or forge their own. Every link is tagged so we can measure how many visitors the showcase actually brings in. (`/docs/sketchfab`) `[feature]`
+- **The on-chain deploy wizard got a full polish pass** — Deploying an agent on-chain is now smoother end to end. The step bar is keyboard-navigable and screen-reader friendly, form fields validate inline with live character counters instead of failing three steps later, and bad service endpoints are caught before they can be minted into your agent's on-chain record. Wallet problems now say exactly what to do (install, unlock, connect, or switch network). A failed mint shows a clear error panel with a working retry, and success promotes the explorer link plus one-click next steps: view your agent page, launch a coin, or embed it. The whole wizard works down to small phones, and a 3D preview that cannot render falls back to a clear notice instead of an empty box. (`/deploy`) `[improvement]`
- **The trade terminal stops throwing 404s and rides out RPC outages** — The deep-dive on /trades asked the platform for holder cohorts and a smart-money score on every coin, including coins three.ws never launched or scored, so the browser logged a guaranteed failed request for almost every selection. Both panels now know the difference between "no data exists for this coin" and a real error: unscored coins get an honest "not scored yet" card that links to the Smart Money radar, and coins launched elsewhere get a direct link to their on-chain holder list. Live price and bonding-curve reads also became outage-proof: when every Solana RPC provider fails at once, the terminal serves the last real curve data it saw (clearly marked stale) instead of a server error and a blank strip. (`/trades`) `[fix, improvement]`
- **Tour and Walk SDK update: switch between Stroll and Platformer from the tour controls** — Embedded tours built with the Tour Builder now include a labeled Stroll / Platformer toggle right in the tour controls next to Exit, so visitors can switch how they explore (tap it or press M) instead of hunting for a hidden corner button. Published as @three-ws/walk 0.2.1 and @three-ws/tour 0.5.1 on npm; the Tour Builder's exported embed snippet now uses the new versions automatically, and also picks up the latest @three-ws/page-agent with its five persona presets. (`/tour-builder`) `[sdk, improvement]`
- **Vanity wallet page loads cleanly again** — Opening /vanity-wallet on desktop threw two script errors the moment the page loaded, which broke the sealed-drop claim and gifting features on that page. The page now ships fully bundled code, so it loads without errors and every feature on it, from the in-browser grinder to sealed drops, works as intended. (`/vanity-wallet`) `[fix]`
diff --git a/data/changelog.json b/data/changelog.json
index 43a418d6d..cfd3e6ac4 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,35 @@
{
"$comment": "Curated changelog entries for three.ws — 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-07-14",
+ "title": "The on-chain deploy wizard got a full polish pass",
+ "summary": "Deploying an agent on-chain is now smoother end to end. The step bar is keyboard-navigable and screen-reader friendly, form fields validate inline with live character counters instead of failing three steps later, and bad service endpoints are caught before they can be minted into your agent's on-chain record. Wallet problems now say exactly what to do (install, unlock, connect, or switch network). A failed mint shows a clear error panel with a working retry, and success promotes the explorer link plus one-click next steps: view your agent page, launch a coin, or embed it. The whole wizard works down to small phones, and a 3D preview that cannot render falls back to a clear notice instead of an empty box.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/deploy"
+ },
+ {
+ "date": "2026-07-14",
+ "title": "Launching a coin is clearer at every step",
+ "summary": "The coin launch page now guides you properly: signed-out and no-agents states have one obvious button instead of buried links, the agent picker supports arrow keys and never shows a broken thumbnail, and the form has live character counters against pump.fun's real limits, auto-uppercased tickers, and inline validation. While a launch runs you see each stage progress, and success now links the actual transaction on Solscan next to your coin page. A subtle bug is also gone: retrying a launch after swapping the image no longer reuses the old image's metadata.",
+ "tags": [
+ "improvement",
+ "fix"
+ ],
+ "link": "/launch"
+ },
+ {
+ "date": "2026-07-14",
+ "title": "Launchpad Studio: loading, saving, and publishing you can trust",
+ "summary": "The studio now shows a real loading state while it fetches a saved launchpad and a clear recovery screen if that fetch fails, instead of silently dropping you into a blank draft. Publishing validates your slug and wallet address inline before any network call, success puts your live URL front and center with a copy button, and a failure keeps your last live URL and offers retry. Edits to a published page warn before you navigate away, the editor finally works on phones with a stacked layout, and the Publish button is no longer white text on a white background.",
+ "tags": [
+ "improvement",
+ "fix"
+ ],
+ "link": "/launchpad"
+ },
{
"date": "2026-07-14",
"title": "Coin Clash, coin worlds, and the sign-in page fail gracefully",
diff --git a/pages/launchpad.html b/pages/launchpad.html
index c26125b6f..5d54c6b78 100644
--- a/pages/launchpad.html
+++ b/pages/launchpad.html
@@ -53,7 +53,14 @@
<meta name="twitter:site" content="@trythreews">
</head>
<body>
- <div id="root"></div>
+ <div id="root">
+ <noscript>
+ <div style="max-width:560px;margin:15vh auto 0;padding:0 24px;text-align:center;font:15px/1.6 system-ui,sans-serif;color:#a1a1aa">
+ <h1 style="font-size:22px;color:#fff;margin:0 0 10px">Launchpad Studio needs JavaScript</h1>
+ <p style="margin:0">The studio is an interactive 3D editor and cannot run with JavaScript disabled. Enable JavaScript and reload, or browse published pages from the <a href="/launches" style="color:#ec4899">launches feed</a>.</p>
+ </div>
+ </noscript>
+ </div>
<script type="module">
// The landing decides what to show: a live discovery front door, or —
// when the URL deep-links the editor (?slug, ?template, ?wallet, ?avatar,
diff --git a/prompts/store-submissions/_generated/openai-gpt-config.md b/prompts/store-submissions/_generated/openai-gpt-config.md
index 1c5a129d1..3e88c36c0 100644
--- a/prompts/store-submissions/_generated/openai-gpt-config.md
+++ b/prompts/store-submissions/_generated/openai-gpt-config.md
@@ -128,22 +128,25 @@ STYLE
## 5. Conversation starters
-Four chips, one per audience: game developers, tabletop players, designers, and
-the merely curious. Specific beats general here (a chip is a one-click demo, not
-a filter), but the set must span use cases instead of four samey desk trinkets.
-The first three subjects are verified live against `/api/3d/studio` (fox is the
-smoke-test prompt; dragon and car re-verified 2026-07-14, both done inline). The
-fourth is open-ended by design: the instructions make the GPT rewrite it into
-one concrete subject before calling.
+Four chips, one per audience: game developers, communities that run on mascot
+culture, tabletop players, and the merely curious. Specific beats general here
+(a chip is a one-click demo, not a filter), but the set must span use cases
+instead of four samey desk trinkets. The mascot chip is the bridge to our
+home audience while staying inside this listing's zero-crypto vocabulary (see
+the compliance audit below); do NOT sharpen it with coin/token/community-token
+wording. The first three subjects are verified live against `/api/3d/studio`
+(fox is the smoke-test prompt; dragon and a mascot re-verified 2026-07-14, both
+done inline). The fourth is open-ended by design: the instructions make the GPT
+rewrite it into one concrete subject before calling.
```
Make me a low-poly fox for my game
```
```
-Create a dragon miniature for my tabletop campaign
+Create a 3D mascot for my community
```
```
-Design a sleek futuristic concept car
+Create a dragon miniature for my tabletop campaign
```
```
Surprise me with something cool in 3D
diff --git a/public/changelog.json b/public/changelog.json
index 07fe12ad0..4dee588ff 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-14T14:08:29.808Z",
+ "generated_at": "2026-07-14T14:39:05.335Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -128,6 +128,28 @@
"improvement"
]
},
+ {
+ "date": "2026-07-14",
+ "type": "update",
+ "title": "Launching a coin is clearer at every step",
+ "summary": "The coin launch page now guides you properly: signed-out and no-agents states have one obvious button instead of buried links, the agent picker supports arrow keys and never shows a broken thumbnail, and the form has live character counters against pump.fun's real limits, auto-uppercased tickers, and inline validation. While a launch runs you see each stage progress, and success now links the actual transaction on Solscan next to your coin page. A subtle bug is also gone: retrying a launch after swapping the image no longer reuses the old image's metadata.",
+ "link": "/launch",
+ "tags": [
+ "improvement",
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-14",
+ "type": "update",
+ "title": "Launchpad Studio: loading, saving, and publishing you can trust",
+ "summary": "The studio now shows a real loading state while it fetches a saved launchpad and a clear recovery screen if that fetch fails, instead of silently dropping you into a blank draft. Publishing validates your slug and wallet address inline before any network call, success puts your live URL front and center with a copy button, and a failure keeps your last live URL and offers retry. Edits to a published page warn before you navigate away, the editor finally works on phones with a stacked layout, and the Publish button is no longer white text on a white background.",
+ "link": "/launchpad",
+ "tags": [
+ "improvement",
+ "fix"
+ ]
+ },
{
"date": "2026-07-14",
"type": "update",
@@ -190,6 +212,16 @@
"feature"
]
},
+ {
+ "date": "2026-07-14",
+ "type": "update",
+ "title": "The on-chain deploy wizard got a full polish pass",
+ "summary": "Deploying an agent on-chain is now smoother end to end. The step bar is keyboard-navigable and screen-reader friendly, form fields validate inline with live character counters instead of failing three steps later, and bad service endpoints are caught before they can be minted into your agent's on-chain record. Wallet problems now say exactly what to do (install, unlock, connect, or switch network). A failed mint shows a clear error panel with a working retry, and success promotes the explorer link plus one-click next steps: view your agent page, launch a coin, or embed it. The whole wizard works down to small phones, and a 3D preview that cannot render falls back to a clear notice instead of an empty box.",
+ "link": "/deploy",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-07-14",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 5465a014b..cc0e48c7f 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -102,6 +102,22 @@
<category>feature</category>
<description>Placing an avatar in the real world through /irl now feels like a native AR app. On phones with a real AR surface the new Place in AR button leads the dock: a floor-finding reticle, a tap to anchor the agent to the actual detected surface, and now a two-finger pinch to resize it live, from a 25% desk figurine to a 400% statue. The size you choose saves with the pin, so everyone who walks up sees your agent exactly where and how big you left it. iPhones open the same placement in ARKit Quick Look. The compass-and-GPS pin path is unchanged and remains the fallback everywhere else.</description>
</item>
+ <item>
+ <title>Launching a coin is clearer at every step</title>
+ <link>https://three.ws/launch</link>
+ <guid isPermaLink="false">2026-07-14:Launching a coin is clearer at every step</guid>
+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The coin launch page now guides you properly: signed-out and no-agents states have one obvious button instead of buried links, the agent picker supports arrow keys and never shows a broken thumbnail, and the form has live character counters against pump.fun's real limits, auto-uppercased tickers, and inline validation. While a launch runs you see each stage progress, and success now links the actual transaction on Solscan next to your coin page. A subtle bug is also gone: retrying a launch after swapping the image no longer reuses the old image's metadata.</description>
+ </item>
+ <item>
+ <title>Launchpad Studio: loading, saving, and publishing you can trust</title>
+ <link>https://three.ws/launchpad</link>
+ <guid isPermaLink="false">2026-07-14:Launchpad Studio: loading, saving, and publishing you can trust</guid>
+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The studio now shows a real loading state while it fetches a saved launchpad and a clear recovery screen if that fetch fails, instead of silently dropping you into a blank draft. Publishing validates your slug and wallet address inline before any network call, success puts your live URL front and center with a copy button, and a failure keeps your last live URL and offers retry. Edits to a published page warn before you navigate away, the editor finally works on phones with a stacked layout, and the Publish button is no longer white text on a white background.</description>
+ </item>
<item>
<title>New doc: IRL, agents in the real world</title>
<link>https://three.ws/docs/irl</link>
@@ -150,6 +166,14 @@
<category>feature</category>
<description>The best forge models are now published to the official three.ws account on Sketchfab, the largest public 3D model site: weekly Forge-Off winners first, then top-voted board models, then creations their makers explicitly accepted. It is a curated showcase, not a firehose: a few validated models a week, each clearly tagged as AI-generated, with its generation prompt and a link back to the creation on three.ws so anyone who finds it can remix it or forge their own. Every link is tagged so we can measure how many visitors the showcase actually brings in.</description>
</item>
+ <item>
+ <title>The on-chain deploy wizard got a full polish pass</title>
+ <link>https://three.ws/deploy</link>
+ <guid isPermaLink="false">2026-07-14:The on-chain deploy wizard got a full polish pass</guid>
+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Deploying an agent on-chain is now smoother end to end. The step bar is keyboard-navigable and screen-reader friendly, form fields validate inline with live character counters instead of failing three steps later, and bad service endpoints are caught before they can be minted into your agent's on-chain record. Wallet problems now say exactly what to do (install, unlock, connect, or switch network). A failed mint shows a clear error panel with a working retry, and success promotes the explorer link plus one-click next steps: view your agent page, launch a coin, or embed it. The whole wizard works down to small phones, and a 3D preview that cannot render falls back to a clear notice instead of an empty box.</description>
+ </item>
<item>
<title>The trade terminal stops throwing 404s and rides out RPC outages</title>
<link>https://three.ws/trades</link>
diff --git a/public/features.json b/public/features.json
index 0ac33701c..b6b9c401e 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-14T14:08:29.792Z",
+ "generated_at": "2026-07-14T14:39:05.322Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/launch/launch.js b/public/launch/launch.js
index 242475322..08aa4b658 100644
--- a/public/launch/launch.js
+++ b/public/launch/launch.js
@@ -49,16 +49,32 @@ const PICKER_CSS = `
background-size:200% 100%;animation:lc-shimmer 1.3s linear infinite}
@keyframes lc-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
-.lc-pick-cta{margin-top:.35rem;display:block;text-align:center;padding:.55rem;border-radius:9px;
+.lc-pick-cta{margin-top:.35rem;display:flex;align-items:center;justify-content:center;
+ min-height:44px;box-sizing:border-box;text-align:center;padding:.55rem;border-radius:9px;
font-size:.78rem;text-decoration:none;color:rgba(255,255,255,.5);background:rgba(255,255,255,.025);
border:1px dashed rgba(255,255,255,.12);transition:all .15s}
.lc-pick-cta:hover{color:rgba(164,240,188,.85);border-color:rgba(164,240,188,.3);
background:rgba(164,240,188,.05)}
+.lc-pick-cta:focus-visible,.lc-cta-primary:focus-visible{outline:2px solid rgba(164,240,188,.6);outline-offset:2px}
+
+.lc-cta-primary{display:flex;align-items:center;justify-content:center;min-height:44px;
+ box-sizing:border-box;padding:.6rem .8rem;border-radius:9px;font-size:.82rem;font-weight:500;
+ text-decoration:none;text-align:center;color:rgba(164,240,188,.9);
+ background:rgba(164,240,188,.08);border:1px solid rgba(164,240,188,.26);
+ transition:background .15s,border-color .15s,color .15s}
+.lc-cta-primary:hover{background:rgba(164,240,188,.14);border-color:rgba(164,240,188,.42);color:#c8f0d8}
+
+.lc-count{margin-left:.45rem;font-weight:600;color:rgba(164,240,188,.6)}
.lc-signin{font-size:.74rem;color:rgba(255,255,255,.45);line-height:1.55;padding:.6rem .7rem;
border-radius:9px;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.07)}
.lc-signin a{color:rgba(164,240,188,.8);text-decoration:none}
.lc-signin a:hover{color:#a4f0bc}
+
+@media (prefers-reduced-motion:reduce){
+ .lc-skel{animation:none;background:rgba(255,255,255,.045)}
+ .lc-card,.lc-pick-cta,.lc-cta-primary{transition:none}
+}
`;
const esc = (s) =>
@@ -106,16 +122,17 @@ function renderPicker() {
return;
}
- // Signed out, or signed in with no avatars → let the panel's guided state
- // lead; the picker just nudges the next concrete action.
+ // Signed out, or signed in with no avatars: let the panel's guided state
+ // lead; the picker names the exact next action with a real CTA.
if (!state.avatars.length) {
pickerEl.innerHTML =
'<p class="lc-col-h">Choose your agent</p>' +
(state.user
- ? '<a class="lc-pick-cta" href="/create-agent">+ Create your first agent</a>'
- : '<div class="lc-signin">A coin launches for one of your agents. ' +
- '<a href="/login?next=/launch">Sign in</a> to pick an agent, or ' +
- '<a href="/create-agent">create one</a> first.</div>');
+ ? '<div class="lc-signin">No agents yet. A coin always launches for one of your agents, so create one first (it takes about a minute).</div>' +
+ '<a class="lc-cta-primary" href="/create-agent">+ Create your first agent</a>'
+ : '<div class="lc-signin">A coin launches for one of your agents. Sign in to pick one, or create a new agent first.</div>' +
+ '<a class="lc-cta-primary" href="/login?next=/launch">Sign in to pick an agent</a>' +
+ '<a class="lc-pick-cta" href="/create-agent">+ Create an agent</a>');
return;
}
@@ -136,19 +153,46 @@ function renderPicker() {
.join('');
pickerEl.innerHTML =
- '<p class="lc-col-h">Choose your agent</p>' +
+ `<p class="lc-col-h">Choose your agent<span class="lc-count">${state.avatars.length}</span></p>` +
cards +
'<a class="lc-pick-cta" href="/create-agent">+ New agent</a>';
- for (const btn of pickerEl.querySelectorAll('.lc-card')) {
+ const cardEls = [...pickerEl.querySelectorAll('.lc-card')];
+ cardEls.forEach((btn, i) => {
btn.addEventListener('click', () => selectAvatar(btn.dataset.id));
+ // Arrow-key movement between agent cards (wraps at the ends).
+ btn.addEventListener('keydown', (e) => {
+ let to = null;
+ if (e.key === 'ArrowDown' || e.key === 'ArrowRight') to = cardEls[(i + 1) % cardEls.length];
+ else if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') to = cardEls[(i - 1 + cardEls.length) % cardEls.length];
+ else if (e.key === 'Home') to = cardEls[0];
+ else if (e.key === 'End') to = cardEls[cardEls.length - 1];
+ if (to) { e.preventDefault(); to.focus(); }
+ });
+ });
+
+ // A dead thumbnail URL must never show a broken-image icon: swap it for
+ // the same initial placeholder the no-thumbnail case uses.
+ for (const img of pickerEl.querySelectorAll('img.lc-thumb')) {
+ img.addEventListener('error', () => {
+ const name = img.closest('.lc-card')?.querySelector('.lc-name')?.textContent || 'A';
+ const ph = document.createElement('span');
+ ph.className = 'lc-thumb-ph';
+ ph.setAttribute('aria-hidden', 'true');
+ ph.textContent = (name.trim().charAt(0) || 'A').toUpperCase();
+ img.replaceWith(ph);
+ }, { once: true });
}
}
function selectAvatar(id) {
if (id === state.avatarId) return;
+ // Re-rendering replaces the focused card; put focus back on the newly
+ // selected one so keyboard flow is unbroken.
+ const hadFocus = pickerEl?.contains(document.activeElement);
state.avatarId = id;
renderPicker();
+ if (hadFocus) pickerEl.querySelector(`.lc-card[data-id="${CSS.escape(id)}"]`)?.focus();
launchPanel?.avatarChanged();
}
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index bf58a3e7e..6b3c416c3 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -52,25 +52,6 @@
.sm-badge-auth { background: rgba(255, 200, 80, .15); color: #ffcf66; }
.sm-badge-internal { background: rgba(120,200,255,.12); color: #9ad4ff; }
</style>
-
- <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="three.ws">
- <meta property="og:locale" content="en_US">
- <meta property="og:title" content="Sitemap · three.ws">
- <meta property="og:description" content="Human-readable index of every page on three.ws.">
- <meta property="og:url" content="https://three.ws/sitemap">
- <meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
- <meta property="og:image:width" content="1200">
- <meta property="og:image:height" content="630">
- <meta property="og:image:type" content="image/png">
- <meta property="og:image:alt" content="Sitemap — three.ws">
- <meta name="twitter:card" content="summary_large_image">
- <meta name="twitter:site" content="@trythreews">
- <meta name="twitter:title" content="Sitemap · three.ws">
- <meta name="twitter:description" content="Human-readable index of every page on three.ws.">
- <meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script>
</head>
<body>
<header><div id="nav-container"></div></header>
diff --git a/public/studio/launch-panel.js b/public/studio/launch-panel.js
index 6158aaf44..675078005 100644
--- a/public/studio/launch-panel.js
+++ b/public/studio/launch-panel.js
@@ -1077,7 +1077,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
s.phase = 'building'; s.phaseLabel = 'Uploading metadata…'; render();
const nameTrim = s.name.trim().slice(0, 32);
- // Preserve the symbol exactly as entered (whitespace/emoji/special chars), cap at 10 codepoints.
+ // Symbol was normalized (uppercased, emoji/special chars kept) at input time; cap at 10 codepoints.
const symTrim = [...s.symbol].slice(0, 10).join('');
const descTrim = s.description.trim().slice(0, 500);
// Key includes the file's identity, not just its presence, so swapping
@@ -1629,35 +1629,49 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
</div>`;
}
+ // Progressive stage tracker shown while a launch is in flight. The agent
+ // wallet path has no local signing step (the server signs), so it shows
+ // three stages instead of four. Decorative twin of the aria-live phase
+ // label below it, so it stays aria-hidden to avoid double announcements.
+ function launchStepsHtml() {
+ const steps = s.walletSource === 'agent'
+ ? [['building', 'Metadata'], ['stamping', 'Brand mark'], ['confirming', 'On-chain']]
+ : [['building', 'Metadata'], ['stamping', 'Brand mark'], ['signing', 'Sign'], ['confirming', 'Confirm']];
+ const idx = steps.findIndex(([id]) => id === s.phase);
+ return `<ol class="lp-steps" aria-hidden="true">${steps
+ .map(([, label], i) => `<li class="${i < idx ? 'done' : i === idx ? 'active' : ''}">${label}</li>`)
+ .join('')}</ol>`;
+ }
+
function renderForm() {
const busy = s.phase !== 'idle' && s.phase !== 'error';
const dis = busy ? 'disabled' : '';
const cost = estimatedCost();
- const sourceToggleHtml = `<div class="lp-src" role="tablist" aria-label="Launch wallet">
- <button type="button" role="tab" data-src="connected" class="${s.walletSource === 'connected' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
+ const sourceToggleHtml = `<div class="lp-src" role="radiogroup" aria-label="Launch wallet">
+ <button type="button" role="radio" aria-checked="${s.walletSource === 'connected'}" data-src="connected" class="${s.walletSource === 'connected' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
Connected wallet<span class="lp-src-sub">Phantom / Backpack</span>
</button>
- <button type="button" role="tab" data-src="agent" class="${s.walletSource === 'agent' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
+ <button type="button" role="radio" aria-checked="${s.walletSource === 'agent'}" data-src="agent" class="${s.walletSource === 'agent' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
Agent wallet<span class="lp-src-sub">Custodial · server-signed</span>
</button>
</div>`;
const ct = s.coinType;
- const coinTypeHtml = `<div class="lp-coin" role="tablist" aria-label="Coin type">
- <button type="button" role="tab" data-coin="regular" class="regular ${ct === 'regular' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
+ const coinTypeHtml = `<div class="lp-coin" role="radiogroup" aria-label="Coin type">
+ <button type="button" role="radio" aria-checked="${ct === 'regular'}" data-coin="regular" class="regular ${ct === 'regular' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
<span class="lp-coin-emoji">🪙</span>Regular<span class="lp-coin-sub">Plain pump.fun</span>
</button>
- <button type="button" role="tab" data-coin="mayhem" class="mayhem ${ct === 'mayhem' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
+ <button type="button" role="radio" aria-checked="${ct === 'mayhem'}" data-coin="mayhem" class="mayhem ${ct === 'mayhem' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
<span class="lp-coin-emoji">🔥</span>Mayhem<span class="lp-coin-sub">High-volatility</span>
</button>
- <button type="button" role="tab" data-coin="agent" class="agent ${ct === 'agent' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
+ <button type="button" role="radio" aria-checked="${ct === 'agent'}" data-coin="agent" class="agent ${ct === 'agent' ? 'on' : ''}" ${busy ? 'disabled' : ''}>
<span class="lp-coin-emoji">🤖</span>Agent<span class="lp-coin-sub">SOL buyback</span>
</button>
- <button type="button" role="tab" data-coin="usdc" class="usdc ${ct === 'usdc' ? 'on' : ''}" ${busy ? 'disabled' : ''} title="USDC-paired agent coin — trades and pays out in USDC instead of SOL.">
+ <button type="button" role="radio" aria-checked="${ct === 'usdc'}" data-coin="usdc" class="usdc ${ct === 'usdc' ? 'on' : ''}" ${busy ? 'disabled' : ''} title="USDC-paired agent coin: trades and pays out in USDC instead of SOL.">
<span class="lp-coin-emoji">💵</span>USDC<span class="lp-coin-sub">Stablecoin pair</span>
</button>
- <button type="button" role="tab" data-coin="reward" class="reward ${ct === 'reward' ? 'on' : ''}" ${busy ? 'disabled' : ''} title="Open-source / GitHub reward coin — creator fees are delegated and split to a team or repo contributors who each claim their share.">
+ <button type="button" role="radio" aria-checked="${ct === 'reward'}" data-coin="reward" class="reward ${ct === 'reward' ? 'on' : ''}" ${busy ? 'disabled' : ''} title="Open-source / GitHub reward coin: creator fees are delegated and split to a team or repo contributors who each claim their share.">
<span class="lp-coin-emoji">🎁</span>Reward<span class="lp-coin-sub">Delegated fees</span>
</button>
</div>`;
@@ -1716,28 +1730,52 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
const imgSrc = s.imagePreviewUrl || av?.thumbnail_url;
+ // Live character counters against the real pump.fun caps (name 32,
+ // symbol 10 codepoints, description 500); warn tint from 90% up.
+ const countHtml = (id, n, max) =>
+ `<span class="lp-count${n >= max * 0.9 ? ' warn' : ''}" id="${id}" aria-hidden="true">${n}/${max}</span>`;
+ const nameBad = s._touched.name && !s.name.trim();
+ const symBad = s._touched.symbol && s.symbol.length === 0;
+ const descBad = s._touched.description && !s.description.trim();
+
container.innerHTML = `<div class="lp">
<div class="lp-card">
<div class="lp-img-zone" id="lp-zone" title="Drop a PNG/JPG/GIF here, or click to pick a file. This becomes the token's avatar on pump.fun.">
${imgSrc ? `<img src="${esc(imgSrc)}" alt="" />` : `<div class="lp-img-ph">Drop image<br>or click</div>`}
- <input type="file" class="lp-img-file" id="lp-img" accept="image/*" ${dis} />
+ <input type="file" class="lp-img-file" id="lp-img" accept="image/*" aria-label="Token image upload" ${dis} />
</div>
<div class="lp-card-fields">
- <input class="lp-iname" id="lp-name" type="text" maxlength="32"
- placeholder="Token name" value="${esc(s.name)}" ${dis}
- title="Shown on pump.fun. Up to 32 chars." />
- <input class="lp-isymbol" id="lp-sym" type="text" maxlength="80"
- placeholder="SYMBOL" value="${esc(s.symbol)}" ${dis}
- title="Ticker symbol (the $ in $CZ). Any characters — emoji and symbols allowed, up to 10." />
+ <div class="lp-frow">
+ <input class="lp-iname" id="lp-name" type="text" maxlength="32"
+ placeholder="Token name" value="${esc(s.name)}" ${dis}
+ aria-label="Token name" aria-required="true" aria-invalid="${nameBad}" aria-describedby="lp-name-msg"
+ title="Shown on pump.fun. Up to 32 chars." />
+ ${countHtml('lp-name-count', s.name.length, 32)}
+ </div>
+ <div class="lp-field-msg" id="lp-name-msg" ${nameBad ? '' : 'hidden'}>Token name is required.</div>
+ <div class="lp-frow">
+ <input class="lp-isymbol" id="lp-sym" type="text" maxlength="80"
+ placeholder="SYMBOL" value="${esc(s.symbol)}" ${dis}
+ aria-label="Ticker symbol" aria-required="true" aria-invalid="${symBad}" aria-describedby="lp-sym-msg"
+ title="Ticker symbol (the $ in $CZ). Uppercased automatically; emoji and symbols allowed, up to 10." />
+ ${countHtml('lp-sym-count', [...s.symbol].length, 10)}
+ </div>
+ <div class="lp-field-msg" id="lp-sym-msg" ${symBad ? '' : 'hidden'}>Symbol is required.</div>
<div class="lp-img-hint">Click image to replace · drag &amp; drop</div>
${getPreviewViewer ? `<button type="button" class="lp-cap-btn" id="lp-capture" ${dis} title="Snapshot the current 3D preview and use it as the token image.">📸 Use 3D view</button>` : ''}
</div>
</div>
+ <div class="lp-img-err" id="lp-img-err" role="alert" ${s.imageError ? '' : 'hidden'}>${esc(s.imageError)}</div>
<div>
- <label for="lp-desc">Description</label>
+ <div class="lp-lrow">
+ <label for="lp-desc">Description</label>
+ ${countHtml('lp-desc-count', s.description.length, 500)}
+ </div>
<textarea id="lp-desc" rows="3" maxlength="500"
placeholder="What does this agent do?" ${dis}
+ aria-required="true" aria-invalid="${descBad}" aria-describedby="lp-desc-msg"
title="Short pitch (up to 500 chars). Shown on pump.fun and on your agent page.">${esc(s.description)}</textarea>
+ <div class="lp-field-msg" id="lp-desc-msg" ${descBad ? '' : 'hidden'}>Description is required.</div>
</div>
${coinTypeHtml}
${coinNoteHtml}
@@ -1761,7 +1799,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
<div>${buyField}</div>
<div>
<div class="lp-slider-head">
- <label title="Share of your agent's paid-endpoint revenue (in ${buybackUnit}) that automatically buys back and burns this token on-chain.">Buyback share</label>
+ <label for="lp-bps" title="Share of your agent's paid-endpoint revenue (in ${buybackUnit}) that automatically buys back and burns this token on-chain.">Buyback share</label>
<span class="lp-bps-val" id="lp-bps-val">${(s.buybackBps / 100).toFixed(1)}%</span>
</div>
<input type="range" class="lp-slider" id="lp-bps"
@@ -1775,8 +1813,9 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
})()}
${sourceToggleHtml}
${walletHtml}
- ${s.phase === 'error' ? `<div class="lp-err">${esc(s.errorMsg)}<div class="lp-err-sub">Adjust the details above and try again — nothing has been minted yet.</div></div>` : ''}
+ ${s.phase === 'error' ? `<div class="lp-err" role="alert"><b>Launch failed.</b> ${esc(s.errorMsg)}<div class="lp-err-sub">Nothing was minted. Fix the issue, then press the launch button to retry.</div></div>` : ''}
<button class="lp-launch${busy ? ' busy' : ''}" id="lp-go" data-action="${btnAction}"${btnTitle ? ` title="${esc(btnTitle)}"` : ''} ${btnDis ? 'disabled' : ''}>${btnText}</button>
+ ${busy ? launchStepsHtml() : ''}
${busy ? `<div class="lp-phase" role="status" aria-live="polite">${esc(s.phaseLabel)}</div>` : ''}
${s.phase === 'stamping' ? `<div class="lp-stamp-live" id="lp-stamp-live" role="status" aria-live="polite" aria-atomic="false"><span class="lp-spspin" aria-hidden="true"></span>Stamping the three.ws mark <strong>3ws</strong>…</div>` : ''}
</div>`;
@@ -1814,6 +1853,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
<div class="lp-ok-links">
<a class="lp-ext" href="${esc(PUMP_URL(mint))}" target="_blank" rel="noopener">pump.fun ↗</a>
<a class="lp-ext" href="https://solscan.io/token/${esc(mint)}" target="_blank" rel="noopener">Solscan ↗</a>
+ ${s.launchSig ? `<a class="lp-ext" href="${esc(SOLSCAN(s.launchSig))}" target="_blank" rel="noopener">Launch tx ↗</a>` : ''}
${agentId ? `<a class="lp-ext" href="/agents/${esc(agentId)}">Agent page ↗</a>` : ''}
</div>
<button class="lp-share" id="lp-share">📋 Copy launch announcement</button>
@@ -1831,8 +1871,8 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
copyBtn('#lp-copy-mint', mint);
copyBtn('#lp-share', shareText);
container.querySelector('#lp-again')?.addEventListener('click', () => {
- s.phase = 'idle'; s.mint = null; s.errorMsg = '';
- s.imageFile = null; s.imagePreviewUrl = null;
+ s.phase = 'idle'; s.mint = null; s.errorMsg = ''; s.launchSig = null;
+ s.imageFile = null; s.imagePreviewUrl = null; s.imageError = '';
s._metaUrl = null; s._metaKey = null;
s.existingMint = null; s.forceNew = false;
render();
@@ -1847,19 +1887,55 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
q('#lp-zone')?.addEventListener('drop', (e) => { e.preventDefault(); q('#lp-zone')?.classList.remove('dragover'); handleImageFile(e.dataTransfer?.files?.[0]); });
q('#lp-img')?.addEventListener('change', (e) => handleImageFile(e.target.files?.[0]));
+ const setCount = (sel, n, max) => {
+ const el = q(sel); if (!el) return;
+ el.textContent = `${n}/${max}`;
+ el.classList.toggle('warn', n >= max * 0.9);
+ };
+
+ // Inline "required" hints: appear once a field is visited and left empty,
+ // clear live as soon as the user types. DOM-patched, never a full render.
+ const wireRequired = (key, inputSel, msgSel, isEmpty) => {
+ const el = q(inputSel); if (!el) return;
+ const apply = () => {
+ const bad = s._touched[key] && isEmpty();
+ el.setAttribute('aria-invalid', String(bad));
+ const m = q(msgSel); if (m) m.hidden = !bad;
+ };
+ el.addEventListener('blur', () => { s._touched[key] = true; apply(); });
+ el.addEventListener('input', apply);
+ };
+
q('#lp-name')?.addEventListener('input', (e) => {
s.name = e.target.value;
+ setCount('#lp-name-count', s.name.length, 32);
if (!s._symbolEdited) {
s.symbol = toSymbol(s.name);
const se = q('#lp-sym'); if (se) se.value = s.symbol;
+ setCount('#lp-sym-count', [...s.symbol].length, 10);
}
});
q('#lp-sym')?.addEventListener('input', (e) => {
- // Permissive: allow any characters (emoji, lowercase, symbols), cap at 10 codepoints.
- const raw = [...e.target.value].slice(0, 10).join('');
+ // Tickers are conventionally uppercase: uppercase letters live, keep
+ // emoji and symbols as typed, cap at 10 codepoints. Restore the caret
+ // since assigning .value moves it to the end.
+ const caret = e.target.selectionStart;
+ const raw = [...e.target.value.toUpperCase()].slice(0, 10).join('');
e.target.value = raw; s.symbol = raw; s._symbolEdited = true;
+ if (caret != null) {
+ try { e.target.setSelectionRange(Math.min(caret, raw.length), Math.min(caret, raw.length)); }
+ catch { /* not applicable on this input type */ }
+ }
+ setCount('#lp-sym-count', [...raw].length, 10);
+ });
+ q('#lp-desc')?.addEventListener('input', (e) => {
+ s.description = e.target.value;
+ setCount('#lp-desc-count', s.description.length, 500);
});
- q('#lp-desc')?.addEventListener('input', (e) => { s.description = e.target.value; });
+
+ wireRequired('name', '#lp-name', '#lp-name-msg', () => !s.name.trim());
+ wireRequired('symbol', '#lp-sym', '#lp-sym-msg', () => s.symbol.length === 0);
+ wireRequired('description', '#lp-desc', '#lp-desc-msg', () => !s.description.trim());
q('#lp-buy')?.addEventListener('input', (e) => {
s.initialBuy = e.target.value;
@@ -1887,15 +1963,27 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView
q('#lp-link-wallet')?.addEventListener('click', () => linkConnectedWallet(false));
q('#lp-link-transfer')?.addEventListener('click', () => linkConnectedWallet(true));
- // Wallet-source toggle
- container.querySelectorAll('.lp-src button[data-src]').forEach((btn) => {
- btn.addEventListener('click', () => switchSource(btn.dataset.src));
- });
-
- // Coin-type selector
- container.querySelectorAll('.lp-coin button[data-coin]').forEach((btn) => {
- btn.addEventListener('click', () => switchCoinType(btn.dataset.coin));
- });
+ // Wallet-source toggle + coin-type selector: radiogroup semantics with
+ // arrow-key movement. Selecting re-renders the panel, so focus is put
+ // back on the freshly rendered button for the chosen value.
+ const wireRadioGroup = (groupSel, dataAttr, apply) => {
+ const btns = [...container.querySelectorAll(`${groupSel} button[data-${dataAttr}]`)];
+ const choose = (value) => {
+ apply(value);
+ container.querySelector(`${groupSel} button[data-${dataAttr}="${value}"]`)?.focus();
+ };
+ btns.forEach((btn, i) => {
+ btn.addEventListener('click', () => choose(btn.dataset[dataAttr]));
+ btn.addEventListener('keydown', (e) => {
+ let to = null;
+ if (e.key === 'ArrowRight' || e.key === 'ArrowDown') to = btns[(i + 1) % btns.length];
+ else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') to = btns[(i - 1 + btns.length) % btns.length];
+ if (to && !to.disabled) { e.preventDefault(); choose(to.dataset[dataAttr]); }
+ });
+ });
+ };
+ wireRadioGroup('.lp-src', 'src', switchSource);
+ wireRadioGroup('.lp-coin', 'coin', switchCoinType);
// Agent-wallet bar
q('#lp-agent-retry')?.addEventListener('click', () => loadAgentWallet());
diff --git a/public/style.css b/public/style.css
index a01bba52b..9b9b00c93 100644
--- a/public/style.css
+++ b/public/style.css
@@ -3360,6 +3360,175 @@ body.deploy-page {
}
}
+/* Error phase: the in-flight phase turns red when a deploy fails, so the user
+ * can see exactly which stage stopped. Cleared on retry. */
+.deploy-phase--error {
+ opacity: 1;
+}
+
+.deploy-phase--error .deploy-phase-dot {
+ background: rgba(248, 113, 113, 0.85);
+ border-color: rgba(248, 113, 113, 0.85);
+ box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
+ animation: none;
+}
+
+.deploy-phase--error .deploy-phase-label {
+ color: #fca5a5;
+}
+
+/* ── Deploy failure panel (message + working retry) ── */
+.deploy-error-panel {
+ margin-top: var(--space-md);
+ padding: var(--space-md);
+ background: rgba(127, 29, 29, 0.14);
+ border: 1px solid rgba(248, 113, 113, 0.32);
+ border-radius: var(--radius-md);
+}
+
+.deploy-error-panel-title {
+ margin-bottom: 4px;
+ font-size: var(--text-sm);
+ font-weight: 600;
+ color: #fca5a5;
+}
+
+.deploy-error-panel-msg {
+ margin: 0 0 var(--space-sm);
+ font-size: var(--text-sm);
+ line-height: 1.5;
+ color: rgba(252, 165, 165, 0.9);
+ word-break: break-word;
+}
+
+/* ── Step bar: completed steps are real buttons (keyboard + focus ring) ── */
+.deploy-step-btn,
+.deploy-step-static {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 8px;
+}
+
+.deploy-step-btn {
+ padding: 2px;
+ margin: 0;
+ background: none;
+ border: 0;
+ font: inherit;
+ color: inherit;
+ cursor: pointer;
+ border-radius: var(--radius-sm);
+}
+
+.deploy-step-btn:hover .erc8004-step-num {
+ border-color: rgba(74, 222, 128, 0.85);
+}
+
+.deploy-step-btn:focus-visible {
+ outline: 2px solid rgba(255, 255, 255, 0.6);
+ outline-offset: 3px;
+}
+
+/* Step headings receive focus programmatically on step change; the move is
+ * announced by AT, a visible ring on a heading is just noise. */
+.deploy-wizard .erc8004-h3[tabindex='-1']:focus,
+.erc8004-wizard-body .erc8004-h3[tabindex='-1']:focus {
+ outline: none;
+}
+
+/* ── Inline field validation + character counters ── */
+.erc8004-field-error {
+ margin: 4px 0 0;
+ font-size: var(--text-xs);
+ color: var(--danger);
+}
+
+.erc8004-input--invalid,
+.deploy-wizard .erc8004-input--invalid {
+ border-color: rgba(248, 113, 113, 0.6);
+}
+
+.erc8004-input--invalid:focus,
+.deploy-wizard .erc8004-input--invalid:focus {
+ border-color: rgba(248, 113, 113, 0.8);
+ box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
+}
+
+.erc8004-hint-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: baseline;
+ gap: var(--space-sm);
+}
+
+.erc8004-count {
+ flex-shrink: 0;
+ color: rgba(255, 255, 255, 0.35);
+ font-variant-numeric: tabular-nums;
+ transition: color 0.15s ease;
+}
+
+.erc8004-count--limit {
+ color: rgba(245, 158, 11, 0.9);
+}
+
+/* ── Services: designed empty state ── */
+.erc8004-svc-empty {
+ padding: var(--space-sm) var(--space-md);
+ border: 1px dashed rgba(255, 255, 255, 0.12);
+ border-radius: var(--radius-md);
+ color: rgba(255, 255, 255, 0.45);
+ font-size: var(--text-sm);
+ line-height: 1.5;
+}
+
+/* ── Deploy success entrance ── */
+.deploy-result--in {
+ animation: deploy-result-in 0.35s ease both;
+}
+
+.deploy-result:focus {
+ outline: none;
+}
+
+@keyframes deploy-result-in {
+ from {
+ opacity: 0;
+ transform: translateY(6px);
+ }
+ to {
+ opacity: 1;
+ transform: none;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .deploy-result--in {
+ animation: none;
+ }
+}
+
+/* ── Touch targets: 44px minimum on coarse pointers ── */
+@media (pointer: coarse) {
+ .deploy-qs-chip {
+ min-height: 44px;
+ padding: 10px 14px;
+ }
+ .deploy-wizard .erc8004-btn,
+ .erc8004-wizard-nav .erc8004-btn,
+ .deploy-wallet-btn,
+ .deploy-step-btn {
+ min-height: 44px;
+ }
+ .deploy-shell .erc8004-chain-select {
+ min-height: 44px;
+ }
+ .deploy-wizard .erc8004-input {
+ min-height: 44px;
+ }
+}
+
/* ── Deploy success result panel ── */
.deploy-result {
margin-top: var(--space-md);
diff --git a/src/editor/launchpad-studio.js b/src/editor/launchpad-studio.js
index 074661179..48a386aae 100644
--- a/src/editor/launchpad-studio.js
+++ b/src/editor/launchpad-studio.js
@@ -58,6 +58,10 @@ const DRAFT_KEY = 'launchpadStudio:draft';
const SECRETS_KEY = 'launchpadStudio:secrets'; // { [slug]: ownerSecret }
const RECENT_KEY = 'launchpadStudio:recent'; // [{slug, template, headline, updatedAt}, ...]
+// Single active beforeunload guard: remounting the studio (landing to studio
+// SPA navigation and back) must not stack stale listeners with dead closures.
+let activeBeforeUnload = null;
+
// Bundled starter avatars — real GLBs shipped in /public, so the gallery is
// never empty even before the public-avatars API responds. { src, name, thumb }.
const STARTER_AVATARS = [
@@ -364,6 +368,102 @@ const STYLE = `
.stage-frame.dark .hero-copy p { color: #cbd5e1; }
.stage-frame.dark .price-chip { color: #94a3b8; }
.stage-frame.dark footer { border-top-color: rgba(255,255,255,0.05); color: #64748b; }
+
+ /* Primary button: near-white gradient background needs dark text (was
+ inheriting the light foreground color and rendering white-on-white). */
+ .btn.primary, .btn.primary:hover { color: #0b0d10; }
+
+ /* Template cards are real buttons (keyboard operable) */
+ .template-card { width: calc(100% - 32px); text-align: left; font: inherit; color: inherit; }
+
+ /* Visible keyboard focus everywhere */
+ .btn:focus-visible, .template-card:focus-visible, .skill-remove:focus-visible,
+ .dropdown-item .di-open:focus-visible, .stage-frame .cta:focus-visible {
+ outline: 2px solid #f4f4f5; outline-offset: 2px;
+ }
+ .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
+ .share-url input:focus-visible, .skill-row input:focus-visible, .skill-row select:focus-visible {
+ border-color: #ffffff; box-shadow: 0 0 0 2px rgba(255,255,255,0.22);
+ }
+
+ /* Topbar save/publish state */
+ .topbar .save-state { font-size: 12px; color: #71717a; white-space: nowrap; }
+ .topbar .save-state.saved { color: #4ade80; }
+ .topbar .save-state.dirty { color: #fbbf24; }
+ .topbar .save-state.busy { color: #a1a1aa; }
+
+ /* Inline field validation */
+ .field input.invalid, .field textarea.invalid, .field select.invalid { border-color: #f87171; }
+ .field-error { color: #f87171; font-size: 11px; margin-top: 4px; line-height: 1.4; }
+
+ /* Notice banner (hydration 404, informational states) */
+ .studio-notice { width: 100%; max-width: 980px; margin-bottom: 14px; padding: 10px 14px;
+ border-radius: 10px; font-size: 13px; line-height: 1.5;
+ display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
+ .studio-notice.info { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3); color: #c7d2fe; }
+ .studio-notice.err { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; }
+
+ /* Hydration loading / error states */
+ .stage-loading { display: flex; flex-direction: column; align-items: center; justify-content: center;
+ gap: 12px; min-height: 50vh; padding: 24px; color: #a1a1aa; font-size: 14px; text-align: center; }
+ .stage-loading .spin { width: 30px; height: 30px; border-radius: 50%;
+ border: 3px solid #262b32; border-top-color: #f4f4f5; animation: lsp-spin 0.8s linear infinite; }
+ @keyframes lsp-spin { to { transform: rotate(360deg); } }
+ .stage-loading-title { font-size: 16px; font-weight: 600; color: #f4f4f5; }
+ .stage-loading-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
+ .stage { position: relative; }
+ .stage-veil { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center;
+ justify-content: center; background: rgba(11,13,16,0.78); }
+ .rail-skel { height: 36px; border-radius: 8px; margin-bottom: 10px;
+ background: linear-gradient(90deg, #181b21 25%, #20252c 50%, #181b21 75%);
+ background-size: 200% 100%; animation: lsp-shimmer 1.2s ease-in-out infinite; }
+
+ /* Publish success card: the live URL is the payoff, make it unmissable */
+ .publish-live { padding: 12px; border-radius: 10px;
+ background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); }
+ .publish-live-head { display: flex; align-items: center; gap: 7px;
+ font-size: 12px; font-weight: 600; color: #4ade80; margin-bottom: 8px; }
+ .publish-live-head .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
+ .publish-live .share-url { margin-top: 0; }
+ .publish-retry { margin-top: 8px; }
+
+ /* Recent-launchpads dropdown rows are buttons, not divs */
+ .dropdown-item { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
+ .dropdown-item .di-open { flex: 1; min-width: 0; text-align: left; background: transparent;
+ border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
+
+ /* Responsive: the fixed 3-pane grid degrades to a stacked, document-scrolled
+ layout on small screens (320px must work with zero horizontal scroll). */
+ @media (max-width: 1100px) {
+ .studio-root { grid-template-columns: 260px 1fr 340px; }
+ }
+ @media (max-width: 880px) {
+ .studio-root { position: static; display: block; min-height: 100vh; }
+ .topbar { position: sticky; top: 0; z-index: 40; height: auto; min-height: 56px;
+ padding: 10px 12px; flex-wrap: wrap; row-gap: 8px; }
+ .topbar .actions { flex-wrap: wrap; row-gap: 8px; }
+ .sidebar, .rail { border-right: 0; border-left: 0; border-bottom: 1px solid #1c2128; overflow: visible; }
+ .stage { padding: 20px 12px; border-bottom: 1px solid #1c2128; }
+ .stage-frame { min-height: 0; }
+ .stage-frame .hero { grid-template-columns: 1fr; padding: 28px 20px 20px; gap: 24px; }
+ .stage-frame .avatar-stage { min-height: 280px; }
+ .stage-frame header { padding: 16px 20px; }
+ .stage-frame .token-strip { padding: 14px 20px; }
+ .stage-frame .skills-row { padding: 12px 20px 20px; }
+ .stage-frame footer { padding: 14px 20px; }
+ }
+ @media (pointer: coarse) {
+ .btn { min-height: 44px; }
+ .field input, .field select { min-height: 44px; }
+ .skill-row { grid-template-columns: 1fr 84px 76px 44px; }
+ .skill-row .skill-remove { width: 44px; height: 44px; }
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .studio-root *, .studio-root, .stage-loading *, .rail-skel {
+ animation: none !important; transition: none !important;
+ }
+ }
`;
// ──────────────────────────────────────────────────────────────────────────
@@ -539,6 +639,7 @@ function extraCopyFor(state, tpl) {
// viewer.js with "Cannot read properties of null (reading 'reset')").
function buildStageSkeleton() {
return `
+ <div class="studio-notice" data-notice hidden role="status"></div>
<div class="stage-frame" data-stage-frame>
<header>
<div class="brand">
@@ -551,7 +652,7 @@ function buildStageSkeleton() {
<div class="hero-copy">
<h1 data-tagline></h1>
<p data-extra-copy></p>
- <button class="cta" type="button" data-preview-cta></button>
+ <button class="cta" type="button" data-preview-cta aria-label="Preview of your call-to-action button"></button>
<span class="price-chip" data-price-chip></span>
</div>
<div class="avatar-stage" data-avatar-mount></div>
@@ -724,6 +825,31 @@ export function mountLaunchpadStudio(root, options = {}) {
const state = mergeOptions(loadDraft() || defaultStateFor(options.template || 'token-launchpad'), options);
+ // Dirty tracking. "Dirty" means edits not yet published. Drafts auto-save to
+ // localStorage on every render, so a never-published draft survives leaving
+ // the page; edits to an already-published page are clobbered by the next
+ // ?slug= re-hydration, so only those get the beforeunload warning.
+ let dirty = false;
+ let publishing = false;
+ let publishError = null;
+ const markDirty = () => { dirty = true; updateSaveState(); };
+ function updateSaveState() {
+ const el = root.querySelector('[data-save-state]');
+ if (!el) return;
+ if (publishing) { el.textContent = 'Publishing…'; el.className = 'save-state busy'; return; }
+ if (dirty && state.isEditing) { el.textContent = 'Unpublished changes'; el.className = 'save-state dirty'; return; }
+ if (dirty) { el.textContent = 'Draft saved'; el.className = 'save-state saved'; return; }
+ el.textContent = '';
+ el.className = 'save-state';
+ }
+ if (activeBeforeUnload) window.removeEventListener('beforeunload', activeBeforeUnload);
+ activeBeforeUnload = (e) => {
+ if (!dirty || !state.isEditing) return;
+ e.preventDefault();
+ e.returnValue = '';
+ };
+ window.addEventListener('beforeunload', activeBeforeUnload);
+
root.innerHTML = `
<div class="studio-root">
<div class="topbar">
@@ -733,9 +859,10 @@ export function mountLaunchpadStudio(root, options = {}) {
<span class="pill" data-mode-pill>Template-driven</span>
</div>
<div class="actions">
+ <span class="save-state" data-save-state role="status" aria-live="polite"></span>
<a class="btn ghost" href="/launches" title="Public feed of every coin launched by a three.ws agent">See all launched coins →</a>
<a class="btn ghost" href="/embed" title="The original place-and-scale embed editor">Open classic editor</a>
- <button class="btn" data-action="open-recent">My launchpads ▾</button>
+ <button class="btn" data-action="open-recent" aria-haspopup="true" aria-expanded="false">My launchpads ▾</button>
<button class="btn" data-action="new-draft" title="Start a new draft (current draft cleared)">New</button>
<button class="btn primary" data-action="publish">Publish</button>
</div>
@@ -751,14 +878,14 @@ export function mountLaunchpadStudio(root, options = {}) {
</div>
`;
- // Templates list
+ // Templates list (real buttons: keyboard operable, aria-pressed reflects choice)
const tplWrap = $('[data-templates]', root);
tplWrap.innerHTML = TEMPLATES.map((t) => `
- <div class="template-card ${t.id === state.template ? 'active' : ''}" data-template-id="${t.id}">
+ <button type="button" class="template-card ${t.id === state.template ? 'active' : ''}" data-template-id="${t.id}" aria-pressed="${t.id === state.template}">
<div class="label">${esc(t.label)}</div>
<div class="tagline">${esc(t.tagline)}</div>
<div class="hint">${esc(t.hint)}</div>
- </div>
+ </button>
`).join('');
tplWrap.addEventListener('click', (e) => {
const card = e.target.closest('[data-template-id]');
@@ -769,6 +896,7 @@ export function mountLaunchpadStudio(root, options = {}) {
state.copy.tagline = tpl.defaultTagline;
state.copy.cta = tpl.defaultCta;
state.monetize = { kind: tpl.monetize.kind, price: tpl.monetize.defaultPrice, currency: tpl.monetize.currency, chain: tpl.monetize.chain };
+ markDirty();
render();
});
@@ -829,6 +957,7 @@ export function mountLaunchpadStudio(root, options = {}) {
<summary>Or enter a URL →</summary>
<div class="lsp-custom-body">
<input type="url" data-avatar-url spellcheck="false" placeholder="https://.../avatar.glb"
+ aria-label="Custom avatar model URL"
value="${isCustomUrl(state.avatar.src) ? esc(state.avatar.src) : ''}" />
<div class="lsp-hint">Direct link to a hosted .glb or .gltf model.</div>
</div>
@@ -892,6 +1021,7 @@ export function mountLaunchpadStudio(root, options = {}) {
const card = e.target.closest('[data-avatar-src]');
if (!card) return;
state.avatar = { src: card.dataset.avatarSrc, name: card.dataset.avatarName || 'Avatar' };
+ markDirty();
render();
});
pickerEl.addEventListener('input', (e) => {
@@ -899,6 +1029,7 @@ export function mountLaunchpadStudio(root, options = {}) {
if (!inp) return;
const url = inp.value.trim();
state.avatar = url ? { src: url, name: 'Custom URL' } : { src: DEFAULT_AVATAR_SRC, name: 'Default' };
+ markDirty();
render();
});
// Remember a manual expand so a gallery "Show more" rebuild doesn't collapse it.
@@ -918,6 +1049,13 @@ export function mountLaunchpadStudio(root, options = {}) {
// Topbar + global actions (delegated)
let recentDropdown = null;
+ let recentBtn = null;
+ root.addEventListener('keydown', (e) => {
+ if (e.key === 'Escape' && recentDropdown) {
+ closeRecent();
+ recentBtn?.focus();
+ }
+ });
root.addEventListener('click', async (e) => {
const action = e.target.closest('[data-action]')?.dataset.action;
if (!action) {
@@ -928,8 +1066,29 @@ export function mountLaunchpadStudio(root, options = {}) {
if (!confirm('Discard current draft and start fresh?')) return;
localStorage.removeItem(DRAFT_KEY);
Object.assign(state, defaultStateFor(state.template));
+ dirty = false;
+ publishError = null;
history.replaceState(null, '', '/launchpad');
- render();
+ render({ force: true });
+ return;
+ }
+ if (action === 'retry-hydrate') {
+ const slug = e.target.closest('[data-slug]')?.dataset.slug;
+ if (slug) hydrateFromSlug(slug);
+ return;
+ }
+ if (action === 'hydrate-fresh') {
+ const slug = e.target.closest('[data-slug]')?.dataset.slug || '';
+ Object.assign(state, defaultStateFor(state.template));
+ state.identity.slug = slug;
+ dirty = false;
+ publishError = null;
+ render({ force: true });
+ return;
+ }
+ if (action === 'dismiss-notice') {
+ const n = root.querySelector('[data-notice]');
+ if (n) n.hidden = true;
return;
}
if (action === 'open-recent') {
@@ -953,7 +1112,20 @@ export function mountLaunchpadStudio(root, options = {}) {
}
if (action === 'publish') {
const btn = e.target.closest('[data-action="publish"]');
+ // Inline validation before the network round-trip: mark the offending
+ // fields, focus the first one, and surface the reason in the publish panel.
+ const errors = validateForPublish(state);
+ if (errors.length) {
+ publishError = errors[0].message;
+ const pub = root.querySelector('[data-publish-block]');
+ if (pub) pub.innerHTML = publishStatusHTML(state, publishError);
+ applyFieldErrors(root, errors);
+ return;
+ }
+ publishing = true;
+ updateSaveState();
btn.disabled = true;
+ btn.setAttribute('aria-busy', 'true');
const orig = btn.textContent;
btn.textContent = 'Publishing…';
try {
@@ -963,19 +1135,35 @@ export function mountLaunchpadStudio(root, options = {}) {
url: result.url || `${AGENT_3D_HOST}/p/${result.slug}`,
publishedAt: result.publishedAt,
};
+ publishError = null;
+ dirty = false;
state.isEditing = true;
history.replaceState(null, '', `/launchpad?slug=${encodeURIComponent(result.slug)}`);
} catch (err) {
- state.published = { error: err.message || String(err) };
+ publishError = err.message || String(err);
} finally {
+ publishing = false;
btn.disabled = false;
+ btn.removeAttribute('aria-busy');
btn.textContent = orig;
render();
+ const pub = root.querySelector('[data-publish-block]');
+ if (!publishError) {
+ // Success: put the live URL front and center. Scroll it into
+ // view and pre-select it for an instant copy.
+ const share = pub?.querySelector('.share-url input');
+ share?.closest('.panel')?.scrollIntoView({ block: 'nearest' });
+ share?.focus();
+ share?.select();
+ } else {
+ pub?.scrollIntoView({ block: 'nearest' });
+ }
}
return;
}
if (action === 'add-skill') {
state.agentSkills.push({ name: '', price: 0.001, currency: 'USDC', chain: 'solana', description: '' });
+ markDirty();
render();
return;
}
@@ -983,6 +1171,7 @@ export function mountLaunchpadStudio(root, options = {}) {
const idx = Number(e.target.closest('[data-skill-idx]')?.dataset.skillIdx);
if (Number.isFinite(idx)) {
state.agentSkills.splice(idx, 1);
+ markDirty();
render();
}
return;
@@ -1014,6 +1203,8 @@ export function mountLaunchpadStudio(root, options = {}) {
// "My launchpads" dropdown
function toggleRecent(button) {
if (recentDropdown) { closeRecent(); return; }
+ recentBtn = button;
+ button.setAttribute('aria-expanded', 'true');
recentDropdown = document.createElement('div');
recentDropdown.className = 'dropdown';
button.parentElement.appendChild(recentDropdown);
@@ -1022,6 +1213,7 @@ export function mountLaunchpadStudio(root, options = {}) {
function closeRecent() {
if (recentDropdown?.parentElement) recentDropdown.parentElement.removeChild(recentDropdown);
recentDropdown = null;
+ recentBtn?.setAttribute('aria-expanded', 'false');
}
function renderRecentDropdown() {
if (!recentDropdown) return;
@@ -1031,36 +1223,107 @@ export function mountLaunchpadStudio(root, options = {}) {
return;
}
recentDropdown.innerHTML = list.map((e) => `
- <div class="dropdown-item" data-action="load-recent" data-slug="${esc(e.slug)}" style="display:flex;align-items:flex-start;gap:8px;justify-content:space-between">
- <div style="min-width:0;flex:1">
+ <div class="dropdown-item">
+ <button type="button" class="di-open" data-action="load-recent" data-slug="${esc(e.slug)}">
<div class="di-title">${esc(e.headline || e.slug)}</div>
<div class="di-meta">/${esc(e.slug)} · ${esc(e.template)} · updated ${esc(new Date(e.updatedAt).toLocaleString())}</div>
- </div>
- <button class="btn tiny ghost" data-action="forget-recent" data-slug="${esc(e.slug)}" title="Remove from this list (does not unpublish)">×</button>
+ </button>
+ <button type="button" class="btn tiny ghost" data-action="forget-recent" data-slug="${esc(e.slug)}" title="Remove from this list (does not unpublish)" aria-label="Remove ${esc(e.slug)} from this list">×</button>
</div>
`).join('');
}
+ // Hydration loading state, shown while /api/launchpad/get resolves so a
+ // ?slug= visit never opens on a blank stage or a flash of default content.
+ // When the studio is already on screen (loading a recent launchpad) the
+ // stage keeps its DOM and gets a veil instead: wiping it would disconnect
+ // the live <agent-3d> element mid-load and can crash the viewer.
+ function hydrateStatusHTML(inner, role) {
+ return `
+ <div class="stage-loading" role="${role}"${role === 'status' ? ' aria-live="polite"' : ''}>
+ ${inner}
+ </div>`;
+ }
+ function renderHydrating(slug) {
+ const stage = $('[data-stage]', root);
+ const inner = `
+ <div class="spin" aria-hidden="true"></div>
+ <div>Loading /p/${esc(slug)}…</div>`;
+ if (stageMounted) {
+ ensureStageVeil(stage).innerHTML = hydrateStatusHTML(inner, 'status');
+ } else {
+ stage.innerHTML = hydrateStatusHTML(inner, 'status');
+ }
+ $('[data-rail]', root).innerHTML = `
+ <div class="panel" aria-hidden="true">${'<div class="rail-skel"></div>'.repeat(6)}</div>`;
+ lastTemplate = null; // rail was wiped, force a rebuild on the next render
+ const pill = root.querySelector('[data-mode-pill]');
+ pill.textContent = 'Loading…';
+ pill.classList.remove('editing');
+ }
+
+ // Hydration failure: say what happened and offer a way forward instead of
+ // silently dropping the visitor into an unrelated blank draft.
+ function renderHydrateError(slug, err) {
+ const stage = $('[data-stage]', root);
+ const inner = `
+ <div class="stage-loading-title">Couldn't load /p/${esc(slug)}</div>
+ <div>${esc(err.message || 'Network error while fetching the saved page.')}</div>
+ <div class="stage-loading-actions">
+ <button type="button" class="btn primary" data-action="retry-hydrate" data-slug="${esc(slug)}">Retry</button>
+ <button type="button" class="btn" data-action="hydrate-fresh" data-slug="${esc(slug)}">Start a fresh draft</button>
+ </div>`;
+ if (stageMounted) {
+ ensureStageVeil(stage).innerHTML = hydrateStatusHTML(inner, 'alert');
+ } else {
+ stage.innerHTML = hydrateStatusHTML(inner, 'alert');
+ }
+ }
+
+ function ensureStageVeil(stage) {
+ let veil = stage.querySelector('[data-hydrate-veil]');
+ if (!veil) {
+ veil = document.createElement('div');
+ veil.className = 'stage-veil';
+ veil.setAttribute('data-hydrate-veil', '');
+ stage.appendChild(veil);
+ }
+ return veil;
+ }
+
+ function showNotice(kind, html) {
+ const n = root.querySelector('[data-notice]');
+ if (!n) return;
+ n.className = `studio-notice ${kind}`;
+ n.innerHTML = `
+ <div class="notice-body">${html}</div>
+ <button type="button" class="btn tiny ghost" data-action="dismiss-notice" aria-label="Dismiss notice">×</button>`;
+ n.hidden = false;
+ }
+
// Edit-mode hydration: ?slug=foo or options.slug
async function hydrateFromSlug(slug) {
+ renderHydrating(slug);
try {
const payload = await fetchLaunchpad(slug);
if (!payload) {
// No row yet — pre-fill the slug into a fresh draft so the user
- // can publish a new page at that URL.
+ // can publish a new page at that URL, and say so.
state.identity.slug = slug;
state.isEditing = false;
- render();
+ dirty = false;
+ render({ force: true });
+ showNotice('info', `Nothing is published at <strong>/p/${esc(slug)}</strong> yet. Fill in the page and hit Publish to claim that URL.`);
return;
}
Object.assign(state, stateFromPayload(payload));
+ dirty = false;
+ publishError = null;
history.replaceState(null, '', `/launchpad?slug=${encodeURIComponent(slug)}`);
- render();
+ render({ force: true });
} catch (err) {
log.warn('[launchpad-studio] hydrate failed:', err.message);
- // Network failure shouldn't blow up the editor — start clean.
- state.identity.slug = slug;
- render();
+ renderHydrateError(slug, err);
}
}
@@ -1096,6 +1359,7 @@ export function mountLaunchpadStudio(root, options = {}) {
let stageMounted = false;
function renderStage() {
const stage = $('[data-stage]', root);
+ stage.querySelector('[data-hydrate-veil]')?.remove();
if (!stageMounted) {
stage.innerHTML = buildStageSkeleton();
stage.querySelector('[data-avatar-mount]').appendChild(ensureAvatarEl());
@@ -1118,15 +1382,15 @@ export function mountLaunchpadStudio(root, options = {}) {
skillCount !== lastSkillCount ||
state.isEditing !== lastEditing;
if (needsRebuild) {
- $('[data-rail]', root).innerHTML = buildRailHTML(state);
- bindRailInputs(root, state, render);
+ $('[data-rail]', root).innerHTML = buildRailHTML(state, publishError);
+ bindRailInputs(root, state, render, markDirty);
lastTemplate = state.template;
lastSkillCount = skillCount;
lastEditing = state.isEditing;
} else {
// Lightweight refresh: only the publish-status block + share URL.
const pub = root.querySelector('[data-publish-block]');
- if (pub) pub.innerHTML = publishStatusHTML(state);
+ if (pub) pub.innerHTML = publishStatusHTML(state, publishError);
}
}
@@ -1135,9 +1399,12 @@ export function mountLaunchpadStudio(root, options = {}) {
pill.textContent = state.isEditing ? 'Editing' : 'New draft';
pill.classList.toggle('editing', !!state.isEditing);
root.querySelectorAll('[data-template-id]').forEach((el) => {
- el.classList.toggle('active', el.dataset.templateId === state.template);
+ const active = el.dataset.templateId === state.template;
+ el.classList.toggle('active', active);
+ el.setAttribute('aria-pressed', String(active));
});
syncPickerSelection();
+ updateSaveState();
}
function render({ force = false } = {}) {
@@ -1147,9 +1414,11 @@ export function mountLaunchpadStudio(root, options = {}) {
syncTopbar();
}
- // Initial render
+ // Initial render. hydrateFromSlug owns its own loading / error / success
+ // rendering; a trailing render() here would paint default state over the
+ // hydration-failure screen.
if (options.slug) {
- hydrateFromSlug(slugify(options.slug)).finally(render);
+ hydrateFromSlug(slugify(options.slug));
} else {
render();
}
@@ -1164,7 +1433,7 @@ export function mountLaunchpadStudio(root, options = {}) {
// ──────────────────────────────────────────────────────────────────────────
// Right-rail (form panels per template + publish + snippets)
// ──────────────────────────────────────────────────────────────────────────
-function buildRailHTML(state) {
+function buildRailHTML(state, publishError = null) {
const tpl = TEMPLATES.find((t) => t.id === state.template) || TEMPLATES[0];
const identityPanel = `
@@ -1252,14 +1521,14 @@ function buildRailHTML(state) {
? `<div class="help" style="color:#71717a;font-size:11px">No paid skills configured. Add one to charge visitors per call via x402 — each skill becomes its own pricing pill on your /p/ page.</div>`
: state.agentSkills.map((s, i) => `
<div class="skill-row" data-skill-idx="${i}">
- <input type="text" data-bind="agentSkills.${i}.name" value="${esc(s.name)}" placeholder="skill name" />
- <input type="number" step="0.001" data-bind="agentSkills.${i}.price" value="${s.price}" />
- <select data-bind="agentSkills.${i}.currency">
+ <input type="text" data-bind="agentSkills.${i}.name" value="${esc(s.name)}" placeholder="skill name" aria-label="Skill ${i + 1} name" />
+ <input type="number" step="0.001" data-bind="agentSkills.${i}.price" value="${s.price}" aria-label="Skill ${i + 1} price" />
+ <select data-bind="agentSkills.${i}.currency" aria-label="Skill ${i + 1} currency">
<option value="USDC" ${s.currency === 'USDC' ? 'selected' : ''}>USDC</option>
<option value="SOL" ${s.currency === 'SOL' ? 'selected' : ''}>SOL</option>
<option value="ETH" ${s.currency === 'ETH' ? 'selected' : ''}>ETH</option>
</select>
- <button type="button" class="skill-remove" data-action="remove-skill" data-skill-idx="${i}" title="Remove">×</button>
+ <button type="button" class="skill-remove" data-action="remove-skill" data-skill-idx="${i}" title="Remove" aria-label="Remove skill ${i + 1}">×</button>
</div>
`).join('')}
</div>
@@ -1268,7 +1537,7 @@ function buildRailHTML(state) {
const publishPanel = `
<div class="panel">
<h4>Publish</h4>
- <div data-publish-block>${publishStatusHTML(state)}</div>
+ <div data-publish-block aria-live="polite">${publishStatusHTML(state, publishError)}</div>
</div>
`;
const snippetsPanel = `
@@ -1291,37 +1560,108 @@ function buildRailHTML(state) {
return identityPanel + socialsPanel + copyPanel + templatePanel + skillsPanel + publishPanel + snippetsPanel;
}
-function publishStatusHTML(state) {
- if (!state.published) {
- return `<div class="publish-status">Set a slug + payout wallet, then hit Publish to mint your hosted page at ${AGENT_3D_HOST}/p/&lt;slug&gt;.</div>`;
+function publishStatusHTML(state, publishError = null) {
+ // A publish failure must not erase the last-known live URL, so the error
+ // travels separately from state.published (state.published.error is only
+ // read here for drafts persisted by older builds).
+ const error = publishError || state.published?.error || null;
+ const live = state.published && !state.published.error ? state.published : null;
+ let html = '';
+ if (error) {
+ html += `
+ <div class="publish-status err" role="alert">${esc(error)}</div>
+ <div class="publish-retry"><button type="button" class="btn" data-action="publish">Retry publish</button></div>
+ `;
}
- if (state.published.error) {
- return `<div class="publish-status err">${esc(state.published.error)}</div>`;
+ if (live) {
+ const url = live.url || `${AGENT_3D_HOST}/p/${live.slug}`;
+ html += `
+ <div class="publish-live">
+ <div class="publish-live-head"><span class="live-dot" aria-hidden="true"></span>${state.isEditing ? 'Live · updated' : 'Live'}</div>
+ <div class="share-url">
+ <input type="text" readonly value="${esc(url)}" aria-label="Live page URL" />
+ <button type="button" class="btn" data-action="copy-share">Copy</button>
+ <a class="btn" href="${esc(url)}" target="_blank" rel="noopener">Open</a>
+ </div>
+ </div>
+ `;
+ } else if (!error) {
+ html = `<div class="publish-status">Set a slug + payout wallet, then hit Publish to mint your hosted page at ${AGENT_3D_HOST}/p/&lt;slug&gt;.</div>`;
}
- const url = state.published.url || `${AGENT_3D_HOST}/p/${state.published.slug}`;
- return `
- <div class="publish-status ok">${state.isEditing ? 'Updated · ' : 'Live at '}${esc(url)}</div>
- <div class="share-url">
- <input type="text" readonly value="${esc(url)}" />
- <button class="btn" data-action="copy-share">Copy</button>
- </div>
- `;
+ return html;
}
+// Pre-publish validation. Returns [{ bind, message }] keyed by data-bind path.
+const SOL_ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+const EVM_ADDR_RE = /^0x[a-fA-F0-9]{40}$/;
+function validateForPublish(state) {
+ const errors = [];
+ if (!slugify(state.identity.slug)) {
+ errors.push({ bind: 'identity.slug', message: 'Choose a URL slug. It becomes your page address.' });
+ }
+ const wallet = String(state.identity.wallet || '').trim();
+ if (!wallet) {
+ errors.push({ bind: 'identity.wallet', message: 'Add your payout wallet address.' });
+ } else if (state.monetize.chain === 'solana' && !SOL_ADDR_RE.test(wallet)) {
+ errors.push({ bind: 'identity.wallet', message: 'That does not look like a Solana address (base58, 32 to 44 characters).' });
+ } else if (state.monetize.chain === 'base' && !EVM_ADDR_RE.test(wallet)) {
+ errors.push({ bind: 'identity.wallet', message: 'That does not look like an EVM address (0x followed by 40 hex characters).' });
+ }
+ return errors;
+}
+
+// Mark invalid fields inline and move focus to the first one.
+function applyFieldErrors(root, errors) {
+ root.querySelectorAll('.field-error').forEach((n) => n.remove());
+ root.querySelectorAll('[data-bind].invalid').forEach((n) => {
+ n.classList.remove('invalid');
+ n.removeAttribute('aria-invalid');
+ });
+ let first = null;
+ for (const { bind, message } of errors) {
+ const input = root.querySelector(`[data-bind="${bind}"]:not([type=color])`);
+ if (!input) continue;
+ input.classList.add('invalid');
+ input.setAttribute('aria-invalid', 'true');
+ const holder = input.closest('.field') || input.parentElement;
+ const msg = document.createElement('div');
+ msg.className = 'field-error';
+ msg.textContent = message;
+ holder.appendChild(msg);
+ if (!first) first = input;
+ }
+ if (first) {
+ first.scrollIntoView({ block: 'center' });
+ first.focus({ preventScroll: true });
+ }
+}
+
+// Each field gets a generated id wired to its <label> so screen readers and
+// label-clicks work. The id is injected into the first form control in the
+// markup string (color pickers have two inputs; the swatch gets the label).
+let fieldSeq = 0;
function field(label, input, help) {
+ const id = `lsf-${++fieldSeq}`;
+ const wired = input.replace(/<(input|select|textarea)(?![^>]*\bid=)/, `<$1 id="${id}"`);
return `
<div class="field">
- <label>${esc(label)}</label>
- ${input}
+ <label for="${id}">${esc(label)}</label>
+ ${wired}
${help ? `<div class="help">${esc(help)}</div>` : ''}
</div>
`;
}
-function bindRailInputs(root, state, render) {
+function bindRailInputs(root, state, render, markDirty) {
root.querySelectorAll('[data-bind]').forEach((el) => {
const path = el.dataset.bind.split('.');
el.addEventListener('input', () => {
+ // Typing clears this field's inline validation error immediately.
+ if (el.classList.contains('invalid')) {
+ el.classList.remove('invalid');
+ el.removeAttribute('aria-invalid');
+ el.closest('.field')?.querySelector('.field-error')?.remove();
+ }
let cur = state;
for (let i = 0; i < path.length - 1; i++) {
const key = path[i];
@@ -1335,9 +1675,16 @@ function bindRailInputs(root, state, render) {
cur = cur[key];
}
}
- let value = el.type === 'number' ? Number(el.value) : el.value;
+ let value = el.value;
+ if (el.type === 'number') {
+ // An emptied or mid-edit number field must not persist NaN; it
+ // would render as the literal string "NaN" on the next rebuild.
+ const n = Number(el.value);
+ value = el.value === '' || Number.isNaN(n) ? '' : n;
+ }
if (path[path.length - 1] === 'slug') value = slugify(value);
cur[path[path.length - 1]] = value;
+ markDirty();
// Brand color: keep both inputs in sync, hot-update preview without re-render.
if (el.dataset.bind === 'identity.brand') {
root.querySelectorAll('[data-bind="identity.brand"]').forEach((peer) => {
diff --git a/src/erc8004/deploy-button.css b/src/erc8004/deploy-button.css
index 01f6bdc98..e847c1941 100644
--- a/src/erc8004/deploy-button.css
+++ b/src/erc8004/deploy-button.css
@@ -109,6 +109,15 @@
color: #fff;
}
+.deploy-btn:active:not(:disabled) {
+ background: rgba(255, 255, 255, 0.12);
+}
+
+.deploy-btn:focus-visible {
+ outline: 2px solid rgba(255, 255, 255, 0.5);
+ outline-offset: 2px;
+}
+
.deploy-btn--disabled,
.deploy-btn:disabled {
opacity: 0.45;
@@ -142,6 +151,11 @@
opacity: 0.82;
}
+.deploy-chip:focus-visible {
+ outline: 2px solid rgba(74, 222, 128, 0.6);
+ outline-offset: 2px;
+}
+
/* ── Progress bar ────────────────────────────────────────────────────────── */
.deploy-progress {
@@ -235,6 +249,12 @@
color: #fecaca;
}
+.deploy-action-btn:focus-visible,
+.deploy-vanity-link:focus-visible {
+ outline: 2px solid rgba(252, 165, 165, 0.7);
+ outline-offset: 2px;
+}
+
/* ── Tooltip ─────────────────────────────────────────────────────────────── */
.deploy-tooltip {
@@ -244,6 +264,17 @@
font-style: italic;
}
+/* ── Touch targets: 44px minimum on coarse pointers ─────────────────────── */
+
+@media (pointer: coarse) {
+ .deploy-btn,
+ .deploy-chain-select,
+ .deploy-chip,
+ .deploy-action-btn {
+ min-height: 44px;
+ }
+}
+
/* No light-mode block: three.ws is a dark-only product (no prefers-color-scheme
switch anywhere in theme.css / style.css). This control must stay dark to match
the page it lives in, regardless of the visitor's OS theme. */
diff --git a/src/erc8004/deploy-button.js b/src/erc8004/deploy-button.js
index 35de02c5a..3c8b8fd44 100644
--- a/src/erc8004/deploy-button.js
+++ b/src/erc8004/deploy-button.js
@@ -151,7 +151,7 @@ export class DeployButton {
this._root.innerHTML = `
<div class="deploy-chain-row">
<select class="deploy-chain-select" title="Choose chain to deploy to" aria-label="Target chain">
- <optgroup label="Solana">${solanaOptionFor(SOLANA_MAINNET)}${solanaOptionFor(SOLANA_DEVNET)}</optgroup>
+ <optgroup label="Solana (recommended)">${solanaOptionFor(SOLANA_MAINNET)}${solanaOptionFor(SOLANA_DEVNET)}</optgroup>
<optgroup label="EVM Mainnets">${evmOptionsFor(mainnets)}</optgroup>
<optgroup label="EVM Testnets">${evmOptionsFor(testnets)}</optgroup>
</select>
@@ -275,6 +275,14 @@ export class DeployButton {
.db-cancel{margin-top:14px;font-size:12.5px;font-weight:600;background:transparent;border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:8px 16px;cursor:pointer;color:#9ca3af;transition:border-color .15s,color .15s,background .15s}
.db-cancel:hover{border-color:rgba(248,113,113,.6);color:#fca5a5;background:rgba(248,113,113,.08)}
.db-cancel:focus-visible{outline:2px solid rgba(165,180,252,.8);outline-offset:2px}
+ .db-spinner{animation:db-spin .85s linear infinite}
+ .db-detail--busy{animation:db-blink 1.6s ease-in-out infinite}
+ @media (prefers-reduced-motion: reduce){
+ .db-step--active{animation:none}
+ .db-connector--flow{animation:none;background:rgba(99,102,241,.7)}
+ .db-status{animation:none}
+ .db-detail--busy{animation:none}
+ }
`;
document.head.appendChild(style);
}
@@ -289,7 +297,7 @@ export class DeployButton {
const icon = done
? `<span style="font-size:16px;line-height:1;width:18px;text-align:center;flex-shrink:0">✓</span>`
: active
- ? `<svg width="18" height="18" viewBox="0 0 18 18" style="animation:db-spin .85s linear infinite;flex-shrink:0"><circle cx="9" cy="9" r="7" fill="none" stroke="rgba(165,180,252,.22)" stroke-width="2"/><path d="M9 2A7 7 0 0 1 16 9" fill="none" stroke="#c7d2fe" stroke-width="2" stroke-linecap="round"/></svg>`
+ ? `<svg width="18" height="18" viewBox="0 0 18 18" class="db-spinner" style="flex-shrink:0" aria-hidden="true"><circle cx="9" cy="9" r="7" fill="none" stroke="rgba(165,180,252,.22)" stroke-width="2"/><path d="M9 2A7 7 0 0 1 16 9" fill="none" stroke="#c7d2fe" stroke-width="2" stroke-linecap="round"/></svg>`
: `<span style="width:18px;height:18px;flex-shrink:0;display:inline-block;border-radius:50%;border:1.5px solid rgba(255,255,255,.1)"></span>`;
const tile = `<div class="db-step ${cls}">${icon}<span>${_esc(s)}</span></div>`;
if (i === steps.length - 1) return tile;
@@ -309,8 +317,8 @@ export class DeployButton {
${rows}
</div>
<div class="db-status ${isDone ? 'db-status--done' : ''}">${_esc(liveText)}</div>
- <div class="deploy-progress-detail" aria-live="polite"
- style="margin-top:7px;font-size:11.5px;color:#6b7280;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;min-height:1.2em;letter-spacing:.01em${extra?.text ? ';animation:db-blink 1.6s ease-in-out infinite' : ''}">
+ <div class="deploy-progress-detail${extra?.text ? ' db-detail--busy' : ''}" aria-live="polite"
+ style="margin-top:7px;font-size:11.5px;color:#6b7280;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;min-height:1.2em;letter-spacing:.01em">
${extra?.text ? _esc(extra.text) : ''}
</div>
${extra?.cancelable ? `<button class="db-cancel deploy-cancel-btn" type="button">⊘ Stop grinding</button>` : ''}
@@ -327,7 +335,7 @@ export class DeployButton {
: '<button class="deploy-action-btn deploy-action-btn--reset">Try again</button>';
this._root.innerHTML = `
<div class="deploy-error" role="alert">
- <span class="deploy-error-msg">${_esc(msg)}</span>
+ <span class="deploy-error-msg" title="${_esc(msg)}">${_esc(msg)}</span>
${actionHtml}
</div>
`;
diff --git a/src/erc8004/register-ui.js b/src/erc8004/register-ui.js
index 8830672bb..f548e796f 100644
--- a/src/erc8004/register-ui.js
+++ b/src/erc8004/register-ui.js
@@ -600,25 +600,55 @@ export class RegisterUI {
// -----------------------------------------------------------------------
async _connectWallet() {
+ // Connect-in-progress affordance: the button reports what's happening
+ // and can't be double-clicked while the wallet popup is open.
+ const walletBtn = this.el.querySelector('.erc8004-btn--wallet');
+ const setBusy = (on) => {
+ if (!walletBtn) return;
+ walletBtn.disabled = on;
+ if (on) walletBtn.textContent = 'Connecting…';
+ };
// On Solana, route to Phantom instead of MetaMask.
if (_isSolana(this.selectedChainId)) {
try {
const provider = detectSolanaWallet();
if (!provider) {
+ this._toast(
+ 'No Solana wallet found. Install Phantom, then reload this page and reconnect.',
+ true,
+ );
window.open('https://phantom.app/', '_blank', 'noopener');
return;
}
+ setBusy(true);
const res = await provider.connect();
const pk = res?.publicKey?.toBase58?.() || provider.publicKey?.toBase58?.();
if (pk) this._toast('Connected ' + shortAddr(pk));
- this._refreshWalletButton();
this._renderActiveTab();
} catch (err) {
- this._toast('Phantom: ' + (err?.message || String(err)), true);
+ const msg = err?.message || String(err);
+ this._toast(
+ /locked/i.test(msg)
+ ? 'Your Solana wallet is locked. Unlock it in the extension, then reconnect.'
+ : 'Phantom: ' + msg,
+ true,
+ );
+ } finally {
+ setBusy(false);
+ this._refreshWalletButton();
}
return;
}
+ if (!window.ethereum) {
+ this._toast(
+ 'No EVM wallet found. Install MetaMask, then reload this page and reconnect.',
+ true,
+ );
+ window.open('https://metamask.io/download/', '_blank', 'noopener');
+ return;
+ }
try {
+ setBusy(true);
const { address, chainId } = await connectWallet();
this.wallet = { address, chainId: Number(chainId) };
@@ -633,11 +663,13 @@ export class RegisterUI {
if (sel) sel.value = String(this.selectedChainId);
}
- this._refreshWalletButton();
this._renderActiveTab();
this._refreshMainnetBanner();
} catch (err) {
this._toast('Wallet: ' + err.message, true);
+ } finally {
+ setBusy(false);
+ this._refreshWalletButton();
}
}
@@ -720,7 +752,7 @@ export class RegisterUI {
const mainnets = ids.filter((id) => !CHAIN_META[id].testnet);
const testnets = ids.filter((id) => CHAIN_META[id].testnet);
const groupS = document.createElement('optgroup');
- groupS.label = 'Solana';
+ groupS.label = 'Solana (recommended)';
for (const id of [SOLANA_MAINNET, SOLANA_DEVNET]) {
const opt = document.createElement('option');
opt.value = id;
@@ -949,7 +981,24 @@ export class RegisterUI {
</div>
`;
this._lastPreviewThumbKey = thumbKey;
- if (thumb.kind === 'glb') this._ensureModelViewer();
+ if (thumb.kind === 'glb') {
+ this._ensureModelViewer();
+ // Some GLBs (meshopt-compressed) exceed what the CDN model-viewer
+ // build can decode. Swap a failed 3D preview for a designed
+ // placeholder instead of leaving a silently empty viewer.
+ const mv = rail.querySelector('.deploy-preview-mv');
+ mv?.addEventListener(
+ 'error',
+ () => {
+ const holder = rail.querySelector('[data-role="thumb"]');
+ if (holder) {
+ holder.innerHTML =
+ '<div class="deploy-preview-ph">3D preview unavailable for this file. Your model still deploys unchanged.</div>';
+ }
+ },
+ { once: true },
+ );
+ }
} else {
const info = rail.querySelector('[data-role="info"]');
if (info) info.innerHTML = infoHtml;
@@ -1509,7 +1558,7 @@ export class RegisterUI {
<div class="erc8004-avatar-panel" data-role="panel"></div>
<label class="erc8004-label">IPFS Pinning Token (optional)
- <input class="erc8004-input" type="password" name="apiToken" autocomplete="off" placeholder="Pinata JWT — leave blank to use built-in R2 storage" value="${esc(this.form.apiToken)}" />
+ <input class="erc8004-input" type="password" name="apiToken" autocomplete="off" placeholder="Pinata JWT (leave blank to use built-in R2 storage)" value="${esc(this.form.apiToken)}" />
</label>
<p class="erc8004-hint">Without a token, uploads go through our backend (R2). Paste a Pinata JWT to pin directly to IPFS.</p>
@@ -1709,7 +1758,7 @@ export class RegisterUI {
<p class="erc8004-p erc8004-muted">Mints your agent from a brand-new wallet holding <b>0 tBNB</b> — sponsored by MegaFuel's paymaster, no faucet, no funding, no wallet connection needed.</p>
</div>
</div>
- <div class="erc8004-log" data-role="gasless-log"></div>
+ <div class="erc8004-log" data-role="gasless-log" role="log" aria-live="polite"></div>
<div class="erc8004-result deploy-result" data-role="gasless-result" style="display:none"></div>
<button type="button" class="erc8004-btn btn btn--secondary" data-role="gasless-deploy">⚡ Register gasless (0 tBNB wallet)</button>
</div>
@@ -1985,31 +2034,41 @@ export class RegisterUI {
</div>
</div>
- <div class="erc8004-log" data-role="log"></div>
+ <div class="erc8004-log" data-role="log" role="log" aria-live="polite" aria-label="Deploy log"></div>
- <div class="erc8004-result deploy-result" data-role="result" style="display:none">
+ <div class="deploy-error-panel" data-role="deploy-error" role="alert" hidden>
+ <div class="deploy-error-panel-title">Mint failed</div>
+ <p class="deploy-error-panel-msg" data-role="deploy-error-msg"></p>
+ <button type="button" class="erc8004-btn btn btn--secondary" data-role="deploy-retry">Try again</button>
+ </div>
+
+ <div class="erc8004-result deploy-result" data-role="result" style="display:none" tabindex="-1">
<div class="deploy-result-badge" data-role="res-badge"></div>
- <h4 class="erc8004-h4 deploy-result-heading">Agent minted on Solana</h4>
+ <h4 class="erc8004-h4 deploy-result-heading">🎉 Agent minted on Solana</h4>
<dl class="erc8004-result-dl">
<dt>Asset</dt> <dd data-role="res-id"></dd>
<dt>Network</dt> <dd data-role="res-uri"></dd>
<dt>Tx Signature</dt><dd data-role="res-tx"></dd>
</dl>
<div class="erc8004-row">
- <a class="erc8004-btn btn btn--secondary" data-role="view-explorer" target="_blank" rel="noopener">Explorer ↗</a>
+ <a class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="view-explorer" target="_blank" rel="noopener">View on explorer ↗</a>
+ <a class="erc8004-btn btn btn--secondary" data-role="res-agent" style="display:none">View agent page →</a>
+ <a class="erc8004-btn btn btn--secondary" data-role="res-launch" style="display:none">Launch a coin 🚀</a>
<a class="erc8004-btn btn btn--secondary" href="/showcase">Browse showcase ↗</a>
</div>
</div>
<div class="erc8004-wizard-nav">
<button class="erc8004-btn btn btn--secondary" data-role="back">← Back</button>
- <button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="deploy" ${hasSolanaWallet ? '' : 'disabled'}>🚀 Mint on ${esc(chainLabel)}</button>
+ <button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="deploy" ${hasSolanaWallet ? '' : 'disabled title="Install a Solana wallet first"'}>🚀 Mint on ${esc(chainLabel)}</button>
</div>
`;
body.querySelector('[data-role="back"]').addEventListener('click', () => {
- this.wizardStep = 3;
- this._renderActiveTab();
+ this._goToStep(3);
});
+ body.querySelector('[data-role="deploy-retry"]').addEventListener('click', () =>
+ this._doSolanaDeploy(body),
+ );
body.querySelector('[data-role="deploy"]').addEventListener('click', () =>
this._doSolanaDeploy(body),
);
@@ -2202,12 +2261,16 @@ export class RegisterUI {
log.scrollTop = log.scrollHeight;
};
const deployBtn = body.querySelector('[data-role="deploy"]');
+ const idleLabel = deployBtn.textContent;
deployBtn.disabled = true;
+ deployBtn.textContent = 'Minting…';
+ this._hideDeployFailure(body);
// Guard: name + description are required before any on-chain transaction.
if (!this.form.name.trim() || !this.form.description.trim()) {
this._toast('Name and description are required before deploying.', true);
deployBtn.disabled = false;
+ deployBtn.textContent = idleLabel;
return;
}
@@ -2250,8 +2313,8 @@ export class RegisterUI {
say(`Minted asset ${result.assetPubkey}`);
say(`Tx ${result.txSignature}`);
setPhase('done');
+ deployBtn.textContent = 'Minted ✓';
- body.querySelector('[data-role="result"]').style.display = '';
body.querySelector('[data-role="res-id"]').textContent = result.assetPubkey;
body.querySelector('[data-role="res-uri"]').textContent = network;
body.querySelector('[data-role="res-tx"]').textContent = result.txSignature;
@@ -2260,6 +2323,22 @@ export class RegisterUI {
result.txSignature,
);
+ // Next actions: the agent's public page and the coin launcher, when we
+ // have real ids to point them at (never synthesize URLs).
+ const agentLink = body.querySelector('[data-role="res-agent"]');
+ const backendAgentId = result.agent?.id || this._backendAgentId;
+ if (agentLink && backendAgentId && backendAgentId !== 'wizard') {
+ agentLink.href = `/agent/${encodeURIComponent(backendAgentId)}`;
+ agentLink.style.display = '';
+ }
+ const launchLink = body.querySelector('[data-role="res-launch"]');
+ const launchAvatarId = avatar?.avatarId || this._avatarId;
+ if (launchLink && launchAvatarId) {
+ launchLink.href = `/launch?avatar=${encodeURIComponent(launchAvatarId)}`;
+ launchLink.style.display = '';
+ }
+ this._revealDeployResult(body);
+
const badgeEl = body.querySelector('[data-role="res-badge"]');
if (badgeEl) {
const cluster = network === 'devnet' ? 'devnet' : 'mainnet';
@@ -2278,17 +2357,19 @@ export class RegisterUI {
chainId: this.selectedChainId,
});
} catch (err) {
+ let friendly;
if (err?.code === 'forbidden') {
- say(
- 'Wallet not linked — sign in with your Solana wallet first, then retry.',
- true,
- );
+ friendly =
+ 'Wallet not linked: sign in with your Solana wallet first, then retry.';
} else if (err?.code === 'payment_required') {
- say(`${err.message || 'Paid plan required'} — upgrade to use 5+ char vanity prefixes.`, true);
+ friendly = `${err.message || 'Paid plan required'}: upgrade to use 5+ char vanity prefixes.`;
} else {
- say(_classifyDeployError(err.message || String(err), err), true);
+ friendly = _classifyDeployError(err.message || String(err), err);
}
+ say(friendly, true);
+ this._showDeployFailure(body, setPhase, friendly);
deployBtn.disabled = false;
+ deployBtn.textContent = idleLabel;
}
}
@@ -2357,13 +2438,27 @@ export class RegisterUI {
track.hidden = false;
if (phase === 'done') {
track.querySelectorAll('[data-phase]').forEach((el) => {
- el.classList.remove('deploy-phase--pending', 'deploy-phase--active');
+ el.classList.remove(
+ 'deploy-phase--pending',
+ 'deploy-phase--active',
+ 'deploy-phase--error',
+ );
el.classList.add('deploy-phase--done');
});
return;
}
+ // 'error' freezes the track and paints the in-flight phase red so the
+ // user can see exactly where the deploy stopped.
+ if (phase === 'error') {
+ track.querySelectorAll('.deploy-phase--active').forEach((el) => {
+ el.classList.remove('deploy-phase--active');
+ el.classList.add('deploy-phase--error');
+ });
+ return;
+ }
const idx = order.indexOf(phase);
track.querySelectorAll('[data-phase]').forEach((el) => {
+ el.classList.remove('deploy-phase--error');
const pi = order.indexOf(el.dataset.phase);
el.classList.toggle('deploy-phase--done', pi < idx);
el.classList.toggle('deploy-phase--active', pi === idx);
@@ -2372,6 +2467,39 @@ export class RegisterUI {
};
}
+ /**
+ * Show the designed deploy-failure panel (message + working retry) and
+ * paint the phase track red. The raw error still lands in the log via
+ * `say` at the call site; this is the human-readable layer on top.
+ */
+ _showDeployFailure(body, setPhase, message) {
+ setPhase('error');
+ const panel = body.querySelector('[data-role="deploy-error"]');
+ if (!panel) return;
+ panel.querySelector('[data-role="deploy-error-msg"]').textContent = message;
+ panel.hidden = false;
+ }
+
+ _hideDeployFailure(body) {
+ const panel = body.querySelector('[data-role="deploy-error"]');
+ if (panel) panel.hidden = true;
+ }
+
+ /**
+ * Reveal the success panel with an entrance animation and move focus into
+ * it, so screen readers announce the result and the explorer link is one
+ * Tab away. Smooth-scroll only when the user hasn't asked for reduced motion.
+ */
+ _revealDeployResult(body) {
+ const result = body.querySelector('[data-role="result"]');
+ if (!result) return;
+ result.style.display = '';
+ result.classList.add('deploy-result--in');
+ const reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches;
+ result.scrollIntoView({ behavior: reduced ? 'auto' : 'smooth', block: 'nearest' });
+ result.focus({ preventScroll: true });
+ }
+
/**
* Wrap say() with keyword-based phase advancement so the phase tracker
* automatically advances when registerAgent / runSolanaDeploy emit known
@@ -2491,12 +2619,16 @@ export class RegisterUI {
log.scrollTop = log.scrollHeight;
};
const deployBtn = body.querySelector('[data-role="deploy"]');
+ const idleLabel = deployBtn.textContent;
deployBtn.disabled = true;
+ deployBtn.textContent = 'Deploying…';
+ this._hideDeployFailure(body);
// Guard: name + description are required before any on-chain transaction.
if (!this.form.name.trim() || !this.form.description.trim()) {
this._toast('Name and description are required before deploying.', true);
deployBtn.disabled = false;
+ deployBtn.textContent = idleLabel;
return;
}
@@ -2515,7 +2647,7 @@ export class RegisterUI {
const result = await this._doRegister(phaseSay);
setPhase('done');
- body.querySelector('[data-role="result"]').style.display = '';
+ deployBtn.textContent = 'Deployed ✓';
body.querySelector('[data-role="res-id"]').textContent = String(result.agentId);
body.querySelector('[data-role="res-uri"]').textContent = result.registrationUrl;
body.querySelector('[data-role="res-tx"]').textContent = result.txHash;
@@ -2528,6 +2660,19 @@ export class RegisterUI {
this.selectedChainId,
result.txHash,
);
+ body.querySelector('[data-role="res-embed"]')?.addEventListener('click', () =>
+ this._openEmbedModal({
+ agentId: result.agentId,
+ name: this.form.name,
+ glbUrl: this.form.glbUrl || this.form.pastedGlbUrl || null,
+ }),
+ );
+ const launchLink = body.querySelector('[data-role="res-launch"]');
+ if (launchLink && this._avatarId) {
+ launchLink.href = `/launch?avatar=${encodeURIComponent(this._avatarId)}`;
+ launchLink.style.display = '';
+ }
+ this._revealDeployResult(body);
const badgeEl = body.querySelector('[data-role="res-badge"]');
if (badgeEl) {
@@ -2548,7 +2693,9 @@ export class RegisterUI {
const raw = err.shortMessage || err.message || String(err);
const errMsg = _classifyDeployError(raw, err);
say(errMsg, true);
+ this._showDeployFailure(body, setPhase, errMsg);
deployBtn.disabled = false;
+ deployBtn.textContent = idleLabel;
}
}
@@ -3071,7 +3218,7 @@ export class RegisterUI {
<input class="erc8004-input" name="apiToken" placeholder="leave blank for R2 backend" />
</label>
- <div class="erc8004-log" data-role="log"></div>
+ <div class="erc8004-log" data-role="log" role="log" aria-live="polite"></div>
<div class="erc8004-row" style="justify-content:flex-end">
<button class="erc8004-btn btn btn--secondary" data-role="cancel">Cancel</button>
@@ -3244,7 +3391,7 @@ export class RegisterUI {
<label class="erc8004-label">Recipient address
<input class="erc8004-input" name="to" placeholder="0x…" />
</label>
- <div class="erc8004-log" data-role="log"></div>
+ <div class="erc8004-log" data-role="log" role="log" aria-live="polite"></div>
<div class="erc8004-row" style="justify-content:flex-end">
<button class="erc8004-btn btn btn--secondary" data-role="cancel">Cancel</button>
<button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="go">Transfer</button>
@@ -3326,7 +3473,7 @@ export class RegisterUI {
<label class="erc8004-label">Pinata JWT (optional)
<input class="erc8004-input" name="apiToken" placeholder="leave blank for R2 backend" />
</label>
- <div class="erc8004-log" data-role="log"></div>
+ <div class="erc8004-log" data-role="log" role="log" aria-live="polite"></div>
<div class="erc8004-row" style="justify-content:flex-end">
<button class="erc8004-btn btn btn--secondary" data-role="cancel">Cancel</button>
<button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="go">Deploy</button>
@@ -3647,6 +3794,7 @@ export class RegisterUI {
_toast(msg, isError = false) {
const t = document.createElement('div');
t.className = 'erc8004-toast' + (isError ? ' erc8004-toast--error' : '');
+ t.setAttribute('role', isError ? 'alert' : 'status');
t.textContent = msg;
this.el.appendChild(t);
setTimeout(() => t.remove(), 4000);