From 823d2c411022a3123057c72c08a3ed97d12d0b72 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 21 Mar 2026 18:11:51 -0700 Subject: [PATCH] fix(spaces): filter disabled modules from space dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderSpaceDashboard was showing all modules regardless of space's enabledModules setting — both in the app cards grid and the app-switcher dropdown. Now filters using getSpaceShellMeta, same as renderShell. Co-Authored-By: Claude Opus 4.6 --- server/landing.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/server/landing.ts b/server/landing.ts index 4cb7908..0046f41 100644 --- a/server/landing.ts +++ b/server/landing.ts @@ -7,7 +7,7 @@ */ import type { ModuleInfo } from "../shared/module"; -import { escapeHtml, escapeAttr, MODULE_LANDING_CSS, RICH_LANDING_CSS, versionAssetUrls } from "./shell"; +import { escapeHtml, escapeAttr, MODULE_LANDING_CSS, RICH_LANDING_CSS, versionAssetUrls, getSpaceShellMeta } from "./shell"; export function renderMainLanding(modules: ModuleInfo[]): string { const moduleListJSON = JSON.stringify(modules); @@ -266,13 +266,18 @@ export function renderMainLanding(modules: ModuleInfo[]): string { // ── Space Dashboard ── export function renderSpaceDashboard(space: string, modules: ModuleInfo[]): string { - const moduleListJSON = JSON.stringify(modules); + // Filter modules by space's enabledModules + const enabledModules = getSpaceShellMeta(space).enabledModules; + const visibleModules = enabledModules + ? modules.filter(m => m.id === "rspace" || enabledModules.includes(m.id)) + : modules; + const moduleListJSON = JSON.stringify(visibleModules); const displayName = space === "demo" ? "Demo Space" : space; const subtitle = space === "demo" ? "Explore the rSpace ecosystem — click any rApp to try it live with sample data." - : `${modules.length} rApps available in this space.`; + : `${visibleModules.length} rApps available in this space.`; - const appCards = modules + const appCards = visibleModules .map((m) => { return `