Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(forge): stop the turntable for reduced motion, unpin the handoff card, and clear the banned dashes
nirholas7c9f7a0ac089
diff --git a/pages/forge.html b/pages/forge.htmlindex 71ec88ff5..e326f2070 100644--- a/pages/forge.html+++ b/pages/forge.html@@ -3572,7 +3572,7 @@data-tier="high"data-access="locked"aria-pressed="false"- aria-label="High quality — $THREE holder feature"+ aria-label="High quality, a $THREE holder feature"title="High: maximum detail and PBR textures on self-hosted GPU workers. Slower; $THREE holder feature or pay per generation."data-i18n-html="forge.high_three" data-i18n-attr="aria-label:forge.high_quality_three_holder_fe_arialabel;title:forge.high_maximum_detail_and_pbr_title"><span class="tier-name">High</span>@@ -3585,7 +3585,7 @@</div><p class="fq-holder-note" id="fq-holder-note" data-state="locked" data-i18n-html="forge.high_quality_is_a_three_holder_feature"><span class="fq-holder-ico" aria-hidden="true">◆</span> High quality is a- <a href="/three-token">$THREE holder</a> feature — hold to unlock, or pay per generation.+ <a href="/three-token">$THREE holder</a> feature: hold to unlock, or pay per generation.</p><div class="fq-row fq-row--engine"><span class="fq-label" id="engine-label" data-i18n="forge.engine">Engine</span>@@ -3814,7 +3814,7 @@</div><div class="viewer-load-error" id="viewer-load-error" role="alert" aria-live="polite"><span class="viewer-load-error-icon" aria-hidden="true">⚠</span>- <p data-i18n="forge.model_failed_to_load_often_a_brief">Model failed to load — often a brief network hiccup on the file. Retry, or use the download button below to save it directly.</p>+ <p data-i18n="forge.model_failed_to_load_often_a_brief">Model failed to load. That is usually a brief network hiccup on the file: retry, or use the download button below to save it directly.</p><button type="button" class="btn ghost" id="viewer-retry" data-i18n="forge.retry_loading">Retry loading</button></div></div>@@ -3838,7 +3838,7 @@type="button"id="cinema"aria-pressed="false"- title="Cinema mode — fullscreen turntable for recording (F)"+ title="Cinema mode: fullscreen turntable for recording (F)"data-i18n-attr="title:forge.cinema_mode_fullscreen_turnt_title"><svgwidth="15"@@ -3868,7 +3868,7 @@type="button"data-outcome="accepted"aria-pressed="false"- title="Keep — good result"+ title="Keep: good result"data-i18n="forge.keep" data-i18n-attr="title:forge.keep_good_result_title">👍 Keep</button>@@ -3876,7 +3876,7 @@type="button"data-outcome="rejected"aria-pressed="false"- title="Discard — bad result"+ title="Discard: bad result"data-i18n="forge.discard" data-i18n-attr="title:forge.discard_bad_result_title">👎 Discard</button>@@ -3962,7 +3962,7 @@class="btn btn-ghost"type="button"id="forge-ar-btn"- title="View this model in AR — place it in your room"+ title="View this model in AR, placed in your room"data-i18n-attr="title:forge.view_this_model_in_ar_place_title"><svgwidth="15"diff --git a/public/feature-discovery.js b/public/feature-discovery.jsindex ce2d6e0e2..1e261bb10 100644--- a/public/feature-discovery.js+++ b/public/feature-discovery.js@@ -348,7 +348,9 @@// content until manually closed (on mobile it's a full-width bottom bar).// After a reveal window it gracefully dismisses itself — paused while the// pointer is over it or keyboard focus is inside, so it never vanishes- // mid-read or mid-interaction. Contextual cards omit autoDismissMs and stay.+ // mid-read or mid-interaction. A card that omits autoDismissMs stays until+ // it is dismissed, which is only right when nothing underneath it needs the+ // corner (see showCrossLinks for why the handoff card no longer does that).if (spec.autoDismissMs) {var arm = function () {clearTimeout(card._fdKill);@@ -463,6 +465,17 @@title: carried && modelLabel ? modelLabel : null,desc: carried ? 'Each tool opens with this model already loaded.' : null,links: links,+ // This card used to stay pinned until dismissed. The page it lands on+ // has just finished something, which is exactly when it fills the+ // bottom-right with its OWN next-step actions: on /forge the result bar+ // (Download, Share, Rig, AR, Place IRL) reaches the same corner, and a+ // permanent card sat on top of it at every width below ~1500px. So the+ // handoff behaves like the passive suggestion it sits beside: it+ // announces the destinations the page does not already offer, then+ // retracts. Longer than the passive window because there is more to+ // read here, and the same hover/focus pause applies, so it never+ // vanishes mid-read or mid-click.+ autoDismissMs: 22000,});}diff --git a/src/forge.js b/src/forge.jsindex baab0105a..9ddf4876e 100644--- a/src/forge.js+++ b/src/forge.js@@ -1075,7 +1075,7 @@ function applyHighAffordances(access) {note.dataset.state = state;note.innerHTML = eligible? '<span class="fq-holder-ico" aria-hidden="true">◆</span> High quality is unlocked — you hold <a href="/three-token">$THREE</a>.'- : '<span class="fq-holder-ico" aria-hidden="true">◆</span> High quality is a <a href="/three-token">$THREE holder</a> feature — hold to unlock, or pay per generation.';+ : '<span class="fq-holder-ico" aria-hidden="true">◆</span> High quality is a <a href="/three-token">$THREE holder</a> feature: hold to unlock, or pay per generation.';}}@@ -2181,6 +2181,11 @@ function showResult(glbUrl, label, meta, { autoSaved = false, downloadUrl = nullels.viewerShell?.classList.add('is-loading');els.viewer.setAttribute('src', glbUrl);els.viewer.setAttribute('alt', `3D model: ${label}`);+ // A turntable that never stops is exactly the motion prefers-reduced-motion+ // exists to silence, and it is the largest moving thing on the page. Drop it+ // for a reader who asked for less motion: camera-controls stays, so the model+ // is still fully inspectable by drag, pinch and arrow key, on their terms.+ if (REDUCED_MOTION) els.viewer.removeAttribute('auto-rotate');lastShownGlb = glbUrl;els.resultLabel.textContent = label;// Real, opt-in attribution only: a byline + link to the creator's publicdiff --git a/tests/api/forge-progress-endpoint.test.js b/tests/api/forge-progress-endpoint.test.jsnew file mode 100644index 000000000..30fa74c85--- /dev/null+++ b/tests/api/forge-progress-endpoint.test.js@@ -0,0 +1,116 @@+/**+ * GET /api/forge?progress=<id> — the read side of the pre-submit progress+ * channel /forge polls while its own POST is still open.+ *+ * These pin the route itself (the crumb store is covered by+ * tests/forge-progress.test.js): a well-formed trace answers with whatever the+ * pipeline has finished so far, an unknown trace answers with an empty list+ * rather than an error, and a malformed id is refused before anything is read.+ *+ * The property that matters most is the last one: polling ahead of the first+ * milestone is the NORMAL case, so it must be indistinguishable from a healthy+ * "not there yet", never a failure the page has to render.+ */++import { describe, it, expect, vi, beforeAll, beforeEach } from 'vitest';++beforeAll(() => {+ Object.assign(process.env, {+ APP_ORIGIN: 'https://three.ws',+ JWT_SECRET: 'test-jwt-secret-at-least-32-characters-long',+ });+});++const crumbs = new Map();+vi.mock('../../api/_lib/cache.js', async (importActual) => {+ const actual = await importActual();+ return {+ ...actual,+ cacheGetFresh: vi.fn(async (key) => (crumbs.has(key) ? crumbs.get(key) : null)),+ cacheSet: vi.fn(async (key, value) => {+ crumbs.set(key, value);+ }),+ };+});++vi.mock('../../api/_lib/rate-limit.js', async (importActual) => {+ const actual = await importActual();+ return {+ ...actual,+ limits: {+ ...actual.limits,+ mcp3dStatus: vi.fn(async () => ({ success: true, reset: Date.now() + 1000 })),+ },+ clientIp: () => '203.0.113.7',+ };+});++const { default: handler } = await import('../../api/forge.js');++const TRACE = 'f0e1d2c3b4a596877869504132231415';++function makeReq(url) {+ return { method: 'GET', url, headers: { 'x-forge-client': 'tester' } };+}++function makeRes() {+ return {+ statusCode: 200,+ headers: {},+ body: null,+ setHeader(name, value) {+ this.headers[String(name).toLowerCase()] = value;+ },+ getHeader(name) {+ return this.headers[String(name).toLowerCase()];+ },+ end(body) {+ this.body = body ? JSON.parse(body) : null;+ },+ };+}++describe('GET /api/forge?progress', () => {+ beforeEach(() => {+ crumbs.clear();+ });++ it('returns the milestones recorded so far for a known trace', async () => {+ crumbs.set(`forge:progress:${TRACE}`, [+ { stage: 'directed', at: 10, directed_prompt: 'a brass sundial, aged patina, studio light' },+ { stage: 'reference', at: 20, preview_image_url: 'https://cdn.example/ref.jpg' },+ ]);+ const res = makeRes();+ await handler(makeReq(`/api/forge?progress=${TRACE}`), res);+ expect(res.statusCode).toBe(200);+ expect(res.body.progress.map((c) => c.stage)).toEqual(['directed', 'reference']);+ expect(res.body.progress[1].preview_image_url).toBe('https://cdn.example/ref.jpg');+ });++ it('answers an unstarted trace with an empty list, not an error', async () => {+ const res = makeRes();+ await handler(makeReq(`/api/forge?progress=${TRACE}`), res);+ expect(res.statusCode).toBe(200);+ expect(res.body).toEqual({ progress: [] });+ });++ it('refuses a malformed trace id before reading anything', async () => {+ const res = makeRes();+ await handler(makeReq('/api/forge?progress=nope'), res);+ expect(res.statusCode).toBe(400);+ expect(res.body.error).toBe('invalid_progress_id');+ });++ it('never caches a progress read', async () => {+ const res = makeRes();+ await handler(makeReq(`/api/forge?progress=${TRACE}`), res);+ expect(String(res.headers['cache-control'])).toContain('no-store');+ });++ it('leaves the job poll alone', async () => {+ const res = makeRes();+ await handler(makeReq('/api/forge'), res);+ expect(res.statusCode).toBe(400);+ expect(res.body.error).toBe('missing_job');+ });+});