From 57fd1f49133519188be8b2604fae67255fe438bd Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 4 Mar 2026 17:29:04 -0800 Subject: [PATCH] fix: always show Demo Space at top of space switcher dropdown Adds a permanent "Demo Space" entry as the first item in the space switcher dropdown across all rApps. Previously demo only appeared in the "Public spaces" section (if the API returned it), making it easy to miss. Now it's always visible at the top with a game controller icon, followed by the sign-in/personal space CTA. Also filters demo out of the "Public spaces" section to avoid showing it twice. Co-Authored-By: Claude Opus 4.6 --- shared/components/rstack-space-switcher.ts | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/shared/components/rstack-space-switcher.ts b/shared/components/rstack-space-switcher.ts index e087e85..ace79d6 100644 --- a/shared/components/rstack-space-switcher.ts +++ b/shared/components/rstack-space-switcher.ts @@ -131,8 +131,20 @@ export class RStackSpaceSwitcher extends HTMLElement { return s.name; } + #demoSpaceHTML(current: string, moduleId: string): string { + const isActive = current === "demo"; + return ` + + 🎮 + Demo Space + 👁 + `; + } + #renderMenu(menu: HTMLElement, current: string) { const auth = isAuthenticated(); + const moduleId = this.#getCurrentModule(); if (this.#spaces.length === 0) { let cta = ""; @@ -144,6 +156,8 @@ export class RStackSpaceSwitcher extends HTMLElement { cta = this.#yourSpaceCTAhtml(label); } menu.innerHTML = ` + ${this.#demoSpaceHTML(current, moduleId)} +
${cta}