MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / HandleKey

Method HandleKey

internal/tui/views/settings.go:42–64  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

40}
41
42func (v *SettingsView) HandleKey(key string) SettingsEvent {
43 switch key {
44 case "up":
45 if v.ActiveSection == SettingsSectionContent {
46 v.ActiveSection = SettingsSectionHeader
47 }
48 case "down":
49 if v.ActiveSection == SettingsSectionHeader {
50 v.ActiveSection = SettingsSectionContent
51 }
52 case "left":
53 if v.ActiveSection == SettingsSectionHeader {
54 return SettingsEventPrevView
55 }
56 case "right":
57 if v.ActiveSection == SettingsSectionHeader {
58 return SettingsEventNextView
59 }
60 case "esc":
61 return SettingsEventQuit
62 }
63 return SettingsEventNone
64}
65
66func (v *SettingsView) Render(active bool, cfg *config.Config, configPath, version string) string {
67 headerFocused := active && v.ActiveSection == SettingsSectionHeader

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected