diff --git a/shared/components/rstack-tab-bar.ts b/shared/components/rstack-tab-bar.ts
index dd3bdb8..310e981 100644
--- a/shared/components/rstack-tab-bar.ts
+++ b/shared/components/rstack-tab-bar.ts
@@ -282,21 +282,20 @@ export class RStackTabBar extends HTMLElement {
const existingModuleIds = new Set(this.#layers.map(l => l.moduleId));
// Use server module list if available, fall back to MODULE_BADGES keys
- const availableModules: Array<{ id: string; name: string; icon: string; description: string }> =
+ const allModules: Array<{ id: string; name: string; icon: string; description: string }> =
this.#modules.length > 0
- ? this.#modules.filter(m => !existingModuleIds.has(m.id))
+ ? this.#modules
: Object.keys(MODULE_BADGES)
- .filter(id => !existingModuleIds.has(id))
.map(id => ({ id, name: id, icon: "", description: "" }));
- if (availableModules.length === 0) {
- return `
`;
+ if (allModules.length === 0) {
+ return ``;
}
// Group by category
- const groups = new Map();
- const uncategorized: typeof availableModules = [];
- for (const m of availableModules) {
+ const groups = new Map();
+ const uncategorized: typeof allModules = [];
+ for (const m of allModules) {
const cat = MODULE_CATEGORIES[m.id];
if (cat) {
if (!groups.has(cat)) groups.set(cat, []);
@@ -311,29 +310,33 @@ export class RStackTabBar extends HTMLElement {
const items = groups.get(cat);
if (!items || items.length === 0) continue;
html += ``;
- html += items.map(m => this.#renderAddMenuItem(m)).join("");
+ html += items.map(m => this.#renderAddMenuItem(m, existingModuleIds.has(m.id))).join("");
}
if (uncategorized.length > 0) {
html += ``;
- html += uncategorized.map(m => this.#renderAddMenuItem(m)).join("");
+ html += uncategorized.map(m => this.#renderAddMenuItem(m, existingModuleIds.has(m.id))).join("");
}
return ``;
}
- #renderAddMenuItem(m: { id: string; name: string; icon: string; description: string }): string {
+ #renderAddMenuItem(m: { id: string; name: string; icon: string; description: string }, isOpen: boolean): string {
const badge = MODULE_BADGES[m.id];
const badgeHtml = badge
? ``
: ``;
+ const openClass = isOpen ? " add-menu-item--open" : "";
+ const openIndicator = isOpen ? `` : "";
+
return `
-