Documentation
¶
Overview ¶
Package settings is the settings area of the native desktop: the 23 categories of the Web UI settings (web-ui/src/components/settings), their unsaved-changes guard and the "?section=" deep link. Plain config documents are data driven (form.go, specs.go); sections with their own UI (providers, MCP servers, LSP, skills, ...) live in their own files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct {
Endpoint string
// Sub is the dotted path of the edited object inside the response ("" =
// the root, "config" for sandbox, "snapshots" for the services doc).
Sub string
// PutWhole sends the whole response with Sub replaced (services,
// settings); otherwise only the Sub object is sent.
PutWhole bool
Groups []Group
// Head draws content before the groups; Tail after them.
Head, Tail func(c *ui.Context, d *Doc)
// Loaded runs after every (re)seed with the root document.
Loaded func(d *Doc, root client.Obj)
// Skip lists keys never sent back (UI-only values).
Skip []string
// SavedMsg is the success toast (default "Settings saved").
SavedMsg string
// contains filtered or unexported fields
}
Doc edits a JSON config document through GET / PUT of one endpoint, exactly as the Web UI stores do: unknown keys survive the round trip.
type Field ¶
type Field struct {
Path string // dotted path in the document ("server.port")
Label string
Desc string
Kind Kind
Opts []Opt
// Inverse stores !value (a "disabled" flag shown as an "enabled" switch).
Inverse bool
// Empty is the option whose value is stored as "" (KSelect).
Empty string
// Zero is the displayed text of an absent KInt/KFloat.
Placeholder string
// Enabled / Visible are evaluated against the current edits.
Enabled, Visible func(d *Doc) bool
// After runs when the value changed in the UI (coupled fields).
After func(d *Doc)
// Width of the control in DIPs (default 240).
Width float32
}
Field describes one editable value of a JSON document. Label and Desc are i18n keys of the Web UI catalogs or literals (a.T returns an unknown key unchanged).
type Opt ¶
type Opt struct{ V, L string }
Opt is an option of a KSelect: the stored value and its label (an i18n key or a literal).
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings is the area's state (UI thread only).
func (*Settings) ConfirmLeave ¶
ConfirmLeave implements app.LeaveGuard: leaving the area with unsaved edits asks first.