Repository navigation
fix(ui): stop spinner from showing previous phase's text - #903
Merged
Merged
Conversation
The bubbletea spinner wrapper only synced Suffix into the rendered model on Start/Restart, but cmd code assigned Suffix after calling Start/Restart (the old briandowns/spinner pattern), so the spinner kept displaying the prior phase's text — e.g. 'VM IP: x.x.x.x' appeared twice during onctl up while waiting for cloud-init. - set Suffix before Start/Restart at all call sites - handle suffix updates in the tea model so SetSuffix works on a running spinner (used by the deploy upload progress bar, which was frozen for the same reason) - drop the pointless Restart/Stop pair around the VM IP println
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #903 +/- ##
==========================================
+ Coverage 21.40% 21.57% +0.16%
==========================================
Files 41 41
Lines 4031 4032 +1
==========================================
+ Hits 863 870 +7
+ Misses 3059 3054 -5
+ Partials 109 108 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
During
onctl up, the VM IP line is shown twice:The bubbletea-based spinner wrapper (
internal/ui/spinner.go) only syncsSuffixinto the rendered model onStart()/Restart(), but the cmd code assigneds.Suffixafter callingStart()/Restart()(the old briandowns/spinner pattern). So every phase's spinner rendered the previous phase's text — after printing✔ VM IP: …, the spinner restarted for the cloud-init wait but kept displaying the staleVM IP: …suffix.A second latent bug:
SetSuffix()sent the updated model to the running program, but the tea model'sUpdate()had no case to receive it, so mid-run suffix changes were silently dropped — which also left the deploy upload progress bar frozen.Changes
internal/ui/spinner.go: add asuffixMsgcase to the tea model'sUpdatesoSetSuffixactually updates a running spinnercmd/create.go,cmd/deploy.go,cmd/ssh.go,cmd/destroy.go: sets.SuffixbeforeStart()/Restart()at every call siteSetSuffix()so the progress bar updates liveRestart()/Stop()pair around the VM IP println in create.goTestModelUpdateSuffixMsgverifying suffix changes reach the rendererVerification
go build ./...,go vetcleango test -race ./internal/ui/...passesgolangci-lint runreports 0 issues🤖 Generated with Claude Code