Additionally, wanted to add that within the WindowGroup, it is also important to specifically add the following .windowStyle(.plain). Otherwise, hiding the window won't work.
WindowGroup("Hello World", id: "modules") {
Modules()
.environment(model)
}
.windowStyle(.plain)