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.

2.6 KB
Raw Blame
<div
  class="z-10 right-sidebar border border-gray-300/80 border-solid rounded-lg embodiment h-full py-4 hidden"
  x-data="agentSettingsSidebar()"
  x-bind:style="'width: ' + width"
  id="agent-settings-sidebar"
>
  <div class="container flex flex-col h-full">
    <div class="dialog-title flex">
      <div class="inline-flex w-full overflow-visible px-4" role="group">
        <div class="title flex items-center flex-1 text-base font-semibold overflow-visible"></div>

        <!-- <div class="title-left-buttons inline-flex text-sm"></div>
          <div class="title-right-buttons inline-flex" dir="rtl">
            <div class="dialog-actions actions m-0 flex">
              <div class="action-buttons w-full inline-flex justify-end px-0 m-0">
                <div class="action-content w-full flex"></div>
              </div>
            </div>
            <button
              type="button"
              class="close-btn items-center py-2 text-xs font-medium text-gray-900 bg-transparent hover:text-gray-600 active:text-gray-900 focus:z-10"
            >
              <span class="mif-cross"></span>
            </button>
          </div> -->
      </div>
    </div>
    <div
      class="tab-container border-b border-gray-200 order-2 py-3 px-4 overflow-x-scroll [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] scroll-smooth [scrollbar-width:none]"
    >
      <nav class="flex -mb-px" aria-label="Tabs"></nav>
    </div>
    <div class="dialog-content content flex-grow overflow-y-auto overflow-x-hidden"></div>
  </div>
</div>

<script>
  document.addEventListener('alpine:init', () => {
    Alpine.data('agentSettingsSidebar', () => ({
      width: '420px',
      init() {
        this.checkWidth();
        window.addEventListener('sidebarStateChanged', () => {
          const sidebarEl = document.getElementById('agent-settings-sidebar');
          if (sidebarEl && sidebarEl.offsetParent !== null) {
            this.checkWidth();
          }
        });
        // Listen for resize events to update width in real-time
        window.addEventListener('rightSidebarResized', (event) => {
          this.width = event.detail.width;
        });
      },
      checkWidth() {
        const DEFAULT_WIDTH = '520px';
        let storedWidth = localStorage.getItem('right-sidebar-common-width') || DEFAULT_WIDTH;

        // Validate width doesn't exceed half screen
        if (parseInt(storedWidth) > window.innerWidth / 2) {
          storedWidth = DEFAULT_WIDTH;
          localStorage.setItem('right-sidebar-common-width', storedWidth);
        }
        this.width = storedWidth;
      },
    }));
  });
</script>