mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-24 22:39:09 +02:00
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:
@@ -9,10 +9,8 @@ import (
|
||||
"github.com/netbirdio/netbird/client/ui/preferences"
|
||||
)
|
||||
|
||||
// Preferences is the Wails-bound facade over preferences.Store. The store
|
||||
// itself owns persistence and the subscription channel; this type just
|
||||
// re-exposes Get and SetLanguage with the context.Context-first signature
|
||||
// the Wails binding generator wants.
|
||||
// Preferences is the Wails-bound facade over preferences.Store; the context.Context-first
|
||||
// signatures are what the binding generator requires.
|
||||
type Preferences struct {
|
||||
store *preferences.Store
|
||||
}
|
||||
@@ -21,23 +19,18 @@ func NewPreferences(store *preferences.Store) *Preferences {
|
||||
return &Preferences{store: store}
|
||||
}
|
||||
|
||||
// Get returns the current user-scope preferences.
|
||||
func (s *Preferences) Get(_ context.Context) (preferences.UIPreferences, error) {
|
||||
return s.store.Get(), nil
|
||||
}
|
||||
|
||||
// SetLanguage validates and persists a new UI language.
|
||||
func (s *Preferences) SetLanguage(_ context.Context, lang i18n.LanguageCode) error {
|
||||
return s.store.SetLanguage(lang)
|
||||
}
|
||||
|
||||
// SetViewMode validates and persists the Main-window view choice
|
||||
// ("default" or "advanced").
|
||||
func (s *Preferences) SetViewMode(_ context.Context, mode preferences.ViewMode) error {
|
||||
return s.store.SetViewMode(mode)
|
||||
}
|
||||
|
||||
// SetOnboardingCompleted persists the welcome-flow dismissal flag.
|
||||
func (s *Preferences) SetOnboardingCompleted(_ context.Context, done bool) error {
|
||||
return s.store.SetOnboardingCompleted(done)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user