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.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
Refactor left sidebar component for improved readability and maintainability
Muhammad Hamza Khan7126279c8ce1
diff --git a/packages/app/views/pages/partials/studio/left-sidebar.ejs b/packages/app/views/pages/partials/studio/left-sidebar.ejsindex 77c4f478..cd3f6cce 100644--- a/packages/app/views/pages/partials/studio/left-sidebar.ejs+++ b/packages/app/views/pages/partials/studio/left-sidebar.ejs@@ -1,103 +1,59 @@-<div- x-data="sidebarState()"- @toggle-sidebar-request.window="toggleSidebar()"- class="max-h-screen z-[11] absolute top-16 md:top-0 h-screen"- :class="{+<div x-data="sidebarState()" @toggle-sidebar-request.window="toggleSidebar()"+ class="max-h-screen z-[11] absolute top-16 md:top-0 h-screen" :class="{// Static widths only apply when sidebarWidth is not set (!sidebarWidth)// When sidebarWidth exists, width is controlled via inline styles'w-full md:w-[414px]': isSidebarOpen && currentSidebarTab === 'helpTab' && !sidebarWidth,'md:w-[378px]': isSidebarOpen && currentSidebarTab !== 'helpTab' && currentSidebarTab !== 'agentBuilderTab' && currentSidebarTab !== 'agentTab' && !sidebarWidth,'w-full md:w-[480px]': isSidebarOpen && (currentSidebarTab === 'agentBuilderTab' || currentSidebarTab === 'agentTab') && !sidebarWidth,'w-0 md:w-16': !isSidebarOpen- }"- id="left-sidebar"->+ }" id="left-sidebar"><!-- x-data="sidebarState()" --><!-- Left mini bar -->- <nav- aria-label="Options"- id="left-sidebar-nav"- class="hidden flex-col items-center flex-shrink-0 w-16 pt-2.5 pb-2 bg-[#F4F4F5] md:flex h-full"- >+ <nav aria-label="Options" id="left-sidebar-nav"+ class="hidden flex-col items-center flex-shrink-0 w-16 pt-2.5 pb-2 bg-[#F4F4F5] md:flex h-full"><!-- Logo --><div class="flex flex-col items-center flex-1 p-0" id="left-sidebar-nav-items"><!-- Agent button -->- <a- href="/"- rel="noopener noreferrer"+ <a href="/" rel="noopener noreferrer"class="flex items-center justify-center cursor-pointer transition-colors h-10 fill-gray-700 hover:fill-gray-700 hover:outline-none mb-2"- data-tooltip-target="tooltip-agent"- data-tooltip-placement="right"- >+ data-tooltip-target="tooltip-agent" data-tooltip-placement="right"><%- include('icons/smyth-grayscale'); -%></a>- <div- id="tooltip-agent"- role="tooltip"+ <div id="tooltip-agent" role="tooltip"class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >+ data-popper-reference-hidden="" data-popper-escaped="" data-popper-placement="bottom">Home</div>-+<div class="relative group components-btn">- <button- id="components-button"- class="relative w-full flex items-center h-10 justify-center"- @click="setSidebarTab('buildTab')"- data-tooltip-target="tooltip-components"- data-tooltip-placement="right"- >- <div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"- :class="{+ <button id="components-button"+ class="tooltip-trigger tooltip-pill relative w-full flex items-center h-10 justify-center"+ @click="setSidebarTab('buildTab')" data-tooltip="Components" data-tooltip-position="right">+ <div class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md" :class="{'!bg-gray-700': currentSidebarTab === 'buildTab' && isSidebarOpen,'!bg-gray-300 !border !border-gray-400': !isSidebarOpen && previousTab === 'buildTab'- }"- >- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- xmlns="http://www.w3.org/2000/svg"- :class="{'[&>path]:!fill-white': currentSidebarTab === 'buildTab' && isSidebarOpen}"- >- <path- fill-rule="evenodd"- clip-rule="evenodd"+ }">+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"+ :class="{'[&>path]:!fill-white': currentSidebarTab === 'buildTab' && isSidebarOpen}">+ <path fill-rule="evenodd" clip-rule="evenodd"d="M6.75 14.75C5.23121 14.75 4 15.9812 4 17.5C4 19.0188 5.23121 20.25 6.75 20.25C8.26879 20.25 9.5 19.0188 9.5 17.5C9.5 15.9812 8.26879 14.75 6.75 14.75ZM2.5 17.5C2.5 15.1528 4.40279 13.25 6.75 13.25C9.09721 13.25 11 15.1528 11 17.5C11 19.8472 9.09721 21.75 6.75 21.75C4.40279 21.75 2.5 19.8472 2.5 17.5Z"- fill="currentColor"- />- <path- fill-rule="evenodd"- clip-rule="evenodd"+ fill="currentColor" />+ <path fill-rule="evenodd" clip-rule="evenodd"d="M8 6.5C8 4.15279 9.90279 2.25 12.25 2.25C14.5972 2.25 16.5 4.15279 16.5 6.5C16.5 8.84721 14.5972 10.75 12.25 10.75C9.90279 10.75 8 8.84721 8 6.5ZM12.25 3.75C10.7312 3.75 9.5 4.98121 9.5 6.5C9.5 8.01879 10.7312 9.25 12.25 9.25C13.7688 9.25 15 8.01879 15 6.5C15 4.98121 13.7688 3.75 12.25 3.75Z"- fill="currentColor"- />- <path- fill-rule="evenodd"- clip-rule="evenodd"+ fill="currentColor" />+ <path fill-rule="evenodd" clip-rule="evenodd"d="M13.5 17.5C13.5 15.1528 15.4028 13.25 17.75 13.25C20.0972 13.25 22 15.1528 22 17.5C22 19.8472 20.0972 21.75 17.75 21.75C15.4028 21.75 13.5 19.8472 13.5 17.5ZM17.75 14.75C16.2312 14.75 15 15.9812 15 17.5C15 19.0188 16.2312 20.25 17.75 20.25C19.2688 20.25 20.5 19.0188 20.5 17.5C20.5 15.9812 19.2688 14.75 17.75 14.75Z"- fill="currentColor"- />+ fill="currentColor" /></svg></div></button>- <div- id="tooltip-components"- role="tooltip"+ <div id="tooltip-components" role="tooltip"class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >+ data-popper-reference-hidden="" data-popper-escaped="" data-popper-placement="bottom">Components</div></div>@@ -110,98 +66,54 @@<!-- Deploy --><div class="relative group deploy-btn">- <button- id="deploy-button"- class="relative w-full flex items-center h-10 justify-center"- @click="setSidebarTab('deployTab')"- data-tooltip-target="tooltip-deploy"- data-tooltip-placement="right"- >- <div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"- :class="{+ <button id="deploy-button"+ class="tooltip-trigger tooltip-pill relative w-full flex items-center h-10 justify-center"+ @click="setSidebarTab('deployTab')" data-tooltip="Deploy" data-tooltip-position="right">+ <div class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md" :class="{'!bg-gray-700': currentSidebarTab === 'deployTab' && isSidebarOpen,'!bg-gray-300 !border !border-gray-400': !isSidebarOpen && previousTab === 'deployTab'- }"- >- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- xmlns="http://www.w3.org/2000/svg"- :class="{'[&>path]:!fill-white': currentSidebarTab === 'deployTab' && isSidebarOpen}"- >+ }">+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"+ :class="{'[&>path]:!fill-white': currentSidebarTab === 'deployTab' && isSidebarOpen}"><pathd="M12.5604 21.75C10.8462 21.747 9.16316 21.2922 7.68084 20.4314C6.19852 19.5706 4.96933 18.3342 4.11721 16.8469C3.26509 15.3595 2.82015 13.6738 2.82723 11.9597C2.83432 10.2456 3.2932 8.56362 4.15758 7.08338C5.02197 5.60314 6.26131 4.37694 7.75069 3.52841C9.24008 2.67987 10.9268 2.23899 12.641 2.25021C14.3551 2.26143 16.0359 2.72435 17.5141 3.5923C18.9922 4.46026 20.2154 5.70256 21.0604 7.19399C21.1415 7.36498 21.155 7.56033 21.0982 7.74086C21.0413 7.9214 20.9183 8.07377 20.7538 8.1674C20.5893 8.26103 20.3955 8.28901 20.2113 8.24572C20.027 8.20243 19.8659 8.09107 19.7603 7.93399C18.7467 6.14468 17.1012 4.79859 15.1465 4.15966C13.1918 3.52074 11.0689 3.63508 9.19411 4.48026C7.31934 5.32544 5.82792 6.84049 5.01232 8.72832C4.19672 10.6161 4.11578 12.7406 4.78536 14.685C5.35829 16.3478 6.44799 17.7839 7.89526 18.7833C9.34252 19.7826 11.0715 20.293 12.8295 20.2397C14.5874 20.1864 16.2823 19.5723 17.6664 18.4871C19.0505 17.4019 20.0512 15.9025 20.5224 14.208C20.5799 14.0216 20.7079 13.865 20.879 13.7714C21.0502 13.6778 21.251 13.6545 21.439 13.7066C21.627 13.7586 21.7873 13.8819 21.886 14.0502C21.9846 14.2184 22.0138 14.4185 21.9673 14.608C21.3932 16.6603 20.1641 18.4687 18.4672 19.7579C16.7702 21.047 14.6984 21.7462 12.5673 21.749L12.5604 21.75Z"- fill="currentColor"- />+ fill="currentColor" /><pathd="M20.6492 8.31853H17.3682C17.1693 8.31853 16.9785 8.23951 16.8379 8.09885C16.6972 7.9582 16.6182 7.76744 16.6182 7.56853C16.6182 7.36961 16.6972 7.17885 16.8379 7.0382C16.9785 6.89755 17.1693 6.81853 17.3682 6.81853H19.8992V4.26953C19.8992 4.07062 19.9782 3.87985 20.1188 3.7392C20.2595 3.59854 20.4503 3.51953 20.6492 3.51953C20.8481 3.51953 21.0389 3.59854 21.1795 3.7392C21.3202 3.87985 21.3992 4.07062 21.3992 4.26953V7.56953C21.3989 7.76827 21.3198 7.95878 21.1791 8.09921C21.0385 8.23965 20.8479 8.31853 20.6492 8.31853Z"- fill="currentColor"- />+ fill="currentColor" /><pathd="M15.3986 15.3164C15.2637 15.3164 15.1313 15.2797 15.0156 15.2104L11.8406 13.3104C11.7291 13.244 11.6367 13.1497 11.5727 13.0368C11.5087 12.9239 11.4752 12.7962 11.4756 12.6664V8.56641C11.4756 8.36749 11.5546 8.17673 11.6953 8.03608C11.8359 7.89543 12.0267 7.81641 12.2256 7.81641C12.4245 7.81641 12.6153 7.89543 12.7559 8.03608C12.8966 8.17673 12.9756 8.36749 12.9756 8.56641V12.2394L15.7846 13.9174C15.9257 14.0016 16.0352 14.1298 16.0963 14.2823C16.1575 14.4348 16.1668 14.6032 16.123 14.7616C16.0791 14.9199 15.9845 15.0595 15.8536 15.1588C15.7228 15.2581 15.5629 15.3118 15.3986 15.3114V15.3164Z"- fill="currentColor"- />+ fill="currentColor" /></svg></div></button>- <div- id="tooltip-deploy"- role="tooltip"+ <div id="tooltip-deploy" role="tooltip"class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >+ data-popper-reference-hidden="" data-popper-escaped="" data-popper-placement="bottom">Deploy</div></div><div class="relative group settings-btn">- <button- id="settings-button"- class="relative w-full flex items-center h-10 justify-center"- @click="openAgentSettings()"- data-tooltip-target="tooltip-settings"- data-tooltip-placement="right"- >- <div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"- :class="{'!bg-gray-700': !!rightSidebarOpen}"- >- <svg- width="20"- fill="none"- height="20"- viewBox="0 0 24 24"- xmlns="http://www.w3.org/2000/svg"- :class="{'[&>path]:!fill-white': !!rightSidebarOpen}"- >- <path- fill-rule="evenodd"- clip-rule="evenodd"+ <button id="settings-button"+ class="tooltip-trigger tooltip-pill relative w-full flex items-center h-10 justify-center"+ @click="openAgentSettings()" data-tooltip="Settings" data-tooltip-position="right">+ <div class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"+ :class="{'!bg-gray-700': !!rightSidebarOpen}">+ <svg width="20" fill="none" height="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"+ :class="{'[&>path]:!fill-white': !!rightSidebarOpen}">+ <path fill-rule="evenodd" clip-rule="evenodd"d="M16.8853 11.3395C16.7416 10.4552 16.3234 9.63843 15.6899 9.00491C15.0564 8.37139 14.2397 7.95319 13.3553 7.80952C12.692 7.70522 12.0134 7.7592 11.3749 7.96705C10.7364 8.1749 10.1561 8.53074 9.68132 9.00554C9.20652 9.48034 8.85068 10.0606 8.64283 10.6991C8.43498 11.3376 8.381 12.0162 8.4853 12.6795V12.6695C8.663 13.7834 9.27592 14.7811 10.1892 15.4431C11.1025 16.1051 12.2414 16.3772 13.3553 16.1995C14.4692 16.0218 15.4669 15.4089 16.1289 14.4956C16.7909 13.5823 17.063 12.4434 16.8853 11.3295V11.3395ZM12.2853 14.7095H12.2753C11.5552 14.5902 10.9121 14.1897 10.4873 13.5961C10.0625 13.0026 9.89095 12.2646 10.0103 11.5445C10.1297 10.8245 10.5302 10.1813 11.1237 9.75653C11.7173 9.33176 12.4553 9.16017 13.1753 9.27952H13.1853C13.7552 9.37544 14.281 9.64657 14.6896 10.0552C15.0983 10.4638 15.3694 10.9896 15.4653 11.5595C15.5353 11.9917 15.5011 12.4343 15.3656 12.8506C15.23 13.2669 14.997 13.6448 14.686 13.9529C14.375 14.261 13.9949 14.4904 13.5773 14.622C13.1597 14.7536 12.7168 14.7836 12.2853 14.7095Z"- fill="#374151"- />- <path- fill-rule="evenodd"- clip-rule="evenodd"+ fill="#374151" />+ <path fill-rule="evenodd" clip-rule="evenodd"d="M22.4247 11.0094C22.382 10.5943 22.2397 10.1958 22.0099 9.84753C21.7801 9.49931 21.4695 9.21177 21.1047 9.00937L20.1047 8.44937C19.7368 8.24297 19.4997 7.80627 19.4847 7.38937V6.23937C19.5005 5.83167 19.4179 5.42614 19.2439 5.05712C19.0698 4.6881 18.8094 4.36645 18.4847 4.11937C17.9314 3.7249 17.3381 3.38972 16.7147 3.11937C16.3382 2.95278 15.9272 2.87943 15.5163 2.90555C15.1055 2.93166 14.707 3.05646 14.3547 3.26937L13.3547 3.85937C12.9754 4.0754 12.4885 4.06721 12.1047 3.85937L11.1047 3.26937C10.7524 3.05646 10.3539 2.93166 9.94305 2.90555C9.53221 2.87943 9.12114 2.95278 8.74469 3.11937C8.12571 3.39232 7.53602 3.72737 6.98469 4.11937C6.66123 4.36758 6.40174 4.68945 6.2278 5.0582C6.05386 5.42695 5.97051 5.83191 5.98469 6.23937V7.37937C5.97201 7.80601 5.74102 8.22034 5.37469 8.43937L4.37469 8.99937C4.00875 9.20044 3.69732 9.48763 3.46732 9.83611C3.23733 10.1846 3.09569 10.5839 3.05469 10.9994C2.98177 11.664 2.98177 12.3347 3.05469 12.9994C3.09735 13.4144 3.23965 13.813 3.46948 14.1612C3.6993 14.5094 4.00985 14.797 4.37469 14.9994L5.37469 15.5494C5.73962 15.7749 5.9693 16.1906 5.98469 16.6194V17.7594C5.97133 18.1667 6.05505 18.5714 6.22892 18.94C6.4028 19.3086 6.66185 19.6306 6.98469 19.8794C7.53919 20.272 8.13226 20.607 8.75469 20.8794C9.13728 21.0582 9.5578 21.1407 9.97959 21.1198C10.4014 21.0989 10.8117 20.9752 11.1747 20.7594L12.1747 20.1694C12.5489 19.9571 13.0308 19.9564 13.4047 20.1694L14.4047 20.7594C14.7597 20.97 15.1596 21.0935 15.5716 21.1195C15.9836 21.1456 16.3959 21.0736 16.7747 20.9094C17.3957 20.6342 17.9885 20.2993 18.5447 19.9094C18.8682 19.6612 19.1276 19.3393 19.3016 18.9706C19.4755 18.6018 19.5589 18.1968 19.5447 17.7894V16.6494C19.5574 16.2212 19.7981 15.811 20.1647 15.5894L21.1647 15.0394C21.5271 14.8351 21.8353 14.5469 22.0632 14.1989C22.2912 13.8509 22.4323 13.4532 22.4747 13.0394C22.5324 12.3629 22.5156 11.6822 22.4247 11.0094ZM20.9347 12.8594C20.8977 13.2092 20.6887 13.5323 20.3847 13.7094L19.3847 14.2594C18.9654 14.4939 18.6192 14.84 18.3847 15.2594C18.1378 15.677 18.0099 16.1542 18.0147 16.6394V17.7794C18.0343 18.1219 17.867 18.4644 17.5847 18.6594C17.1187 18.999 16.6195 19.2905 16.0947 19.5294C15.7748 19.6694 15.3919 19.6426 15.0947 19.4594L14.0947 18.8694C13.6751 18.6283 13.1986 18.504 12.7147 18.5094C12.2275 18.5027 11.7474 18.627 11.3247 18.8694L10.3247 19.4594C10.0263 19.6395 9.64531 19.6662 9.32469 19.5294C8.79672 19.2905 8.29418 18.9991 7.82469 18.6594C7.55159 18.4557 7.38758 18.12 7.39469 17.7794V16.6394C7.3973 16.15 7.26588 15.6693 7.01469 15.2494C6.78364 14.8274 6.43664 14.4804 6.01469 14.2494L5.01469 13.6994C4.71073 13.5223 4.50168 13.1992 4.46469 12.8494C4.41467 12.2972 4.41467 11.7416 4.46469 11.1894C4.50168 10.8395 4.71073 10.5165 5.01469 10.3394L6.01469 9.77937C6.42534 9.56007 6.77043 9.23569 7.01469 8.83937C7.26588 8.41942 7.3973 7.93871 7.39469 7.44937V6.30937C7.38758 5.96873 7.55159 5.63309 7.82469 5.42937C8.29418 5.08969 8.79672 4.79822 9.32469 4.55937C9.64089 4.40463 10.0331 4.43209 10.3247 4.62937L11.3247 5.21937C11.7443 5.46043 12.2208 5.58474 12.7047 5.57937C13.1933 5.58707 13.6745 5.45899 14.0947 5.20937L15.0947 4.62937C15.3862 4.43209 15.7785 4.40463 16.0947 4.55937C16.6243 4.79101 17.1272 5.07936 17.5947 5.41937C17.88 5.61614 18.0478 5.96359 18.0247 6.30937V7.34937C18.0229 7.81887 18.1435 8.28074 18.3747 8.68937C18.6121 9.10653 18.9575 9.45198 19.3747 9.68937L20.3747 10.2494C20.6797 10.4252 20.8893 10.7491 20.9247 11.0994C20.9899 11.6841 20.9932 12.274 20.9347 12.8594Z"- fill="#374151"- />+ fill="#374151" /></svg></div></button>- <div- id="tooltip-settings"- role="tooltip"+ <div id="tooltip-settings" role="tooltip"class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >+ data-popper-reference-hidden="" data-popper-escaped="" data-popper-placement="bottom">Settings</div></div>@@ -211,66 +123,33 @@<!-- New Agent --><div class="relative group new-agent-btn">- <a- href="/builder"- target="_blank"- class="relative w-full flex items-center h-10 justify-center"- >+ <a href="/builder" target="_blank" class="relative w-full flex items-center h-10 justify-center"><div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md hover:bg-gray-700 group-hover:bg-gray-700 group"- >- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- xmlns="http://www.w3.org/2000/svg"- class="transition-colors"- >- <path- d="M6 12H18"- stroke="currentColor"- stroke-width="1.5"- stroke-linecap="round"- stroke-linejoin="round"- class="group-hover:stroke-white"- />- <path- d="M12 6V18"- stroke="currentColor"- stroke-width="1.5"- stroke-linecap="round"- stroke-linejoin="round"- class="group-hover:stroke-white"- />+ class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md hover:bg-gray-700 group-hover:bg-gray-700 group">+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"+ class="transition-colors">+ <path d="M6 12H18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"+ class="group-hover:stroke-white" />+ <path d="M12 6V18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"+ class="group-hover:stroke-white" /></svg></div></a><!-- Agents Dropdown --><div- class="absolute left-8 top-0 w-72 bg-white rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-50"- >+ class="absolute left-8 top-0 w-72 bg-white rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-50"><div class="py-2">- <div- class="space-y-2 max-h-[300px] min-h-[200px] overflow-y-auto pl-2"- id="recent-agents-dropdown"- style="scrollbar-gutter: stable"- >+ <div class="space-y-2 max-h-[300px] min-h-[200px] overflow-y-auto pl-2" id="recent-agents-dropdown"+ style="scrollbar-gutter: stable"><div class="flex items-center justify-center py-4">- <div- class="animate-spin rounded-full h-6 w-6 border-b-2 border-solid border-smyth-blue"- ></div>+ <div class="animate-spin rounded-full h-6 w-6 border-b-2 border-solid border-smyth-blue"></div></div></div><div- class="h-14 bg-gray-50 hover:bg-gray-200 border border-solid border-gray-200 rounded-lg mx-2 mt-2 flex items-center"- >- <a- href="/builder"- target="_blank"- class="w-full text-gray-700 hover:text-gray-900 font-medium flex items-center gap-2 px-2"- >+ class="h-14 bg-gray-50 hover:bg-gray-200 border border-solid border-gray-200 rounded-lg mx-2 mt-2 flex items-center">+ <a href="/builder" target="_blank"+ class="w-full text-gray-700 hover:text-gray-900 font-medium flex items-center gap-2 px-2"><div class="flex items-center justify-center w-8 h-8 bg-gray-100 rounded-full"><i class="fa-solid fa-plus text-smyth-blue"></i></div>@@ -283,162 +162,80 @@<!-- Home --><div class="relative group home-btn">- <a- href="/"- target="_blank"- rel="noopener noreferrer"- id="home-button"- class="relative w-full flex items-center h-10 justify-center"- data-tooltip-target="tooltip-home"- data-tooltip-placement="right"- >+ <a href="/" target="_blank" rel="noopener noreferrer" id="home-button"+ class="tooltip-trigger tooltip-pill relative w-full flex items-center h-10 justify-center" data-tooltip="Home"+ data-tooltip-position="right"><div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md hover:bg-gray-100"- >+ class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md hover:bg-gray-100"><%- include('icons/home'); -%></div></a>- <div- id="tooltip-home"- role="tooltip"+ <div id="tooltip-home" role="tooltip"class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >+ data-popper-reference-hidden="" data-popper-escaped="" data-popper-placement="bottom">Home</div></div><!-- Vault -->- <% if (navPages.filter(page => page.url === '/vault').length > 0) { %>- <div class="relative group vault-btn">- <a- href="/vault"- target="_blank"- rel="noopener noreferrer"- id="vault-button"- class="relative w-full flex items-center h-10 justify-center"- data-tooltip-target="tooltip-vault"- data-tooltip-placement="right"- >- <div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md hover:bg-gray-100"- >- <%- include('icons/key'); -%>+ <% if (navPages.filter(page=> page.url === '/vault').length > 0) { %>+ <div class="relative group vault-btn">+ <a href="/vault" target="_blank" rel="noopener noreferrer" id="vault-button"+ class="tooltip-trigger tooltip-pill relative w-full flex items-center h-10 justify-center"+ data-tooltip="Vault" data-tooltip-position="right">+ <div+ class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md hover:bg-gray-100">+ <%- include('icons/key'); -%>+ </div>+ </a>+ <div id="tooltip-vault" role="tooltip"+ class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"+ data-popper-reference-hidden="" data-popper-escaped="" data-popper-placement="bottom">+ Vault</div>- </a>- <div- id="tooltip-vault"- role="tooltip"- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >- Vault</div>- </div>- <% } %>+ <% } %></div><!-- Help button needs special handling --><div class="relative w-full flex items-center justify-center">- <button- id="help-button"- class="w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"- @click="setSidebarTab('helpTab')"- data-tooltip-target="tooltip-help"- data-tooltip-placement="right"- >- <div- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"- :class="{'!bg-gray-700': currentSidebarTab === 'helpTab' && isSidebarOpen}"- >- <svg- xmlns="http://www.w3.org/2000/svg"- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="1.5"- stroke-linecap="round"- stroke-linejoin="round"+ <button id="help-button"+ class="tooltip-trigger tooltip-pill w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"+ @click="setSidebarTab('helpTab')" data-tooltip="Help" data-tooltip-position="right">+ <div class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"+ :class="{'!bg-gray-700': currentSidebarTab === 'helpTab' && isSidebarOpen}">+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"+ stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"class="lucide lucide-help-circle transition-colors"- :class="{'!stroke-white': currentSidebarTab === 'helpTab' && isSidebarOpen}"- >+ :class="{'!stroke-white': currentSidebarTab === 'helpTab' && isSidebarOpen}"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><path d="M12 17h.01"></path></svg></div></button>- <div- id="tooltip-help"- role="tooltip"- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >- Help- </div></div><!-- Feedback button --><div class="relative w-full flex items-center justify-center">- <button- id="feedback-button"- class="w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"- data-tooltip-target="tooltip-feedback"- data-tooltip-placement="right"- >- <svg- width="20"- height="20"- viewBox="0 0 20 20"- fill="none"- xmlns="http://www.w3.org/2000/svg"- >- <path- d="M6.38672 6.6875H11.0176M6.38672 9.86876H8.38573"- stroke="currentColor"- stroke-width="1.25"- stroke-linecap="round"- stroke-linejoin="round"- />+ <button id="feedback-button"+ class="tooltip-trigger tooltip-pill w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"+ data-tooltip="Feedback" data-tooltip-position="right">+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path d="M6.38672 6.6875H11.0176M6.38672 9.86876H8.38573" stroke="currentColor" stroke-width="1.25"+ stroke-linecap="round" stroke-linejoin="round" /><pathd="M9.47683 14.4364H7.00674C6.75384 14.4364 6.50688 14.5128 6.2985 14.6557L3.80549 16.3641C3.25258 16.743 2.5 16.3485 2.5 15.6797V5.29627C2.5 3.92021 3.61929 2.80469 5 2.80469H15C16.3807 2.80469 17.5 3.9202 17.5 5.29627V9.45325"- stroke="currentColor"- stroke-width="1.25"- stroke-linecap="round"- stroke-linejoin="round"- />+ stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" /><pathd="M14.6516 13.3472C15.1236 11.8857 14.8813 11.3036 14.4133 11.2077C14.2345 11.1711 14.1603 11.1729 14.0188 11.3102C13.5612 11.8481 12.7882 12.69 12.3664 13.1458C12.2575 13.2637 12.203 13.3226 12.1644 13.389C12.1284 13.4508 12.1028 13.5165 12.0871 13.5862C12.0703 13.6612 12.0703 13.7408 12.0703 13.9002V15.8511C12.0703 16.3172 12.0703 16.5502 12.1598 16.7288C12.2421 16.8928 12.3755 17.0257 12.54 17.1077C12.7193 17.197 12.9531 17.197 13.4208 17.197H15.4663C15.8429 17.197 16.0313 17.197 16.1892 17.1331C16.3346 17.0742 16.4613 16.9774 16.5562 16.8529C16.6592 16.7176 16.7083 16.5363 16.8063 16.1739L16.9792 15.5352C17.1644 14.8507 17.257 14.5086 17.1796 14.2378C17.1088 13.9902 16.9462 13.7787 16.7248 13.6461C16.4827 13.5011 16.1271 13.5011 15.4158 13.5011H14.7625C14.6403 13.5011 14.6171 13.4541 14.6516 13.3472Z"- stroke="currentColor"- stroke-width="1.25"- stroke-linecap="round"- stroke-linejoin="round"- />+ stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" /></svg></button>- <div- id="tooltip-feedback"- role="tooltip"- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >- Feedback- </div></div><!-- bottom buttons --><div class="relative w-full flex items-center justify-center">- <button- id="collapse-expand-btn-builder-left-sidebar"- class="w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"+ <button id="collapse-expand-btn-builder-left-sidebar"+ class="tooltip-trigger tooltip-pill w-full h-10 flex items-center text-gray-600 justify-center transition-all duration-300"@click="if (!isSidebarOpen) {isSidebarOpen = true;@@ -448,95 +245,52 @@} else {isSidebarOpen = false;}- "- data-tooltip-target="tooltip-collapse-expand"- data-tooltip-placement="right"- >- <svg- width="20"- height="20"- viewBox="0 0 24 24"- fill="none"- xmlns="http://www.w3.org/2000/svg"- class="transition-transform duration-300"- :class="isSidebarOpen ? '' : 'rotate-180'"- >- <path- d="M18.0039 18L11.0039 12L18.0039 6"- stroke="#374151"- stroke-width="1.5"- stroke-linecap="round"- stroke-linejoin="round"- />- <path- d="M6 18V6"- stroke="#374151"- stroke-width="1.5"- stroke-linecap="round"- stroke-linejoin="round"- />+ " :data-tooltip="isSidebarOpen ? 'Collapse' : 'Expand'" data-tooltip-position="right">+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"+ class="transition-transform duration-300" :class="isSidebarOpen ? '' : 'rotate-180'">+ <path d="M18.0039 18L11.0039 12L18.0039 6" stroke="#374151" stroke-width="1.5" stroke-linecap="round"+ stroke-linejoin="round" />+ <path d="M6 18V6" stroke="#374151" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg></button>- <div- id="tooltip-collapse-expand"- role="tooltip"- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"- data-popper-reference-hidden=""- data-popper-escaped=""- data-popper-placement="bottom"- >- <span x-text="isSidebarOpen ? 'Collapse' : 'Expand'"></span>- </div></div></nav>- <div- x-show="isSidebarOpen"- id="left-sidebar-container"- class="inset-y-0 -top-5 md:top-4 md:bottom-4 left-[6px] md:left-[80px] p-3 px-0 flex-shrink-0 rounded-lg absolute"- >- <div- aria-label="Main"- id="left-sidebar-content-sections"- class="flex flex-col items-start bg-white rounded-lg border border-solid border-gray-300 h-[calc(100dvh-4rem)] md:h-full"- >+ <div x-show="isSidebarOpen" id="left-sidebar-container"+ class="inset-y-0 -top-5 md:top-4 md:bottom-4 left-[6px] md:left-[80px] p-3 px-0 flex-shrink-0 rounded-lg absolute">+ <div aria-label="Main" id="left-sidebar-content-sections"+ class="flex flex-col items-start bg-white rounded-lg border border-solid border-gray-300 h-[calc(100dvh-4rem)] md:h-full"><div class="w-full flex md:hidden justify-between items-center p-2"><div class="flex items-center gap-2"><div class="flex items-center h-full gap-2">- <% if (typeof agent !== 'undefined' && agent) { %> <% if (agent.avatar) { %>- <img- class="w-8 h-8 rounded-full"- src="<%= agent.avatar %>"- alt="agent avatar"- onerror="this.onerror=null;this.src='/img/user_default.svg';"- />- <% } else { %>- <div- class="bg-uipink rounded-full w-8 h-8 flex items-center justify-center text-white font-medium text-xl"- >- <%= (agent.name || 'A').charAt(0).toLocaleUpperCase() %>- </div>- <% } %>- <p class="builder-topbar-agent-name font-medium"><%= agent.name %></p>- <% } %>+ <% if (typeof agent !=='undefined' && agent) { %>+ <% if (agent.avatar) { %>+ <img class="w-8 h-8 rounded-full" src="<%= agent.avatar %>" alt="agent avatar"+ onerror="this.onerror=null;this.src='/img/user_default.svg';" />+ <% } else { %>+ <div+ class="bg-uipink rounded-full w-8 h-8 flex items-center justify-center text-white font-medium text-xl">+ <%= (agent.name || 'A' ).charAt(0).toLocaleUpperCase() %>+ </div>+ <% } %>+ <p class="builder-topbar-agent-name font-medium">+ <%= agent.name %>+ </p>+ <% } %></div></div><div @click="toggleSidebar"><i class="fa-solid fa-arrow-right"></i></div></div>- <section- x-show="(currentSidebarTab == 'helpTab')"- class="helpTab m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%]"- >+ <section x-show="(currentSidebarTab == 'helpTab')"+ class="helpTab m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%]"><%- include('left-sidebar-help'); -%></section>- <section- x-show="(currentSidebarTab == 'agentTab')"+ <section x-show="(currentSidebarTab == 'agentTab')"class="agentTab pb-4 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%] [&>*]:w-[calc(100%+5px)]"- style="scrollbar-gutter: stable"- >+ style="scrollbar-gutter: stable"><%- include('left-sidebar-agent', { agentId: agentId }); -%></section>@@ -544,16 +298,14 @@<%- include('left-sidebar-build', { menu: menu }); -%></section>- <section- x-show="(currentSidebarTab == 'deployTab')"- class="deployTab pb-4 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%]"- >+ <section x-show="(currentSidebarTab == 'deployTab')"+ class="deployTab pb-4 m-0 relative w-full overflow-hidden hover:overflow-y-auto h-[100%]"><%- include('left-sidebar-deploy'); -%></section>--++</div></div>@@ -597,15 +349,15 @@if (!this.isSidebarOpen) {return '84px';}-+// Sidebar left position: 80px on desktop (64px nav + 16px), 6px on mobileconst sidebarLeft = window.innerWidth >= 768 ? 80 : 6;-+// Get sidebar width from stored value or use default from getLeftSidebarWidth()- const sidebarWidth = this.sidebarWidth- ? parseInt(this.sidebarWidth)+ const sidebarWidth = this.sidebarWidth+ ? parseInt(this.sidebarWidth): parseInt(getLeftSidebarWidth());-+// Position = sidebar left + sidebar width + paddingreturn `${sidebarLeft + sidebarWidth + 8}px`;},@@ -613,10 +365,10 @@// Add special handler for the help tabtoggleHelpTab() {if (this.currentSidebarTab === 'helpTab') {- // If no valid previous tab, close sidebar- this.previousTab = this.currentSidebarTab;- this.currentSidebarTab = null;- this.isSidebarOpen = false;+ // 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 helpthis.previousTab = this.currentSidebarTab;@@ -685,29 +437,29 @@this.isSidebarOpen =(storedValue !== null ? storedValue === 'true' : true) || isChatPresent;- // Always use default tab (weaver or component) instead of restoring from localStorage- // Check if weaver is enabled (same logic as builder.ejs - weaver is always enabled)- const isWeaverEnabled = true; // Weaver is always enabled (same as builder.ejs)- const defaultTab = isWeaverEnabled ? 'agentBuilderTab' : 'buildTab';-- // Always set to default tab when sidebar is open- if (this.isSidebarOpen) {- this.currentSidebarTab = defaultTab;- localStorage.setItem('currentSidebarTab', defaultTab);- } else {- this.currentSidebarTab = null;- }-- // Initialize previousTab (but don't restore currentSidebarTab from localStorage)- this.previousTab = localStorage.getItem('previousTab');- if (this.previousTab === 'null') this.previousTab = null;+ // Always use default tab (weaver or component) instead of restoring from localStorage+ // Check if weaver is enabled (same logic as builder.ejs - weaver is always enabled)+ const isWeaverEnabled = true; // Weaver is always enabled (same as builder.ejs)+ const defaultTab = isWeaverEnabled ? 'agentBuilderTab' : 'buildTab';++ // Always set to default tab when sidebar is open+ if (this.isSidebarOpen) {+ this.currentSidebarTab = defaultTab;+ localStorage.setItem('currentSidebarTab', defaultTab);+ } else {+ this.currentSidebarTab = null;+ }++ // Initialize previousTab (but don't restore currentSidebarTab from localStorage)+ this.previousTab = localStorage.getItem('previousTab');+ if (this.previousTab === 'null') this.previousTab = null;// === SINGLE SOURCE OF TRUTH: Apply width to DOM ===const applyWidth = (width) => {this.$nextTick(() => {const leftSidebar = document.querySelector('#left-sidebar');const contentContainer = document.querySelector('#left-sidebar-content-sections');-+if (leftSidebar && width) {leftSidebar.style.setProperty('width', width, 'important');}@@ -752,8 +504,8 @@if (leftSidebar) leftSidebar.style.width = '';if (contentContainer) contentContainer.style.width = '';});-- // Very important: If sidebar is closed, ensure currentSidebarTab is null++ // Very important: If sidebar is closed, ensure currentSidebarTab is nullif (this.currentSidebarTab) {this.previousTab = this.currentSidebarTab;this.currentSidebarTab = null;@@ -831,4 +583,4 @@},}));});-</script>+</script>\ No newline at end of file