What is NSPanel?
NSPanel is a class in Apple’s AppKit framework for a window that Apple describes as typically performing a function auxiliary to the main window. Palettes, inspectors and floating tool windows are panels.
Why it matters
A normal window takes focus from the app you are using when it appears. For a panel you hover over to open, that would be disruptive: your typing would stop going where you were typing. A panel created with the .nonactivatingPanel style mask does not make its app the active one when you click it.
How NotchStar uses it
The notch is an NSPanel with the .borderless and .nonactivatingPanel styles, placed above the menu bar. The panel returns false from canBecomeKey by default, so it can take mouse events without taking keyboard focus. A second panel variant allows key status, and it becomes key only when a tool needs typing, such as Quick Notes or the teleprompter editor. SwiftUI draws the contents inside the panel through a hosting view.
Why not pure SwiftUI
SwiftUI describes the views, but the window level, the style mask and the focus rules are AppKit features. A notch app therefore mixes the two: SwiftUI for the views, AppKit for the window.
Related
See what is a notch app for the user side, and hover intent for how opening is timed.