settings

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package settings is the full-screen /settings modal: a left nav sidebar (General, Models, MCP, Agents, Automations) beside a detail pane, keeping the top bar and a status row.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SectionIndex

func SectionIndex(name string) (int, bool)

SectionIndex resolves a deep-link section name (as "/settings models" or CommandOutcome.SettingsSection would carry) to its nav index, case-insensitively. An empty name resolves to 0 (General): opening settings with no argument is not a deep link, it is the default. The caller - not this package - decides what an unresolved name means; commands.go's openSettingsScreen turns a false ok into a Notice rather than silently opening on General, so a typo'd deep link is never mistaken for "no argument was given".

Types

type Screen

type Screen struct {
	Theme theme.Theme
	Tier  theme.Tier
	// contains filtered or unexported fields
}

Screen is the settings modal. It owns the frame (top bar, nav, status row); each section owns only its own detail body.

func New

func New(t theme.Theme, tier theme.Tier, top topbar.Model, store ports.Settings, initialNav int) Screen

New builds the settings screen over store, opened on the section at initialNav (clamped into range - callers resolve a name to an index with SectionIndex first). Every store field may be nil; a nil field's section renders "unavailable" rather than the screen failing to build.

Sections are constructed EAGERLY, not lazily on first navigation: the app-wide theme walk (TestSelectingThemeLeavesNoValueOnTheOldTheme) only reaches values already live on the router, and a section built later would keep whatever theme it was born with.

func (Screen) Init

func (s Screen) Init() tea.Cmd

func (Screen) OwnsQuit

func (s Screen) OwnsQuit() bool

OwnsQuit reports true so the app router (app.OwnsQuit) forwards ctrl+c to this screen's own Update instead of quitting on the first press - the settings modal holds real in-flight state (cursor position, filters, a save in flight), unlike a quick pick-one-and-go dialog, so a stray ctrl+c must not discard it with no warning.

func (Screen) Update

func (s Screen) Update(msg tea.Msg) (app.Screen, tea.Cmd)

func (Screen) View

func (s Screen) View() string

View draws the settings modal dialog: a centered bordered box with the tabs sidebar on the left and the active section's options on the right.

func (Screen) ViewFlags

func (s Screen) ViewFlags() app.ViewFlags

ViewFlags holds the alternate screen, like every other pushed modal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL