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

Method handleFilterKey

internal/ui/logs.go:147–164  ·  view source on GitHub ↗
(msg tea.KeyPressMsg)

Source from the content-addressed store, hash-verified

145}
146
147func (m Logs) handleFilterKey(msg tea.KeyPressMsg) (Component, tea.Cmd) {
148 if key.Matches(msg, logsKeys.Back) {
149 m.filterActive = false
150 m.filterEnabled = true
151 m.filterText = ""
152 m.filterInput.SetValue("")
153 m.filterInput.Blur()
154 m.help.SetBindings(logsHelpBindings(m.filterEnabled))
155 m.rebuildContent()
156 return m, nil
157 }
158
159 var cmd tea.Cmd
160 m.filterInput, cmd = m.filterInput.Update(msg)
161 m.filterText = m.filterInput.Value()
162 m.rebuildContent()
163 return m, cmd
164}
165
166func (m Logs) handleNormalKey(msg tea.KeyPressMsg) (Component, tea.Cmd) {
167 switch {

Callers 1

UpdateMethod · 0.95

Calls 7

rebuildContentMethod · 0.95
logsHelpBindingsFunction · 0.85
SetBindingsMethod · 0.80
BlurMethod · 0.65
UpdateMethod · 0.65
ValueMethod · 0.65
SetValueMethod · 0.45

Tested by

no test coverage detected