Add ThinkingSpinner Component to Webview Extension #3975
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR adds an animated thinking spinner to the webview UI, mirroring the implementation already deployed in the CLI. The spinner provides visual feedback to users when the AI is actively processing requests, making the interface feel more responsive and keeping users informed about ongoing operations.
The spinner uses 10 Braille Unicode characters (⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏) that animate at 80ms per frame, providing a smooth, accessible loading indicator that works across all terminals and browsers without requiring external assets.
Implementation
Changes Made
1. New ThinkingSpinner Component
/webview-ui/src/components/chat/ThinkingSpinner.tsxclassNameprop for custom styling2. Enhanced ProgressIndicator Component
/webview-ui/src/components/chat/ProgressIndicator.tsxto acceptuseSpinnerpropuseSpinner=true: displays the new ThinkingSpinner with VSCode foreground coloruseSpinner=false(default): displays the existing VSCode progress ring3. Integration Points
Updated the following components to show the spinner during active operations:
Program Flow
useSpinner={true}to ProgressIndicatorTradeoffs
Screenshots
The spinner displays inline with other content, showing:
⠋ Thinking...with the character animating smoothly.How to Test
Verify Spinner Display
Verify Spinner in Different Contexts
Verify Backward Compatibility
useSpinner={true}should use the default progress ringVerify Cleanup
Testing Coverage
Automated test suite validates:
Run tests with:
pnpm test webview-ui/src/components/chat/__tests__/ThinkingSpinner.spec.tsxGet in Touch
This PR completes the spinner implementation across the entire application. Feel free to reach out on Discord (handle: thomas07374) if you have questions about the implementation or want to discuss any adjustments to the animation timing, styling, or integration points.
Branch:
add-spinner-to-extensionCommit:
Add ThinkingSpinner component to webview(1f6ba1d)Based on: Latest main (after add-spinner-to-cli merge)