ws = null;
        panes.style.gridTemplateColumns = "var(--left-column-width) 1fr";
      }
    }
    layout.addEventListener('change', () => {
      layoutType = layout.value;
      setLayout(layoutType, splitRatio);
      updateDividerPosition(); // Ensure divider updates when layout changes
    });

    // handle changing the split ratio
    const divider = document.getElementById('divider');
    function updateDividerPosition() {
      if (layoutType === 'topbottom') {
        // For top/bottom layout,