How to keep sidebar always open on macOS 12.0 in SwiftUI?

Consider this code:

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            EmptyView()
        }
    }
}

Which looks like this:

How can I prevent the sidebar from being resized by a mouse and from being hidden?

P.S. Can consider using AppKit if it can help.

Accepted Answer

There are 272 lines of code in the file you linked to. Is all that code necessary just to keep the sidebar open?!

Seems like something Apple should implement in SwiftUI. Would you consider raising a Feedback request? (If they implement it, it would save everyone having to write so much code, including you 😉)

How to keep sidebar always open on macOS 12.0 in SwiftUI?
 
 
Q