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

Method handleGHErrorKeys

internal/tui/first_time_setup.go:335–371  ·  view source on GitHub ↗
(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

333}
334
335func (f FirstTimeSetup) handleGHErrorKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
336 switch msg.String() {
337 case "ctrl+c":
338 f.result.Cancelled = true
339 return f, tea.Quit
340
341 case "esc":
342 // Go back to post-completion step
343 f.step = StepPostCompletion
344 return f, nil
345
346 case "up", "k":
347 if f.ghErrorSelected > 0 {
348 f.ghErrorSelected--
349 }
350 return f, nil
351
352 case "down", "j":
353 if f.ghErrorSelected < 1 {
354 f.ghErrorSelected++
355 }
356 return f, nil
357
358 case "enter":
359 if f.ghErrorSelected == 0 {
360 // Continue without PR creation
361 f.result.CreatePROnComplete = false
362 return f, tea.Quit
363 }
364 // Try again
365 return f, func() tea.Msg {
366 installed, authenticated, err := git.CheckGHCLI()
367 return ghCheckResultMsg{installed: installed, authenticated: authenticated, err: err}
368 }
369 }
370 return f, nil
371}
372
373// View renders the TUI.
374func (f FirstTimeSetup) View() string {

Callers 1

UpdateMethod · 0.95

Calls 2

CheckGHCLIFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected