From 5ae8aeec02b275c08d5c6bf4eec59b6956507f8c Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 25 Feb 2026 19:15:35 -0800 Subject: [PATCH] =?UTF-8?q?feat:=20demo=20space=20improvements=20=E2=80=94?= =?UTF-8?q?=20description=20+=20sorted=20listing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add description to demo space seed for context in the UI - Sort spaces API: user's own spaces first, then demo, then alphabetical Co-Authored-By: Claude Opus 4.6 --- server/seed-demo.ts | 4 +++- server/spaces.ts | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 }); });