MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / Show

Method Show

internal/ui/components/help_modal.go:151–173  ·  view source on GitHub ↗

Show displays the help modal.

()

Source from the content-addressed store, hash-verified

149
150// Show displays the help modal.
151func (hm *HelpModal) Show() {
152 if hm.app != nil {
153 // Set up input capture to handle closing and scrolling
154 hm.textView.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
155 switch {
156 case event.Key() == tcell.KeyEscape ||
157 (event.Key() == tcell.KeyRune && (event.Rune() == '?' || event.Rune() == 'q')):
158 hm.Hide()
159
160 return nil
161 case event.Key() == tcell.KeyRune && event.Rune() == 'j':
162 return tcell.NewEventKey(tcell.KeyDown, 0, tcell.ModNone) // Map 'j' to Down
163 case event.Key() == tcell.KeyRune && event.Rune() == 'k':
164 return tcell.NewEventKey(tcell.KeyUp, 0, tcell.ModNone) // Map 'k' to Up
165 }
166
167 return event
168 })
169
170 hm.app.pages.AddPage("help", hm.Pages, true, true)
171 hm.app.SetFocus(hm.textView)
172 }
173}
174
175// Hide hides the help modal.
176func (hm *HelpModal) Hide() {

Callers 7

setupKeyboardHandlersMethod · 0.45
showStorageMenuMethod · 0.45
ShowNodeContextMenuMethod · 0.45
ShowVMContextMenuMethod · 0.45
ShowGlobalContextMenuMethod · 0.45

Calls 2

HideMethod · 0.95
SetFocusMethod · 0.65

Tested by

no test coverage detected