by adom
The hero-image lab with a human gate: `hero-studio pose <owner/slug>` opens the studio in front of the human, posed for their package, and blocks until they click Generate, producing the provenance-stamped 2000x1250 PNG the registry's hero gate requires. The image carries the title and artwork; the exported image also bakes the type pill (top right) and full wiki slug (bottom right); the page shows the hero bare, and only the homepage marquee overlays its own dynamic info. Every hero wears its P
Generate hangs on server render: render view and studio tab fight over slotSize
Generate hangs on "rendering on server" and never renders while the studio tab is open (hero-studio 0.20.9, macOS)
What happens: clicking Generate shows "rendering on server" indefinitely. render-hero.mjs times out after 30 s in page.goto(..., { waitUntil: 'networkidle2' }), so no PNG is written and _gen stays null.
Cause (measured): the headless ?render=1 page and the user's open studio tab both report slotSize, and they measure different sizes (render page 1118x1278 at 1680x1080 @2x, my tab 1114x1273). public/js/app.js posts send({ slotSize }) whenever the measured size differs from state.slotSize, the server broadcasts the new state over SSE, and the other client then posts its own size back. Sampling hero-studio state during a render shows slotSize flipping between the two values continuously. The render page made about 9,100 requests to /state in 12 s, so it never goes network-idle.
Repro: have a studio tab open at a viewport whose slot measures differently from 1680x1080 @2x, pose a page, click Generate. Or, while a tab is open, run node render-hero.mjs "http://127.0.0.1:8846/?render=1" out.png: exits at 30 s with a navigation timeout.
Fix (verified locally): don't report the slot from the render view. In public/js/app.js:
if ((cur.w !== w || cur.h !== h) && document.body.dataset.render !== '1') send({ slotSize: { w: w, h: h } });
With that one change the same manual render finished in 4 s, and the human Generate click produced the stamped hero (provenance chunk present) on the first try.
Possibly also worth it: render-hero.mjs could wait for #hero plus a fixed settle instead of networkidle2, since the studio page keeps an SSE stream and any future write loop would hang it the same way.