Skip to content

Commit 7885bcc

Browse files
committed
fix(?) spinners
1 parent 046262b commit 7885bcc

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

npm-app/src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,9 @@ export class Client {
10581058
}
10591059
DiffManager.receivedResponse()
10601060
process.stdout.write(chunk)
1061+
if (chunk.endsWith('\n')) {
1062+
Spinner.get().start(null, true)
1063+
}
10611064
} else {
10621065
printModeLog(chunk)
10631066
printSubagentHeader(chunk)
@@ -1280,9 +1283,6 @@ export class Client {
12801283
}
12811284

12821285
const xmlStreamParser = createXMLStreamParser(toolRenderers, (chunk) => {
1283-
if (chunk) {
1284-
Spinner.get().stop()
1285-
}
12861286
if (!streamStarted) {
12871287
streamStarted = true
12881288
onStreamStart()

npm-app/src/display/markdown-renderer.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import MarkdownIt from 'markdown-it'
44
import terminal from 'markdown-it-terminal'
55
import wrapAnsi from 'wrap-ansi'
66

7-
import { Spinner } from '../utils/spinner'
8-
97
export type MarkdownStreamRendererOptions = {
108
width?: number
119
isTTY?: boolean
@@ -150,8 +148,6 @@ export class MarkdownStreamRenderer {
150148

151149
// Check if we should force flush due to age or size
152150
this.checkForceFlush(outs)
153-
154-
Spinner.get().start(null, true)
155151
}
156152

157153
private processLine(
@@ -320,9 +316,6 @@ export class MarkdownStreamRenderer {
320316
private flushBlock(outs: string[]) {
321317
if (!this.currentBlock) return
322318

323-
// Hide loading indicator if showing
324-
Spinner.get().stop()
325-
326319
// Render the block
327320
const rendered = this.render(this.currentBlock.buffer)
328321
outs.push(rendered)
@@ -352,9 +345,6 @@ export class MarkdownStreamRenderer {
352345
(age > 1000 && this.currentBlock.type === 'list') // Lists get extra time to accumulate
353346

354347
if (shouldForceFlush) {
355-
// Hide indicator since we flushed something
356-
Spinner.get().stop()
357-
358348
// Try to find a soft boundary for force flush
359349
const buffer = this.currentBlock.buffer
360350
const sentenceEnd = buffer.lastIndexOf('. ')
@@ -392,9 +382,6 @@ export class MarkdownStreamRenderer {
392382
}
393383

394384
end(): string | null {
395-
// Hide any loading indicator
396-
Spinner.get().stop()
397-
398385
const outputs: string[] = []
399386

400387
// Flush current block if any

npm-app/src/subagent-headers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ export function printSubagentHeader(event: PrintModeEvent) {
3939
)
4040
console.log(``)
4141
}
42+
4243
if (stoppedSpinner && stoppedSpinner.type === 'text') {
4344
return Spinner.get().start(stoppedSpinner.text)
4445
}
46+
if (stoppedSpinner && stoppedSpinner.type === 'textless') {
47+
return Spinner.get().start('Thinking')
48+
}
4549
}

0 commit comments

Comments
 (0)