How is Safari's sidebar animation implemented in visionOS?

When tapping the sidebar button, the window expands in the leading edge to accommodate the sidebar, and shrinks when closed.

Can this be achieved with public APIs on UISplitView or NavigationSplitView?

I have the same question, but so far I have not found anyway to do this with public APIs. https://developer.apple.com/forums/thread/732953

There is an example of this for UIKit here: https://github.com/steventroughtonsmith/VisionExpandingSidebar/tree/main

Looks like it uses a new UIScene preferences type for VisionOS.

https://developer.apple.com/documentation/uikit/uiwindowscene/geometrypreferences/reality

However, I'm unable to find a declarative analog to this with SwiftUI. You can set the max and min sizes, but it's unclear how to request preferred size for the window, as you can with the size property.

How is Safari's sidebar animation implemented in visionOS?
 
 
Q