Skip to content

Commit a6a37ea

Browse files
cpcloudcursoragent
andcommitted
fix(chat): show spinner during SQL generation
The spinner was not displaying during stage 1 (SQL generation) because the labelLine variable was set but never assigned to rendered. This fix ensures the spinner shows properly for both SQL generation and response generation stages. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ca745ae commit a6a37ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/app/chat.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,15 +1163,15 @@ func (m *Model) renderChatMessages() string {
11631163
}
11641164

11651165
// Determine what to show on the label line.
1166-
var labelLine string
11671166
if m.chat.StreamingSQL && sql == "" {
11681167
// Stage 1: generating SQL query
1169-
labelLine = label + " " + m.chat.Spinner.View() + " " + m.styles.HeaderHint.Render(
1168+
labelLine := label + " " + m.chat.Spinner.View() + " " + m.styles.HeaderHint.Render(
11701169
"generating query",
11711170
)
1171+
rendered = labelLine
11721172
} else if text == "" && m.chat.Streaming && !m.chat.StreamingSQL {
11731173
// Stage 2: thinking about response (may have SQL already)
1174-
labelLine = label + " " + m.chat.Spinner.View() + " " + m.styles.HeaderHint.Render("thinking")
1174+
labelLine := label + " " + m.chat.Spinner.View() + " " + m.styles.HeaderHint.Render("thinking")
11751175
// If we have parts (e.g., SQL), show them below the label.
11761176
if len(parts) > 0 {
11771177
rendered = labelLine + "\n" + strings.Join(parts, "\n")

0 commit comments

Comments
 (0)