fix(bonfire): keep the order of lines printed above a live view and drain them before it ends
- each PrintAbove block is one bubbletea print message sent straight to the program's queue under liveMu, so the event loop prints it in call order instead of a command goroutine racing it back - runLive unregisters, sends finishMsg and waits under liveMu, so a late printer writes after the final frame and no line is lost - TestPrintAboveOrderedNoLoss pins order and no loss for spinner, progress, process and a printer racing the finish (CR-01)
This commit is contained in:
@@ -129,7 +129,7 @@ func (p *liveProgress) Current(item string) {
|
||||
|
||||
func (p *liveProgress) Fail(item string, err error) {
|
||||
p.send(itemMsg{done: p.current, total: p.total, item: item, err: err})
|
||||
p.send(printAboveMsg(failureLine(item, err)))
|
||||
p.send(printLine(failureLine(item, err)))
|
||||
}
|
||||
|
||||
func failureLine(item string, err error) string {
|
||||
|
||||
Reference in New Issue
Block a user