diff --git a/commands/ci/view/view.go b/commands/ci/view/view.go index 71ae21bb714f4c2e6bfc2361474d6e1a498f36b0..d5a62341b50cec71e478aad1a90e07f21a1e8372 100644 --- a/commands/ci/view/view.go +++ b/commands/ci/view/view.go @@ -221,7 +221,38 @@ func drawView(opts ViewOpts) error { app.Draw() } }() - if err := app.SetScreen(screen).SetRoot(root, true).SetAfterDrawFunc(linkJobsView(app)).Run(); err != nil { + + const ( + naviText = `Use arrow keys to navigate jobs and logs. + + - 'Enter' to toggle through a job's logs / traces, or display a child pipeline. Trigger jobs are marked with a 'ยป'. + + - 'Esc' or 'q' to close the logs or trace, or return to the parent pipeline. + + - 'Ctrl+R', 'Ctrl+P' to run, retry, or play a job. Use 'Tab' or arrow keys to navigate the modal, and 'Enter' to confirm. + + - 'Ctrl+D' to cancel a job. If the selected job isn't running or pending, quits the CI/CD view. + + - 'Ctrl+Q' to quit the CI/CD view. + + - 'Ctrl+Space' to suspend application and view the logs.` + ) + // Create a new TextView with a title and border + // textView := tview.NewTextView(). + textView := tview.NewTextView(). + SetDynamicColors(true). + SetRegions(true). + SetWordWrap(true) + + go func() { + fmt.Fprintf(textView, "%s ", naviText) + }() + + flex := tview.NewFlex(). + SetDirection(tview.FlexRow). + AddItem(root, 0, 1, false). + AddItem(textView, 14, 1, true) + if err := app.SetScreen(screen).SetRoot(flex, true).SetAfterDrawFunc(linkJobsView(app)).Run(); err != nil { return err } return nil @@ -268,6 +299,7 @@ func inputCapture( inputCh <- struct{}{} } } + switch event.Key() { case tcell.KeyCtrlQ: app.Stop()