@@ -3,6 +3,7 @@ package render
33import (
44 "fmt"
55 "os"
6+ "strings"
67 "sync"
78
89 api "github.com/bootdotdev/bootdev/client"
@@ -42,15 +43,21 @@ func (m rootModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
4243 return m , tea .Quit
4344
4445 case messages.StartStepMsg :
45- step := fmt .Sprintf ("Running: %s" , msg .CMD )
46+ description := strings .TrimSpace (msg .Description )
47+ detail := fmt .Sprintf ("Command: %s" , msg .CMD )
4648 if msg .TmdlQuery != nil {
47- step += fmt .Sprintf (" (TMDL query: '%s')" , * msg .TmdlQuery )
49+ detail += fmt .Sprintf (" (TMDL query: '%s')" , * msg .TmdlQuery )
4850 }
4951 if msg .CMD == "" {
50- step = fmt .Sprintf ("%s %s" , msg .Method , msg .URL )
52+ detail = fmt .Sprintf ("Request: %s %s" , msg .Method , msg .URL )
53+ }
54+ if description == "" {
55+ description = strings .TrimPrefix (detail , "Command: " )
56+ description = strings .TrimPrefix (description , "Request: " )
5157 }
5258 m .steps = append (m .steps , stepModel {
53- step : step ,
59+ description : description ,
60+ detail : detail ,
5461 tests : []testModel {},
5562 noPenaltyOnFail : msg .NoPenaltyOnFail ,
5663 })
@@ -97,9 +104,9 @@ func (m rootModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
97104 }
98105}
99106
100- func StartRenderer (data api.CLIData , isSubmit bool , ch chan tea.Msg ) func (api.LessonSubmissionEvent ) {
107+ func StartRenderer (data api.CLIData , isSubmit bool , verbose bool , ch chan tea.Msg ) func (api.LessonSubmissionEvent ) {
101108 var wg sync.WaitGroup
102- p := tea .NewProgram (initModel (isSubmit ), tea .WithoutSignalHandler ())
109+ p := tea .NewProgram (initModel (isSubmit , verbose ), tea .WithoutSignalHandler ())
103110
104111 wg .Add (1 )
105112 go func () {
0 commit comments