1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Animated spinner and elapsed-time formatting.
//!
//! Ported from the legacy TUI. [`current_spinner_frame`] cycles through
//! braille-pattern glyphs every 100 ms. [`format_elapsed`] renders an
//! [`Instant`] delta as `MmSS` or `S.s` seconds.
const SPINNER: = ;
/// Return the current braille-spinner glyph based on wall-clock time.
///
/// # Examples
///
/// ```rust
/// use codetether_agent::tui::ui::chat_view::spinner::current_spinner_frame;
/// let frame = current_spinner_frame();
/// assert!(frame.chars().count() >= 1);
/// ```
/// Format the time elapsed since `started` as a human-readable string.
///
/// Returns ` MmSS` for durations ≥ 60 s, otherwise ` S.s`.
///
/// # Examples
///
/// ```rust
/// use codetether_agent::tui::ui::chat_view::spinner::format_elapsed;
/// // Instant::now() has ≈0 s elapsed, so format is " 0.xs"
/// let s = format_elapsed(std::time::Instant::now());
/// assert!(s.starts_with(' '));
/// assert!(s.contains('s'));
/// ```