diff --git a/server/seed-demo.ts b/server/seed-demo.ts index 461dd1b..0c4bff3 100644 --- a/server/seed-demo.ts +++ b/server/seed-demo.ts @@ -773,7 +773,9 @@ export async function ensureDemoCommunity(): Promise { const exists = await communityExists("demo"); if (!exists) { - await createCommunity("r* Ecosystem Demo", "demo", null, "public"); + await createCommunity("r* Ecosystem Demo", "demo", null, "public", { + description: "Public demo space showcasing all rStack apps with the Alpine Explorer 2026 scenario", + }); console.log("[Demo] Created demo community with visibility: public"); } else { await loadCommunity("demo"); diff --git a/server/spaces.ts b/server/spaces.ts index fba2f1d..e4f5ff2 100644 --- a/server/spaces.ts +++ b/server/spaces.ts @@ -84,6 +84,15 @@ spaces.get("/", async (c) => { } } + // Sort: user's own spaces first, then demo, then others alphabetically + spacesList.sort((a, b) => { + if (a.role && !b.role) return -1; + if (!a.role && b.role) return 1; + if (a.slug === "demo") return -1; + if (b.slug === "demo") return 1; + return a.name.localeCompare(b.name); + }); + return c.json({ spaces: spacesList }); });