Skip to content

feat: replace raw thinking output with animated color-cycling indicator#149

Open
NianJiuZst wants to merge 1 commit into
MiniMax-AI:mainfrom
NianJiuZst:feat/thinking-indicator
Open

feat: replace raw thinking output with animated color-cycling indicator#149
NianJiuZst wants to merge 1 commit into
MiniMax-AI:mainfrom
NianJiuZst:feat/thinking-indicator

Conversation

@NianJiuZst
Copy link
Copy Markdown
Contributor

Summary

Closes #148

Replaces raw thinking token output in streaming chat with a dynamic, color-animated indicator.

Before

Thinking:
Let me think about this step by step. First, I need to understand the user's question...

Response:
Here is the answer...

After

⠋ Thinking (3s)       ← spinner rotates + colors cycle through full hue range

Response:
Here is the answer...

How it works

Component Detail
Spinner 10-frame braille cycle (⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏) at ~12.5 fps
Elapsed Real-time counter: "Thinking (Xs)" → "Thinking (1m 30s)"
Color HSL hue rotation (~17°/frame) on spinner, staggered +40° on label
Output \r carriage-return on stderr, clean stdout for piping
Teardown \r\x1b[0K clears the indicator line, then shows Response:

Files changed

File Change
src/commands/text/chat.ts +80/-8 — ThinkingIndicator class + stream loop update

Screenshots

Instead of dumping raw thinking tokens to the terminal, show a dynamic
indicator that conveys the model is working:

- Braille spinner character cycles through 10 frames (⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)
- "Thinking (Xs)" label with real-time elapsed seconds
- Hue-rotating color applied to both spinner and label independently
  for a smooth, continuous animation effect
- Indicator renders on stderr via \r (carriage return) to keep
  stdout clean for piped output
- Cleanly cleared when thinking phase ends and "Response:" is shown

The thinking_delta events are now intentionally ignored — only the
text_delta content reaches stdout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streaming chat outputs raw thinking tokens — poor UX

1 participant