detached bd06446

fix: preserve spinner state and use carriage return for animation

- Reassign model after Update() to preserve spinner state between iterations
- Add \r carriage return so frames overwrite instead of printing new lines
- Add \n after final success message for clean line ending
commit
bd06446e4255d656da8fe1d2d4ce56aadaa44ae9
author
brice · · 2026-02-13 18:35 UTC
parent
0ad73b1
signature
unsigned
1 file · +3 -2
M internal/adapters/in/cli/images.go +3 -2
@@ -178,13 +178,14 @@ func pruneWithSpinner(ctx context.Context, client imagesClient, req dto.ImagePru
178178 model.SetMessage(cliRenderSuccess("Pruning complete"))
179179 updatedModel, _ := model.Update(spinner.TickMsg{})
180180 if m, ok := updatedModel.(components.SpinnerModel); ok {
181- fmt.Print(m.View())
181+ fmt.Print("\r" + m.View() + "\n")
182182 }
183183 return result.resp, nil
184184 case <-time.After(100 * time.Millisecond):
185185 updatedModel, _ := model.Update(spinner.TickMsg{})
186186 if m, ok := updatedModel.(components.SpinnerModel); ok {
187- fmt.Print(m.View())
187+ model = m
188+ fmt.Print("\r" + m.View())
188189 }
189190 }
190191 }
@@ -178,13 +178,14 @@ func pruneWithSpinner(ctx context.Context, client imagesClient, req dto.ImagePru
178 model.SetMessage(cliRenderSuccess("Pruning complete"))178 model.SetMessage(cliRenderSuccess("Pruning complete"))
179 updatedModel, _ := model.Update(spinner.TickMsg{})179 updatedModel, _ := model.Update(spinner.TickMsg{})
180 if m, ok := updatedModel.(components.SpinnerModel); ok {180 if m, ok := updatedModel.(components.SpinnerModel); ok {
181- fmt.Print(m.View())181+ fmt.Print("\r" + m.View() + "\n")
182 }182 }
183 return result.resp, nil183 return result.resp, nil
184 case <-time.After(100 * time.Millisecond):184 case <-time.After(100 * time.Millisecond):
185 updatedModel, _ := model.Update(spinner.TickMsg{})185 updatedModel, _ := model.Update(spinner.TickMsg{})
186 if m, ok := updatedModel.(components.SpinnerModel); ok {186 if m, ok := updatedModel.(components.SpinnerModel); ok {
187- fmt.Print(m.View())187+ model = m
188+ fmt.Print("\r" + m.View())
188 }189 }
189 }190 }
190 }191 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 106

↑↓ moveenter openesc close