diff --git a/client/ui/CLAUDE.md b/client/ui/CLAUDE.md index c6ef6a890..12c00a9e3 100644 --- a/client/ui/CLAUDE.md +++ b/client/ui/CLAUDE.md @@ -148,6 +148,8 @@ The tray uses Wails' built-in `notifications` service. One `notifications.Notifi `task dev` (Wails dev, live reload), `task build` (prod build for the current OS, dispatches to `build/{darwin,linux,windows}/Taskfile.yml`), `task build:server` / `run:server` / `build:docker` / `run:docker` (server-mode variants in `build/Taskfile.yml`). **No** `task generate:bindings` alias — run `wails3 generate bindings -clean=true -ts` directly from this directory. CLI flags + log-target semantics are documented in the `main.go` bullet under "Layout". +Both `windows:build` and `windows:build:console` (the latter outputs `bin/netbird-ui-console.exe` linked against the console subsystem, so Go stdout/stderr/logrus print to the launching terminal) honour `DEV=true`, which drops the `-tags production` flag. The `production` tag is what disables the WebKit/WebView2 DevTools inspector — so `DEV=true` is the only way to get a Windows binary where the frontend JS console is reachable (right-click → Inspect / F12). Cross-compile from Linux with `CGO_ENABLED=1 task windows:build:console DEV=true`. + ## Useful references - `WAILS-DIALOGS.md` (sibling) — full `@wailsio/runtime` `Dialogs` API + per-OS behaviour + frameless-window pattern. - `LINUX-TRAY.md` (sibling) — StatusNotifierWatcher + XEmbed host details. diff --git a/client/ui/build/windows/Taskfile.yml b/client/ui/build/windows/Taskfile.yml index eeab4a6c6..f51f7fbee 100644 --- a/client/ui/build/windows/Taskfile.yml +++ b/client/ui/build/windows/Taskfile.yml @@ -41,6 +41,11 @@ tasks: Cross-compile from Linux works the same way: CGO_ENABLED=1 task windows:build:console + + Pass DEV=true to drop the `production` build tag so the WebKit/WebView2 + DevTools inspector (right-click → Inspect, or F12) stays enabled and the + frontend JS console is reachable — same DEV handling as windows:build: + CGO_ENABLED=1 task windows:build:console DEV=true deps: - task: common:go:mod:tidy - task: common:build:frontend @@ -61,9 +66,11 @@ tasks: - cmd: rm -f *.syso platforms: [linux, darwin] vars: - # Identical to build:native's flags except no -H windowsgui, so the - # binary attaches to the launching console. - BUILD_FLAGS: '-tags production{{if .EXTRA_TAGS}},{{.EXTRA_TAGS}}{{end}} -trimpath -ldflags="-w -s"' + # Identical to build:native's flags (including DEV handling) except no + # -H windowsgui, so the binary attaches to the launching console. With + # DEV=true the `production` tag is dropped, keeping the WebKit/WebView2 + # DevTools inspector enabled so the frontend JS console is reachable. + BUILD_FLAGS: '{{if eq .DEV "true"}}{{if .EXTRA_TAGS}}-tags {{.EXTRA_TAGS}} {{end}}-gcflags=all="-l"{{else}}-tags production{{if .EXTRA_TAGS}},{{.EXTRA_TAGS}}{{end}} -trimpath -ldflags="-w -s"{{end}}' CGO_ENABLED: '{{.CGO_ENABLED | default "0"}}' CC: '{{.CC | default "x86_64-w64-mingw32-gcc"}}' env: