Merge branch 'dev'

This commit is contained in:
Jeff Emmett 2026-03-20 17:14:28 -07:00
commit 451801d12c
2 changed files with 13 additions and 0 deletions

View File

@ -842,6 +842,8 @@ routes.get("/api/context/:tool", async (c) => {
routes.get("/", (c) => {
const space = c.req.param("space") || "demo";
const dataSpace = c.get("effectiveSpace") || space;
// Seed sample data for any space that has no events yet
seedDemoIfEmpty(dataSpace);
return c.html(renderShell({
title: `${space} — Calendar | rSpace`,
moduleId: "rcal",

View File

@ -176,6 +176,17 @@ export async function createSpace(opts: CreateSpaceOpts): Promise<CreateSpaceRes
console.error(`[createSpace:${source}] Template seeding failed for ${slug}:`, e);
}
// Seed module-specific demo data (calendar events, sample tasks, etc.)
for (const mod of getAllModules()) {
if (mod.seedTemplate) {
try {
mod.seedTemplate(slug);
} catch (e) {
console.error(`[createSpace:${source}] Module ${mod.id} seedTemplate failed for ${slug}:`, e);
}
}
}
console.log(`[createSpace:${source}] Created space: ${slug}`);
return { ok: true, slug, name, visibility, ownerDID };
}