diff --git a/server/shell.ts b/server/shell.ts index 8fb8d79..ecf2294 100644 --- a/server/shell.ts +++ b/server/shell.ts @@ -428,6 +428,7 @@ export function renderShell(opts: ShellOptions): string { // Provide module list to app switcher and offline runtime window.__rspaceModuleList = ${moduleListJSON}; window.__rspaceAllModules = ${allModulesJSON}; + window.__rspaceEnabledModules = ${JSON.stringify(enabledModules)}; const _switcher = document.querySelector('rstack-app-switcher'); _switcher?.setModules(window.__rspaceModuleList); _switcher?.setAllModules(window.__rspaceAllModules); diff --git a/website/canvas.html b/website/canvas.html index d60c083..b9b7135 100644 --- a/website/canvas.html +++ b/website/canvas.html @@ -2051,7 +2051,7 @@
Connect
- +
@@ -2064,8 +2064,8 @@ - - + + @@ -2078,15 +2078,15 @@ - + - - - - - - - + + + + + + + @@ -2095,9 +2095,9 @@
Connect
- - - + + +
@@ -2121,13 +2121,13 @@
Create
- + - - + +
@@ -2143,7 +2143,7 @@ - + @@ -2152,8 +2152,8 @@
Spend
- - + +
@@ -2163,11 +2163,11 @@
Travel
- - - - - + + + + +
@@ -4459,6 +4459,24 @@ }); }); + // Hide toolbar items for disabled modules + const _enabledMods = window.__rspaceEnabledModules; + if (_enabledMods) { + const _enabledSet = new Set(_enabledMods); + document.querySelectorAll('[data-requires-module]').forEach(el => { + if (!_enabledSet.has(el.dataset.requiresModule)) { + el.style.display = 'none'; + } + }); + // Hide empty toolbar groups (all visible items hidden) + document.querySelectorAll('.toolbar-group').forEach(group => { + const dropdown = group.querySelector('.toolbar-dropdown'); + if (!dropdown) return; + const visibleItems = dropdown.querySelectorAll('button:not([style*="display: none"]):not(.toolbar-dropdown-header)'); + if (visibleItems.length === 0) group.style.display = 'none'; + }); + } + // rApp embed buttons — embed any module as a folk-rapp shape on the canvas const rAppModules = [ { btnId: "embed-notes", moduleId: "rnotes" },