From 69d382cb70d1c41564a7e9e2d77e633f5a6dbd9f Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 21 Feb 2026 01:04:23 +0000 Subject: [PATCH] Add app/space switcher dropdowns to landing and canvas pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace legacy mountHeader() (identity only) with the full rstack shell header on both index.html and canvas.html. Both pages now show rstack-app-switcher (21 modules), rstack-space-switcher, and rstack-identity — matching the module pages rendered by renderShell(). Co-Authored-By: Claude Opus 4.6 --- website/canvas.html | 34 ++++++++++++++++++++++++++++++---- website/index.html | 28 ++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/website/canvas.html b/website/canvas.html index 66cd329..0b5fcff 100644 --- a/website/canvas.html +++ b/website/canvas.html @@ -436,8 +436,18 @@ } } + - + +
+
+ + +
+
+ +
+

Loading...

@@ -535,10 +545,19 @@ generatePeerId, OfflineStore } from "@lib"; - import { mountHeader } from "@lib/rspace-header"; + import { RStackIdentity } from "@shared/components/rstack-identity"; + import { RStackAppSwitcher } from "@shared/components/rstack-app-switcher"; + import { RStackSpaceSwitcher } from "@shared/components/rstack-space-switcher"; - // Mount the header (light theme for canvas) - mountHeader({ theme: "light", showBrand: true }); + // Register shell header components + RStackIdentity.define(); + RStackAppSwitcher.define(); + RStackSpaceSwitcher.define(); + + // Load module list for app switcher + fetch("/api/modules").then(r => r.json()).then(data => { + document.querySelector("rstack-app-switcher")?.setModules(data.modules || []); + }).catch(() => {}); // Register service worker for offline support if ("serviceWorker" in navigator && window.location.hostname !== "localhost") { @@ -602,6 +621,13 @@ document.getElementById("community-name").textContent = communitySlug; document.getElementById("community-slug").textContent = `${communitySlug}.rspace.online`; + // Update shell header space-switcher with resolved slug + const spaceSwitcher = document.querySelector("rstack-space-switcher"); + if (spaceSwitcher) { + spaceSwitcher.setAttribute("current", communitySlug); + spaceSwitcher.setAttribute("name", communitySlug); + } + const canvas = document.getElementById("canvas"); const canvasContent = document.getElementById("canvas-content"); const status = document.getElementById("status"); diff --git a/website/index.html b/website/index.html index e11904c..9ca9d78 100644 --- a/website/index.html +++ b/website/index.html @@ -336,9 +336,19 @@ } } + - + +
+
+ + +
+
+ +
+

rSpace

@@ -567,10 +577,20 @@