Tighten verbose comments in Wails UI Go code

Shorten over-long godoc/inline comments across the client/ui tray and
services code: drop narrative restatement, legacy-Fyne tangents, and text
already evident from signatures and names. Keep only the non-obvious why
(concurrency/lock ordering, platform quirks, ordering constraints, the
profile-switch state table). No code changes.
This commit is contained in:
Zoltan Papp
2026-06-13 00:22:27 +02:00
parent c2b43b9cf0
commit edf7e2d04d
58 changed files with 972 additions and 2156 deletions
+6 -16
View File
@@ -8,9 +8,7 @@ import (
"github.com/netbirdio/netbird/client/ui/authsession"
)
// Re-exports so frontend bindings stay on services.ExtendStart* /
// services.ExtendWait* / services.ExtendResult without each call site
// importing authsession.
// Re-exports so generated bindings reference services.* without importing authsession.
type (
ExtendStartParams = authsession.ExtendStartParams
ExtendStartResult = authsession.ExtendStartResult
@@ -18,31 +16,23 @@ type (
ExtendResult = authsession.ExtendResult
)
// Session is the Wails-bound wrapper around authsession.Session. It only
// re-exposes the subset the React frontend actually calls
// (SessionExpirationDialog.tsx: RequestExtend + WaitExtend). The tray
// uses authsession.Session directly, so methods that only the tray needs
// (DismissWarning) are deliberately absent here — keeping the generated
// TS surface minimal.
// Session wraps authsession.Session, exposing only the subset the React frontend
// calls; the tray uses authsession.Session directly, keeping the generated TS surface minimal.
type Session struct {
inner *authsession.Session
}
// NewSession returns the Wails-bound wrapper. The caller owns the inner
// authsession.Session and may use it directly (e.g. the tray).
// NewSession wraps inner; the caller retains ownership and may use it directly.
func NewSession(inner *authsession.Session) *Session {
return &Session{inner: inner}
}
// RequestExtend starts the SSO session-extension flow on the daemon and
// returns the verification URI for the UI to open.
// RequestExtend starts the SSO session-extension flow; the result carries the verification URI to open.
func (s *Session) RequestExtend(ctx context.Context, p ExtendStartParams) (ExtendStartResult, error) {
return s.inner.RequestExtend(ctx, p)
}
// WaitExtend blocks until the user completes the SSO flow started by
// RequestExtend, then returns the new session deadline (or nil when the
// management server reports the peer ineligible).
// WaitExtend blocks until the RequestExtend flow completes; the deadline is nil when the peer is ineligible.
func (s *Session) WaitExtend(ctx context.Context, p ExtendWaitParams) (ExtendResult, error) {
return s.inner.WaitExtend(ctx, p)
}