title: Big Sur Toolbar Items in the Sidebar
body: <p>In Big Sur, Xcode and Calendar have toolbar items that stay over the sidebar when open but remain visible on the left side when the sidebar's collapsed.</p>
  <p>Sidebar open:
  <a href="https://i.stack.imgur.com/uXoDI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uXoDI.png" alt="enter image description here" /></a></p>
  <p>Sidebar collapsed:
  <a href="https://i.stack.imgur.com/X2SaR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/X2SaR.png" alt="enter image description here" /></a></p>
  <p>In <a href="https://developer.apple.com/videos/play/wwdc2020/10104/?time=835" rel="noreferrer">&quot;Adopt the New Look of macOS&quot;</a> at 13:55, John says &quot;items placed before the separator [sidebarTrackingSeparator] will appear over the full-height sidebar&quot;, just as they are in Xcode and Calendar. I haven't been able to make this work.</p>
  <p><a href="https://github.com/seanmrich/SidebarToggleTest" rel="noreferrer">Here's a sample project</a> that demonstrates the issue. I used the IB-defined &quot;Window Controller with Sidebar&quot; and added a toolbar item for toggling the sidebar. In a subclass of NSWindowController I insert <code>.sidebarTrackingSeparator</code> after the <code>.toggleSidebar</code> item:</p>
  <pre class="lang-swift prettyprint-override"><code>override func windowDidLoad() {
      // Sometimes the toolbar items aren't loaded yet--async is a quick and dirty way to prevent a crash
      DispatchQueue.main.async {
          self.window?.toolbar?.insertItem(withItemIdentifier: .sidebarTrackingSeparator, at: 1)
      }
  }
  
  </code></pre>
  <p>Sometimes this has no effect (the toggle button remains to the right of the sidebar). Sometimes the sidebar toggle get put in an overflow menu:</p>
  <p><a href="https://i.stack.imgur.com/HKVkz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HKVkz.png" alt="enter image description here" /></a></p>
  <p>I haven't seen any discussion of implementing this toolbar design outside that WWDC session. Has anyone been able to get this to work?</p>