The Windows menu renderer paints leading bitmaps into the Win32
check-mark slot (SetMenuItemBitmaps), which differs from how Cocoa
and GTK handle NSMenuItem.image / menu-row icons:
- SM_CXMENUCHECK sizing: Windows expects ~16x16 at 100% DPI in the
check-mark slot and visually overflows the row for anything bigger.
- Disabled-state mask: Windows desaturates both the row text and the
bitmap when MFS_DISABLED is set, so a disabled informational row
renders the coloured status dot in greyscale.
Per the platform icon guidelines:
Platform | Size | Notes
---------|----------------|-----------------------------------------
Windows | 16x16 | check-mark slot, status row stays enabled
macOS | 22x22 (18-22) | NSMenuItem leading image, HIG
Linux | 24x24 (22-48) | GTK4 menu-row icon channel
Changes:
* Split the menu-row icon embeds into icons_menu_{windows,darwin,linux}.go
so each platform pulls its own size; the brand mark is rendered from
assets/svg/netbird-menu.svg (new vector source) at 16/22/24 px with
Inkscape, and the Windows status dots ship as 8x8 content centred on
a 16x16 transparent canvas (the renderer upscales the bitmap, so the
padding keeps the dot visually proportional to the row text).
* Introduce statusRowEnabled() in tray_status_enabled_{windows,other}.go:
true on Windows so the disabled-state mask does not strip the dot's
colour; false on macOS/Linux where disabled menu rows fade the label
without desaturating the leading bitmap, signalling that the row is
informational.
* Add an icon to the About submenu using the same brand mark.
NetBird desktop UI (Wails3 + React)
Replaces client/ui (Fyne). One binary on Windows / macOS / Linux,
talks to the NetBird daemon over gRPC, renders a React frontend in a
WebView.
Prerequisites
- Go ≥ 1.25, Node ≥ 20, pnpm (
corepack enable && corepack prepare pnpm@latest --activate) wails3CLI:go install github.com/wailsapp/wails/v3/cmd/wails3@latesttask:go install github.com/go-task/task/v3/cmd/task@latest- A running NetBird daemon (default:
unix:///var/run/netbird.sock, Windowstcp://127.0.0.1:41731) - Linux only:
libwebkit2gtk-4.1-dev,libgtk-3-dev,libayatana-appindicator3-dev
Develop without rebuilding
cd client/ui
task dev
task dev runs Vite (port 9245) + the Go binary + a *.go watcher.
Frontend edits hot-reload instantly. Go edits trigger a rebuild and
relaunch. Pass daemon flags after --:
task dev -- --daemon-addr=tcp://127.0.0.1:41731
For pure UI work (no native window, fastest loop):
cd frontend && pnpm dev
Production build
task build
Output in bin/. Frontend assets are embedded into the binary.
Cross-compile Windows from Linux
Install the mingw-w64 toolchain once:
sudo apt install gcc-mingw-w64-x86-64 # Debian/Ubuntu
sudo dnf install mingw64-gcc # Fedora
sudo pacman -S mingw-w64-gcc # Arch
Then:
CGO_ENABLED=1 task windows:build
Produces bin/netbird-ui.exe. macOS cross-compile from Linux is not
supported (signing and notarization need a real Mac).
Windows console build (logs in the terminal)
Default windows:build links the binary as a Windows GUI app, which
detaches from the launching console — logrus output, fmt.Println,
and panics go nowhere visible. To debug tray/event/daemon issues:
CGO_ENABLED=1 task windows:build:console
Produces bin/netbird-ui-console.exe. Run it from cmd.exe /
PowerShell / Windows Terminal and stdout/stderr land in that
terminal. Same flag works on a native Windows build (drop the
CGO_ENABLED=1 if your toolchain already has it set).
Regenerating bindings
When a Go service signature changes:
wails3 generate bindings
task dev does this automatically on *.go save.
Tray icons
Source SVGs live in assets/svg/ (state.svg + state-macos.svg). After editing
any SVG, rasterize to the PNGs the Go side embeds:
task common:generate:tray:icons
Requires Inkscape. Commit the resulting assets/*.png files alongside the
SVG change so CI doesn't need Inkscape installed.