diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-13 17:05:37 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-13 17:05:37 +0000 |
| commit | e97f272db32df2a384465f48ddc3c5be1f59654c (patch) | |
| tree | a406a0e4545fd3056c966ffc608bcfc7c3841c4d | |
| parent | 9dd97603f5903184ed251ab3bd5920309286223f (diff) | |
fix: only show heading when expand delay fires
Use a ProgressBar inside the detail multi for the heading instead
of eprintln so it gets cleared with progress_reporter.clear()
and never appears when fetch completes before the delay.
| -rw-r--r-- | src/lib/client.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index 7c83e19..0427501 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -417,7 +417,15 @@ impl Connect for Client { | |||
| 417 | if let Some(spinner) = spinner_for_timer { | 417 | if let Some(spinner) = spinner_for_timer { |
| 418 | spinner.finish_and_clear(); | 418 | spinner.finish_and_clear(); |
| 419 | } | 419 | } |
| 420 | eprintln!("fetching updates..."); | 420 | // Add heading as a finished progress bar so it gets cleared |
| 421 | // along with the other bars by progress_reporter.clear() | ||
| 422 | let heading = detail_multi_for_timer.insert( | ||
| 423 | 0, | ||
| 424 | ProgressBar::new(0).with_style( | ||
| 425 | ProgressStyle::with_template("{msg}").unwrap(), | ||
| 426 | ), | ||
| 427 | ); | ||
| 428 | heading.finish_with_message("fetching updates..."); | ||
| 421 | detail_multi_for_timer | 429 | detail_multi_for_timer |
| 422 | .set_draw_target(ProgressDrawTarget::stderr()); | 430 | .set_draw_target(ProgressDrawTarget::stderr()); |
| 423 | }); | 431 | }); |