Refactor spinner to use idiomatic Bubble Tea patterns#9196
Merged
Conversation
- Replace manual goroutine management with tea.NewProgram() - Remove sync.Mutex and manual locking (use Bubble Tea message passing) - Implement proper Init/Update/View pattern with spinnerModel - Use tea.WithoutRenderer() for inline mode output to stderr - Add updateMessageMsg custom message for message updates - Maintain backward compatibility with existing API - All tests pass without modifications - Update documentation to reflect Bubble Tea implementation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Test spinnerModel Init/Update/View directly - Test disabled operations (when ACCESSIBLE is set) - Test rapid start/stop cycles - Test update message before start - Test stop without start - All tests pass successfully - Coverage for edge cases and Bubble Tea-specific behavior Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor spinner for idiomatic Bubble Tea implementation
Refactor spinner to use idiomatic Bubble Tea patterns
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The spinner implementation used manual goroutine and mutex management, bypassing Bubble Tea's rendering pipeline. This creates race condition risks, prevents framerate optimization, and diverges from patterns used in other console components.
Changes
Architecture:
spinnerModelwith standard Init/Update/View patterntea.NewProgram()usingWithoutRenderer()for inline modesync.Mutexand all manual locking (5+ Lock/Unlock call sites)stopCh chan struct{})updateMessageMsgcustom message for thread-safe updates via message passingAPI:
Testing:
Before/After
Before:
After:
Architecture now consistent with
list.goandconfirm.gocomponents.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.