@@ -132,17 +132,34 @@ func (model TestModeModel) Update(message tea.Msg) (tea.Model, tea.Cmd) {
132
132
model .resourceGroupName = tmpResourceGroup
133
133
}
134
134
}
135
- model .CommandLines = append (model .CommandLines , codeBlockState .StdOut )
135
+ model .CommandLines = append (
136
+ model .CommandLines ,
137
+ ui .VerboseStyle .Render (codeBlockState .StdOut ),
138
+ )
136
139
viewportContentUpdated = true
137
140
138
141
// Increment the codeblock and update the viewport content.
139
142
model .currentCodeBlock ++
140
143
141
144
if model .currentCodeBlock < len (model .codeBlockState ) {
145
+ nextTitle := model .codeBlockState [model .currentCodeBlock ].StepName
142
146
nextCommand := model .codeBlockState [model .currentCodeBlock ].CodeBlock .Content
143
147
nextLanguage := model .codeBlockState [model .currentCodeBlock ].CodeBlock .Language
144
148
145
- model .CommandLines = append (model .CommandLines , ui .CommandPrompt (nextLanguage )+ nextCommand )
149
+ // Only add the title if the next step title is different from the current step.
150
+ if codeBlockState .StepName != nextTitle {
151
+ model .CommandLines = append (
152
+ model .CommandLines ,
153
+ ui .StepTitleStyle .Render (
154
+ fmt .Sprintf ("Step %d: %s" , model .currentCodeBlock + 1 , nextTitle ),
155
+ )+ "\n " ,
156
+ )
157
+ }
158
+
159
+ model .CommandLines = append (
160
+ model .CommandLines ,
161
+ ui .CommandPrompt (nextLanguage )+ nextCommand ,
162
+ )
146
163
}
147
164
148
165
// Only increment the step for azure if the step name has changed.
@@ -178,7 +195,10 @@ func (model TestModeModel) Update(message tea.Msg) (tea.Model, tea.Cmd) {
178
195
codeBlockState .SimilarityScore = message .SimilarityScore
179
196
180
197
model .codeBlockState [step ] = codeBlockState
181
- model .CommandLines = append (model .CommandLines , codeBlockState .StdErr + message .Error .Error ())
198
+ model .CommandLines = append (
199
+ model .CommandLines ,
200
+ ui .ErrorStyle .Render (codeBlockState .StdErr + message .Error .Error ()),
201
+ )
182
202
viewportContentUpdated = true
183
203
184
204
commands = append (commands , common .Exit (true ))
@@ -287,6 +307,8 @@ func NewTestModeModel(
287
307
288
308
language := codeBlockState [0 ].CodeBlock .Language
289
309
commandLines := []string {
310
+ ui .ScenarioTitleStyle .Render (title ) + "\n " ,
311
+ ui .StepTitleStyle .Render ("Step 1: " + codeBlockState [0 ].StepName ) + "\n " ,
290
312
ui .CommandPrompt (language ) + codeBlockState [0 ].CodeBlock .Content ,
291
313
}
292
314
0 commit comments