feat(scratchnode): self-serve "Create a room" front-door on the landing#472
Merged
Conversation
The scratchnode.live apex only offered "Join with a code" — a first-time visitor had no way to actually create a room. createEvent existed in the backend and a create flow lived in the in-room host console, but the live-backend module bails early on the apex (if (!slugMatch) return), so creation was never wired on the landing at all. Add a .landing-create form (event name + optional custom room code) beside Join, plus a self-contained _landingCreate() handler that lazily bootstraps a Convex client (same /api/scratchnode-config + esm.sh paths the room module uses), calls events:createEvent, persists the issued host token (sn_host_owner_key_v2), and navigates the new host into /e/<slug>. Join stays the single primary accent CTA; Create is outline-accent (secondary). Honesty contract preserved: every failure (config down, client load fail, taken code, rate limit) surfaces a real inline error and re-enables the button — never a fake success, and data-sn-live stays untouched so the apex reads honestly "not live" until the host lands in their room. Covered by 4 new cases in scratchnode-live-route-honesty.spec.ts (happy path, auto-code, short-name rejection, honest config-failure). 10/10 honesty suite green; tsc clean; verified live in preview (desktop + mobile, honest 404 on missing API). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
HomenShum
enabled auto-merge (squash)
June 2, 2026 19:45
✅ Dogfood Visual QA Gate: PASSED
ArtifactsDownload the Generated by Dogfood QA Gate |
|
Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re your ask
Correct — you couldn't. This adds the missing front-door.
Root cause (5 whys)
snCreateEventFromHostSheet) lives inside the in-room host console → 4. the entire Convex client module bails early on the apex (if (!slugMatch) return), soevents:createEventwas never wired on the landing → 5. the apex was built "join-first";createEventshipped later (Phase 4) but never got a front-door. The backend was fully ready (rate-limited 5/10min, issues an HMAC host token, auto-generates a room code).What changed (
public/proto/home-v5.html).landing-createform beside Join: event name (required) + optional custom room code._landingCreate()handler that lazily bootstraps a Convex client (same/api/scratchnode-config+esm.shpaths the room module uses), callsevents:createEvent, persists the issued host token (sn_host_owner_key_v2), and navigates the new host into/e/<slug>— where the room boot recognizes them as host.Honesty contract preserved
Every failure (config down, client load fail, taken code, rate limit) surfaces a real inline error and re-enables the button — never a fake success.
data-sn-liveis left untouched so the apex stays honestly "not live" until the host lands in their room.Verification
--noEmit: clean (exit 0)scratchnode-live-route-honesty.spec.ts10/10 green, incl. 4 new landing-create cases (happy path, auto-code, short-name rejection, honest config-failure)public/protostatic server): desktop + mobile (375px, no overflow) render clean, zero console errors; real-environment honesty confirmed — a valid-name submit with no API present shows "Could not load room config (HTTP 404)", no navigation, no host token persisted.🤖 Generated with Claude Code