MCPcopy
hub / github.com/basecamp/once / Update

Method Update

internal/ui/settings_menu.go:47–68  ·  view source on GitHub ↗
(msg tea.Msg)

Source from the content-addressed store, hash-verified

45}
46
47func (m SettingsMenu) Update(msg tea.Msg) (Component, tea.Cmd) {
48 switch msg := msg.(type) {
49 case MouseEvent:
50 var cmd tea.Cmd
51 m.help, cmd = m.help.Update(msg)
52 if cmd != nil {
53 return m, cmd
54 }
55
56 case tea.KeyPressMsg:
57 if key.Matches(msg, settingsMenuCloseKey) {
58 return m, func() tea.Msg { return SettingsMenuCloseMsg{} }
59 }
60
61 case MenuSelectMsg:
62 return m, m.selectSection(SettingsSectionType(msg.Key))
63 }
64
65 var cmd tea.Cmd
66 m.menu, cmd = m.menu.Update(msg)
67 return m, cmd
68}
69
70func (m SettingsMenu) View() string {
71 boxStyle := lipgloss.NewStyle().

Callers

nothing calls this directly

Calls 3

selectSectionMethod · 0.95
SettingsSectionTypeTypeAlias · 0.85
UpdateMethod · 0.65

Tested by

no test coverage detected