MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / handleQuitConfirmKeys

Method handleQuitConfirmKeys

internal/tui/app.go:883–905  ·  view source on GitHub ↗

handleQuitConfirmKeys handles keyboard input for the quit confirmation dialog.

(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

881
882// handleQuitConfirmKeys handles keyboard input for the quit confirmation dialog.
883func (a App) handleQuitConfirmKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
884 switch msg.String() {
885 case "esc":
886 a.viewMode = a.previousViewMode
887 return a, nil
888 case "up", "k":
889 a.quitConfirm.MoveUp()
890 return a, nil
891 case "down", "j":
892 a.quitConfirm.MoveDown()
893 return a, nil
894 case "enter":
895 if a.quitConfirm.GetSelected() == QuitOptionQuit {
896 a.stopAllLoops()
897 a.stopWatcher()
898 return a, tea.Quit
899 }
900 // Cancel
901 a.viewMode = a.previousViewMode
902 return a, nil
903 }
904 return a, nil
905}
906
907// renderQuitConfirmView renders the quit confirmation dialog.
908func (a *App) renderQuitConfirmView() string {

Callers 1

UpdateMethod · 0.95

Calls 6

stopAllLoopsMethod · 0.95
stopWatcherMethod · 0.95
GetSelectedMethod · 0.80
StringMethod · 0.45
MoveUpMethod · 0.45
MoveDownMethod · 0.45

Tested by

no test coverage detected