From fe6e46ca2cc4aa62dcfb5129d98479e1d1fdc2f5 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 25 Feb 2026 23:09:10 -0800 Subject: [PATCH] feat: app switcher links to landing pages, demo uses standalone rApp builds App switcher on demo/bare domain now links to rspace.online/{moduleId} landing pages instead of jumping straight to demo. "Try Demo" buttons use standalone domain builds (rnotes.online, rvote.online, etc.) which have better styling and more updated features. Falls back to demo.rspace.online for modules without a standalone domain. Co-Authored-By: Claude Opus 4.6 --- server/shell.ts | 13 ++++++++++--- shared/components/rstack-app-switcher.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/server/shell.ts b/server/shell.ts index d4f2318..e3b808f 100644 --- a/server/shell.ts +++ b/server/shell.ts @@ -45,6 +45,10 @@ export function renderShell(opts: ShellOptions): string { } = opts; const moduleListJSON = JSON.stringify(modules); + const currentMod = modules.find((m) => m.id === moduleId); + const shellDemoUrl = currentMod?.standaloneDomain + ? `https://${escapeAttr(currentMod.standaloneDomain)}` + : `https://demo.rspace.online/${escapeAttr(moduleId)}`; return ` @@ -78,7 +82,7 @@ export function renderShell(opts: ShellOptions): string { @@ -424,10 +428,13 @@ export interface ModuleLandingOptions { export function renderModuleLanding(opts: ModuleLandingOptions): string { const { module: mod, modules, theme = "dark" } = opts; const moduleListJSON = JSON.stringify(modules); - const demoUrl = `https://demo.rspace.online/${mod.id}`; + // Prefer standalone domain for demo (better styling, more updated features) + const demoUrl = mod.standaloneDomain + ? `https://${mod.standaloneDomain}` + : `https://demo.rspace.online/${mod.id}`; const standaloneLinkHtml = mod.standaloneDomain - ? `Also available at ${escapeHtml(mod.standaloneDomain)} ↗` + ? `Also available inside rSpace demo ↗` : ""; let feedsHtml = ""; diff --git a/shared/components/rstack-app-switcher.ts b/shared/components/rstack-app-switcher.ts index 0d4bdd3..c9510b1 100644 --- a/shared/components/rstack-app-switcher.ts +++ b/shared/components/rstack-app-switcher.ts @@ -188,10 +188,19 @@ export class RStackAppSwitcher extends HTMLElement { ? `${badgeInfo.badge}` : `${m.icon}`; + const space = this.#getSpaceSlug(); + // On demo (bare domain or demo subdomain): link to landing pages + const host = window.location.host.split(":")[0]; + const onRspace = host.includes("rspace.online"); + const href = + onRspace && space === "demo" + ? `${window.location.protocol}//rspace.online/${m.id}` + : rspaceNavUrl(space, m.id); + return `