Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

fix left sidebar issues

ali-inkco18159a53bf14
diff --git a/packages/app/src/builder-ui/pages/builder/components-menu.ts b/packages/app/src/builder-ui/pages/builder/components-menu.ts
index a5e87337..478bb94e 100644
--- a/packages/app/src/builder-ui/pages/builder/components-menu.ts
+++ b/packages/app/src/builder-ui/pages/builder/components-menu.ts
@@ -901,15 +901,8 @@ function setupBuilderMenuDragDrop() {
const finalWidth = event.target.style.width;
- // Get current tab from localStorage and save with per-tab key
- const currentTab = localStorage.getItem('currentSidebarTab');
- if (currentTab && currentTab !== 'null') {
- const storageKey = `leftSidebarWidth-${currentTab}`;
- localStorage.setItem(storageKey, finalWidth);
- } else {
- // Fallback to generic key if no tab is set
- localStorage.setItem('left-sidebar-width', finalWidth);
- }
+ // Save to common width key for all left sidebar tabs
+ localStorage.setItem('left-sidebar-width', finalWidth);
// Update Alpine.js width property to keep binding in sync
try {
diff --git a/packages/app/views/pages/partials/studio/left-sidebar-help.ejs b/packages/app/views/pages/partials/studio/left-sidebar-help.ejs
index 859262a5..e1eabfe6 100644
--- a/packages/app/views/pages/partials/studio/left-sidebar-help.ejs
+++ b/packages/app/views/pages/partials/studio/left-sidebar-help.ejs
@@ -25,13 +25,7 @@
class="close-btn text-[#757575] hover:bg-gray-100 rounded-lg p-2"
data-tooltip-target="tooltip-close-help"
data-tooltip-placement="left"
- @click="
- if (previousTab && previousTab !== 'helpTab') {
- currentSidebarTab = previousTab;
- } else {
- toggleSidebar()
- }
- "
+ @click="toggleSidebar"
>
<%- include('icons/close-icon'); -%>
</button>
diff --git a/packages/app/views/pages/partials/studio/left-sidebar.ejs b/packages/app/views/pages/partials/studio/left-sidebar.ejs
index 20338aa9..2bc3c71d 100644
--- a/packages/app/views/pages/partials/studio/left-sidebar.ejs
+++ b/packages/app/views/pages/partials/studio/left-sidebar.ejs
@@ -342,7 +342,7 @@
<button
id="help-button"
class="w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"
- @click="toggleHelpTab()"
+ @click="setSidebarTab('helpTab')"
data-tooltip-target="tooltip-help"
data-tooltip-placement="right"
>
@@ -541,8 +541,7 @@
<section
x-show="(currentSidebarTab == 'deployTab')"
- class="deployTab pb-4 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%] [&>*]:w-[calc(100%+5px)]"
- style="scrollbar-gutter: stable"
+ class="deployTab pb-4 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%]"
>
<%- include('left-sidebar-deploy'); -%>
</section>
@@ -581,17 +580,10 @@
// Add special handler for the help tab
toggleHelpTab() {
if (this.currentSidebarTab === 'helpTab') {
- // If help tab is active, switch to previous tab
- if (this.previousTab && this.previousTab !== 'helpTab') {
- const temp = this.currentSidebarTab;
- this.currentSidebarTab = this.previousTab;
- this.previousTab = temp;
- } else {
// If no valid previous tab, close sidebar
this.previousTab = this.currentSidebarTab;
this.currentSidebarTab = null;
this.isSidebarOpen = false;
- }
} else {
// If help tab is not active, store current tab and switch to help
this.previousTab = this.currentSidebarTab;
@@ -657,24 +649,24 @@
init() {
const storedValue = localStorage?.getItem('sidebarOpen');
- const parts = document.location?.pathname?.split('/');
- const currentAgentId = parts?.length == 3 ? parts?.pop() : null;
this.isSidebarOpen =
(storedValue !== null ? storedValue === 'true' : true) || isChatPresent;
- // Initialize currentSidebarTab properly
- this.currentSidebarTab = localStorage.getItem(`${currentAgentId}-currentSidebarTab`);
- this.previousTab = localStorage.getItem('previousTab');
+ // Initialize currentSidebarTab properly
+ this.currentSidebarTab = localStorage.getItem('currentSidebarTab');
+ console.log('currentSidebarTab', this.currentSidebarTab);
+ this.previousTab = localStorage.getItem('previousTab');
+ console.log('previousTab', this.previousTab);
- // Convert "null" strings to actual null values
- if (this.currentSidebarTab === 'null') this.currentSidebarTab = null;
- if (this.previousTab === 'null') this.previousTab = null;
+ // Convert "null" strings to actual null values
+ if (this.currentSidebarTab === 'null') this.currentSidebarTab = null;
+ if (this.previousTab === 'null') this.previousTab = null;
- // Set default tab to Agent Weaver if sidebar is open and no tab is selected
- if (this.isSidebarOpen && !this.currentSidebarTab) {
- this.currentSidebarTab = 'agentBuilderTab';
- localStorage.setItem('currentSidebarTab', 'agentBuilderTab');
- }
+ // Set default tab to Agent Weaver if sidebar is open and no tab is selected
+ if (this.isSidebarOpen && !this.currentSidebarTab) {
+ this.currentSidebarTab = 'agentBuilderTab';
+ localStorage.setItem('currentSidebarTab', 'agentBuilderTab');
+ }
// === SINGLE SOURCE OF TRUTH: Apply width to DOM ===
const applyWidth = (width) => {
@@ -726,7 +718,7 @@
if (contentContainer) contentContainer.style.width = '';
});
- // Very important: If sidebar is closed, ensure currentSidebarTab is null
+ // Very important: If sidebar is closed, ensure currentSidebarTab is null
if (this.currentSidebarTab) {
this.previousTab = this.currentSidebarTab;
this.currentSidebarTab = null;
@@ -794,12 +786,12 @@
this.isSidebarOpen = false;
} else {
// When reopening sidebar via border
- this.isSidebarOpen = true;
// Restore the previous tab if available
if (this.previousTab) {
this.currentSidebarTab = this.previousTab;
localStorage.setItem('currentSidebarTab', this.currentSidebarTab);
}
+ this.isSidebarOpen = true;
}
},
}));