Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5fadbeb
Open quick settings window if netbird-ui is already running
lixmal Oct 20, 2025
07b378f
[client-ui] fix connection status comparison
doromaraujo Oct 21, 2025
43ef5e4
[client-ui] modularize quick actions code
doromaraujo Oct 23, 2025
bd84332
[client-ui] add netbird-disconnected logo
doromaraujo Oct 24, 2025
77cd871
[client-ui] change quickactions UI
doromaraujo Oct 24, 2025
a29a61b
[client-ui] add hint message to quick actions screen
doromaraujo Oct 28, 2025
781844f
[client-ui] remove unnecessary default clause
doromaraujo Oct 28, 2025
2cc84ce
[client-ui] remove commented code
doromaraujo Oct 28, 2025
fe94640
[client-ui] remove unused dependency
doromaraujo Oct 29, 2025
ecddf55
[client-ui] close quick actions on connection change
doromaraujo Oct 29, 2025
e2c0717
[client-ui] add function to get image from embed resources
doromaraujo Oct 29, 2025
83577d1
[client] Return error when calling sendShowWindowSignal from Windows
doromaraujo Oct 29, 2025
03cb2d9
[client-ui] Add commentary on empty OnTapped function for toggleConne…
doromaraujo Oct 29, 2025
53e0466
[client-ui] Fix tests
doromaraujo Oct 29, 2025
421c337
Merge remote-tracking branch 'upstream/main' into feature/quick-setti…
doromaraujo Oct 29, 2025
f666935
[client-ui] Add context to menuUpClick call
doromaraujo Oct 29, 2025
a1592a4
[client-ui] Pass serviceClient app as parameter
doromaraujo Oct 29, 2025
b791473
[client-ui] Replace for select with for range chan
doromaraujo Oct 29, 2025
b9130b9
[client-ui] Replace settings change listener channel
doromaraujo Oct 29, 2025
3df0975
[client-ui] Add missing iconAboutDisconnected to icons_windows.go
doromaraujo Oct 29, 2025
6f86725
[client] Add quick actions signal handler for Windows with named events
doromaraujo Nov 5, 2025
632d0ab
Merge branch 'main' into feature/quick-settings-show-popup-macos
doromaraujo Nov 5, 2025
1827df4
Merge branch 'feature/quick-settings-show-popup-macos' of github.com:…
doromaraujo Nov 5, 2025
fa88002
[client] Run go mod tidy
doromaraujo Nov 5, 2025
e10ebc0
[client] Remove line break
doromaraujo Nov 5, 2025
3d55baa
[client] Log unexpected status in separate function
doromaraujo Nov 6, 2025
0743511
[client-ui] Refactor quick actions window
doromaraujo Nov 7, 2025
5bd40d0
[client-ui] use derived context from ServiceClient
doromaraujo Nov 7, 2025
69cb1aa
[client] Update signal_windows log message
doromaraujo Nov 7, 2025
27ff17d
Merge remote-tracking branch 'upstream/main' into feature/quick-setti…
doromaraujo Nov 7, 2025
d76212a
go mod tidy
doromaraujo Nov 7, 2025
62e69d5
[client-ui] Add struct to pass fewer parameters
doromaraujo Nov 7, 2025
da6d4e0
[client] Add missing import
doromaraujo Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/ui/assets/netbird-disconnected.ico
Binary file not shown.
Binary file added client/ui/assets/netbird-disconnected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 40 additions & 30 deletions client/ui/client_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,22 @@

// Create the service client (this also builds the settings or networks UI if requested).
client := newServiceClient(&newServiceClientArgs{
addr: flags.daemonAddr,
logFile: logFile,
app: a,
showSettings: flags.showSettings,
showNetworks: flags.showNetworks,
showLoginURL: flags.showLoginURL,
showDebug: flags.showDebug,
showProfiles: flags.showProfiles,
addr: flags.daemonAddr,
logFile: logFile,
app: a,
showSettings: flags.showSettings,
showNetworks: flags.showNetworks,
showLoginURL: flags.showLoginURL,
showDebug: flags.showDebug,
showProfiles: flags.showProfiles,
showQuickActions: flags.showQuickActions,
})

// Watch for theme/settings changes to update the icon.
go watchSettingsChanges(a, client)

// Run in window mode if any UI flag was set.
if flags.showSettings || flags.showNetworks || flags.showDebug || flags.showLoginURL || flags.showProfiles {
if flags.showSettings || flags.showNetworks || flags.showDebug || flags.showLoginURL || flags.showProfiles || flags.showQuickActions {
a.Run()
return
}
Expand All @@ -111,23 +112,29 @@
return
}
if running {
log.Warnf("another process is running with pid %d, exiting", pid)
log.Infof("another process is running with pid %d, sending signal to show window", pid)
if err := sendShowWindowSignal(pid); err != nil {
log.Errorf("send signal to running instance: %v", err)
}
return
}

client.setupSignalHandler(client.ctx)

client.setDefaultFonts()

Check failure on line 124 in client/ui/client_ui.go

View workflow job for this annotation

GitHub Actions / JS / Lint

client.setDefaultFonts undefined (type *serviceClient has no field or method setDefaultFonts) (typecheck)
systray.Run(client.onTrayReady, client.onTrayExit)
Comment on lines +122 to 125
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Restore the missing setDefaultFonts implementation

client.setDefaultFonts() is invoked here, but no definition is provided in any of the included build targets, and the static analysis/typecheck run already fails with “client.setDefaultFonts undefined”. The PR will not compile until the function is (re)introduced or this call is removed/guarded. Please add the missing implementation (with the appropriate build tags) or drop the call so the build succeeds.

🧰 Tools
🪛 GitHub Check: JS / Lint

[failure] 124-124:
client.setDefaultFonts undefined (type *serviceClient has no field or method setDefaultFonts) (typecheck)

}

type cliFlags struct {
daemonAddr string
showSettings bool
showNetworks bool
showProfiles bool
showDebug bool
showLoginURL bool
errorMsg string
saveLogsInFile bool
daemonAddr string
showSettings bool
showNetworks bool
showProfiles bool
showDebug bool
showLoginURL bool
showQuickActions bool
errorMsg string
saveLogsInFile bool
}

// parseFlags reads and returns all needed command-line flags.
Expand All @@ -143,6 +150,7 @@
flag.BoolVar(&flags.showNetworks, "networks", false, "run networks window")
flag.BoolVar(&flags.showProfiles, "profiles", false, "run profiles window")
flag.BoolVar(&flags.showDebug, "debug", false, "run debug window")
flag.BoolVar(&flags.showQuickActions, "quick-actions", false, "run quick actions window")
flag.StringVar(&flags.errorMsg, "error-msg", "", "displays an error message window")
flag.BoolVar(&flags.saveLogsInFile, "use-log-file", false, fmt.Sprintf("save logs in a file: %s/netbird-ui-PID.log", os.TempDir()))
flag.BoolVar(&flags.showLoginURL, "login-url", false, "show login URL in a popup window")
Expand All @@ -158,11 +166,9 @@

// watchSettingsChanges listens for Fyne theme/settings changes and updates the client icon.
func watchSettingsChanges(a fyne.App, client *serviceClient) {
settingsChangeChan := make(chan fyne.Settings)
a.Settings().AddChangeListener(settingsChangeChan)
for range settingsChangeChan {
a.Settings().AddListener(func(settings fyne.Settings) {
client.updateIcon()
}
})
}

// showErrorMessage displays an error message in a simple window.
Expand Down Expand Up @@ -287,6 +293,7 @@
showNetworks bool
wNetworks fyne.Window
wProfiles fyne.Window
wQuickActions fyne.Window

eventManager *event.Manager

Expand All @@ -306,14 +313,15 @@
}

type newServiceClientArgs struct {
addr string
logFile string
app fyne.App
showSettings bool
showNetworks bool
showDebug bool
showLoginURL bool
showProfiles bool
addr string
logFile string
app fyne.App
showSettings bool
showNetworks bool
showDebug bool
showLoginURL bool
showProfiles bool
showQuickActions bool
}

// newServiceClient instance constructor
Expand Down Expand Up @@ -349,6 +357,8 @@
s.showDebugUI()
case args.showProfiles:
s.showProfilesUI()
case args.showQuickActions:
s.showQuickActionsUI()
}

return s
Expand Down
8 changes: 4 additions & 4 deletions client/ui/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ func (s *serviceClient) createDebugBundleFromCollection(
if uploadFailureReason != "" {
showUploadFailedDialog(progress.window, localPath, uploadFailureReason)
} else {
showUploadSuccessDialog(progress.window, localPath, uploadedKey)
showUploadSuccessDialog(s.app, progress.window, localPath, uploadedKey)
}
} else {
showBundleCreatedDialog(progress.window, localPath)
Expand Down Expand Up @@ -565,7 +565,7 @@ func (s *serviceClient) handleDebugCreation(
if uploadFailureReason != "" {
showUploadFailedDialog(w, localPath, uploadFailureReason)
} else {
showUploadSuccessDialog(w, localPath, uploadedKey)
showUploadSuccessDialog(s.app, w, localPath, uploadedKey)
}
} else {
showBundleCreatedDialog(w, localPath)
Expand Down Expand Up @@ -665,7 +665,7 @@ func showUploadFailedDialog(w fyne.Window, localPath, failureReason string) {
}

// showUploadSuccessDialog displays a dialog when upload succeeds
func showUploadSuccessDialog(w fyne.Window, localPath, uploadedKey string) {
func showUploadSuccessDialog(a fyne.App, w fyne.Window, localPath, uploadedKey string) {
log.Infof("Upload key: %s", uploadedKey)
keyEntry := widget.NewEntry()
keyEntry.SetText(uploadedKey)
Expand All @@ -683,7 +683,7 @@ func showUploadSuccessDialog(w fyne.Window, localPath, uploadedKey string) {
customDialog := dialog.NewCustom("Upload Successful", "OK", content, w)

copyBtn := createButtonWithAction("Copy key", func() {
w.Clipboard().SetContent(uploadedKey)
a.Clipboard().SetContent(uploadedKey)
log.Info("Upload key copied to clipboard")
})

Expand Down
3 changes: 3 additions & 0 deletions client/ui/icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
//go:embed assets/netbird.png
var iconAbout []byte

//go:embed assets/netbird-disconnected.png
var iconAboutDisconnected []byte

//go:embed assets/netbird-systemtray-connected.png
var iconConnected []byte

Expand Down
3 changes: 3 additions & 0 deletions client/ui/icons_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
//go:embed assets/netbird.ico
var iconAbout []byte

//go:embed assets/netbird-disconnected.ico
var iconAboutDisconnected []byte

//go:embed assets/netbird-systemtray-connected.ico
var iconConnected []byte

Expand Down
Loading
Loading