I have the same issue, and am looking for a code example that can show how to handle this situation.
The video showing off the new took bar, and the new applications in macOS 11 even go further by converting the toolbar as you resize the window, I also thought this was automatic, but I could not recreate it.
thanks