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:
parent
32160ae4ce
commit
5ae8aeec02
|
|
@ -773,7 +773,9 @@ export async function ensureDemoCommunity(): Promise<void> {
|
||||||
const exists = await communityExists("demo");
|
const exists = await communityExists("demo");
|
||||||
|
|
||||||
if (!exists) {
|
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");
|
console.log("[Demo] Created demo community with visibility: public");
|
||||||
} else {
|
} else {
|
||||||
await loadCommunity("demo");
|
await loadCommunity("demo");
|
||||||
|
|
|
||||||
|
|
@ -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 });
|
return c.json({ spaces: spacesList });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue