function toggleExpandWindow(shouldExpandWindow) {
  if (shouldExpandWindow != null) expanded = !shouldExpandWindow;

  if (!expanded) {
    assistantWindow.setSize(screen.availWidth - 20, 450);
    expandCollapseButton.setAttribute('src', '../res/collapse_btn.svg'); // Change to 'collapse' icon after expanding
  }
  else {
    assistantWindow.setSize(1000, 420);
    expandCollapseButton.setAttribute('src', '../res/expand_btn.svg'); // Change to 'expand' icon after collapsing
  }

  setAssistantWindowPosition();
  expanded = !expanded;
}
Toggle Expand/Collapse Assistant Window.

@param {boolean?} shouldExpandWindow
Specify whether the window should be expanded.
Leave the parameter if the window should toggle
the size automatically.