supplementarySidebarTrackingSeparatorItemIdentifier

I'm developing an iOS 14 Catalyst app and I'm trying to setup the window toolbar.

I created a NSToolbar and assigned to the scene window titlebar property.

var toolbarDelegate = ToolbarDelegate()

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
   
   #if targetEnvironment(macCatalyst)
   guard let windowScene = scene as? UIWindowScene else { return }
   let toolbar = NSToolbar(identifier: "main")
   toolbar.delegate = toolbarDelegate
   toolbar.displayMode = .iconOnly
   
   if let titlebar = windowScene.titlebar {
      titlebar.toolbar = toolbar
      titlebar.toolbarStyle = .unified
      titlebar.titleVisibility = .hidden
   }
   #endif
}

I then assigned some items to the toolbar via the toolbarDefaultItemIdentifiers delegate method.

func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
   let identifiers: [NSToolbarItem.Identifier] = [
      .toggleSidebar,
      .print,
      .flexibleSpace,
      .print
   ]
   return identifiers
}

This work as expected.

Now, let's say that I want to align some items with the edges of the supplementary column.

I found that there is an NSToolbarItem named supplementarySidebarTrackingSeparatorItemIdentifier.

This item appears to allow us to align items with the supplementary column. If I do this:

func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
   let identifiers: [NSToolbarItem.Identifier] = [
      .toggleSidebar,
      .flexibleSpace,
      .print,
      .supplementarySidebarTrackingSeparatorItemIdentifier,
      .print,
      .flexibleSpace,
      .print
   ]
   return identifiers
}

I got the following result which is exactly what I want to achieve (the items are aligned with the supplementary column):

But there are some issues.

As you can see from the above image for some reason the background color of the toolbar on top of the supplementary column become white. But it's worse. If I resize the window the background instantly become gray:

If I then scroll the content of the supplementary column the toolbar become white again.

Another issue is that If I collapse the primary column the toolbar on top of the supplementary column loose the right separator line. Why?

I tried to search some info online but if I try to search for supplementarySidebarTrackingSeparatorItemIdentifier I got only 5 results! One of these is Apple's official documentation page, which does not contain any info about the behaviour of this item: Apple documentation about supplementarySidebarTrackingSeparatorItemIdentifier

At this point I wonder if this item is ready to be used in real apps.

Someone has experience using the supplementarySidebarTrackingSeparatorItemIdentifier item?

There is a way to align toolbar items with the supplementary column without having the above described issues? (different toolbar background color, missing toolbar separator line)

Thank you

@DaleOne Did you ever find a solution to this?

supplementarySidebarTrackingSeparatorItemIdentifier
 
 
Q