feat: demo space improvements — description + sorted listing

- 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 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-25 19:15:35 -08:00
parent 32160ae4ce
commit 5ae8aeec02
2 changed files with 12 additions and 1 deletions

View File

@ -773,7 +773,9 @@ export async function ensureDemoCommunity(): Promise<void> {
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");

View File

@ -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 });
});