From dbe60f2711cf57e308efb09f85afd5407d845eab Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 21 Mar 2026 18:22:11 -0700 Subject: [PATCH] fix(onboarding): remove moduleHasData gate so live spaces show module UI Live spaces with no CRDT data were showing a generic onboarding page instead of the module's actual UI. Demo always bypassed this check, causing visual parity issues between demo.rspace.online and live spaces. Co-Authored-By: Claude Opus 4.6 --- server/index.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/server/index.ts b/server/index.ts index 8846965..3b4a7c1 100644 --- a/server/index.ts +++ b/server/index.ts @@ -2037,15 +2037,11 @@ app.get("/:space/:moduleId/template", async (c) => { import type { RSpaceModule } from "../shared/module"; import { resolveDataSpace } from "../shared/scope-resolver"; -function moduleHasData(space: string, mod: RSpaceModule): boolean { - if (space === "demo") return true; // demo always has data - if (!mod.docSchemas || mod.docSchemas.length === 0) return true; // no schemas = can't detect - for (const schema of mod.docSchemas) { - if (!schema.pattern.includes('{space}')) return true; // global module, always show - const prefix = schema.pattern.replace('{space}', space).split(':').slice(0, 3).join(':'); - if (syncServer.hasDocsWithPrefix(prefix)) return true; - } - return false; +function moduleHasData(_space: string, _mod: RSpaceModule): boolean { + // Always show the module's own UI — let each module handle its empty state. + // Previously demo returned true while live spaces checked for CRDT docs, + // causing live spaces to show a generic onboarding page instead of the module. + return true; } // ── Mount module routes under /:space/:moduleId ──